{
  "version": 1,
  "ccxt_version": "4.5.40",
  "generated_at": "2026-02-24T10:38:43.397Z",
  "exchange_count": 110,
  "method_count": 1885,
  "own_method_count": 1544,
  "inherited_count": 341,
  "parse_methods": {
    "alp": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 760,
        "line_end": 772,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['used'] = this.safeString (balance, 'reserve');\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBidsAsks",
        "signature": "parseBidsAsks (bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2)",
        "line_start": 494,
        "line_end": 503,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBidsAsks (bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2) {\n        const result = [];\n        for (let i = 0; i < bidasks.length; i++) {\n            const bidask = bidasks[i];\n            if (bidask) {\n                result.push (this.parseBidAsk (bidask, priceKey, amountKey));\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 304,
        "line_end": 362,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n                'price': this.parseNumber (this.parsePrecision ((pricePrecision))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.parseNumber (amountLimit),\n                    'max': this.safeNumber (market, 'maximum_order_size'),\n                },\n                'price': {\n                    'min': this.parseNumber (priceLimit),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.parseNumber (Precise.stringMul (priceLimit, amountLimit)),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.parseNumber (amountLimit),\n                    'max': this.safeNumber (market, 'maximum_order_size'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.parseNumber (priceLimit),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.parseNumber (Precise.stringMul (priceLimit, amountLimit)),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.parseNumber (priceLimit)",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'name');\n        const baseId = this.safeString (market, 'currency1');\n        const quoteId = this.safeString (market, 'currency2');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const pricePrecision = this.safeString (market, 'price_precision');\n        const priceLimit = this.parsePrecision (pricePrecision);\n        const amountLimit = this.safeString (market, 'minimum_order_size');\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': true,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n                'price': this.parseNumber (this.parsePrecision ((pricePrecision))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.parseNumber (amountLimit),\n                    'max': this.safeNumber (market, 'maximum_order_size'),\n                },\n                'price': {\n                    'min': this.parseNumber (priceLimit),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.parseNumber (Precise.stringMul (priceLimit, amountLimit)),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 703,
        "line_end": 722,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"time\":1591296000,\n         \"open\":0.024746,\n         \"close\":0.024728,\n         \"low\":0.024728,\n         \"high\":0.024753,\n         \"volume\":16.624\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"time\":1591296000,\n        //         \"open\":0.024746,\n        //         \"close\":0.024728,\n        //         \"low\":0.024728,\n        //         \"high\":0.024753,\n        //         \"volume\":16.624\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'time'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 797,
        "line_end": 867,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": \"923763073\",\n       \"date\": \"1635451090368\",\n       \"type\": \"sell\",\n       \"pair\": \"XRP_USDT\",\n       \"price\": \"1.00000000\",\n       \"amount\": \"0.00000000\",\n       \"status\": \"3\",\n       \"amount_filled\": \"10.00000000\",\n       \"amount_original\": \"10.0\"\n       \"trades\": [],\n     }",
          "{\n       \"success\": true,\n       \"date\": \"1635451754.497541\",\n       \"type\": \"sell\",\n       \"oid\": \"923776755\",\n       \"price\": \"1.0\",\n       \"amount\": \"10.0\",\n       \"amount_filled\": \"0.0\",\n       \"amount_original\": \"10.0\",\n       \"trades\": []\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchClosedOrders / fetchOrder\n        //     {\n        //       \"id\": \"923763073\",\n        //       \"date\": \"1635451090368\",\n        //       \"type\": \"sell\",\n        //       \"pair\": \"XRP_USDT\",\n        //       \"price\": \"1.00000000\",\n        //       \"amount\": \"0.00000000\",\n        //       \"status\": \"3\",\n        //       \"amount_filled\": \"10.00000000\",\n        //       \"amount_original\": \"10.0\"\n        //       \"trades\": [],\n        //     }\n        //\n        // createOrder\n        //     {\n        //       \"success\": true,\n        //       \"date\": \"1635451754.497541\",\n        //       \"type\": \"sell\",\n        //       \"oid\": \"923776755\",\n        //       \"price\": \"1.0\",\n        //       \"amount\": \"10.0\",\n        //       \"amount_filled\": \"0.0\",\n        //       \"amount_original\": \"10.0\",\n        //       \"trades\": []\n        //     }\n        //\n        const marketId = this.safeString (order, 'pair');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = market['symbol'];\n        const success = this.safeBool (order, 'success', false);\n        let timestamp = undefined;\n        if (success) {\n            timestamp = this.safeTimestamp (order, 'date');\n        } else {\n            timestamp = this.safeInteger (order, 'date');\n        }\n        const price = this.safeString (order, 'price');\n        const remaining = this.safeString (order, 'amount');\n        const filled = this.safeString (order, 'amount_filled');\n        const amount = this.safeString (order, 'amount_original');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const id = this.safeStringN (order, [ 'oid', 'id', 'order' ]);\n        const trades = this.safeValue (order, 'trades');\n        const side = this.safeString2 (order, 'my_side', 'type');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'status': status,\n            'symbol': symbol,\n            'type': 'limit',\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'trades': trades,\n            'fee': undefined,\n            'info': order,\n            'lastTradeTimestamp': undefined,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 788,
        "line_end": 795,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '1': 'open',\n            '2': 'canceled',\n            '3': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 427,
        "line_end": 468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'diff')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'vol')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"timestamp\": \"1674658.445272\",\n        \"pair\": \"BTC_USDT\",\n        \"last\": \"22476.85\",\n        \"diff\": \"458.96\",\n        \"vol\": \"6660.847784\",\n        \"high\": \"23106.08\",\n        \"low\": \"22348.29\",\n        \"buy\": \"22508.46\",\n        \"sell\": \"22521.11\"\n    }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //    {\n        //        \"timestamp\": \"1674658.445272\",\n        //        \"pair\": \"BTC_USDT\",\n        //        \"last\": \"22476.85\",\n        //        \"diff\": \"458.96\",\n        //        \"vol\": \"6660.847784\",\n        //        \"high\": \"23106.08\",\n        //        \"low\": \"22348.29\",\n        //        \"buy\": \"22508.46\",\n        //        \"sell\": \"22521.11\"\n        //    }\n        //\n        const timestampStr = this.safeString (ticker, 'timestamp');\n        const timestamp = parseInt (Precise.stringMul (timestampStr, '1000000'));\n        const marketId = this.safeString (ticker, 'pair');\n        market = this.safeMarket (marketId, market, '_');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'info': ticker,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'diff'),\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': this.safeString (ticker, 'vol'),\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 505,
        "line_end": 553,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "id",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"id\": \"202203440\",\n          \"timestamp\": \"1637856276.264215\",\n          \"pair\": \"AAVE_USDT\",\n          \"price\": \"320.79900000\",\n          \"amount\": \"0.05000000\",\n          \"type\": \"buy\"\n      }",
          "{\n          \"id\": \"202203440\",\n          \"timestamp\": \"1637856276.264215\",\n          \"pair\": \"AAVE_USDT\",\n          \"price\": \"320.79900000\",\n          \"amount\": \"0.05000000\",\n          \"type\": \"buy\",\n          \"my_side\": \"buy\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"id\": \"202203440\",\n        //          \"timestamp\": \"1637856276.264215\",\n        //          \"pair\": \"AAVE_USDT\",\n        //          \"price\": \"320.79900000\",\n        //          \"amount\": \"0.05000000\",\n        //          \"type\": \"buy\"\n        //      }\n        //\n        // fetchMyTrades (private)\n        //\n        //      {\n        //          \"id\": \"202203440\",\n        //          \"timestamp\": \"1637856276.264215\",\n        //          \"pair\": \"AAVE_USDT\",\n        //          \"price\": \"320.79900000\",\n        //          \"amount\": \"0.05000000\",\n        //          \"type\": \"buy\",\n        //          \"my_side\": \"buy\"\n        //      }\n        //\n        const marketId = this.safeString (trade, 'pair');\n        market = this.safeMarket (marketId, market, '_');\n        const timestampRaw = this.safeString (trade, 'timestamp');\n        const timestamp = this.parseToInt (Precise.stringMul (timestampRaw, '1000000'));\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const id = this.safeString (trade, 'id');\n        const side = this.safeString2 (trade, 'my_side', 'type');\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': id,\n            'type': 'limit',\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 646,
        "line_end": 690,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (statusId)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"timestamp\": 1485363039.18359,\n          \"id\": 317,\n          \"currency\": \"BTC\",\n          \"amount\": 530.00000000\n      }",
          "{\n          \"id\": 403,\n          \"timestamp\": 1485363466.868539,\n          \"currency\": \"BTC\",\n          \"amount\": 0.53000000,\n          \"status\": 20\n      }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //  deposit\n        //      {\n        //          \"timestamp\": 1485363039.18359,\n        //          \"id\": 317,\n        //          \"currency\": \"BTC\",\n        //          \"amount\": 530.00000000\n        //      }\n        //\n        //  withdrawal\n        //      {\n        //          \"id\": 403,\n        //          \"timestamp\": 1485363466.868539,\n        //          \"currency\": \"BTC\",\n        //          \"amount\": 0.53000000,\n        //          \"status\": 20\n        //      }\n        //\n        const timestamp = this.safeTimestamp (transaction, 'timestamp');\n        const currencyId = this.safeString (transaction, 'currency');\n        const statusId = this.safeString (transaction, 'status');\n        return {\n            'id': this.safeString (transaction, 'id'),\n            'info': transaction,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'txid': undefined,\n            'type': undefined,\n            'status': this.parseTransactionStatus (statusId),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'updated': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 692,
        "line_end": 701,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            '10': 'pending',  // New\n            '20': 'pending',  // Verified, waiting for approving\n            '30': 'ok',       // Approved by moderator\n            '40': 'failed',   // Refused by moderator. See your email for more details\n            '50': 'canceled', // Cancelled by user\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "alpaca": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1882,
        "line_end": 1891,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const account = this.account ();\n        const currencyId = this.safeString (response, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        account['free'] = this.safeString (response, 'cash');\n        account['total'] = this.safeString (response, 'equity');\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1602,
        "line_end": 1621,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "parsedCurrency",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"asset_id\": \"4fa30c85-77b7-4cbc-92dd-7b7513640aad\",\n         \"address\": \"bc1q2fpskfnwem3uq9z8660e4z6pfv7aqfamysk75r\",\n         \"created_at\": \"2024-11-03T07:30:05.609976344Z\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"asset_id\": \"4fa30c85-77b7-4cbc-92dd-7b7513640aad\",\n        //         \"address\": \"bc1q2fpskfnwem3uq9z8660e4z6pfv7aqfamysk75r\",\n        //         \"created_at\": \"2024-11-03T07:30:05.609976344Z\"\n        //     }\n        //\n        let parsedCurrency = undefined;\n        if (currency !== undefined) {\n            parsedCurrency = currency['id'];\n        }\n        return {\n            'info': depositAddress,\n            'currency': parsedCurrency,\n            'network': undefined,\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (asset): Market",
        "line_start": 486,
        "line_end": 574,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': amount,\n                'price': price,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "asset",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"c150e086-1e75-44e6-9c2c-093bb1e93139\",\n         \"class\": \"crypto\",\n         \"exchange\": \"CRYPTO\",\n         \"symbol\": \"BTC/USDT\",\n         \"name\": \"Bitcoin / USD Tether\",\n         \"status\": \"active\",\n         \"tradable\": true,\n         \"marginable\": false,\n         \"maintenance_margin_requirement\": 101,\n         \"shortable\": false,\n         \"easy_to_borrow\": false,\n         \"fractionable\": true,\n         \"attributes\": [],\n         \"min_order_size\": \"0.000026873\",\n         \"min_trade_increment\": \"0.000000001\",\n         \"price_increment\": \"1\"\n     }"
        ],
        "source": "parseMarket (asset): Market {\n        //\n        //     {\n        //         \"id\": \"c150e086-1e75-44e6-9c2c-093bb1e93139\",\n        //         \"class\": \"crypto\",\n        //         \"exchange\": \"CRYPTO\",\n        //         \"symbol\": \"BTC/USDT\",\n        //         \"name\": \"Bitcoin / USD Tether\",\n        //         \"status\": \"active\",\n        //         \"tradable\": true,\n        //         \"marginable\": false,\n        //         \"maintenance_margin_requirement\": 101,\n        //         \"shortable\": false,\n        //         \"easy_to_borrow\": false,\n        //         \"fractionable\": true,\n        //         \"attributes\": [],\n        //         \"min_order_size\": \"0.000026873\",\n        //         \"min_trade_increment\": \"0.000000001\",\n        //         \"price_increment\": \"1\"\n        //     }\n        //\n        const marketId = this.safeString (asset, 'symbol');\n        const parts = marketId.split ('/');\n        const assetClass = this.safeString (asset, 'class');\n        const baseId = this.safeString (parts, 0);\n        const quoteId = this.safeString (parts, 1);\n        const base = this.safeCurrencyCode (baseId);\n        let quote = this.safeCurrencyCode (quoteId);\n        // Us equity markets do not include quote in symbol.\n        // We can safely coerce us_equity quote to USD\n        if (quote === undefined && assetClass === 'us_equity') {\n            quote = 'USD';\n        }\n        const symbol = base + '/' + quote;\n        const status = this.safeString (asset, 'status');\n        const active = (status === 'active');\n        const minAmount = this.safeNumber (asset, 'min_order_size');\n        const amount = this.safeNumber (asset, 'min_trade_increment');\n        const price = this.safeNumber (asset, 'price_increment');\n        return {\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': undefined,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': amount,\n                'price': price,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': asset,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 810,
        "line_end": 833,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"c\":22895,\n        \"h\":22895,\n        \"l\":22884,\n        \"n\":6,\n        \"o\":22884,\n        \"t\":\"2022-07-21T05:01:00Z\",\n        \"v\":0.001,\n        \"vw\":22889.5\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //        \"c\":22895,\n        //        \"h\":22895,\n        //        \"l\":22884,\n        //        \"n\":6,\n        //        \"o\":22884,\n        //        \"t\":\"2022-07-21T05:01:00Z\",\n        //        \"v\":0.001,\n        //        \"vw\":22889.5\n        //     }\n        //\n        const datetime = this.safeString (ohlcv, 't');\n        const timestamp = this.parse8601 (datetime);\n        return [\n            timestamp, // timestamp\n            this.safeNumber (ohlcv, 'o'), // open\n            this.safeNumber (ohlcv, 'h'), // high\n            this.safeNumber (ohlcv, 'l'), // low\n            this.safeNumber (ohlcv, 'c'), // close\n            this.safeNumber (ohlcv, 'v'), // volume\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1353,
        "line_end": 1437,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastTradeTimeStamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'time_in_force'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'limit_price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber (order, 'filled_avg_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (order, 'qty')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeNumber (order, 'filled_qty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\":\"6ecfcc34-4bed-4b53-83ba-c564aa832a81\",\n        \"client_order_id\":\"ccxt_1c6ceab0b5e84727b2f1c0394ba17560\",\n        \"created_at\":\"2022-06-14T13:59:30.224037068Z\",\n        \"updated_at\":\"2022-06-14T13:59:30.224037068Z\",\n        \"submitted_at\":\"2022-06-14T13:59:30.221856828Z\",\n        \"filled_at\":null,\n        \"expired_at\":null,\n        \"canceled_at\":null,\n        \"failed_at\":null,\n        \"replaced_at\":null,\n        \"replaced_by\":null,\n        \"replaces\":null,\n        \"asset_id\":\"64bbff51-59d6-4b3c-9351-13ad85e3c752\",\n        \"symbol\":\"BTCUSD\",\n        \"asset_class\":\"crypto\",\n        \"notional\":null,\n        \"qty\":\"0.01\",\n        \"filled_qty\":\"0\",\n        \"filled_avg_price\":null,\n        \"order_class\":\"\",\n        \"order_type\":\"limit\",\n        \"type\":\"limit\",\n        \"side\":\"buy\",\n        \"time_in_force\":\"day\",\n        \"limit_price\":\"14000\",\n        \"stop_price\":null,\n        \"status\":\"accepted\",\n        \"extended_hours\":false,\n        \"legs\":null,\n        \"trail_percent\":null,\n        \"trail_price\":null,\n        \"hwm\":null,\n        \"commission\":\"0.42\",\n        \"source\":null\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //    {\n        //        \"id\":\"6ecfcc34-4bed-4b53-83ba-c564aa832a81\",\n        //        \"client_order_id\":\"ccxt_1c6ceab0b5e84727b2f1c0394ba17560\",\n        //        \"created_at\":\"2022-06-14T13:59:30.224037068Z\",\n        //        \"updated_at\":\"2022-06-14T13:59:30.224037068Z\",\n        //        \"submitted_at\":\"2022-06-14T13:59:30.221856828Z\",\n        //        \"filled_at\":null,\n        //        \"expired_at\":null,\n        //        \"canceled_at\":null,\n        //        \"failed_at\":null,\n        //        \"replaced_at\":null,\n        //        \"replaced_by\":null,\n        //        \"replaces\":null,\n        //        \"asset_id\":\"64bbff51-59d6-4b3c-9351-13ad85e3c752\",\n        //        \"symbol\":\"BTCUSD\",\n        //        \"asset_class\":\"crypto\",\n        //        \"notional\":null,\n        //        \"qty\":\"0.01\",\n        //        \"filled_qty\":\"0\",\n        //        \"filled_avg_price\":null,\n        //        \"order_class\":\"\",\n        //        \"order_type\":\"limit\",\n        //        \"type\":\"limit\",\n        //        \"side\":\"buy\",\n        //        \"time_in_force\":\"day\",\n        //        \"limit_price\":\"14000\",\n        //        \"stop_price\":null,\n        //        \"status\":\"accepted\",\n        //        \"extended_hours\":false,\n        //        \"legs\":null,\n        //        \"trail_percent\":null,\n        //        \"trail_price\":null,\n        //        \"hwm\":null,\n        //        \"commission\":\"0.42\",\n        //        \"source\":null\n        //    }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const alpacaStatus = this.safeString (order, 'status');\n        const status = this.parseOrderStatus (alpacaStatus);\n        const feeValue = this.safeString (order, 'commission');\n        let fee = undefined;\n        if (feeValue !== undefined) {\n            fee = {\n                'cost': feeValue,\n                'currency': 'USD',\n            };\n        }\n        let orderType = this.safeString (order, 'order_type');\n        if (orderType !== undefined) {\n            if (orderType.indexOf ('limit') >= 0) {\n                // might be limit or stop-limit\n                orderType = 'limit';\n            }\n        }\n        const datetime = this.safeString (order, 'submitted_at');\n        const timestamp = this.parse8601 (datetime);\n        return this.safeOrder ({\n            'id': this.safeString (order, 'id'),\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'lastTradeTimeStamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': orderType,\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'time_in_force')),\n            'postOnly': undefined,\n            'side': this.safeString (order, 'side'),\n            'price': this.safeNumber (order, 'limit_price'),\n            'triggerPrice': this.safeNumber (order, 'stop_price'),\n            'cost': undefined,\n            'average': this.safeNumber (order, 'filled_avg_price'),\n            'amount': this.safeNumber (order, 'qty'),\n            'filled': this.safeNumber (order, 'filled_qty'),\n            'remaining': undefined,\n            'trades': undefined,\n            'fee': fee,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1439,
        "line_end": 1449,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'pending_new': 'open',\n            'accepted': 'open',\n            'new': 'open',\n            'partially_filled': 'open',\n            'activated': 'open',\n            'filled': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1451,
        "line_end": 1456,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'day': 'Day',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1515,
        "line_end": 1574,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'i', 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "'taker'",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"t\":\"2022-06-14T05:00:00.027869Z\",\n       \"x\":\"CBSE\",\n       \"p\":\"21942.15\",\n       \"s\":\"0.0001\",\n       \"tks\":\"S\",\n       \"i\":\"355681339\"\n   }",
          "{\n         \"id\": \"20221228071929579::ca2aafd0-1270-4b56-b0a9-85423b4a07c8\",\n         \"activity_type\": \"FILL\",\n         \"transaction_time\": \"2022-12-28T12:19:29.579352Z\",\n         \"type\": \"fill\",\n         \"price\": \"67.31\",\n         \"qty\": \"0.07\",\n         \"side\": \"sell\",\n         \"symbol\": \"LTC/USD\",\n         \"leaves_qty\": \"0\",\n         \"order_id\": \"82eebcf7-6e66-4b7e-93f8-be0df0e4f12e\",\n         \"cum_qty\": \"0.07\",\n         \"order_status\": \"filled\",\n         \"swap_rate\": \"1\"\n     },"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //   {\n        //       \"t\":\"2022-06-14T05:00:00.027869Z\",\n        //       \"x\":\"CBSE\",\n        //       \"p\":\"21942.15\",\n        //       \"s\":\"0.0001\",\n        //       \"tks\":\"S\",\n        //       \"i\":\"355681339\"\n        //   }\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"id\": \"20221228071929579::ca2aafd0-1270-4b56-b0a9-85423b4a07c8\",\n        //         \"activity_type\": \"FILL\",\n        //         \"transaction_time\": \"2022-12-28T12:19:29.579352Z\",\n        //         \"type\": \"fill\",\n        //         \"price\": \"67.31\",\n        //         \"qty\": \"0.07\",\n        //         \"side\": \"sell\",\n        //         \"symbol\": \"LTC/USD\",\n        //         \"leaves_qty\": \"0\",\n        //         \"order_id\": \"82eebcf7-6e66-4b7e-93f8-be0df0e4f12e\",\n        //         \"cum_qty\": \"0.07\",\n        //         \"order_status\": \"filled\",\n        //         \"swap_rate\": \"1\"\n        //     },\n        //\n        const marketId = this.safeString2 (trade, 'S', 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const datetime = this.safeString2 (trade, 't', 'transaction_time');\n        const timestamp = this.parse8601 (datetime);\n        const alpacaSide = this.safeString (trade, 'tks');\n        let side = this.safeString (trade, 'side');\n        if (alpacaSide === 'B') {\n            side = 'buy';\n        } else if (alpacaSide === 'S') {\n            side = 'sell';\n        }\n        const priceString = this.safeString2 (trade, 'p', 'price');\n        const amountString = this.safeString2 (trade, 's', 'qty');\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'i', 'id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': this.safeString (trade, 'order_id'),\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': 'taker',\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1751,
        "line_end": 1801,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'tx_hash')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (transaction, 'chain')",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'to_address')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "this.safeString (transaction, 'to_address')",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (transaction, 'from_address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseTransactionType (this.safeString (transaction, 'direction'))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (totalFee)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"e27b70a6-5610-40d7-8468-a516a284b776\",\n         \"tx_hash\": null,\n         \"direction\": \"OUTGOING\",\n         \"amount\": \"20\",\n         \"usd_value\": \"19.99856\",\n         \"chain\": \"ETH\",\n         \"asset\": \"USDT\",\n         \"from_address\": \"0x123930E4dCA196E070d39B60c644C8Aae02f23\",\n         \"to_address\": \"0x1232c0925196e4dcf05945f67f690153190fbaab\",\n         \"status\": \"PROCESSING\",\n         \"created_at\": \"2024-11-07T02:39:01.775495Z\",\n         \"network_fee\": \"4\",\n         \"fees\": \"0.1\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"id\": \"e27b70a6-5610-40d7-8468-a516a284b776\",\n        //         \"tx_hash\": null,\n        //         \"direction\": \"OUTGOING\",\n        //         \"amount\": \"20\",\n        //         \"usd_value\": \"19.99856\",\n        //         \"chain\": \"ETH\",\n        //         \"asset\": \"USDT\",\n        //         \"from_address\": \"0x123930E4dCA196E070d39B60c644C8Aae02f23\",\n        //         \"to_address\": \"0x1232c0925196e4dcf05945f67f690153190fbaab\",\n        //         \"status\": \"PROCESSING\",\n        //         \"created_at\": \"2024-11-07T02:39:01.775495Z\",\n        //         \"network_fee\": \"4\",\n        //         \"fees\": \"0.1\"\n        //     }\n        //\n        const datetime = this.safeString (transaction, 'created_at');\n        const currencyId = this.safeString (transaction, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const fees = this.safeString (transaction, 'fees');\n        const networkFee = this.safeString (transaction, 'network_fee');\n        const totalFee = Precise.stringAdd (fees, networkFee);\n        const fee = {\n            'cost': this.parseNumber (totalFee),\n            'currency': code,\n        };\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'tx_hash'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'network': this.safeString (transaction, 'chain'),\n            'address': this.safeString (transaction, 'to_address'),\n            'addressTo': this.safeString (transaction, 'to_address'),\n            'addressFrom': this.safeString (transaction, 'from_address'),\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': this.parseTransactionType (this.safeString (transaction, 'direction')),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': undefined,\n            'fee': fee,\n            'comment': undefined,\n            'internal': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1803,
        "line_end": 1810,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'PROCESSING': 'pending',\n            'FAILED': 'failed',\n            'COMPLETE': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 1812,
        "line_end": 1818,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'INCOMING': 'deposit',\n            'OUTGOING': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }"
      }
    ],
    "apex": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account: Dict): Account",
        "line_start": 372,
        "line_end": 380,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "accountId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccount (account: Dict): Account {\n        const accountId = this.safeString (account, 'id', '0');\n        return {\n            'id': accountId,\n            'type': undefined,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 328,
        "line_end": 355,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n     \"totalEquityValue\": \"100.000000\",\n     \"availableBalance\": \"100.000000\",\n     \"initialMargin\": \"100.000000\",\n     \"maintenanceMargin\": \"100.000000\",\n     \"symbolToOraclePrice\": {\n     \"BTC-USDC\": {\n         \"oraclePrice\": \"20000\",\n             \"createdTime\": 124566\n     }\n }\n }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // {\n        //     \"totalEquityValue\": \"100.000000\",\n        //     \"availableBalance\": \"100.000000\",\n        //     \"initialMargin\": \"100.000000\",\n        //     \"maintenanceMargin\": \"100.000000\",\n        //     \"symbolToOraclePrice\": {\n        //     \"BTC-USDC\": {\n        //         \"oraclePrice\": \"20000\",\n        //             \"createdTime\": 124566\n        //     }\n        // }\n        // }\n        //\n        const timestamp = this.milliseconds ();\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const code = 'USDT';\n        const account = this.account ();\n        account['free'] = this.safeString (response, 'availableBalance');\n        account['total'] = this.safeString (response, 'totalEquityValue');\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 1819,
        "line_end": 1848,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'id')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'fundingValue')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (income, 'rate')",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"1234\",\n     \"symbol\": \"BTC-USDT\",\n     \"fundingValue\": \"10000\",\n     \"rate\": \"0.0000125000\",\n     \"positionSize\": \"500\",\n     \"price\": \"90\",\n     \"side\": \"LONG\",\n     \"status\": \"SUCCESS\",\n     \"fundingTime\": 1647502440973,\n     \"transactionId\": \"1234556\"\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        // {\n        //     \"id\": \"1234\",\n        //     \"symbol\": \"BTC-USDT\",\n        //     \"fundingValue\": \"10000\",\n        //     \"rate\": \"0.0000125000\",\n        //     \"positionSize\": \"500\",\n        //     \"price\": \"90\",\n        //     \"side\": \"LONG\",\n        //     \"status\": \"SUCCESS\",\n        //     \"fundingTime\": 1647502440973,\n        //     \"transactionId\": \"1234556\"\n        // }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const code = 'USDT';\n        const timestamp = this.safeInteger (income, 'fundingTime');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market),\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'id'),\n            'amount': this.safeNumber (income, 'fundingValue'),\n            'rate': this.safeNumber (income, 'rate'),\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 645,
        "line_end": 710,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "id2",
            "value": "id2",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeBool (market, 'enableTrade')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "takerFee",
            "comment": null
          },
          {
            "key": "maker",
            "value": "makerFee",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'minOrderSize')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "(expiry === 0) ? undefined : expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "(expiry === 0) ? undefined : this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'stepSize'),\n                'price': this.safeNumber (market, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.safeNumber (market, 'displayMinLeverage'),\n                    'max': this.safeNumber (market, 'displayMaxLeverage'),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minOrderSize'),\n                    'max': this.safeNumber (market, 'maxOrderSize'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'stepSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSize')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.safeNumber (market, 'displayMinLeverage'),\n                    'max': this.safeNumber (market, 'displayMaxLeverage'),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minOrderSize'),\n                    'max': this.safeNumber (market, 'maxOrderSize'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'minOrderSize')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'maxOrderSize')",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        const id2 = this.safeString (market, 'crossSymbolName');\n        const quoteId = this.safeString (market, 'l2PairId');\n        const baseId = this.safeString (market, 'baseTokenId');\n        const quote = this.safeString (market, 'settleAssetId');\n        const base = this.safeCurrencyCode (baseId);\n        const settleId = this.safeString (market, 'settleAssetId');\n        const settle = this.safeCurrencyCode (settleId);\n        const symbol = baseId + '/' + quote + ':' + settle;\n        const expiry = 0;\n        const takerFee = this.parseNumber ('0.0002');\n        const makerFee = this.parseNumber ('0.0005');\n        return this.safeMarketStructure ({\n            'id': id,\n            'id2': id2,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': 'swap',\n            'spot': false,\n            'margin': undefined,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': this.safeBool (market, 'enableTrade'),\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'taker': takerFee,\n            'maker': makerFee,\n            'contractSize': this.safeNumber (market, 'minOrderSize'),\n            'expiry': (expiry === 0) ? undefined : expiry,\n            'expiryDatetime': (expiry === 0) ? undefined : this.iso8601 (expiry),\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'stepSize'),\n                'price': this.safeNumber (market, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.safeNumber (market, 'displayMinLeverage'),\n                    'max': this.safeNumber (market, 'displayMaxLeverage'),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minOrderSize'),\n                    'max': this.safeNumber (market, 'maxOrderSize'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 838,
        "line_end": 860,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n     \"start\": 1647511440000,\n     \"symbol\": \"BTC-USD\",\n     \"interval\": \"1\",\n     \"low\": \"40000\",\n     \"high\": \"45000\",\n     \"open\": \"45000\",\n     \"close\": \"40000\",\n     \"volume\": \"1.002\",\n     \"turnover\": \"3\"\n  } {\"s\":\"BTCUSDT\",\"i\":\"1\",\"t\":1741265880000,\"c\":\"90235\",\"h\":\"90235\",\"l\":\"90156\",\"o\":\"90156\",\"v\":\"0.052\",\"tr\":\"4690.4466\"}"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //  {\n        //     \"start\": 1647511440000,\n        //     \"symbol\": \"BTC-USD\",\n        //     \"interval\": \"1\",\n        //     \"low\": \"40000\",\n        //     \"high\": \"45000\",\n        //     \"open\": \"45000\",\n        //     \"close\": \"40000\",\n        //     \"volume\": \"1.002\",\n        //     \"turnover\": \"3\"\n        //  } {\"s\":\"BTCUSDT\",\"i\":\"1\",\"t\":1741265880000,\"c\":\"90235\",\"h\":\"90235\",\"l\":\"90156\",\"o\":\"90156\",\"v\":\"0.052\",\"tr\":\"4690.4466\"}\n        //\n        return [\n            this.safeIntegerN (ohlcv, [ 'start', 't' ]),\n            this.safeNumberN (ohlcv, [ 'open', 'o' ]),\n            this.safeNumberN (ohlcv, [ 'high', 'h' ]),\n            this.safeNumberN (ohlcv, [ 'low', 'l' ]),\n            this.safeNumberN (ohlcv, [ 'close', 'c' ]),\n            this.safeNumberN (ohlcv, [ 'volume', 'v' ]),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 1024,
        "line_end": 1055,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeString (interest, 'openInterest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"BTCUSDT\",\n     \"price24hPcnt\": \"0.450141\",\n     \"lastPrice\": \"43511.50\",\n     \"highPrice24h\": \"43513.50\",\n     \"lowPrice24h\": \"29996.00\",\n     \"markPrice\": \"43513.50\",\n     \"indexPrice\": \"40828.94\",\n     \"openInterest\": \"2036854775808\",\n     \"turnover24h\": \"5626085.23749999\",\n     \"volume24h\": \"169.317\",\n     \"fundingRate\": \"0\",\n     \"predictedFundingRate\": \"0\",\n     \"nextFundingTime\": \"10:00:00\",\n     \"tradeCount\": 100\n }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // {\n        //     \"symbol\": \"BTCUSDT\",\n        //     \"price24hPcnt\": \"0.450141\",\n        //     \"lastPrice\": \"43511.50\",\n        //     \"highPrice24h\": \"43513.50\",\n        //     \"lowPrice24h\": \"29996.00\",\n        //     \"markPrice\": \"43513.50\",\n        //     \"indexPrice\": \"40828.94\",\n        //     \"openInterest\": \"2036854775808\",\n        //     \"turnover24h\": \"5626085.23749999\",\n        //     \"volume24h\": \"169.317\",\n        //     \"fundingRate\": \"0\",\n        //     \"predictedFundingRate\": \"0\",\n        //     \"nextFundingTime\": \"10:00:00\",\n        //     \"tradeCount\": 100\n        // }\n        //\n        const timestamp = this.milliseconds ();\n        const marketId = this.safeString (interest, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market);\n        return this.safeOpenInterest ({\n            'symbol': symbol,\n            'openInterestAmount': this.safeString (interest, 'openInterest'),\n            'openInterestValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1126,
        "line_end": 1225,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (orderType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'timeInForce'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "this.safeBool (order, 'postOnly')",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'triggerPrice')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeString (order, 'fee'),\n                'currency': market['settleId'],\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settleId']",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"1234\",\n     \"clientId\": \"1234\",\n     \"accountId\": \"12345\",\n     \"symbol\": \"BTC-USD\",\n     \"side\": \"SELL\",\n     \"price\": \"18000\",\n     \"limitFee\": \"100\",\n     \"fee\": \"100\",\n     \"triggerPrice\": \"1.2\",\n     \"trailingPercent\": \"0.12\",\n     \"size\": \"100\",\n     \"remainingSize\": \"100\",\n     \"type\": \"LIMIT\",\n     \"createdAt\": 1647502440973,\n     \"updatedTime\": 1647502440973,\n     \"expiresAt\": 1647502440973,\n     \"status\": \"PENDING\",\n     \"timeInForce\": \"GOOD_TIL_CANCEL\",\n     \"postOnly\": false,\n     \"reduceOnly\": false,\n     \"stopPnl\": false,\n     \"latestMatchFillPrice\": \"reason\",\n     \"cumMatchFillSize\": \"0.1\",\n     \"cumMatchFillValue\": \"1000\",\n     \"cumMatchFillFee\": \"1\",\n     \"cumSuccessFillSize\": \"0.1\",\n     \"cumSuccessFillValue\": \"1000\",\n     \"cumSuccessFillFee\": \"1\",\n     \"triggerPriceType\": \"INDEX\",\n     \"isOpenTpslOrder\": true,\n     \"isSetOpenTp\": true,\n     \"isSetOpenSl\": false,\n     \"openTpParam\": {\n     \"side\": \"SELL\",\n         \"price\": \"18000\",\n         \"limitFee\": \"100\",\n         \"clientOrderId\": \"111100\",\n         \"triggerPrice\": \"1.2\",\n         \"trailingPercent\": \"0.12\",\n         \"size\": \"100\"\n },\n     \"openSlParam\": {\n     \"side\": \"SELL\",\n         \"price\": \"18000\",\n         \"limitFee\": \"100\",\n         \"clientOrderId\": \"111100\",\n         \"triggerPrice\": \"1.2\",\n         \"trailingPercent\": \"0.12\",\n         \"size\": \"100\"\n }\n }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // {\n        //     \"id\": \"1234\",\n        //     \"clientId\": \"1234\",\n        //     \"accountId\": \"12345\",\n        //     \"symbol\": \"BTC-USD\",\n        //     \"side\": \"SELL\",\n        //     \"price\": \"18000\",\n        //     \"limitFee\": \"100\",\n        //     \"fee\": \"100\",\n        //     \"triggerPrice\": \"1.2\",\n        //     \"trailingPercent\": \"0.12\",\n        //     \"size\": \"100\",\n        //     \"remainingSize\": \"100\",\n        //     \"type\": \"LIMIT\",\n        //     \"createdAt\": 1647502440973,\n        //     \"updatedTime\": 1647502440973,\n        //     \"expiresAt\": 1647502440973,\n        //     \"status\": \"PENDING\",\n        //     \"timeInForce\": \"GOOD_TIL_CANCEL\",\n        //     \"postOnly\": false,\n        //     \"reduceOnly\": false,\n        //     \"stopPnl\": false,\n        //     \"latestMatchFillPrice\": \"reason\",\n        //     \"cumMatchFillSize\": \"0.1\",\n        //     \"cumMatchFillValue\": \"1000\",\n        //     \"cumMatchFillFee\": \"1\",\n        //     \"cumSuccessFillSize\": \"0.1\",\n        //     \"cumSuccessFillValue\": \"1000\",\n        //     \"cumSuccessFillFee\": \"1\",\n        //     \"triggerPriceType\": \"INDEX\",\n        //     \"isOpenTpslOrder\": true,\n        //     \"isSetOpenTp\": true,\n        //     \"isSetOpenSl\": false,\n        //     \"openTpParam\": {\n        //     \"side\": \"SELL\",\n        //         \"price\": \"18000\",\n        //         \"limitFee\": \"100\",\n        //         \"clientOrderId\": \"111100\",\n        //         \"triggerPrice\": \"1.2\",\n        //         \"trailingPercent\": \"0.12\",\n        //         \"size\": \"100\"\n        // },\n        //     \"openSlParam\": {\n        //     \"side\": \"SELL\",\n        //         \"price\": \"18000\",\n        //         \"limitFee\": \"100\",\n        //         \"clientOrderId\": \"111100\",\n        //         \"triggerPrice\": \"1.2\",\n        //         \"trailingPercent\": \"0.12\",\n        //         \"size\": \"100\"\n        // }\n        // }\n        //\n        const timestamp = this.safeInteger (order, 'createdAt');\n        const orderId = this.safeString (order, 'id');\n        const clientOrderId = this.safeString (order, 'clientId');\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'size');\n        const orderType = this.safeString (order, 'type');\n        const status = this.safeString (order, 'status');\n        const side = this.safeStringLower (order, 'side');\n        // const average = this.omitZero (this.safeString (order, 'avg_fill_price'));\n        const remaining = this.omitZero (this.safeString (order, 'remainingSize'));\n        const lastUpdateTimestamp = this.safeInteger (order, 'updatedTime');\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': this.parseOrderType (orderType),\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'timeInForce')),\n            'postOnly': this.safeBool (order, 'postOnly'),\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString (order, 'triggerPrice'),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n            'average': undefined,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': remaining,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': {\n                'cost': this.safeString (order, 'fee'),\n                'currency': market['settleId'],\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1237,
        "line_end": 1250,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'PENDING': 'open',\n                'OPEN': 'open',\n                'FILLED': 'filled',\n                'CANCELING': 'canceled',\n                'CANCELED': 'canceled',\n                'UNTRIGGERED': 'open',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1252,
        "line_end": 1262,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n            'STOP_LIMIT': 'limit',\n            'STOP_MARKET': 'market',\n            'TAKE_PROFIT_LIMIT': 'limit',\n            'TAKE_PROFIT_MARKET': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1894,
        "line_end": 1946,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeString (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"BTC-USDT\",\n     \"status\": \"\",\n     \"side\": \"LONG\",\n     \"size\": \"0.000\",\n     \"entryPrice\": \"0.00\",\n     \"exitPrice\": \"\",\n     \"createdAt\": 1690366452416,\n     \"updatedTime\": 1690366452416,\n     \"fee\": \"0.000000\",\n     \"fundingFee\": \"0.000000\",\n     \"lightNumbers\": \"\",\n     \"customInitialMarginRate\": \"0\"\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"symbol\": \"BTC-USDT\",\n        //     \"status\": \"\",\n        //     \"side\": \"LONG\",\n        //     \"size\": \"0.000\",\n        //     \"entryPrice\": \"0.00\",\n        //     \"exitPrice\": \"\",\n        //     \"createdAt\": 1690366452416,\n        //     \"updatedTime\": 1690366452416,\n        //     \"fee\": \"0.000000\",\n        //     \"fundingFee\": \"0.000000\",\n        //     \"lightNumbers\": \"\",\n        //     \"customInitialMarginRate\": \"0\"\n        // }\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        const quantity = this.safeString (position, 'size');\n        const timestamp = this.safeInteger (position, 'updatedTime');\n        let leverage = 20;\n        const customInitialMarginRate = this.safeStringN (position, [ 'customInitialMarginRate', 'customImr' ], '0');\n        if (this.precisionFromString (customInitialMarginRate) !== 0) {\n            leverage = this.parseToInt (Precise.stringDiv ('1', customInitialMarginRate, 4));\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'id'),\n            'symbol': symbol,\n            'entryPrice': this.safeString (position, 'entryPrice'),\n            'markPrice': undefined,\n            'notional': undefined,\n            'collateral': undefined,\n            'unrealizedPnl': undefined,\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': leverage,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 712,
        "line_end": 765,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"BTCUSDT\",\n     \"price24hPcnt\": \"0.450141\",\n     \"lastPrice\": \"43511.50\",\n     \"highPrice24h\": \"43513.50\",\n     \"lowPrice24h\": \"29996.00\",\n     \"markPrice\": \"43513.50\",\n     \"indexPrice\": \"40828.94\",\n     \"openInterest\": \"2036854775808\",\n     \"turnover24h\": \"5626085.23749999\",\n     \"volume24h\": \"169.317\",\n     \"fundingRate\": \"0\",\n     \"predictedFundingRate\": \"0\",\n     \"nextFundingTime\": \"10:00:00\",\n     \"tradeCount\": 100\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // {\n        //     \"symbol\": \"BTCUSDT\",\n        //     \"price24hPcnt\": \"0.450141\",\n        //     \"lastPrice\": \"43511.50\",\n        //     \"highPrice24h\": \"43513.50\",\n        //     \"lowPrice24h\": \"29996.00\",\n        //     \"markPrice\": \"43513.50\",\n        //     \"indexPrice\": \"40828.94\",\n        //     \"openInterest\": \"2036854775808\",\n        //     \"turnover24h\": \"5626085.23749999\",\n        //     \"volume24h\": \"169.317\",\n        //     \"fundingRate\": \"0\",\n        //     \"predictedFundingRate\": \"0\",\n        //     \"nextFundingTime\": \"10:00:00\",\n        //     \"tradeCount\": 100\n        // }\n        //\n        const timestamp = this.milliseconds ();\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString (ticker, 'lastPrice');\n        const percentage = this.safeString (ticker, 'price24hPcnt');\n        const quoteVolume = this.safeString (ticker, 'turnover24h');\n        const baseVolume = this.safeString (ticker, 'volume24h');\n        const high = this.safeString (ticker, 'highPrice24h');\n        const low = this.safeString (ticker, 'lowPrice24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1227,
        "line_end": 1235,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GOOD_TIL_CANCEL': 'GOOD_TIL_CANCEL',\n            'FILL_OR_KILL': 'FILL_OR_KILL',\n            'IMMEDIATE_OR_CANCEL': 'IMMEDIATE_OR_CANCEL',\n            'POST_ONLY': 'POST_ONLY',\n        };\n        return this.safeString (timeInForces, timeInForce, undefined);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 964,
        "line_end": 1001,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "[\n  {\n      \"i\": \"993f7f85-9215-5723-9078-2186ae140847\",\n      \"p\": \"96534.3\",\n      \"S\": \"Sell\",\n      \"v\": \"0.261\",\n      \"s\": \"BTCUSDT\",\n      \"T\": 1739118072710\n  }\n  ]"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // [\n        //  {\n        //      \"i\": \"993f7f85-9215-5723-9078-2186ae140847\",\n        //      \"p\": \"96534.3\",\n        //      \"S\": \"Sell\",\n        //      \"v\": \"0.261\",\n        //      \"s\": \"BTCUSDT\",\n        //      \"T\": 1739118072710\n        //  }\n        //  ]\n        //\n        const marketId = this.safeStringN (trade, [ 's', 'symbol' ]);\n        market = this.safeMarket (marketId, market);\n        const id = this.safeStringN (trade, [ 'i', 'id' ]);\n        const timestamp = this.safeIntegerN (trade, [ 't', 'T', 'createdAt' ]);\n        const priceString = this.safeStringN (trade, [ 'p', 'price' ]);\n        const amountString = this.safeStringN (trade, [ 'v', 'size' ]);\n        const side = this.safeStringLowerN (trade, [ 'S', 'side' ]);\n        const type = this.safeStringN (trade, [ 'type' ]);\n        const fee = this.safeStringN (trade, [ 'fee' ]);\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': type,\n            'takerOrMaker': undefined,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1557,
        "line_end": 1573,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (transfer, [ 'transferId', 'id' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.safeString (transfer, 'status')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        const currencyId = this.safeString (transfer, 'coin');\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        const fromAccount = this.safeString (transfer, 'fromAccount');\n        const toAccount = this.safeString (transfer, 'toAccount');\n        return {\n            'info': transfer,\n            'id': this.safeStringN (transfer, [ 'transferId', 'id' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': this.safeString (transfer, 'status'),\n        };\n    }"
      }
    ],
    "arkham": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 1707,
        "line_end": 1725,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (account, 'id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n                \"id\": \"0\",\n                \"name\": \"Primary\",\n                \"pinned\": true,\n                \"isLsp\": false,\n                \"futuresEnabled\": true,\n                \"payFeesInArkm\": false,\n                \"lspSettings\": []\n            }"
        ],
        "source": "parseAccount (account) {\n        //\n        //            {\n        //                \"id\": \"0\",\n        //                \"name\": \"Primary\",\n        //                \"pinned\": true,\n        //                \"isLsp\": false,\n        //                \"futuresEnabled\": true,\n        //                \"payFeesInArkm\": false,\n        //                \"lspSettings\": []\n        //            }\n        //\n        return {\n            'id': this.safeString (account, 'id'),\n            'type': undefined,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1771,
        "line_end": 1788,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const timestamp = this.safeIntegerProduct (response, 'lastUpdateTime', 0.001);\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const symbol = this.safeString (balance, 'symbol');\n            const code = this.safeCurrencyCode (symbol);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'balance');\n            account['free'] = this.safeString (balance, 'free');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (entry, currency: Currency = undefined): DepositAddress",
        "line_start": 1851,
        "line_end": 1862,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "entry",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "entry",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (entry, currency: Currency = undefined): DepositAddress {\n        //\n        //     \"12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV\"\n        //\n        return {\n            'info': entry,\n            'currency': this.safeString (currency, 'code'),\n            'network': undefined,\n            'address': entry,\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 2059,
        "line_end": 2084,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'id')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'amount')",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"amount\": \"20.1\",\n             \"assetSymbol\": \"BTC\",\n             \"indexPrice\": \"1.23\",\n             \"pairSymbol\": \"BTC_USDT\",\n             \"time\": 1704067200000000,\n             \"id\": 1,\n             \"subaccountId\": 1,\n             \"userId\": 1\n         }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //         {\n        //             \"amount\": \"20.1\",\n        //             \"assetSymbol\": \"BTC\",\n        //             \"indexPrice\": \"1.23\",\n        //             \"pairSymbol\": \"BTC_USDT\",\n        //             \"time\": 1704067200000000,\n        //             \"id\": 1,\n        //             \"subaccountId\": 1,\n        //             \"userId\": 1\n        //         }\n        //\n        const marketId = this.safeString (income, 'pairSymbol');\n        const currencyId = this.safeString (income, 'assetSymbol');\n        const timestamp = this.safeIntegerProduct (income, 'time', 0.001);\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'id'),\n            'amount': this.safeNumber (income, 'amount'),\n        };\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2122,
        "line_end": 2138,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageNum",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageNum",
            "comment": null
          }
        ],
        "examples": [
          "{\n            \"symbol\": \"ETH_USDT_PERP\",\n            \"leverage\": \"5\"\n        }"
        ],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        //\n        //        {\n        //            \"symbol\": \"ETH_USDT_PERP\",\n        //            \"leverage\": \"5\"\n        //        }\n        //\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageNum = this.safeNumber (leverage, 'leverage'); // default leverage is 1 typically\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': undefined,\n            'longLeverage': leverageNum,\n            'shortLeverage': leverageNum,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLeverageTiers",
        "signature": "parseLeverageTiers (response: any, symbols: string[] = undefined, marketIdKey = undefined): LeverageTiers",
        "line_start": 2392,
        "line_end": 2409,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLeverageTiers (response: any, symbols: string[] = undefined, marketIdKey = undefined): LeverageTiers {\n        // overloaded method\n        const indexed = this.indexBy (response, 'name');\n        symbols = this.marketSymbols (symbols);\n        const tiers = {};\n        for (let i = 0; i < symbols.length; i++) {\n            const symbol = symbols[i];\n            const market = this.market (symbol);\n            const marginSchedule = this.safeString (market['info'], 'marginSchedule');\n            if (marginSchedule === undefined) {\n                throw new BadSymbol (this.id + ' fetchLeverageTiers() could not find marginSchedule for ' + symbol);\n            }\n            const selectedDict = this.safeDict (indexed, marginSchedule, {});\n            const bands = this.safeList (selectedDict, 'bands', []);\n            tiers[symbol] = this.parseMarketLeverageTiers (bands, market);\n        }\n        return tiers;\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 2411,
        "line_end": 2433,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['linear'] ? market['base'] : market['quote']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "maxNotional",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'marginRate')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeInteger (tier, 'leverageRate')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        const tiers = [];\n        const brackets = info;\n        let minNotional = 0;\n        for (let i = 0; i < brackets.length; i++) {\n            const tier = brackets[i];\n            const marketId = this.safeString (info, 'market');\n            market = this.safeMarket (marketId, market, undefined, 'swap');\n            const maxNotional = this.safeNumber (tier, 'positionLimit');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n                'currency': market['linear'] ? market['base'] : market['quote'],\n                'minNotional': minNotional,\n                'maxNotional': maxNotional,\n                'maintenanceMarginRate': this.safeNumber (tier, 'marginRate'),\n                'maxLeverage': this.safeInteger (tier, 'leverageRate'),\n                'info': tier,\n            });\n            minNotional = maxNotional;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 819,
        "line_end": 841,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n            \"symbol\": \"BTC_USDT_PERP\",\n            \"time\": \"1753464720000000\",\n            \"duration\": \"60000000\",\n            \"open\": \"116051.35\",\n            \"high\": \"116060.27\",\n            \"low\": \"116051.35\",\n            \"close\": \"116060.27\",\n            \"volume\": \"0.0257\",\n            \"quoteVolume\": \"2982.6724054\"\n        }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //        {\n        //            \"symbol\": \"BTC_USDT_PERP\",\n        //            \"time\": \"1753464720000000\",\n        //            \"duration\": \"60000000\",\n        //            \"open\": \"116051.35\",\n        //            \"high\": \"116060.27\",\n        //            \"low\": \"116051.35\",\n        //            \"close\": \"116060.27\",\n        //            \"volume\": \"0.0257\",\n        //            \"quoteVolume\": \"2982.6724054\"\n        //        }\n        //\n        return [\n            this.safeIntegerProduct (ohlcv, 'time', 0.001),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1427,
        "line_end": 1554,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (order, 'orderId', 'triggerOrderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimeStamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeIntegerProduct (order, 'lastTime', 0.001)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'executedNotional')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumberOmitZero (order, 'avgPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (order, 'size')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeNumber (order, '')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fees",
            "value": "fees",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"orderId\": \"3694872060678\",\n        \"clientOrderId\": \"test123\",\n        \"symbol\": \"SOL_USDT\",\n        \"subaccountId\": \"0\",\n        \"side\": \"buy\",\n        \"type\": \"limitGtc\",\n        \"size\": \"0.05\",\n        \"price\": \"170\",\n        \"time\": \"1753710501474043\"\n    }",
          "{\n        \"orderId\": \"3690478767430\",\n        \"userId\": \"2959123\",\n        \"subaccountId\": \"0\",\n        \"symbol\": \"SOL_USDT\",\n        \"time\": \"1753696843913970\",\n        \"side\": \"sell\",\n        \"type\": \"limitGtc\",\n        \"size\": \"0.066\",\n        \"price\": \"293.2\",\n        \"postOnly\": false,\n        \"reduceOnly\": false,\n        \"executedSize\": \"0\",\n        \"status\": \"booked\",\n        \"avgPrice\": \"0\",\n        \"executedNotional\": \"0\",\n        \"creditFeePaid\": \"0\",\n        \"marginBonusFeePaid\": \"0\",\n        \"quoteFeePaid\": \"0\",\n        \"arkmFeePaid\": \"0\",\n        \"revisionId\": \"887956326\",\n        \"lastTime\": \"1753696843914830\",\n        \"clientOrderId\": \"\",\n        \"lastSize\": \"0\",\n        \"lastPrice\": \"0\",\n        \"lastCreditFee\": \"0\",\n        \"lastMarginBonusFee\": \"0\",\n        \"lastQuoteFee\": \"0\",\n        \"lastArkmFee\": \"0\"\n    }",
          "{\n        \"triggerOrderId\": \"3716436645573\",\n        \"symbol\": \"SOL_USDT_PERP\",\n        \"side\": \"buy\",\n        \"type\": \"limitGtc\",\n        \"size\": \"0.05\",\n        \"price\": \"150\"\n    }",
          "{\n            \"subaccountId\": \"0\",\n            \"symbol\": \"SOL_USDT\",\n            \"side\": \"sell\",\n            \"type\": \"market\",\n            \"size\": \"0.045\",\n            \"price\": \"99.9\",\n            \"postOnly\": false,\n            \"reduceOnly\": false,\n            \"time\": \"1753768103780063\",\n            \"triggerOrderId\": \"3715847222127\",\n            \"triggerType\": \"stopLoss\",\n            \"triggerPriceType\": \"last\",\n            \"triggerPrice\": \"111\",\n            \"clientOrderId\": \"\",\n            \"status\": \"staged\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //    {\n        //        \"orderId\": \"3694872060678\",\n        //        \"clientOrderId\": \"test123\",\n        //        \"symbol\": \"SOL_USDT\",\n        //        \"subaccountId\": \"0\",\n        //        \"side\": \"buy\",\n        //        \"type\": \"limitGtc\",\n        //        \"size\": \"0.05\",\n        //        \"price\": \"170\",\n        //        \"time\": \"1753710501474043\"\n        //    }\n        //\n        // fetchOrder, fetchOpenOrders, fetchClosedOrders\n        //\n        //    {\n        //        \"orderId\": \"3690478767430\",\n        //        \"userId\": \"2959123\",\n        //        \"subaccountId\": \"0\",\n        //        \"symbol\": \"SOL_USDT\",\n        //        \"time\": \"1753696843913970\",\n        //        \"side\": \"sell\",\n        //        \"type\": \"limitGtc\",\n        //        \"size\": \"0.066\",\n        //        \"price\": \"293.2\",\n        //        \"postOnly\": false,\n        //        \"reduceOnly\": false,\n        //        \"executedSize\": \"0\",\n        //        \"status\": \"booked\",\n        //        \"avgPrice\": \"0\",\n        //        \"executedNotional\": \"0\",\n        //        \"creditFeePaid\": \"0\",\n        //        \"marginBonusFeePaid\": \"0\",\n        //        \"quoteFeePaid\": \"0\",\n        //        \"arkmFeePaid\": \"0\",\n        //        \"revisionId\": \"887956326\",\n        //        \"lastTime\": \"1753696843914830\",\n        //        \"clientOrderId\": \"\",\n        //        \"lastSize\": \"0\",\n        //        \"lastPrice\": \"0\",\n        //        \"lastCreditFee\": \"0\",\n        //        \"lastMarginBonusFee\": \"0\",\n        //        \"lastQuoteFee\": \"0\",\n        //        \"lastArkmFee\": \"0\"\n        //    }\n        //\n        // trigger-orders: createOrder\n        //\n        //    {\n        //        \"triggerOrderId\": \"3716436645573\",\n        //        \"symbol\": \"SOL_USDT_PERP\",\n        //        \"side\": \"buy\",\n        //        \"type\": \"limitGtc\",\n        //        \"size\": \"0.05\",\n        //        \"price\": \"150\"\n        //    }\n        //\n        // trigger-orders: fetchOpenOrders\n        //\n        //    {\n        //            \"subaccountId\": \"0\",\n        //            \"symbol\": \"SOL_USDT\",\n        //            \"side\": \"sell\",\n        //            \"type\": \"market\",\n        //            \"size\": \"0.045\",\n        //            \"price\": \"99.9\",\n        //            \"postOnly\": false,\n        //            \"reduceOnly\": false,\n        //            \"time\": \"1753768103780063\",\n        //            \"triggerOrderId\": \"3715847222127\",\n        //            \"triggerType\": \"stopLoss\",\n        //            \"triggerPriceType\": \"last\",\n        //            \"triggerPrice\": \"111\",\n        //            \"clientOrderId\": \"\",\n        //            \"status\": \"staged\"\n        //    }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const isPostOnly = this.safeBool (order, 'postOnly');\n        const typeRaw = this.safeString (order, 'type');\n        const orderType = isPostOnly ? 'limit' : this.parseOrderType (typeRaw);\n        const timeInForce = isPostOnly ? 'PO' : this.parseTimeInForce (typeRaw);\n        const quoteFeePaid = this.safeString (order, 'quoteFeePaid');\n        const arkmFeePaid = this.safeString (order, 'arkmFeePaid');\n        const fees = [];\n        if (quoteFeePaid !== undefined) {\n            fees.push ({\n                'cost': quoteFeePaid,\n                'currency': this.safeString (market, 'quote'),\n            });\n        }\n        if (arkmFeePaid !== undefined) {\n            fees.push ({\n                'cost': arkmFeePaid,\n                'currency': 'ARKM',\n            });\n        }\n        const timestamp = this.safeIntegerProduct (order, 'time', 0.001);\n        return this.safeOrder ({\n            'id': this.safeString2 (order, 'orderId', 'triggerOrderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimeStamp': undefined,\n            'lastUpdateTimestamp': this.safeIntegerProduct (order, 'lastTime', 0.001),\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'symbol': market['symbol'],\n            'type': orderType,\n            'timeInForce': timeInForce,\n            'postOnly': undefined,\n            'side': this.safeString (order, 'side'),\n            'price': this.safeNumber (order, 'price'),\n            'triggerPrice': undefined,\n            'cost': this.safeNumber (order, 'executedNotional'),\n            'average': this.safeNumberOmitZero (order, 'avgPrice'),\n            'amount': this.safeNumber (order, 'size'),\n            'filled': this.safeNumber (order, ''),\n            'remaining': undefined,\n            'trades': undefined,\n            'fees': fees,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1576,
        "line_end": 1587,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'pending',\n            'staged': 'open',\n            'booked': 'open',\n            'taker': 'closed',\n            'maker': 'closed',\n            'cancelled': 'canceled',\n            'closed': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str): Str",
        "line_start": 1556,
        "line_end": 1564,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str): Str {\n        const types: Dict = {\n            'limitGtc': 'limit',\n            'limitIoc': 'limit',\n            'limitFok': 'limit',\n            'market': 'market',\n        };\n        return this.safeStringUpper (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2212,
        "line_end": 2273,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (Precise.stringAbs (notional))",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'averageEntryPrice')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'pnl')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (baseAbs)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'lastUpdateTime')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (position, 'maintenanceMargin')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'initialMargin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n            \"subaccountId\": \"0\",\n            \"symbol\": \"SOL_USDT_PERP\",\n            \"base\": \"0.037\",                             // negative for short position\n            \"quote\": \"-6.44614\",                         // negative for long position\n            \"openBuySize\": \"0\",\n            \"openSellSize\": \"0\",\n            \"openBuyNotional\": \"0\",\n            \"openSellNotional\": \"0\",\n            \"lastUpdateReason\": \"orderFill\",\n            \"lastUpdateTime\": \"1753903829389966\",\n            \"lastUpdateId\": \"250434684\",\n            \"lastUpdateBaseDelta\": \"0.037\",\n            \"lastUpdateQuoteDelta\": \"-6.44614\",\n            \"breakEvenPrice\": \"174.22\",\n            \"markPrice\": \"174.33\",\n            \"value\": \"6.45021\",\n            \"pnl\": \"0.00407\",\n            \"initialMargin\": \"0.645021\",\n            \"maintenanceMargin\": \"0.3870126\",\n            \"averageEntryPrice\": \"174.22\"\n        }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //        {\n        //            \"subaccountId\": \"0\",\n        //            \"symbol\": \"SOL_USDT_PERP\",\n        //            \"base\": \"0.037\",                             // negative for short position\n        //            \"quote\": \"-6.44614\",                         // negative for long position\n        //            \"openBuySize\": \"0\",\n        //            \"openSellSize\": \"0\",\n        //            \"openBuyNotional\": \"0\",\n        //            \"openSellNotional\": \"0\",\n        //            \"lastUpdateReason\": \"orderFill\",\n        //            \"lastUpdateTime\": \"1753903829389966\",\n        //            \"lastUpdateId\": \"250434684\",\n        //            \"lastUpdateBaseDelta\": \"0.037\",\n        //            \"lastUpdateQuoteDelta\": \"-6.44614\",\n        //            \"breakEvenPrice\": \"174.22\",\n        //            \"markPrice\": \"174.33\",\n        //            \"value\": \"6.45021\",\n        //            \"pnl\": \"0.00407\",\n        //            \"initialMargin\": \"0.645021\",\n        //            \"maintenanceMargin\": \"0.3870126\",\n        //            \"averageEntryPrice\": \"174.22\"\n        //        }\n        //\n        const base = this.safeString (position, 'base');\n        const baseAbs = Precise.stringAbs (base);\n        const isLong = Precise.stringGe (base, '0');\n        const side = isLong ? 'long' : 'short';\n        const marketId = this.safeString (position, 'symbol');\n        const notional = this.safeString (position, 'value');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeSymbol (marketId, market),\n            'notional': this.parseNumber (Precise.stringAbs (notional)),\n            'marginMode': undefined,\n            'liquidationPrice': undefined,\n            'entryPrice': this.safeNumber (position, 'averageEntryPrice'),\n            'unrealizedPnl': this.safeNumber (position, 'pnl'),\n            'realizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': this.parseNumber (baseAbs),\n            'contractSize': undefined,\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'lastPrice': undefined,\n            'side': side,\n            'hedged': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': this.safeInteger (position, 'lastUpdateTime'),\n            'maintenanceMargin': this.safeNumber (position, 'maintenanceMargin'),\n            'maintenanceMarginPercentage': undefined,\n            'collateral': undefined,\n            'initialMargin': this.safeNumber (position, 'initialMargin'),\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 914,
        "line_end": 937,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (ticker, 'high24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (ticker, 'low24h')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeNumber (ticker, 'price')",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeNumber (ticker, 'price24hAgo')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (ticker, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (ticker, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (ticker, 'volume24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (ticker, 'usdVolume24h')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return this.safeTicker ({\n            'info': ticker,\n            'symbol': this.safeSymbol (marketId, market),\n            'high': this.safeNumber (ticker, 'high24h'),\n            'low': this.safeNumber (ticker, 'low24h'),\n            'bid': this.safeNumber (ticker, 'bid'),\n            'last': this.safeNumber (ticker, 'price'),\n            'open': this.safeNumber (ticker, 'price24hAgo'),\n            'change': this.safeNumber (ticker, 'priceChange'),\n            'percentage': this.safeNumber (ticker, 'priceChangePercent'),\n            'baseVolume': this.safeNumber (ticker, 'volume24h'),\n            'quoteVolume': this.safeNumber (ticker, 'usdVolume24h'),\n            'markPrice': this.safeNumber (ticker, 'markPrice'),\n            'indexPrice': this.safeNumber (ticker, 'indexPrice'),\n            'vwap': undefined,\n            'average': undefined,\n            'previousClose': undefined,\n            'askVolume': undefined,\n            'bidVolume': undefined,\n        });\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (type: Str): Str",
        "line_start": 1566,
        "line_end": 1574,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (type: Str): Str {\n        const types: Dict = {\n            'limitGtc': 'GTC',\n            'limitIoc': 'IOC',\n            'limitFok': 'FOK',\n            'market': 'IOC',\n        };\n        return this.safeStringUpper (types, type, type);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 979,
        "line_end": 1040,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'revisionId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString2 (trade, 'userSide', 'takerSide')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'size')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          }
        ],
        "examples": [
          "{\n            \"symbol\": \"BTC_USDT_PERP\",\n            \"revisionId\": \"1130514101\",\n            \"size\": \"0.01668\",\n            \"price\": \"116309.57\",\n            \"takerSide\": \"sell\",\n            \"time\": \"1753439710374047\"\n        }",
          "{\n            \"symbol\": \"SOL_USDT\",\n            \"revisionId\": \"891839406\",\n            \"size\": \"0.042\",\n            \"price\": \"185.06\",\n            \"takerSide\": \"sell\",\n            \"time\": \"1753773952039342\",\n            \"orderId\": \"3717304929194\",\n            \"userSide\": \"sell\",\n            \"quoteFee\": \"0.00777252\",\n            \"arkmFee\": \"0\",\n            \"clientOrderId\": \"\"\n        }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //        {\n        //            \"symbol\": \"BTC_USDT_PERP\",\n        //            \"revisionId\": \"1130514101\",\n        //            \"size\": \"0.01668\",\n        //            \"price\": \"116309.57\",\n        //            \"takerSide\": \"sell\",\n        //            \"time\": \"1753439710374047\"\n        //        }\n        //\n        // fetchMyTrades\n        //\n        //        {\n        //            \"symbol\": \"SOL_USDT\",\n        //            \"revisionId\": \"891839406\",\n        //            \"size\": \"0.042\",\n        //            \"price\": \"185.06\",\n        //            \"takerSide\": \"sell\",\n        //            \"time\": \"1753773952039342\",\n        //            \"orderId\": \"3717304929194\",\n        //            \"userSide\": \"sell\",\n        //            \"quoteFee\": \"0.00777252\",\n        //            \"arkmFee\": \"0\",\n        //            \"clientOrderId\": \"\"\n        //        }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeIntegerProduct (trade, 'time', 0.001);\n        const quoteFee = this.safeNumber (trade, 'quoteFee');\n        const arkmFee = this.safeNumber (trade, 'arkmFee');\n        let fee = undefined;\n        if (quoteFee !== undefined) {\n            fee = {\n                'cost': quoteFee,\n                'currency': market['quote'],\n            };\n        } else if (arkmFee !== undefined) {\n            fee = {\n                'cost': arkmFee,\n                'currency': 'ARKM',\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString (trade, 'revisionId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': undefined,\n            'side': this.safeString2 (trade, 'userSide', 'takerSide'), // priority to userSide\n            'takerOrMaker': undefined,\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString (trade, 'size'),\n            'cost': undefined,\n            'fee': fee,\n            'order': this.safeString (trade, 'orderId'),\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1927,
        "line_end": 1972,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transactionHash')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'chain'))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          }
        ],
        "examples": [
          "{\n            \"id\": \"238644\",\n            \"symbol\": \"SOL\",\n            \"amount\": \"0.104\",\n            \"time\": \"1753436404000000\",\n            \"confirmed\": true,\n            \"transactionHash\": \"1DRxbbyePTsMuB82SDf2fG5gLXH5iYnY8TQDstDPLULpLtjMJtF1ug1T4Mf8B6DSb8fp2sb5YtdbyqieZ2tkE1Ve\",\n            \"chain\": \"Solana\",\n            \"depositAddress\": \"12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV\",\n            \"price\": \"180.322010164\"\n        }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //        {\n        //            \"id\": \"238644\",\n        //            \"symbol\": \"SOL\",\n        //            \"amount\": \"0.104\",\n        //            \"time\": \"1753436404000000\",\n        //            \"confirmed\": true,\n        //            \"transactionHash\": \"1DRxbbyePTsMuB82SDf2fG5gLXH5iYnY8TQDstDPLULpLtjMJtF1ug1T4Mf8B6DSb8fp2sb5YtdbyqieZ2tkE1Ve\",\n        //            \"chain\": \"Solana\",\n        //            \"depositAddress\": \"12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV\",\n        //            \"price\": \"180.322010164\"\n        //        }\n        //\n        const address = this.safeString (transaction, 'depositAddress');\n        const timestamp = this.safeIntegerProduct (transaction, 'time', 0.001);\n        const confirmd = this.safeBool (transaction, 'confirmed');\n        let status = undefined;\n        if (confirmd) {\n            status = 'ok';\n        }\n        const currencyId = this.safeString (transaction, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'transactionHash'),\n            'type': undefined,\n            'currency': code,\n            'network': this.networkIdToCode (this.safeString (transaction, 'chain')),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': undefined,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': undefined,\n            'comment': undefined,\n            'fee': undefined,\n            'internal': false,\n        };\n    }"
      }
    ],
    "ascendex": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 928,
        "line_end": 944,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const balances = this.safeList (response, 'data', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'availableBalance');\n            account['total'] = this.safeString (balance, 'totalBalance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2560,
        "line_end": 2588,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n         \"destTag\": \"\",\n         \"tagType\": \"\",\n         \"tagId\": \"\",\n         \"chainName\": \"ERC20\",\n         \"numConfirmations\": 20,\n         \"withdrawalFee\": 1,\n         \"nativeScale\": 4,\n         \"tips\": []\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n        //         \"destTag\": \"\",\n        //         \"tagType\": \"\",\n        //         \"tagId\": \"\",\n        //         \"chainName\": \"ERC20\",\n        //         \"numConfirmations\": 20,\n        //         \"withdrawalFee\": 1,\n        //         \"nativeScale\": 4,\n        //         \"tips\": []\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const tagId = this.safeString (depositAddress, 'tagId');\n        const tag = this.safeString (depositAddress, tagId);\n        this.checkAddress (address);\n        const code = (currency === undefined) ? undefined : currency['code'];\n        const chainName = this.safeString (depositAddress, 'blockchain');\n        const network = this.networkIdToCode (chainName, code);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': network,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 3282,
        "line_end": 3331,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': this.safeNumber (blockChain, 'withdrawFee'), 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"assetCode\":      \"USDT\",\n     \"assetName\":      \"Tether\",\n     \"precisionScale\":  9,\n     \"nativeScale\":     4,\n     \"blockChain\": [\n         {\n             \"chainName\":        \"Omni\",\n             \"withdrawFee\":      \"30.0\",\n             \"allowDeposit\":      true,\n             \"allowWithdraw\":     true,\n             \"minDepositAmt\":    \"0.0\",\n             \"minWithdrawal\":    \"50.0\",\n             \"numConfirmations\":  3\n         },\n     ]\n }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        // {\n        //     \"assetCode\":      \"USDT\",\n        //     \"assetName\":      \"Tether\",\n        //     \"precisionScale\":  9,\n        //     \"nativeScale\":     4,\n        //     \"blockChain\": [\n        //         {\n        //             \"chainName\":        \"Omni\",\n        //             \"withdrawFee\":      \"30.0\",\n        //             \"allowDeposit\":      true,\n        //             \"allowWithdraw\":     true,\n        //             \"minDepositAmt\":    \"0.0\",\n        //             \"minWithdrawal\":    \"50.0\",\n        //             \"numConfirmations\":  3\n        //         },\n        //     ]\n        // }\n        //\n        const blockChains = this.safeList (fee, 'blockChain', []);\n        const blockChainsLength = blockChains.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        for (let i = 0; i < blockChainsLength; i++) {\n            const blockChain = blockChains[i];\n            const networkId = this.safeString (blockChain, 'chainName');\n            const currencyCode = this.safeString (currency, 'code');\n            const networkCode = this.networkIdToCode (networkId, currencyCode);\n            result['networks'][networkCode] = {\n                'deposit': { 'fee': undefined, 'percentage': undefined },\n                'withdraw': { 'fee': this.safeNumber (blockChain, 'withdrawFee'), 'percentage': false },\n            };\n            if (blockChainsLength === 1) {\n                result['withdraw']['fee'] = this.safeNumber (blockChain, 'withdrawFee');\n                result['withdraw']['percentage'] = false;\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 2960,
        "line_end": 2997,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'indexPrice')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "currentTime",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (currentTime)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"time\": 1640061364830,\n          \"symbol\": \"EOS-PERP\",\n          \"markPrice\": \"3.353854865\",\n          \"indexPrice\": \"3.3542\",\n          \"openInterest\": \"14242\",\n          \"fundingRate\": \"-0.000073026\",\n          \"nextFundingTime\": 1640073600000\n      }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //      {\n        //          \"time\": 1640061364830,\n        //          \"symbol\": \"EOS-PERP\",\n        //          \"markPrice\": \"3.353854865\",\n        //          \"indexPrice\": \"3.3542\",\n        //          \"openInterest\": \"14242\",\n        //          \"fundingRate\": \"-0.000073026\",\n        //          \"nextFundingTime\": 1640073600000\n        //      }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const currentTime = this.safeInteger (contract, 'time');\n        const nextFundingRate = this.safeNumber (contract, 'fundingRate');\n        const nextFundingRateTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': this.safeNumber (contract, 'markPrice'),\n            'indexPrice': this.safeNumber (contract, 'indexPrice'),\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': currentTime,\n            'datetime': this.iso8601 (currentTime),\n            'previousFundingRate': undefined,\n            'nextFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'nextFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'nextFundingDatetime': undefined,\n            'fundingRate': nextFundingRate,\n            'fundingTimestamp': nextFundingRateTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 3478,
        "line_end": 3498,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-', 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "'USDT'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'paymentInUSDT')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"timestamp\": 1640476800000,\n         \"symbol\": \"BTC-PERP\",\n         \"paymentInUSDT\": \"-0.013991178\",\n         \"fundingRate\": \"0.000173497\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //         \"timestamp\": 1640476800000,\n        //         \"symbol\": \"BTC-PERP\",\n        //         \"paymentInUSDT\": \"-0.013991178\",\n        //         \"fundingRate\": \"0.000173497\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const timestamp = this.safeInteger (income, 'timestamp');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, '-', 'swap'),\n            'code': 'USDT',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.safeNumber (income, 'paymentInUSDT'),\n        };\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3635,
        "line_end": 3647,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        const marginType = this.safeString (leverage, 'marginType');\n        const marginMode = (marginType === 'crossed') ? 'cross' : 'isolated';\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginBalance",
        "signature": "parseMarginBalance (response)",
        "line_start": 946,
        "line_end": 965,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarginBalance (response) {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const balances = this.safeList (response, 'data', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'availableBalance');\n            account['total'] = this.safeString (balance, 'totalBalance');\n            const debt = this.safeString (balance, 'borrowed');\n            const interest = this.safeString (balance, 'interest');\n            account['debt'] = Precise.stringAdd (debt, interest);\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 3562,
        "line_end": 3571,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "margin",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        const marginType = this.safeString (marginMode, 'marginType');\n        const margin = (marginType === 'crossed') ? 'cross' : 'isolated';\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': margin,\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 3069,
        "line_end": 3091,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"code\": 0\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //     {\n        //          \"code\": 0\n        //     }\n        //\n        const errorCode = this.safeString (data, 'code');\n        const status = (errorCode === '0') ? 'ok' : 'failed';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': market['quote'],\n            'status': status,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 3233,
        "line_end": 3280,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (tier, 'positionNotionalLowerBound')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'positionNotionalUpperBound')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintenanceMarginRate')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.parseNumber (Precise.stringDiv ('1', initialMarginRate))",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "@param {object} info Exchange market response for 1 market",
          "@param {object} market CCXT market",
          "{\n        \"symbol\":\"BTC-PERP\",\n        \"status\":\"Normal\",\n        \"displayName\":\"BTCUSDT\",\n        \"settlementAsset\":\"USDT\",\n        \"underlying\":\"BTC/USDT\",\n        \"tradingStartTime\":1579701600000,\n        \"priceFilter\":{\"minPrice\":\"1\",\"maxPrice\":\"1000000\",\"tickSize\":\"1\"},\n        \"lotSizeFilter\":{\"minQty\":\"0.0001\",\"maxQty\":\"1000000000\",\"lotSize\":\"0.0001\"},\n        \"commissionType\":\"Quote\",\n        \"commissionReserveRate\":\"0.001\",\n        \"marketOrderPriceMarkup\":\"0.03\",\n        \"marginRequirements\":[\n            {\"positionNotionalLowerBound\":\"0\",\"positionNotionalUpperBound\":\"50000\",\"initialMarginRate\":\"0.01\",\"maintenanceMarginRate\":\"0.006\"},\n            {\"positionNotionalLowerBound\":\"50000\",\"positionNotionalUpperBound\":\"200000\",\"initialMarginRate\":\"0.02\",\"maintenanceMarginRate\":\"0.012\"},\n            {\"positionNotionalLowerBound\":\"200000\",\"positionNotionalUpperBound\":\"2000000\",\"initialMarginRate\":\"0.04\",\"maintenanceMarginRate\":\"0.024\"},\n            {\"positionNotionalLowerBound\":\"2000000\",\"positionNotionalUpperBound\":\"20000000\",\"initialMarginRate\":\"0.1\",\"maintenanceMarginRate\":\"0.06\"},\n            {\"positionNotionalLowerBound\":\"20000000\",\"positionNotionalUpperBound\":\"40000000\",\"initialMarginRate\":\"0.2\",\"maintenanceMarginRate\":\"0.12\"},\n            {\"positionNotionalLowerBound\":\"40000000\",\"positionNotionalUpperBound\":\"1000000000\",\"initialMarginRate\":\"0.333333\",\"maintenanceMarginRate\":\"0.2\"}\n        ]\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @param {object} info Exchange market response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\":\"BTC-PERP\",\n        //        \"status\":\"Normal\",\n        //        \"displayName\":\"BTCUSDT\",\n        //        \"settlementAsset\":\"USDT\",\n        //        \"underlying\":\"BTC/USDT\",\n        //        \"tradingStartTime\":1579701600000,\n        //        \"priceFilter\":{\"minPrice\":\"1\",\"maxPrice\":\"1000000\",\"tickSize\":\"1\"},\n        //        \"lotSizeFilter\":{\"minQty\":\"0.0001\",\"maxQty\":\"1000000000\",\"lotSize\":\"0.0001\"},\n        //        \"commissionType\":\"Quote\",\n        //        \"commissionReserveRate\":\"0.001\",\n        //        \"marketOrderPriceMarkup\":\"0.03\",\n        //        \"marginRequirements\":[\n        //            {\"positionNotionalLowerBound\":\"0\",\"positionNotionalUpperBound\":\"50000\",\"initialMarginRate\":\"0.01\",\"maintenanceMarginRate\":\"0.006\"},\n        //            {\"positionNotionalLowerBound\":\"50000\",\"positionNotionalUpperBound\":\"200000\",\"initialMarginRate\":\"0.02\",\"maintenanceMarginRate\":\"0.012\"},\n        //            {\"positionNotionalLowerBound\":\"200000\",\"positionNotionalUpperBound\":\"2000000\",\"initialMarginRate\":\"0.04\",\"maintenanceMarginRate\":\"0.024\"},\n        //            {\"positionNotionalLowerBound\":\"2000000\",\"positionNotionalUpperBound\":\"20000000\",\"initialMarginRate\":\"0.1\",\"maintenanceMarginRate\":\"0.06\"},\n        //            {\"positionNotionalLowerBound\":\"20000000\",\"positionNotionalUpperBound\":\"40000000\",\"initialMarginRate\":\"0.2\",\"maintenanceMarginRate\":\"0.12\"},\n        //            {\"positionNotionalLowerBound\":\"40000000\",\"positionNotionalUpperBound\":\"1000000000\",\"initialMarginRate\":\"0.333333\",\"maintenanceMarginRate\":\"0.2\"}\n        //        ]\n        //    }\n        //\n        const marginRequirements = this.safeList (info, 'marginRequirements', []);\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const tiers = [];\n        for (let i = 0; i < marginRequirements.length; i++) {\n            const tier = marginRequirements[i];\n            const initialMarginRate = this.safeString (tier, 'initialMarginRate');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber (tier, 'positionNotionalLowerBound'),\n                'maxNotional': this.safeNumber (tier, 'positionNotionalUpperBound'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintenanceMarginRate'),\n                'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMarginRate)),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1261,
        "line_end": 1286,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"m\":\"bar\",\n         \"s\":\"BTC/USDT\",\n         \"data\":{\n             \"i\":\"1\",\n             \"ts\":1590228000000,\n             \"o\":\"9139.59\",\n             \"c\":\"9131.94\",\n             \"h\":\"9139.99\",\n             \"l\":\"9121.71\",\n             \"v\":\"25.20648\"\n         }\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"m\":\"bar\",\n        //         \"s\":\"BTC/USDT\",\n        //         \"data\":{\n        //             \"i\":\"1\",\n        //             \"ts\":1590228000000,\n        //             \"o\":\"9139.59\",\n        //             \"c\":\"9131.94\",\n        //             \"h\":\"9139.99\",\n        //             \"l\":\"9121.71\",\n        //             \"v\":\"25.20648\"\n        //         }\n        //     }\n        //\n        const data = this.safeDict (ohlcv, 'data', {});\n        return [\n            this.safeInteger (data, 'ts'),\n            this.safeNumber (data, 'o'),\n            this.safeNumber (data, 'h'),\n            this.safeNumber (data, 'l'),\n            this.safeNumber (data, 'c'),\n            this.safeNumber (data, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1450,
        "line_end": 1631,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"16e607e2b83a8bXHbAwwoqDo55c166fa\",\n         \"orderId\": \"16e85b4d9b9a8bXHbAwwoqDoc3d66830\",\n         \"orderType\": \"Market\",\n         \"symbol\": \"BTC/USDT\",\n         \"timestamp\": 1573576916201\n     }",
          "{\n         \"ac\": \"FUTURES\",\n         \"accountId\": \"fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn\",\n         \"time\": 1640819389454,\n         \"orderId\": \"a17e0874ecbdU0711043490bbtcpDU5X\",\n         \"seqNum\": -1,\n         \"orderType\": \"Limit\",\n         \"execInst\": \"NULL_VAL\", // NULL_VAL, ReduceOnly , ...\n         \"side\": \"Buy\",\n         \"symbol\": \"BTC-PERP\",\n         \"price\": \"30000\",\n         \"orderQty\": \"0.002\",\n         \"stopPrice\": \"0\",\n         \"stopBy\": \"ref-px\",\n         \"status\": \"Ack\",\n         \"lastExecTime\": 1640819389454,\n         \"lastQty\": \"0\",\n         \"lastPx\": \"0\",\n         \"avgFilledPx\": \"0\",\n         \"cumFilledQty\": \"0\",\n         \"fee\": \"0\",\n         \"cumFee\": \"0\",\n         \"feeAsset\": \"\",\n         \"errorCode\": \"\",\n         \"posStopLossPrice\": \"0\",\n         \"posStopLossTrigger\": \"market\",\n         \"posTakeProfitPrice\": \"0\",\n         \"posTakeProfitTrigger\": \"market\",\n         \"liquidityInd\": \"n\"\n      }",
          "{\n         \"symbol\":       \"BTC/USDT\",\n         \"price\":        \"8131.22\",\n         \"orderQty\":     \"0.00082\",\n         \"orderType\":    \"Market\",\n         \"avgPx\":        \"7392.02\",\n         \"cumFee\":       \"0.005152238\",\n         \"cumFilledQty\": \"0.00082\",\n         \"errorCode\":    \"\",\n         \"feeAsset\":     \"USDT\",\n         \"lastExecTime\": 1575953151764,\n         \"orderId\":      \"a16eee20b6750866943712zWEDdAjt3\",\n         \"seqNum\":       2623469,\n         \"side\":         \"Buy\",\n         \"status\":       \"Filled\",\n         \"stopPrice\":    \"\",\n         \"execInst\":     \"NULL_VAL\" // \"Post\" (for postOnly orders), \"reduceOnly\" (for reduceOnly orders)\n     }",
          "{\n         \"orderId\": \"a173ad938fc3U22666567717788c3b66\",   // orderId\n         \"seqNum\": 18777366360,                           // sequence number\n         \"accountId\": \"cshwSjbpPjSwHmxPdz2CPQVU9mnbzPpt\", // accountId\n         \"symbol\": \"BTC/USDT\",                            // symbol\n         \"orderType\": \"Limit\",                            // order type (Limit/Market/StopMarket/StopLimit)\n         \"side\": \"Sell\",                                  // order side (Buy/Sell)\n         \"price\": \"11346.77\",                             // order price\n         \"stopPrice\": \"0\",                                // stop price (0 by default)\n         \"orderQty\": \"0.01\",                              // order quantity (in base asset)\n         \"status\": \"Canceled\",                            // order status (Filled/Canceled/Rejected)\n         \"createTime\": 1596344995793,                     // order creation time\n         \"lastExecTime\": 1596344996053,                   // last execution time\n         \"avgFillPrice\": \"11346.77\",                      // average filled price\n         \"fillQty\": \"0.01\",                               // filled quantity (in base asset)\n         \"fee\": \"-0.004992579\",                           // cummulative fee. if negative, this value is the commission charged; if possitive, this value is the rebate received.\n         \"feeAsset\": \"USDT\"                               // fee asset\n     }",
          "{\n         \"ac\": \"FUTURES\",\n         \"accountId\": \"testabcdefg\",\n         \"avgPx\": \"0\",\n         \"cumFee\": \"0\",\n         \"cumQty\": \"0\",\n         \"errorCode\": \"NULL_VAL\",\n         \"execInst\": \"NULL_VAL\",\n         \"feeAsset\": \"USDT\",\n         \"lastExecTime\": 1584072844085,\n         \"orderId\": \"r170d21956dd5450276356bbtcpKa74\",\n         \"orderQty\": \"1.1499\",\n         \"orderType\": \"Limit\",\n         \"price\": \"4000\",\n         \"sendingTime\": 1584072841033,\n         \"seqNum\": 24105338,\n         \"side\": \"Buy\",\n         \"status\": \"Canceled\",\n         \"stopPrice\": \"\",\n         \"symbol\": \"BTC-PERP\"\n     },"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"id\": \"16e607e2b83a8bXHbAwwoqDo55c166fa\",\n        //         \"orderId\": \"16e85b4d9b9a8bXHbAwwoqDoc3d66830\",\n        //         \"orderType\": \"Market\",\n        //         \"symbol\": \"BTC/USDT\",\n        //         \"timestamp\": 1573576916201\n        //     }\n        //\n        //  & linear (fetchClosedOrders)\n        //\n        //     {\n        //         \"ac\": \"FUTURES\",\n        //         \"accountId\": \"fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn\",\n        //         \"time\": 1640819389454,\n        //         \"orderId\": \"a17e0874ecbdU0711043490bbtcpDU5X\",\n        //         \"seqNum\": -1,\n        //         \"orderType\": \"Limit\",\n        //         \"execInst\": \"NULL_VAL\", // NULL_VAL, ReduceOnly , ...\n        //         \"side\": \"Buy\",\n        //         \"symbol\": \"BTC-PERP\",\n        //         \"price\": \"30000\",\n        //         \"orderQty\": \"0.002\",\n        //         \"stopPrice\": \"0\",\n        //         \"stopBy\": \"ref-px\",\n        //         \"status\": \"Ack\",\n        //         \"lastExecTime\": 1640819389454,\n        //         \"lastQty\": \"0\",\n        //         \"lastPx\": \"0\",\n        //         \"avgFilledPx\": \"0\",\n        //         \"cumFilledQty\": \"0\",\n        //         \"fee\": \"0\",\n        //         \"cumFee\": \"0\",\n        //         \"feeAsset\": \"\",\n        //         \"errorCode\": \"\",\n        //         \"posStopLossPrice\": \"0\",\n        //         \"posStopLossTrigger\": \"market\",\n        //         \"posTakeProfitPrice\": \"0\",\n        //         \"posTakeProfitTrigger\": \"market\",\n        //         \"liquidityInd\": \"n\"\n        //      }\n        //\n        // fetchOrder, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"symbol\":       \"BTC/USDT\",\n        //         \"price\":        \"8131.22\",\n        //         \"orderQty\":     \"0.00082\",\n        //         \"orderType\":    \"Market\",\n        //         \"avgPx\":        \"7392.02\",\n        //         \"cumFee\":       \"0.005152238\",\n        //         \"cumFilledQty\": \"0.00082\",\n        //         \"errorCode\":    \"\",\n        //         \"feeAsset\":     \"USDT\",\n        //         \"lastExecTime\": 1575953151764,\n        //         \"orderId\":      \"a16eee20b6750866943712zWEDdAjt3\",\n        //         \"seqNum\":       2623469,\n        //         \"side\":         \"Buy\",\n        //         \"status\":       \"Filled\",\n        //         \"stopPrice\":    \"\",\n        //         \"execInst\":     \"NULL_VAL\" // \"Post\" (for postOnly orders), \"reduceOnly\" (for reduceOnly orders)\n        //     }\n        //\n        //     {\n        //         \"orderId\": \"a173ad938fc3U22666567717788c3b66\",   // orderId\n        //         \"seqNum\": 18777366360,                           // sequence number\n        //         \"accountId\": \"cshwSjbpPjSwHmxPdz2CPQVU9mnbzPpt\", // accountId\n        //         \"symbol\": \"BTC/USDT\",                            // symbol\n        //         \"orderType\": \"Limit\",                            // order type (Limit/Market/StopMarket/StopLimit)\n        //         \"side\": \"Sell\",                                  // order side (Buy/Sell)\n        //         \"price\": \"11346.77\",                             // order price\n        //         \"stopPrice\": \"0\",                                // stop price (0 by default)\n        //         \"orderQty\": \"0.01\",                              // order quantity (in base asset)\n        //         \"status\": \"Canceled\",                            // order status (Filled/Canceled/Rejected)\n        //         \"createTime\": 1596344995793,                     // order creation time\n        //         \"lastExecTime\": 1596344996053,                   // last execution time\n        //         \"avgFillPrice\": \"11346.77\",                      // average filled price\n        //         \"fillQty\": \"0.01\",                               // filled quantity (in base asset)\n        //         \"fee\": \"-0.004992579\",                           // cummulative fee. if negative, this value is the commission charged; if possitive, this value is the rebate received.\n        //         \"feeAsset\": \"USDT\"                               // fee asset\n        //     }\n        //\n        //     {\n        //         \"ac\": \"FUTURES\",\n        //         \"accountId\": \"testabcdefg\",\n        //         \"avgPx\": \"0\",\n        //         \"cumFee\": \"0\",\n        //         \"cumQty\": \"0\",\n        //         \"errorCode\": \"NULL_VAL\",\n        //         \"execInst\": \"NULL_VAL\",\n        //         \"feeAsset\": \"USDT\",\n        //         \"lastExecTime\": 1584072844085,\n        //         \"orderId\": \"r170d21956dd5450276356bbtcpKa74\",\n        //         \"orderQty\": \"1.1499\",\n        //         \"orderType\": \"Limit\",\n        //         \"price\": \"4000\",\n        //         \"sendingTime\": 1584072841033,\n        //         \"seqNum\": 24105338,\n        //         \"side\": \"Buy\",\n        //         \"status\": \"Canceled\",\n        //         \"stopPrice\": \"\",\n        //         \"symbol\": \"BTC-PERP\"\n        //     },\n        //\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '/');\n        let timestamp = this.safeIntegerN (order, [ 'timestamp', 'sendingTime', 'time' ]);\n        const lastTradeTimestamp = this.safeInteger (order, 'lastExecTime');\n        if (timestamp === undefined) {\n            timestamp = lastTradeTimestamp;\n        }\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'orderQty');\n        const average = this.safeString2 (order, 'avgPx', 'avgFilledPx');\n        const filled = this.safeStringN (order, [ 'cumFilledQty', 'cumQty', 'fillQty' ]);\n        const id = this.safeString (order, 'orderId');\n        let clientOrderId = this.safeString (order, 'id');\n        if (clientOrderId !== undefined) {\n            if (clientOrderId.length < 1) {\n                clientOrderId = undefined;\n            }\n        }\n        const rawTypeLower = this.safeStringLower (order, 'orderType');\n        let type = rawTypeLower;\n        if (rawTypeLower !== undefined) {\n            if (rawTypeLower === 'stoplimit') {\n                type = 'limit';\n            }\n            if (rawTypeLower === 'stopmarket') {\n                type = 'market';\n            }\n        }\n        const side = this.safeStringLower (order, 'side');\n        const feeCost = this.safeNumber2 (order, 'cumFee', 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (order, 'feeAsset');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const triggerPrice = this.omitZero (this.safeString (order, 'stopPrice'));\n        let reduceOnly = undefined;\n        const execInst = this.safeStringLower (order, 'execInst');\n        if (execInst === 'reduceonly') {\n            reduceOnly = true;\n        }\n        let postOnly = undefined;\n        if (execInst === 'post') {\n            postOnly = true;\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': postOnly,\n            'reduceOnly': reduceOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': undefined,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1438,
        "line_end": 1448,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'PendingNew': 'open',\n            'New': 'open',\n            'PartiallyFilled': 'open',\n            'Filled': 'closed',\n            'Canceled': 'canceled',\n            'Rejected': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2894,
        "line_end": 2958,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'avgOpenPrice')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPnl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'position')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (position, 'side')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeInteger (position, 'leverage')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeNumber (position, 'stopLossPrice')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeNumber (position, 'takeProfitPrice')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-PERP\",\n         \"side\": \"LONG\",\n         \"position\": \"0.0001\",\n         \"referenceCost\": \"-3.12277254\",\n         \"unrealizedPnl\": \"-0.001700233\",\n         \"realizedPnl\": \"0\",\n         \"avgOpenPrice\": \"31209\",\n         \"marginType\": \"isolated\",\n         \"isolatedMargin\": \"1.654972977\",\n         \"leverage\": \"2\",\n         \"takeProfitPrice\": \"0\",\n         \"takeProfitTrigger\": \"market\",\n         \"stopLossPrice\": \"0\",\n         \"stopLossTrigger\": \"market\",\n         \"buyOpenOrderNotional\": \"0\",\n         \"sellOpenOrderNotional\": \"0\",\n         \"markPrice\": \"31210.723063672\",\n         \"indexPrice\": \"31223.148857925\"\n     },"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTC-PERP\",\n        //         \"side\": \"LONG\",\n        //         \"position\": \"0.0001\",\n        //         \"referenceCost\": \"-3.12277254\",\n        //         \"unrealizedPnl\": \"-0.001700233\",\n        //         \"realizedPnl\": \"0\",\n        //         \"avgOpenPrice\": \"31209\",\n        //         \"marginType\": \"isolated\",\n        //         \"isolatedMargin\": \"1.654972977\",\n        //         \"leverage\": \"2\",\n        //         \"takeProfitPrice\": \"0\",\n        //         \"takeProfitTrigger\": \"market\",\n        //         \"stopLossPrice\": \"0\",\n        //         \"stopLossTrigger\": \"market\",\n        //         \"buyOpenOrderNotional\": \"0\",\n        //         \"sellOpenOrderNotional\": \"0\",\n        //         \"markPrice\": \"31210.723063672\",\n        //         \"indexPrice\": \"31223.148857925\"\n        //     },\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        let notional = this.safeString (position, 'buyOpenOrderNotional');\n        if (Precise.stringEq (notional, '0')) {\n            notional = this.safeString (position, 'sellOpenOrderNotional');\n        }\n        const marginType = this.safeString (position, 'marginType');\n        const marginMode = (marginType === 'crossed') ? 'cross' : 'isolated';\n        let collateral = undefined;\n        if (marginMode === 'isolated') {\n            collateral = this.safeString (position, 'isolatedMargin');\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': market['symbol'],\n            'notional': this.parseNumber (notional),\n            'marginMode': marginMode,\n            'liquidationPrice': undefined,\n            'entryPrice': this.safeNumber (position, 'avgOpenPrice'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPnl'),\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'position'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'lastPrice': undefined,\n            'side': this.safeStringLower (position, 'side'),\n            'hedged': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': collateral,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeInteger (position, 'leverage'),\n            'marginRatio': undefined,\n            'stopLossPrice': this.safeNumber (position, 'stopLossPrice'),\n            'takeProfitPrice': this.safeNumber (position, 'takeProfitPrice'),\n        });\n    }"
      },
      {
        "name": "parseSwapBalance",
        "signature": "parseSwapBalance (response)",
        "line_start": 967,
        "line_end": 983,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSwapBalance (response) {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const data = this.safeDict (response, 'data', {});\n        const collaterals = this.safeList (data, 'collaterals', []);\n        for (let i = 0; i < collaterals.length; i++) {\n            const balance = collaterals[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1128,
        "line_end": 1173,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (bid, 0)",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (bid, 1)",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ask, 0)",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ask, 1)",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"QTUM/BTC\",\n         \"open\":\"0.00016537\",\n         \"close\":\"0.00019077\",\n         \"high\":\"0.000192\",\n         \"low\":\"0.00016537\",\n         \"volume\":\"846.6\",\n         \"ask\":[\"0.00018698\",\"26.2\"],\n         \"bid\":[\"0.00018408\",\"503.7\"],\n         \"type\":\"spot\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"symbol\":\"QTUM/BTC\",\n        //         \"open\":\"0.00016537\",\n        //         \"close\":\"0.00019077\",\n        //         \"high\":\"0.000192\",\n        //         \"low\":\"0.00016537\",\n        //         \"volume\":\"846.6\",\n        //         \"ask\":[\"0.00018698\",\"26.2\"],\n        //         \"bid\":[\"0.00018408\",\"503.7\"],\n        //         \"type\":\"spot\"\n        //     }\n        //\n        const timestamp = undefined;\n        const marketId = this.safeString (ticker, 'symbol');\n        const type = this.safeString (ticker, 'type');\n        const delimiter = (type === 'spot') ? '/' : undefined;\n        const symbol = this.safeSymbol (marketId, market, delimiter);\n        const close = this.safeString (ticker, 'close');\n        const bid = this.safeList (ticker, 'bid', []);\n        const ask = this.safeList (ticker, 'ask', []);\n        const open = this.safeString (ticker, 'open');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': undefined,\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (bid, 0),\n            'bidVolume': this.safeString (bid, 1),\n            'ask': this.safeString (ask, 0),\n            'askVolume': this.safeString (ask, 1),\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': close,\n            'previousClose': undefined, // previous day close\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1363,
        "line_end": 1396,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"p\":\"9128.5\", // price\n         \"q\":\"0.0030\", // quantity\n         \"ts\":1590229002385, // timestamp\n         \"bm\":false, // if true, the buyer is the market maker, we only use this field to \"define the side\" of a public trade\n         \"seqnum\":180143985289898554\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"p\":\"9128.5\", // price\n        //         \"q\":\"0.0030\", // quantity\n        //         \"ts\":1590229002385, // timestamp\n        //         \"bm\":false, // if true, the buyer is the market maker, we only use this field to \"define the side\" of a public trade\n        //         \"seqnum\":180143985289898554\n        //     }\n        //\n        const timestamp = this.safeInteger (trade, 'ts');\n        const priceString = this.safeString2 (trade, 'price', 'p');\n        const amountString = this.safeString (trade, 'q');\n        const buyerIsMaker = this.safeBool (trade, 'bm', false);\n        const side = buyerIsMaker ? 'sell' : 'buy';\n        market = this.safeMarket (undefined, market);\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': undefined,\n            'order': undefined,\n            'type': undefined,\n            'takerOrMaker': undefined,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2772,
        "line_end": 2826,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'requestId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'networkTransactionId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (transaction, 'transactionType')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostString)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"requestId\": \"wuzd1Ojsqtz4bCA3UXwtUnnJDmU8PiyB\",\n         \"time\": 1591606166000,\n         \"asset\": \"USDT\",\n         \"transactionType\": \"deposit\",\n         \"amount\": \"25\",\n         \"commission\": \"0\",\n         \"networkTransactionId\": \"0xbc4eabdce92f14dbcc01d799a5f8ca1f02f4a3a804b6350ea202be4d3c738fce\",\n         \"status\": \"pending\",\n         \"numConfirmed\": 8,\n         \"numConfirmations\": 20,\n         \"destAddress\": {\n             \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n             \"destTag\": \"...\" // for currencies that have it\n         }\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"requestId\": \"wuzd1Ojsqtz4bCA3UXwtUnnJDmU8PiyB\",\n        //         \"time\": 1591606166000,\n        //         \"asset\": \"USDT\",\n        //         \"transactionType\": \"deposit\",\n        //         \"amount\": \"25\",\n        //         \"commission\": \"0\",\n        //         \"networkTransactionId\": \"0xbc4eabdce92f14dbcc01d799a5f8ca1f02f4a3a804b6350ea202be4d3c738fce\",\n        //         \"status\": \"pending\",\n        //         \"numConfirmed\": 8,\n        //         \"numConfirmations\": 20,\n        //         \"destAddress\": {\n        //             \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n        //             \"destTag\": \"...\" // for currencies that have it\n        //         }\n        //     }\n        //\n        const destAddress = this.safeDict (transaction, 'destAddress', {});\n        const address = this.safeString (destAddress, 'address');\n        const tag = this.safeString (destAddress, 'destTag');\n        const timestamp = this.safeInteger (transaction, 'time');\n        const currencyId = this.safeString (transaction, 'asset');\n        let amountString = this.safeString (transaction, 'amount');\n        const feeCostString = this.safeString (transaction, 'commission');\n        amountString = Precise.stringSub (amountString, feeCostString);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'requestId'),\n            'txid': this.safeString (transaction, 'networkTransactionId'),\n            'type': this.safeString (transaction, 'transactionType'),\n            'currency': code,\n            'network': undefined,\n            'amount': this.parseNumber (amountString),\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tag,\n            'updated': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n                'rate': undefined,\n            },\n            'internal': false,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2762,
        "line_end": 2770,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'reviewing': 'pending',\n            'pending': 'pending',\n            'confirmed': 'ok',\n            'rejected': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 3395,
        "line_end": 3412,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    { \"code\": \"0\" }\n        //\n        const status = this.safeString (transfer, 'code');\n        const currencyCode = this.safeCurrencyCode (undefined, currency);\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': currencyCode,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 3414,
        "line_end": 3419,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        if (status === '0') {\n            return 'ok';\n        }\n        return 'failed';\n    }"
      }
    ],
    "aster": [
      {
        "name": "parseAccountPosition",
        "signature": "parseAccountPosition (position, market: Market = undefined)",
        "line_start": 3278,
        "line_end": 3439,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "initialMargin",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccountPosition (position, market: Market = undefined) {\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const leverageString = this.safeString (position, 'leverage');\n        const leverage = (leverageString !== undefined) ? parseInt (leverageString) : undefined;\n        const initialMarginString = this.safeString (position, 'initialMargin');\n        const initialMargin = this.parseNumber (initialMarginString);\n        let initialMarginPercentageString = undefined;\n        if (leverageString !== undefined) {\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            const rational = this.isRoundNumber (1000 % leverage);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringDiv (Precise.stringAdd (initialMarginPercentageString, '1e-8'), '1', 8);\n            }\n        }\n        // as oppose to notionalValue\n        const usdm = ('notional' in position);\n        const maintenanceMarginString = this.safeString (position, 'maintMargin');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        let entryPrice = this.parseNumber (entryPriceString);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        const notional = this.parseNumber (notionalStringAbs);\n        let contractsString = this.safeString (position, 'positionAmt');\n        let contractsStringAbs = Precise.stringAbs (contractsString);\n        if (contractsString === undefined) {\n            const entryNotional = Precise.stringMul (Precise.stringMul (leverageString, initialMarginString), entryPriceString);\n            const contractSizeNew = this.safeString (market, 'contractSize');\n            contractsString = Precise.stringDiv (entryNotional, contractSizeNew);\n            contractsStringAbs = Precise.stringDiv (Precise.stringAdd (contractsString, '0.5'), '1', 0);\n        }\n        const contracts = this.parseNumber (contractsStringAbs);\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        const unrealizedPnlString = this.safeString (position, 'unrealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        let isolated = this.safeBool (position, 'isolated');\n        if (isolated === undefined) {\n            const isolatedMarginRaw = this.safeString (position, 'isolatedMargin');\n            isolated = !Precise.stringEq (isolatedMarginRaw, '0');\n        }\n        let marginMode = undefined;\n        let collateralString = undefined;\n        let walletBalance = undefined;\n        if (isolated) {\n            marginMode = 'isolated';\n            walletBalance = this.safeString (position, 'isolatedWallet');\n            collateralString = Precise.stringAdd (walletBalance, unrealizedPnlString);\n        } else {\n            marginMode = 'cross';\n            walletBalance = this.safeString (position, 'crossWalletBalance');\n            collateralString = this.safeString (position, 'crossMargin');\n        }\n        const collateral = this.parseNumber (collateralString);\n        let marginRatio = undefined;\n        let side = undefined;\n        let percentage = undefined;\n        let liquidationPriceStringRaw = undefined;\n        let liquidationPrice = undefined;\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        if (Precise.stringEquals (notionalString, '0')) {\n            entryPrice = undefined;\n        } else {\n            side = Precise.stringLt (notionalString, '0') ? 'short' : 'long';\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n            if (usdm) {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (walletBalance / (contracts * (±1 + mmp))) + (±entryPrice / (±1 + mmp))\n                //\n                // mmp = maintenanceMarginPercentage\n                // where ± is negative for long and positive for short\n                // TODO: calculate liquidation price for coinm contracts\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const leftSide = Precise.stringDiv (walletBalance, Precise.stringMul (contractsStringAbs, onePlusMaintenanceMarginPercentageString));\n                const rightSide = Precise.stringDiv (entryPriceSignString, onePlusMaintenanceMarginPercentageString);\n                liquidationPriceStringRaw = Precise.stringAdd (leftSide, rightSide);\n            } else {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (contracts * contractSize(±1 - mmp)) / (±1/entryPrice * contracts * contractSize - walletBalance)\n                //\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const size = Precise.stringMul (contractsStringAbs, contractSizeString);\n                const leftSide = Precise.stringMul (size, onePlusMaintenanceMarginPercentageString);\n                const rightSide = Precise.stringSub (Precise.stringMul (Precise.stringDiv ('1', entryPriceSignString), size), walletBalance);\n                liquidationPriceStringRaw = Precise.stringDiv (leftSide, rightSide);\n            }\n            const pricePrecision = this.precisionFromString (this.safeString (market['precision'], 'price'));\n            const pricePrecisionPlusOne = pricePrecision + 1;\n            const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString ();\n            // round half up\n            const rounder = new Precise ('5e-' + pricePrecisionPlusOneString);\n            const rounderString = rounder.toString ();\n            const liquidationPriceRoundedString = Precise.stringAdd (rounderString, liquidationPriceStringRaw);\n            let truncatedLiquidationPrice = Precise.stringDiv (liquidationPriceRoundedString, '1', pricePrecision);\n            if (truncatedLiquidationPrice[0] === '-') {\n                // user cannot be liquidated\n                // since he has more collateral than the size of the position\n                truncatedLiquidationPrice = undefined;\n            }\n            liquidationPrice = this.parseNumber (truncatedLiquidationPrice);\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return {\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'initialMargin': initialMargin,\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'entryPrice': entryPrice,\n            'notional': notional,\n            'leverage': this.parseNumber (leverageString),\n            'unrealizedPnl': unrealizedPnl,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'marginRatio': marginRatio,\n            'liquidationPrice': liquidationPrice,\n            'markPrice': undefined,\n            'collateral': collateral,\n            'marginMode': marginMode,\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n        };\n    }"
      },
      {
        "name": "parseAccountPositions",
        "signature": "parseAccountPositions (account, filterClosed = false)",
        "line_start": 3240,
        "line_end": 3276,
        "comment": null,
        "mappings": [
          {
            "key": "crossMargin",
            "value": "balances[code]['crossMargin']",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "balances[code]['crossWalletBalance']",
            "comment": null
          },
          {
            "key": "crossMargin",
            "value": "Precise.stringAdd (crossWalletBalance, crossUnPnl)",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "crossWalletBalance",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccountPositions (account, filterClosed = false) {\n        const positions = this.safeList (account, 'positions');\n        const assets = this.safeList (account, 'assets', []);\n        const balances: Dict = {};\n        for (let i = 0; i < assets.length; i++) {\n            const entry = assets[i];\n            const currencyId = this.safeString (entry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const crossWalletBalance = this.safeString (entry, 'crossWalletBalance');\n            const crossUnPnl = this.safeString (entry, 'crossUnPnl');\n            balances[code] = {\n                'crossMargin': Precise.stringAdd (crossWalletBalance, crossUnPnl),\n                'crossWalletBalance': crossWalletBalance,\n            };\n        }\n        const result = [];\n        for (let i = 0; i < positions.length; i++) {\n            const position = positions[i];\n            const marketId = this.safeString (position, 'symbol');\n            const market = this.safeMarket (marketId, undefined, undefined, 'contract');\n            const code = market['linear'] ? market['quote'] : market['base'];\n            const maintenanceMargin = this.safeString (position, 'maintMargin');\n            // check for maintenance margin so empty positions are not returned\n            const isPositionOpen = (maintenanceMargin !== '0') && (maintenanceMargin !== '0.00000000');\n            if (!filterClosed || isPositionOpen) {\n                // sometimes not all the codes are correctly returned...\n                if (code in balances) {\n                    const parsed = this.parseAccountPosition (this.extend (position, {\n                        'crossMargin': balances[code]['crossMargin'],\n                        'crossWalletBalance': balances[code]['crossWalletBalance'],\n                    }), market);\n                    result.push (parsed);\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1626,
        "line_end": 1639,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString2 (balance, 'free', 'maxWithdrawAmount');\n            account['used'] = this.safeString (balance, 'locked');\n            account['total'] = this.safeString (balance, 'walletBalance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1481,
        "line_end": 1530,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'indexPrice')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (contract, 'interestRate')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "this.safeNumber (contract, 'estimatedSettlePrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'lastFundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"106729.84047826\",\n         \"indexPrice\": \"106775.72673913\",\n         \"estimatedSettlePrice\": \"106708.84997006\",\n         \"lastFundingRate\": \"0.00010000\",\n         \"interestRate\": \"0.00010000\",\n         \"nextFundingTime\": 1750147200000,\n         \"time\": 1750146970000\n     }",
          "{\n         \"symbol\": \"INJUSDT\",\n         \"interestRate\": \"0.00010000\",\n         \"time\": 1756197479000,\n         \"fundingIntervalHours\": 8,\n         \"fundingFeeCap\": 0.03,\n         \"fundingFeeFloor\": -0.03\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"106729.84047826\",\n        //         \"indexPrice\": \"106775.72673913\",\n        //         \"estimatedSettlePrice\": \"106708.84997006\",\n        //         \"lastFundingRate\": \"0.00010000\",\n        //         \"interestRate\": \"0.00010000\",\n        //         \"nextFundingTime\": 1750147200000,\n        //         \"time\": 1750146970000\n        //     }\n        //     {\n        //         \"symbol\": \"INJUSDT\",\n        //         \"interestRate\": \"0.00010000\",\n        //         \"time\": 1756197479000,\n        //         \"fundingIntervalHours\": 8,\n        //         \"fundingFeeCap\": 0.03,\n        //         \"fundingFeeFloor\": -0.03\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const nextFundingTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        const timestamp = this.safeInteger (contract, 'time');\n        const interval = this.safeString (contract, 'fundingIntervalHours');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'markPrice': this.safeNumber (contract, 'markPrice'),\n            'indexPrice': this.safeNumber (contract, 'indexPrice'),\n            'interestRate': this.safeNumber (contract, 'interestRate'),\n            'estimatedSettlePrice': this.safeNumber (contract, 'estimatedSettlePrice'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 'lastFundingRate'),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 2822,
        "line_end": 2847,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'tranId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'income')",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"ETHUSDT\",\n       \"incomeType\": \"FUNDING_FEE\",\n       \"income\": \"0.00134317\",\n       \"asset\": \"USDT\",\n       \"time\": \"1621584000000\",\n       \"info\": \"FUNDING_FEE\",\n       \"tranId\": \"4480321991774044580\",\n       \"tradeId\": \"\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"symbol\": \"ETHUSDT\",\n        //       \"incomeType\": \"FUNDING_FEE\",\n        //       \"income\": \"0.00134317\",\n        //       \"asset\": \"USDT\",\n        //       \"time\": \"1621584000000\",\n        //       \"info\": \"FUNDING_FEE\",\n        //       \"tranId\": \"4480321991774044580\",\n        //       \"tradeId\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const currencyId = this.safeString (income, 'asset');\n        const timestamp = this.safeInteger (income, 'time');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'tranId'),\n            'amount': this.safeNumber (income, 'income'),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2884,
        "line_end": 2927,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'tranId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tradeId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"\",\n         \"incomeType\": \"TRANSFER\",\n         \"income\": \"10.00000000\",\n         \"asset\": \"USDT\",\n         \"time\": 1677645250000,\n         \"info\": \"TRANSFER\",\n         \"tranId\": 131001573082,\n         \"tradeId\": \"\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"symbol\": \"\",\n        //         \"incomeType\": \"TRANSFER\",\n        //         \"income\": \"10.00000000\",\n        //         \"asset\": \"USDT\",\n        //         \"time\": 1677645250000,\n        //         \"info\": \"TRANSFER\",\n        //         \"tranId\": 131001573082,\n        //         \"tradeId\": \"\"\n        //     }\n        //\n        let amount = this.safeString (item, 'income');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'time');\n        const type = this.safeString (item, 'incomeType');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'tranId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tradeId'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2929,
        "line_end": 2940,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'TRANSFER': 'transfer',\n            'WELCOME_BONUS': 'cashback',\n            'REALIZED_PNL': 'trade',\n            'FUNDING_FEE': 'fee',\n            'COMMISSION': 'commission',\n            'INSURANCE_CLEAR': 'settlement',\n            'MARKET_MERCHANT_RETURN_REWARD': 'cashback',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2568,
        "line_end": 2609,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"INJUSDT\",\n         \"positionAmt\": \"0.0\",\n         \"entryPrice\": \"0.0\",\n         \"markPrice\": \"0.00000000\",\n         \"unRealizedProfit\": \"0.00000000\",\n         \"liquidationPrice\": \"0\",\n         \"leverage\": \"20\",\n         \"maxNotionalValue\": \"25000\",\n         \"marginType\": \"cross\",\n         \"isolatedMargin\": \"0.00000000\",\n         \"isAutoAddMargin\": \"false\",\n         \"positionSide\": \"BOTH\",\n         \"notional\": \"0\",\n         \"isolatedWallet\": \"0\",\n         \"updateTime\": 0\n     }"
        ],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        //\n        //     {\n        //         \"symbol\": \"INJUSDT\",\n        //         \"positionAmt\": \"0.0\",\n        //         \"entryPrice\": \"0.0\",\n        //         \"markPrice\": \"0.00000000\",\n        //         \"unRealizedProfit\": \"0.00000000\",\n        //         \"liquidationPrice\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"maxNotionalValue\": \"25000\",\n        //         \"marginType\": \"cross\",\n        //         \"isolatedMargin\": \"0.00000000\",\n        //         \"isAutoAddMargin\": \"false\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"notional\": \"0\",\n        //         \"isolatedWallet\": \"0\",\n        //         \"updateTime\": 0\n        //     }\n        //\n        const marketId = this.safeString (leverage, 'symbol');\n        const marginMode = this.safeStringLower (leverage, 'marginType');\n        const side = this.safeStringLower (leverage, 'positionSide');\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        if ((side === undefined) || (side === 'both')) {\n            longLeverage = leverageValue;\n            shortLeverage = leverageValue;\n        } else if (side === 'long') {\n            longLeverage = leverageValue;\n        } else if (side === 'short') {\n            shortLeverage = leverageValue;\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 2649,
        "line_end": 2676,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (marginMode, 'marginType')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"INJUSDT\",\n         \"positionAmt\": \"0.0\",\n         \"entryPrice\": \"0.0\",\n         \"markPrice\": \"0.00000000\",\n         \"unRealizedProfit\": \"0.00000000\",\n         \"liquidationPrice\": \"0\",\n         \"leverage\": \"20\",\n         \"maxNotionalValue\": \"25000\",\n         \"marginType\": \"cross\",\n         \"isolatedMargin\": \"0.00000000\",\n         \"isAutoAddMargin\": \"false\",\n         \"positionSide\": \"BOTH\",\n         \"notional\": \"0\",\n         \"isolatedWallet\": \"0\",\n         \"updateTime\": 0\n     }"
        ],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        //\n        //     {\n        //         \"symbol\": \"INJUSDT\",\n        //         \"positionAmt\": \"0.0\",\n        //         \"entryPrice\": \"0.0\",\n        //         \"markPrice\": \"0.00000000\",\n        //         \"unRealizedProfit\": \"0.00000000\",\n        //         \"liquidationPrice\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"maxNotionalValue\": \"25000\",\n        //         \"marginType\": \"cross\",\n        //         \"isolatedMargin\": \"0.00000000\",\n        //         \"isAutoAddMargin\": \"false\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"notional\": \"0\",\n        //         \"isolatedWallet\": \"0\",\n        //         \"updateTime\": 0\n        //     }\n        //\n        const marketId = this.safeString (marginMode, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': this.safeStringLower (marginMode, 'marginType'),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 2731,
        "line_end": 2768,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "(rawType === 1) ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (data, 'asset')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "(success || noErrorCode) ? 'ok' : 'failed'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": \"100\",\n         \"asset\": \"USDT\",\n         \"symbol\": \"BTCUSDT\",\n         \"time\": 1578047900425,\n         \"type\": 1,\n         \"positionSide\": \"LONG\"\n     }",
          "{\n         \"amount\": 100.0,\n         \"code\": 200,\n         \"msg\": \"Successfully modify position margin.\",\n         \"type\": 1\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //     {\n        //         \"amount\": \"100\",\n        //         \"asset\": \"USDT\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"time\": 1578047900425,\n        //         \"type\": 1,\n        //         \"positionSide\": \"LONG\"\n        //     }\n        //\n        //     {\n        //         \"amount\": 100.0,\n        //         \"code\": 200,\n        //         \"msg\": \"Successfully modify position margin.\",\n        //         \"type\": 1\n        //     }\n        //\n        const rawType = this.safeInteger (data, 'type');\n        const errorCode = this.safeString (data, 'code');\n        const marketId = this.safeString (data, 'symbol');\n        const timestamp = this.safeInteger (data, 'time');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const noErrorCode = errorCode === undefined;\n        const success = errorCode === '200';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': (rawType === 1) ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'code': this.safeString (data, 'asset'),\n            'total': undefined,\n            'status': (success || noErrorCode) ? 'ok' : 'failed',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 856,
        "line_end": 881,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1631158560000,\n         \"208.1850\",\n         \"208.1850\",\n         \"208.1850\",\n         \"208.1850\",\n         \"11.84\",\n         1631158619999,\n         \"2464.910400\",\n         1,\n         \"11.84\",\n         \"2464.910400\",\n         \"0\"\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1631158560000,\n        //         \"208.1850\",\n        //         \"208.1850\",\n        //         \"208.1850\",\n        //         \"208.1850\",\n        //         \"11.84\",\n        //         1631158619999,\n        //         \"2464.910400\",\n        //         1,\n        //         \"11.84\",\n        //         \"2464.910400\",\n        //         \"0\"\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1856,
        "line_end": 1939,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'updateTime')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (rawType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'avgPrice')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'cumQuote')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'origQty')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'executedQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (statusId)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool2 (order, 'reduceOnly', 'ro')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"avgPrice\": \"0.00000\",\n         \"clientOrderId\": \"abc\",\n         \"cumQuote\": \"0\",\n         \"executedQty\": \"0\",\n         \"orderId\": 1917641,\n         \"origQty\": \"0.40\",\n         \"origType\": \"TRAILING_STOP_MARKET\",\n         \"price\": \"0\",\n         \"reduceOnly\": false,\n         \"side\": \"BUY\",\n         \"positionSide\": \"SHORT\",\n         \"status\": \"NEW\",\n         \"stopPrice\": \"9300\",\n         \"closePosition\": false,\n         \"symbol\": \"BTCUSDT\",\n         \"time\": 1579276756075,\n         \"timeInForce\": \"GTC\",\n         \"type\": \"TRAILING_STOP_MARKET\",\n         \"activatePrice\": \"9020\",\n         \"priceRate\": \"0.3\",\n         \"updateTime\": 1579276756075,\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false\n     }",
          "{\n         \"orderId\": 38,\n         \"symbol\": \"ADA25SLP25\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"afMd4GBQyHkHpGWdiy34Li\",\n         \"price\": \"20\",\n         \"avgPrice\": \"12.0000000000000000\",\n         \"origQty\": \"10\",\n         \"executedQty\": \"10\",\n         \"cumQuote\": \"120\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0\",\n         \"origType\": \"LIMIT\",\n         \"time\": 1649913186270,\n         \"updateTime\": 1649913186297\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // swap\n        //     {\n        //         \"avgPrice\": \"0.00000\",\n        //         \"clientOrderId\": \"abc\",\n        //         \"cumQuote\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"orderId\": 1917641,\n        //         \"origQty\": \"0.40\",\n        //         \"origType\": \"TRAILING_STOP_MARKET\",\n        //         \"price\": \"0\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"status\": \"NEW\",\n        //         \"stopPrice\": \"9300\",\n        //         \"closePosition\": false,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"time\": 1579276756075,\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"TRAILING_STOP_MARKET\",\n        //         \"activatePrice\": \"9020\",\n        //         \"priceRate\": \"0.3\",\n        //         \"updateTime\": 1579276756075,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        // spot\n        //     {\n        //         \"orderId\": 38,\n        //         \"symbol\": \"ADA25SLP25\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"afMd4GBQyHkHpGWdiy34Li\",\n        //         \"price\": \"20\",\n        //         \"avgPrice\": \"12.0000000000000000\",\n        //         \"origQty\": \"10\",\n        //         \"executedQty\": \"10\",\n        //         \"cumQuote\": \"120\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1649913186270,\n        //         \"updateTime\": 1649913186297\n        //     }\n        //\n        const info = order;\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const side = this.safeStringLower (order, 'side');\n        const timestamp = this.safeInteger (order, 'time');\n        const lastTradeTimestamp = this.safeInteger (order, 'updateTime');\n        const statusId = this.safeStringUpper (order, 'status');\n        const rawType = this.safeStringUpper (order, 'type');\n        const stopPriceString = this.safeString (order, 'stopPrice');\n        const triggerPrice = this.parseNumber (this.omitZero (stopPriceString));\n        return this.safeOrder ({\n            'info': info,\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'symbol': this.safeSymbol (marketId, market),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': this.safeInteger (order, 'updateTime'),\n            'type': this.parseOrderType (rawType),\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': undefined,\n            'side': side,\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': triggerPrice,\n            'average': this.safeString (order, 'avgPrice'),\n            'cost': this.safeString (order, 'cumQuote'),\n            'amount': this.safeString (order, 'origQty'),\n            'filled': this.safeString (order, 'executedQty'),\n            'remaining': undefined,\n            'status': this.parseOrderStatus (statusId),\n            'fee': undefined,\n            'trades': undefined,\n            'reduceOnly': this.safeBool2 (order, 'reduceOnly', 'ro'),\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1831,
        "line_end": 1841,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'REJECTED': 'canceled',\n            'EXPIRED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1843,
        "line_end": 1854,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n            'STOP': 'limit',\n            'STOP_MARKET': 'market',\n            'TAKE_PROFIT': 'limit',\n            'TAKE_PROFIT_MARKET': 'market',\n            'TRAILING_STOP_MARKET': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePositionRisk",
        "signature": "parsePositionRisk (position, market: Market = undefined)",
        "line_start": 2990,
        "line_end": 3158,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"entryPrice\": \"6563.66500\",\n         \"marginType\": \"isolated\",\n         \"isAutoAddMargin\": \"false\",\n         \"isolatedMargin\": \"15517.54150468\",\n         \"leverage\": \"10\",\n         \"liquidationPrice\": \"5930.78\",\n         \"markPrice\": \"6679.50671178\",\n         \"maxNotionalValue\": \"20000000\",\n         \"positionSide\": \"LONG\",\n         \"positionAmt\": \"20.000\",\n         \"symbol\": \"BTCUSDT\",\n         \"unRealizedProfit\": \"2316.83423560\",\n         \"updateTime\": 1625474304765\n     }"
        ],
        "source": "parsePositionRisk (position, market: Market = undefined) {\n        //\n        //     {\n        //         \"entryPrice\": \"6563.66500\",\n        //         \"marginType\": \"isolated\",\n        //         \"isAutoAddMargin\": \"false\",\n        //         \"isolatedMargin\": \"15517.54150468\",\n        //         \"leverage\": \"10\",\n        //         \"liquidationPrice\": \"5930.78\",\n        //         \"markPrice\": \"6679.50671178\",\n        //         \"maxNotionalValue\": \"20000000\",\n        //         \"positionSide\": \"LONG\",\n        //         \"positionAmt\": \"20.000\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"unRealizedProfit\": \"2316.83423560\",\n        //         \"updateTime\": 1625474304765\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const isolatedMarginString = this.safeString (position, 'isolatedMargin');\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const notional = this.parseNumber (notionalStringAbs);\n        const contractsAbs = Precise.stringAbs (this.safeString (position, 'positionAmt'));\n        const contracts = this.parseNumber (contractsAbs);\n        const unrealizedPnlString = this.safeString (position, 'unRealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        const liquidationPriceString = this.omitZero (this.safeString (position, 'liquidationPrice'));\n        const liquidationPrice = this.parseNumber (liquidationPriceString);\n        let collateralString = undefined;\n        let marginMode = this.safeString (position, 'marginType');\n        if (marginMode === undefined && isolatedMarginString !== undefined) {\n            marginMode = Precise.stringEq (isolatedMarginString, '0') ? 'cross' : 'isolated';\n        }\n        let side = undefined;\n        if (Precise.stringGt (notionalString, '0')) {\n            side = 'long';\n        } else if (Precise.stringLt (notionalString, '0')) {\n            side = 'short';\n        }\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        const entryPrice = this.parseNumber (entryPriceString);\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        // as oppose to notionalValue\n        const linear = ('notional' in position);\n        if (marginMode === 'cross') {\n            // calculate collateral\n            const precision = this.safeDict (market, 'precision', {});\n            const basePrecisionValue = this.safeString (precision, 'base');\n            const quotePrecisionValue = this.safeString2 (precision, 'quote', 'price');\n            const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);\n            if (!precisionIsUndefined) {\n                if (linear) {\n                    // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    }\n                    const inner = Precise.stringMul (liquidationPriceString, onePlusMaintenanceMarginPercentageString);\n                    const leftSide = Precise.stringAdd (inner, entryPriceSignString);\n                    const quotePrecision = this.precisionFromString (this.safeString2 (precision, 'quote', 'price'));\n                    if (quotePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, contractsAbs), '1', quotePrecision);\n                    }\n                } else {\n                    // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    }\n                    const leftSide = Precise.stringMul (contractsAbs, contractSizeString);\n                    const rightSide = Precise.stringSub (Precise.stringDiv ('1', entryPriceSignString), Precise.stringDiv (onePlusMaintenanceMarginPercentageString, liquidationPriceString));\n                    const basePrecision = this.precisionFromString (this.safeString (precision, 'base'));\n                    if (basePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, rightSide), '1', basePrecision);\n                    }\n                }\n            }\n        } else {\n            collateralString = this.safeString (position, 'isolatedMargin');\n        }\n        collateralString = (collateralString === undefined) ? '0' : collateralString;\n        const collateral = this.parseNumber (collateralString);\n        const markPrice = this.parseNumber (this.omitZero (this.safeString (position, 'markPrice')));\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        let maintenanceMarginString = Precise.stringMul (maintenanceMarginPercentageString, notionalStringAbs);\n        if (maintenanceMarginString === undefined) {\n            // for a while, this new value was a backup to the existing calculations, but in future we might prioritize this\n            maintenanceMarginString = this.safeString (position, 'maintMargin');\n        }\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        let initialMarginString = undefined;\n        let initialMarginPercentageString = undefined;\n        const leverageString = this.safeString (position, 'leverage');\n        if (leverageString !== undefined) {\n            const leverage = parseInt (leverageString);\n            const rational = this.isRoundNumber (1000 % leverage);\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringAdd (initialMarginPercentageString, '1e-8');\n            }\n            const unrounded = Precise.stringMul (notionalStringAbs, initialMarginPercentageString);\n            initialMarginString = Precise.stringDiv (unrounded, '1', 8);\n        } else {\n            initialMarginString = this.safeString (position, 'initialMargin');\n            const unrounded = Precise.stringMul (initialMarginString, '1');\n            initialMarginPercentageString = Precise.stringDiv (unrounded, notionalStringAbs, 8);\n        }\n        let marginRatio = undefined;\n        let percentage = undefined;\n        if (!Precise.stringEquals (collateralString, '0')) {\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'unrealizedPnl': unrealizedPnl,\n            'leverage': this.parseNumber (leverageString),\n            'liquidationPrice': liquidationPrice,\n            'collateral': collateral,\n            'notional': notional,\n            'markPrice': markPrice,\n            'entryPrice': entryPrice,\n            'timestamp': timestamp,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'marginRatio': marginRatio,\n            'datetime': this.iso8601 (timestamp),\n            'marginMode': marginMode,\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1265,
        "line_end": 1354,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"priceChange\": \"-2274.38\",\n         \"priceChangePercent\": \"-2.049\",\n         \"weightedAvgPrice\": \"109524.37084136\",\n         \"lastPrice\": \"108738.78\",\n         \"lastQty\": \"0.00034\",\n         \"openPrice\": \"111013.16\",\n         \"highPrice\": \"111975.81\",\n         \"lowPrice\": \"107459.25\",\n         \"volume\": \"28.67876\",\n         \"quoteVolume\": \"3141023.14551030\",\n         \"openTime\": \"1760578800000\",\n         \"closeTime\": \"1760665024749\",\n         \"firstId\": \"37447\",\n         \"lastId\": \"39698\",\n         \"count\": \"2252\",\n         \"baseAsset\": \"BTC\",\n         \"quoteAsset\": \"USDT\",\n         \"bidPrice\": \"108705.11\",\n         \"bidQty\": \"0.03351\",\n         \"askPrice\": \"108725.99\",\n         \"askQty\": \"0.08724\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"priceChange\": \"1845.7\",\n         \"priceChangePercent\": \"1.755\",\n         \"weightedAvgPrice\": \"105515.5\",\n         \"lastPrice\": \"107037.7\",\n         \"lastQty\": \"0.004\",\n         \"openPrice\": \"105192.0\",\n         \"highPrice\": \"107223.5\",\n         \"lowPrice\": \"104431.6\",\n         \"volume\": \"8753.286\",\n         \"quoteVolume\": \"923607368.61\",\n         \"openTime\": 1749976620000,\n         \"closeTime\": 1750063053754,\n         \"firstId\": 24195078,\n         \"lastId\": 24375783,\n         \"count\": 180706\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"priceChange\": \"-2274.38\",\n        //         \"priceChangePercent\": \"-2.049\",\n        //         \"weightedAvgPrice\": \"109524.37084136\",\n        //         \"lastPrice\": \"108738.78\",\n        //         \"lastQty\": \"0.00034\",\n        //         \"openPrice\": \"111013.16\",\n        //         \"highPrice\": \"111975.81\",\n        //         \"lowPrice\": \"107459.25\",\n        //         \"volume\": \"28.67876\",\n        //         \"quoteVolume\": \"3141023.14551030\",\n        //         \"openTime\": \"1760578800000\",\n        //         \"closeTime\": \"1760665024749\",\n        //         \"firstId\": \"37447\",\n        //         \"lastId\": \"39698\",\n        //         \"count\": \"2252\",\n        //         \"baseAsset\": \"BTC\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"bidPrice\": \"108705.11\",\n        //         \"bidQty\": \"0.03351\",\n        //         \"askPrice\": \"108725.99\",\n        //         \"askQty\": \"0.08724\"\n        //     }\n        // swap\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"priceChange\": \"1845.7\",\n        //         \"priceChangePercent\": \"1.755\",\n        //         \"weightedAvgPrice\": \"105515.5\",\n        //         \"lastPrice\": \"107037.7\",\n        //         \"lastQty\": \"0.004\",\n        //         \"openPrice\": \"105192.0\",\n        //         \"highPrice\": \"107223.5\",\n        //         \"lowPrice\": \"104431.6\",\n        //         \"volume\": \"8753.286\",\n        //         \"quoteVolume\": \"923607368.61\",\n        //         \"openTime\": 1749976620000,\n        //         \"closeTime\": 1750063053754,\n        //         \"firstId\": 24195078,\n        //         \"lastId\": 24375783,\n        //         \"count\": 180706\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'closeTime');\n        let marketType = undefined;\n        if ('bidQty' in ticker) {\n            marketType = 'spot';\n        } else {\n            marketType = 'contract';\n        }\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'lastPrice');\n        const open = this.safeString (ticker, 'openPrice');\n        let percentage = this.safeString (ticker, 'priceChangePercent');\n        percentage = Precise.stringMul (percentage, '100');\n        const quoteVolume = this.safeString (ticker, 'quoteVolume');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const high = this.safeString (ticker, 'highPrice');\n        const low = this.safeString (ticker, 'lowPrice');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 956,
        "line_end": 1033,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.parseNumber (Precise.stringAbs (this.safeString (trade, 'commission'))),\n                'currency': currencyCode,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (Precise.stringAbs (this.safeString (trade, 'commission')))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 3913206,\n         \"price\": \"644.100\",\n         \"qty\": \"0.08\",\n         \"quoteQty\": \"51.528\",\n         \"time\": 1749784506633,\n         \"isBuyerMaker\": true\n     }",
          "{\n         \"id\": 657,\n         \"price\": \"1.01000000\",\n         \"qty\": \"5.00000000\",\n         \"baseQty\": \"4.95049505\",\n         \"time\": 1755156533943,\n         \"isBuyerMaker\": false\n     }",
          "{\n         \"buyer\": false,\n         \"commission\": \"-0.07819010\",\n         \"commissionAsset\": \"USDT\",\n         \"id\": 698759,\n         \"maker\": false,\n         \"orderId\": 25851813,\n         \"price\": \"7819.01\",\n         \"qty\": \"0.002\",\n         \"quoteQty\": \"15.63802\",\n         \"realizedPnl\": \"-0.91539999\",\n         \"side\": \"SELL\",\n         \"positionSide\": \"SHORT\",\n         \"symbol\": \"BTCUSDT\",\n         \"time\": 1569514978020\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"id\": 3913206,\n        //         \"price\": \"644.100\",\n        //         \"qty\": \"0.08\",\n        //         \"quoteQty\": \"51.528\",\n        //         \"time\": 1749784506633,\n        //         \"isBuyerMaker\": true\n        //     }\n        //\n        //     {\n        //         \"id\": 657,\n        //         \"price\": \"1.01000000\",\n        //         \"qty\": \"5.00000000\",\n        //         \"baseQty\": \"4.95049505\",\n        //         \"time\": 1755156533943,\n        //         \"isBuyerMaker\": false\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"buyer\": false,\n        //         \"commission\": \"-0.07819010\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"id\": 698759,\n        //         \"maker\": false,\n        //         \"orderId\": 25851813,\n        //         \"price\": \"7819.01\",\n        //         \"qty\": \"0.002\",\n        //         \"quoteQty\": \"15.63802\",\n        //         \"realizedPnl\": \"-0.91539999\",\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"time\": 1569514978020\n        //     }\n        //\n        const id = this.safeString (trade, 'id');\n        const symbol = market['symbol'];\n        const currencyId = this.safeString (trade, 'commissionAsset');\n        const currencyCode = this.safeCurrencyCode (currencyId);\n        const amountString = this.safeString (trade, 'qty');\n        const priceString = this.safeString (trade, 'price');\n        const costString = this.safeString2 (trade, 'quoteQty', 'baseQty');\n        const timestamp = this.safeInteger (trade, 'time');\n        let side = this.safeStringLower (trade, 'side');\n        const isMaker = this.safeBool (trade, 'maker');\n        let takerOrMaker = undefined;\n        if (isMaker !== undefined) {\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        const isBuyerMaker = this.safeBool (trade, 'isBuyerMaker');\n        if (isBuyerMaker !== undefined) {\n            side = isBuyerMaker ? 'sell' : 'buy';\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': this.safeString (trade, 'orderId'),\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': {\n                'cost': this.parseNumber (Precise.stringAbs (this.safeString (trade, 'commission'))),\n                'currency': currencyCode,\n            },\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1785,
        "line_end": 1797,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'makerCommissionRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'takerCommissionRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "false",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        const marketId = this.safeString (fee, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'makerCommissionRate'),\n            'taker': this.safeNumber (fee, 'takerCommissionRate'),\n            'percentage': false,\n            'tierBased': false,\n        };\n    }"
      }
    ],
    "backpack": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1361,
        "line_end": 1386,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"USDC\": {\n             \"available\": \"120\",\n             \"locked\": \"0\",\n             \"staked\": \"0\"\n         }\n     }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        //     {\n        //         \"USDC\": {\n        //             \"available\": \"120\",\n        //             \"locked\": \"0\",\n        //             \"staked\": \"0\"\n        //         }\n        //     }\n        //\n        const balanceKeys = Object.keys (response);\n        const result: Dict = {};\n        for (let i = 0; i < balanceKeys.length; i++) {\n            const id = balanceKeys[i];\n            const code = this.safeCurrencyCode (id);\n            const balance = response[id];\n            const account = this.account ();\n            const locked = this.safeString (balance, 'locked');\n            const staked = this.safeString (balance, 'staked');\n            const used = Precise.stringAdd (locked, staked);\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = used;\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1648,
        "line_end": 1664,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        return {\n            'info': depositAddress,\n            'currency': currency['code'],\n            'network': undefined, // network is not returned by the API\n            'address': address,\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1032,
        "line_end": 1066,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'indexPrice')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "'1h'",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fundingRate\": \"0.0001\",\n         \"indexPrice\": \"118333.18643195\",\n         \"markPrice\": \"118343.51853741\",\n         \"nextFundingTimestamp\": 1753113600000,\n         \"symbol\": \"BTC_USDC_PERP\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"fundingRate\": \"0.0001\",\n        //         \"indexPrice\": \"118333.18643195\",\n        //         \"markPrice\": \"118343.51853741\",\n        //         \"nextFundingTimestamp\": 1753113600000,\n        //         \"symbol\": \"BTC_USDC_PERP\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market);\n        const nextFundingTimestamp = this.safeInteger (contract, 'nextFundingTimestamp');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': this.safeNumber (contract, 'markPrice'),\n            'indexPrice': this.safeNumber (contract, 'indexPrice'),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': '1h',\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 2231,
        "line_end": 2258,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fundingRate\": \"0.0001\",\n         \"intervalEndTimestamp\": \"2025-08-01T16:00:00\",\n         \"quantity\": \"-0.001301\",\n         \"subaccountId\": 0,\n         \"symbol\": \"ETH_USDC_PERP\",\n         \"userId\": 1813870\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //         \"fundingRate\": \"0.0001\",\n        //         \"intervalEndTimestamp\": \"2025-08-01T16:00:00\",\n        //         \"quantity\": \"-0.001301\",\n        //         \"subaccountId\": 0,\n        //         \"symbol\": \"ETH_USDC_PERP\",\n        //         \"userId\": 1813870\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const amount = this.safeNumber (income, 'quantity');\n        const id = this.safeString (income, 'userId');\n        const timestamp = this.parse8601 (this.safeString (income, 'intervalEndTimestamp'));\n        const rate = this.safeNumber (income, 'fundingRate');\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': id,\n            'amount': amount,\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 619,
        "line_end": 793,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "type === 'spot'",
            "comment": null
          },
          {
            "key": "margin",
            "value": "type === 'spot'",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "orderBookState === 'Open'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "type !== 'spot'",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': amountPrecision,\n                'price': pricePrecision,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minQuantity,\n                    'max': maxQuantity,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': maxPrice,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.parse8601 (this.safeString (market, 'createdAt'))",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"baseSymbol\": \"SOL\",\n             \"createdAt\": \"2025-01-21T06:34:54.691858\",\n             \"filters\": {\n                 \"price\": {\n                     \"borrowmarketFeeMaxMultiplier\": null,\n                     \"borrowmarketFeeMinMultiplier\": null,\n                     \"maxImpactMultiplier\": \"1.03\",\n                     \"maxMultiplier\": \"1.25\",\n                     \"maxPrice\": null,\n                     \"meanMarkPriceBand\": {\n                         \"maxMultiplier\": \"1.15\",\n                         \"minMultiplier\": \"0.9\"\n                     },\n                     \"meanPremiumBand\": null,\n                     \"minImpactMultiplier\": \"0.97\",\n                     \"minMultiplier\": \"0.75\",\n                     \"minPrice\": \"0.01\",\n                     \"tickSize\": \"0.01\"\n                 },\n                 \"quantity\": {\n                     \"maxQuantity\": null,\n                     \"minQuantity\": \"0.01\",\n                     \"stepSize\": \"0.01\"\n                 }\n             },\n             \"fundingInterval\": 28800000,\n             \"fundingRateLowerBound\": null,\n             \"fundingRateUpperBound\": null,\n             \"imfFunction\": null,\n             \"marketType\": \"SPOT\",\n             \"mmfFunction\": null,\n             \"openInterestLimit\": \"0\",\n             \"orderBookState\": \"Open\",\n             \"quoteSymbol\": \"USDC\",\n             \"symbol\": \"SOL_USDC\"\n         },\n         {\n             \"baseSymbol\": \"SOL\",\n             \"createdAt\": \"2025-01-21T06:34:54.691858\",\n             \"filters\": {\n                 \"price\": {\n                     \"borrowEntryFeeMaxMultiplier\": null,\n                     \"borrowEntryFeeMinMultiplier\": null,\n                     \"maxImpactMultiplier\": \"1.03\",\n                     \"maxMultiplier\": \"1.25\",\n                     \"maxPrice\": \"1000\",\n                     \"meanMarkPriceBand\": {\n                         \"maxMultiplier\": \"1.1\",\n                         \"minMultiplier\": \"0.9\"\n                     },\n                     \"meanPremiumBand\": {\n                         \"tolerancePct\": \"0.05\"\n                     },\n                     \"minImpactMultiplier\": \"0.97\",\n                     \"minMultiplier\": \"0.75\",\n                     \"minPrice\": \"0.01\",\n                     \"tickSize\": \"0.01\"\n                 },\n                 \"quantity\": {\n                     \"maxQuantity\": null,\n                     \"minQuantity\": \"0.01\",\n                     \"stepSize\": \"0.01\"\n                 }\n             },\n             \"fundingInterval\": \"28800000\",\n             \"fundingRateLowerBound\": \"-100\",\n             \"fundingRateUpperBound\": \"100\",\n             \"imfFunction\": {\n                 \"base\": \"0.02\",\n                 \"factor\": \"0.0001275\",\n                 \"type\": \"sqrt\"\n             },\n             \"marketType\": \"PERP\",\n             \"mmfFunction\": {\n                 \"base\": \"0.0125\",\n                 \"factor\": \"0.0000765\",\n                 \"type\": \"sqrt\"\n             },\n             \"openInterestLimit\": \"4000000\",\n             \"orderBookState\": \"Open\",\n             \"quoteSymbol\": \"USDC\",\n             \"symbol\": \"SOL_USDC_PERP\"\n         }\n     ]"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     [\n        //         {\n        //             \"baseSymbol\": \"SOL\",\n        //             \"createdAt\": \"2025-01-21T06:34:54.691858\",\n        //             \"filters\": {\n        //                 \"price\": {\n        //                     \"borrowmarketFeeMaxMultiplier\": null,\n        //                     \"borrowmarketFeeMinMultiplier\": null,\n        //                     \"maxImpactMultiplier\": \"1.03\",\n        //                     \"maxMultiplier\": \"1.25\",\n        //                     \"maxPrice\": null,\n        //                     \"meanMarkPriceBand\": {\n        //                         \"maxMultiplier\": \"1.15\",\n        //                         \"minMultiplier\": \"0.9\"\n        //                     },\n        //                     \"meanPremiumBand\": null,\n        //                     \"minImpactMultiplier\": \"0.97\",\n        //                     \"minMultiplier\": \"0.75\",\n        //                     \"minPrice\": \"0.01\",\n        //                     \"tickSize\": \"0.01\"\n        //                 },\n        //                 \"quantity\": {\n        //                     \"maxQuantity\": null,\n        //                     \"minQuantity\": \"0.01\",\n        //                     \"stepSize\": \"0.01\"\n        //                 }\n        //             },\n        //             \"fundingInterval\": 28800000,\n        //             \"fundingRateLowerBound\": null,\n        //             \"fundingRateUpperBound\": null,\n        //             \"imfFunction\": null,\n        //             \"marketType\": \"SPOT\",\n        //             \"mmfFunction\": null,\n        //             \"openInterestLimit\": \"0\",\n        //             \"orderBookState\": \"Open\",\n        //             \"quoteSymbol\": \"USDC\",\n        //             \"symbol\": \"SOL_USDC\"\n        //         },\n        //         {\n        //             \"baseSymbol\": \"SOL\",\n        //             \"createdAt\": \"2025-01-21T06:34:54.691858\",\n        //             \"filters\": {\n        //                 \"price\": {\n        //                     \"borrowEntryFeeMaxMultiplier\": null,\n        //                     \"borrowEntryFeeMinMultiplier\": null,\n        //                     \"maxImpactMultiplier\": \"1.03\",\n        //                     \"maxMultiplier\": \"1.25\",\n        //                     \"maxPrice\": \"1000\",\n        //                     \"meanMarkPriceBand\": {\n        //                         \"maxMultiplier\": \"1.1\",\n        //                         \"minMultiplier\": \"0.9\"\n        //                     },\n        //                     \"meanPremiumBand\": {\n        //                         \"tolerancePct\": \"0.05\"\n        //                     },\n        //                     \"minImpactMultiplier\": \"0.97\",\n        //                     \"minMultiplier\": \"0.75\",\n        //                     \"minPrice\": \"0.01\",\n        //                     \"tickSize\": \"0.01\"\n        //                 },\n        //                 \"quantity\": {\n        //                     \"maxQuantity\": null,\n        //                     \"minQuantity\": \"0.01\",\n        //                     \"stepSize\": \"0.01\"\n        //                 }\n        //             },\n        //             \"fundingInterval\": \"28800000\",\n        //             \"fundingRateLowerBound\": \"-100\",\n        //             \"fundingRateUpperBound\": \"100\",\n        //             \"imfFunction\": {\n        //                 \"base\": \"0.02\",\n        //                 \"factor\": \"0.0001275\",\n        //                 \"type\": \"sqrt\"\n        //             },\n        //             \"marketType\": \"PERP\",\n        //             \"mmfFunction\": {\n        //                 \"base\": \"0.0125\",\n        //                 \"factor\": \"0.0000765\",\n        //                 \"type\": \"sqrt\"\n        //             },\n        //             \"openInterestLimit\": \"4000000\",\n        //             \"orderBookState\": \"Open\",\n        //             \"quoteSymbol\": \"USDC\",\n        //             \"symbol\": \"SOL_USDC_PERP\"\n        //         }\n        //     ]\n        //\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'baseSymbol');\n        const quoteId = this.safeString (market, 'quoteSymbol');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        const filters = this.safeDict (market, 'filters', {});\n        const priceFilter = this.safeDict (filters, 'price', {});\n        const maxPrice = this.safeNumber (priceFilter, 'maxPrice');\n        const minPrice = this.safeNumber (priceFilter, 'minPrice');\n        const pricePrecision = this.safeNumber (priceFilter, 'tickSize');\n        const quantityFilter = this.safeDict (filters, 'quantity', {});\n        const maxQuantity = this.safeNumber (quantityFilter, 'maxQuantity');\n        const minQuantity = this.safeNumber (quantityFilter, 'minQuantity');\n        const amountPrecision = this.safeNumber (quantityFilter, 'stepSize');\n        let type: MarketType;\n        const typeOfMarket = this.parseMarketType (this.safeString (market, 'marketType'));\n        let linear: Bool = undefined;\n        let inverse: Bool = undefined;\n        let settle: Str = undefined;\n        let settleId: Str = undefined;\n        let contractSize: Num = undefined;\n        if (typeOfMarket === 'spot') {\n            type = 'spot';\n        } else if (typeOfMarket === 'swap') {\n            type = 'swap';\n            linear = true;\n            inverse = false;\n            settleId = this.safeString (market, 'quoteSymbol');\n            settle = this.safeCurrencyCode (settleId);\n            symbol += ':' + settle;\n            contractSize = 1;\n        }\n        const orderBookState = this.safeString (market, 'orderBookState');\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': type === 'spot',\n            'margin': type === 'spot', // todo check if margin is supported for all markets\n            'swap': type === 'swap',\n            'future': false,\n            'option': false,\n            'active': orderBookState === 'Open',\n            'contract': type !== 'spot',\n            'linear': linear,\n            'inverse': inverse,\n            'taker': undefined, // todo check commission\n            'maker': undefined, // todo check commission\n            'contractSize': contractSize,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': amountPrecision,\n                'price': pricePrecision,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minQuantity,\n                    'max': maxQuantity,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': maxPrice,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': this.parse8601 (this.safeString (market, 'createdAt')),\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketType",
        "signature": "parseMarketType (type)",
        "line_start": 795,
        "line_end": 806,
        "comment": null,
        "mappings": [
          {
            "key": "SPOT",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "PERP",
            "value": "'swap'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketType (type) {\n        const types = {\n            'SPOT': 'spot',\n            'PERP': 'swap',\n            // current types are described in the docs, but the exchange returns only 'SPOT' and 'PERP'\n            // 'IPERP': 'swap',\n            // 'DATED': 'swap',\n            // 'PREDICTION': 'swap',\n            // 'RFQ': 'swap',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 982,
        "line_end": 1007,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"close\": \"118294.6\",\n             \"end\": \"2025-07-19 13:12:00\",\n             \"high\": \"118297.6\",\n             \"low\": \"118237.5\",\n             \"open\": \"118238\",\n             \"quoteVolume\": \"4106.558156\",\n             \"start\": \"2025-07-19 13:09:00\",\n             \"trades\": \"12\",\n             \"volume\": \"0.03473\"\n         },\n         ...\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         {\n        //             \"close\": \"118294.6\",\n        //             \"end\": \"2025-07-19 13:12:00\",\n        //             \"high\": \"118297.6\",\n        //             \"low\": \"118237.5\",\n        //             \"open\": \"118238\",\n        //             \"quoteVolume\": \"4106.558156\",\n        //             \"start\": \"2025-07-19 13:09:00\",\n        //             \"trades\": \"12\",\n        //             \"volume\": \"0.03473\"\n        //         },\n        //         ...\n        //     ]\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'start')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 1091,
        "line_end": 1111,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openInterest",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"openInterest\": \"1273.85214\",\n             \"symbol\": \"BTC_USDC_PERP\",\n             \"timestamp\":1753105735301\n         }\n     ]"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     [\n        //         {\n        //             \"openInterest\": \"1273.85214\",\n        //             \"symbol\": \"BTC_USDC_PERP\",\n        //             \"timestamp\":1753105735301\n        //         }\n        //     ]\n        //\n        const timestamp = this.safeInteger (interest, 'timestamp');\n        const openInterest = this.safeNumber (interest, 'openInterest');\n        return this.safeOpenInterest ({\n            'symbol': market['symbol'],\n            'openInterestAmount': undefined,\n            'openInterestValue': openInterest,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1935,
        "line_end": 2075,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clientId\": null,\n         \"createdAt\": 1753624283415,\n         \"executedQuantity\": \"0.001\",\n         \"executedQuoteQuantity\": \"3.81428\",\n         \"id\": \"4227701917\",\n         \"orderType\": \"Market\",\n         \"quantity\": \"0.001\",\n         \"quoteQuantity\": \"3.82\",\n         \"reduceOnly\": null,\n         \"relatedOrderId\": null,\n         \"selfTradePrevention\": \"RejectTaker\",\n         \"side\": \"Bid\",\n         \"status\": \"Filled\",\n         \"stopLossLimitPrice\": null,\n         \"stopLossTriggerBy\": null,\n         \"stopLossTriggerPrice\": null,\n         \"strategyId\": null,\n         \"symbol\": \"ETH_USDC\",\n         \"takeProfitLimitPrice\": null,\n         \"takeProfitTriggerBy\": null,\n         \"takeProfitTriggerPrice\": null,\n         \"timeInForce\": \"GTC\",\n         \"triggerBy\": null,\n         \"triggerPrice\": null,\n         \"triggerQuantity\": null,\n         \"triggeredAt\": null\n     }",
          "{\n         \"clientId\": 123456789,\n         \"createdAt\": 1753626206762,\n         \"executedQuantity\": \"0\",\n         \"executedQuoteQuantity\": \"0\",\n         \"id\": \"4228978331\",\n         \"orderType\": \"Limit\",\n         \"postOnly\": true,\n         \"price\": \"3000\",\n         \"quantity\": \"0.001\",\n         \"reduceOnly\": null,\n         \"relatedOrderId\": null,\n         \"selfTradePrevention\": \"RejectTaker\",\n         \"side\": \"Bid\",\n         \"status\": \"New\",\n         \"stopLossLimitPrice\": null,\n         \"stopLossTriggerBy\": null,\n         \"stopLossTriggerPrice\": null,\n         \"strategyId\": null,\n         \"symbol\": \"ETH_USDC\",\n         \"takeProfitLimitPrice\": null,\n         \"takeProfitTriggerBy\": null,\n         \"takeProfitTriggerPrice\": null,\n         \"timeInForce\": \"GTC\",\n         \"triggerBy\": null,\n         \"triggerPrice\": null,\n         \"triggerQuantity\": null,\n         \"triggeredAt\": null\n     }",
          "{\n         \"clientId\": null,\n         \"createdAt\": \"2025-07-27T18:05:40.897\",\n         \"executedQuantity\": \"0\",\n         \"executedQuoteQuantity\": \"0\",\n         \"expiryReason\": null,\n         \"id\": \"4239996998\",\n         \"orderType\": \"Limit\",\n         \"postOnly\": false,\n         \"price\": \"4500\",\n         \"quantity\": null,\n         \"quoteQuantity\": null,\n         \"selfTradePrevention\": \"RejectTaker\",\n         \"side\": \"Ask\",\n         \"status\": \"Cancelled\",\n         \"stopLossLimitPrice\": null,\n         \"stopLossTriggerBy\": null,\n         \"stopLossTriggerPrice\": null,\n         \"strategyId\": null,\n         \"symbol\": \"ETH_USDC\",\n         \"systemOrderType\": null,\n         \"takeProfitLimitPrice\": null,\n         \"takeProfitTriggerBy\": null,\n         \"takeProfitTriggerPrice\": null,\n         \"timeInForce\": \"GTC\",\n         \"triggerBy\": null,\n         \"triggerPrice\": \"4300\",\n         \"triggerQuantity\": \"0.001\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"clientId\": null,\n        //         \"createdAt\": 1753624283415,\n        //         \"executedQuantity\": \"0.001\",\n        //         \"executedQuoteQuantity\": \"3.81428\",\n        //         \"id\": \"4227701917\",\n        //         \"orderType\": \"Market\",\n        //         \"quantity\": \"0.001\",\n        //         \"quoteQuantity\": \"3.82\",\n        //         \"reduceOnly\": null,\n        //         \"relatedOrderId\": null,\n        //         \"selfTradePrevention\": \"RejectTaker\",\n        //         \"side\": \"Bid\",\n        //         \"status\": \"Filled\",\n        //         \"stopLossLimitPrice\": null,\n        //         \"stopLossTriggerBy\": null,\n        //         \"stopLossTriggerPrice\": null,\n        //         \"strategyId\": null,\n        //         \"symbol\": \"ETH_USDC\",\n        //         \"takeProfitLimitPrice\": null,\n        //         \"takeProfitTriggerBy\": null,\n        //         \"takeProfitTriggerPrice\": null,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerBy\": null,\n        //         \"triggerPrice\": null,\n        //         \"triggerQuantity\": null,\n        //         \"triggeredAt\": null\n        //     }\n        //\n        // fetchOpenOrders\n        //     {\n        //         \"clientId\": 123456789,\n        //         \"createdAt\": 1753626206762,\n        //         \"executedQuantity\": \"0\",\n        //         \"executedQuoteQuantity\": \"0\",\n        //         \"id\": \"4228978331\",\n        //         \"orderType\": \"Limit\",\n        //         \"postOnly\": true,\n        //         \"price\": \"3000\",\n        //         \"quantity\": \"0.001\",\n        //         \"reduceOnly\": null,\n        //         \"relatedOrderId\": null,\n        //         \"selfTradePrevention\": \"RejectTaker\",\n        //         \"side\": \"Bid\",\n        //         \"status\": \"New\",\n        //         \"stopLossLimitPrice\": null,\n        //         \"stopLossTriggerBy\": null,\n        //         \"stopLossTriggerPrice\": null,\n        //         \"strategyId\": null,\n        //         \"symbol\": \"ETH_USDC\",\n        //         \"takeProfitLimitPrice\": null,\n        //         \"takeProfitTriggerBy\": null,\n        //         \"takeProfitTriggerPrice\": null,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerBy\": null,\n        //         \"triggerPrice\": null,\n        //         \"triggerQuantity\": null,\n        //         \"triggeredAt\": null\n        //     }\n        //\n        // fetchOrders\n        //     {\n        //         \"clientId\": null,\n        //         \"createdAt\": \"2025-07-27T18:05:40.897\",\n        //         \"executedQuantity\": \"0\",\n        //         \"executedQuoteQuantity\": \"0\",\n        //         \"expiryReason\": null,\n        //         \"id\": \"4239996998\",\n        //         \"orderType\": \"Limit\",\n        //         \"postOnly\": false,\n        //         \"price\": \"4500\",\n        //         \"quantity\": null,\n        //         \"quoteQuantity\": null,\n        //         \"selfTradePrevention\": \"RejectTaker\",\n        //         \"side\": \"Ask\",\n        //         \"status\": \"Cancelled\",\n        //         \"stopLossLimitPrice\": null,\n        //         \"stopLossTriggerBy\": null,\n        //         \"stopLossTriggerPrice\": null,\n        //         \"strategyId\": null,\n        //         \"symbol\": \"ETH_USDC\",\n        //         \"systemOrderType\": null,\n        //         \"takeProfitLimitPrice\": null,\n        //         \"takeProfitTriggerBy\": null,\n        //         \"takeProfitTriggerPrice\": null,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerBy\": null,\n        //         \"triggerPrice\": \"4300\",\n        //         \"triggerQuantity\": \"0.001\"\n        //     }\n        //\n        let timestamp = this.safeInteger (order, 'createdAt');\n        const timestamp2 = this.parse8601 (this.safeString (order, 'createdAt'));\n        if (timestamp2 !== undefined) {\n            timestamp = timestamp2;\n        }\n        const id = this.safeString (order, 'id');\n        const clientOrderId = this.safeString (order, 'clientId');\n        const symbol = this.safeSymbol (this.safeString (order, 'symbol'), market);\n        const type = this.safeStringLower (order, 'orderType');\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const side = this.parseOrderSide (this.safeString (order, 'side'));\n        const amount = this.safeString2 (order, 'quantity', 'triggerQuantity');\n        const price = this.safeString (order, 'price');\n        const cost = this.safeString (order, 'executedQuoteQuantity');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const triggerPrice = this.safeString (order, 'triggerPrice');\n        const filled = this.safeString (order, 'executedQuantity');\n        const reduceOnly = this.safeBool (order, 'reduceOnly');\n        const postOnly = this.safeBool (order, 'postOnly');\n        const stopLossPrice = this.safeString2 (order, 'stopLossLimitPrice', 'stopLossTriggerPrice');\n        const takeProfitPrice = this.safeString2 (order, 'takeProfitLimitPrice', 'takeProfitTriggerPrice');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': reduceOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'stopLossPrice': stopLossPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': undefined,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (side: Str)",
        "line_start": 2090,
        "line_end": 2096,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSide (side: Str) {\n        const sides: Dict = {\n            'Bid': 'buy',\n            'Ask': 'sell',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2077,
        "line_end": 2088,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'New': 'open',\n            'Filled': 'closed',\n            'Cancelled': 'canceled',\n            'Expired': 'canceled',\n            'PartiallyFilled': 'open',\n            'TriggerPending': 'open',\n            'TriggerFailed': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2118,
        "line_end": 2202,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (this.safeString (position, 'timestamp'))",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (this.parse8601 (this.safeString (position, 'timestamp')))",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeString (position, 'netExposureQuantity')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "Precise.stringAbs (netCost)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.safeString (position, 'imf')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.safeString (position, 'mmf')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "realizedPnl",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"breakEvenPrice\": \"3831.3630555555555555555555556\",\n         \"cumulativeFundingPayment\": \"-0.009218\",\n         \"cumulativeInterest\": \"0\",\n         \"entryPrice\": \"3826.8888888888888888888888889\",\n         \"estLiquidationPrice\": \"0\",\n         \"imf\": \"0.02\",\n         \"imfFunction\": {\n             \"base\": \"0.02\",\n             \"factor\": \"0.0000935\",\n             \"type\": \"sqrt\"\n         },\n         \"markPrice\": \"3787.46813304\",\n         \"mmf\": \"0.0125\",\n         \"mmfFunction\": {\n             \"base\": \"0.0125\",\n             \"factor\": \"0.0000561\",\n             \"type\": \"sqrt\"\n         },\n         \"netCost\": \"13.7768\",\n         \"netExposureNotional\": \"13.634885278944\",\n         \"netExposureQuantity\": \"0.0036\",\n         \"netQuantity\": \"0.0036\",\n         \"pnlRealized\": \"0\",\n         \"pnlUnrealized\": \"-0.141914\",\n         \"positionId\": \"4238420454\",\n         \"subaccountId\": null,\n         \"symbol\": \"ETH_USDC_PERP\",\n         \"userId\":1813870\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // fetchPositions\n        //     {\n        //         \"breakEvenPrice\": \"3831.3630555555555555555555556\",\n        //         \"cumulativeFundingPayment\": \"-0.009218\",\n        //         \"cumulativeInterest\": \"0\",\n        //         \"entryPrice\": \"3826.8888888888888888888888889\",\n        //         \"estLiquidationPrice\": \"0\",\n        //         \"imf\": \"0.02\",\n        //         \"imfFunction\": {\n        //             \"base\": \"0.02\",\n        //             \"factor\": \"0.0000935\",\n        //             \"type\": \"sqrt\"\n        //         },\n        //         \"markPrice\": \"3787.46813304\",\n        //         \"mmf\": \"0.0125\",\n        //         \"mmfFunction\": {\n        //             \"base\": \"0.0125\",\n        //             \"factor\": \"0.0000561\",\n        //             \"type\": \"sqrt\"\n        //         },\n        //         \"netCost\": \"13.7768\",\n        //         \"netExposureNotional\": \"13.634885278944\",\n        //         \"netExposureQuantity\": \"0.0036\",\n        //         \"netQuantity\": \"0.0036\",\n        //         \"pnlRealized\": \"0\",\n        //         \"pnlUnrealized\": \"-0.141914\",\n        //         \"positionId\": \"4238420454\",\n        //         \"subaccountId\": null,\n        //         \"symbol\": \"ETH_USDC_PERP\",\n        //         \"userId\":1813870\n        //     }\n        //\n        //\n        const id = this.safeString (position, 'positionId');\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const entryPrice = this.safeString (position, 'entryPrice');\n        const markPrice = this.safeString (position, 'markPrice');\n        const netCost = this.safeString (position, 'netCost');\n        let hedged = false;\n        let side = 'long';\n        if (Precise.stringLt (netCost, '0')) {\n            side = 'short';\n        }\n        if (netCost === undefined) {\n            hedged = undefined;\n            side = undefined;\n        }\n        const unrealizedPnl = this.safeString (position, 'pnlUnrealized');\n        const realizedPnl = this.safeString (position, 'pnlRealized');\n        const liquidationPrice = this.safeString (position, 'estLiquidationPrice');\n        return this.safePosition ({\n            'info': position,\n            'id': id,\n            'symbol': symbol,\n            'timestamp': this.parse8601 (this.safeString (position, 'timestamp')),\n            'datetime': this.iso8601 (this.parse8601 (this.safeString (position, 'timestamp'))),\n            'lastUpdateTimestamp': undefined,\n            'hedged': hedged,\n            'side': side,\n            'contracts': this.safeString (position, 'netExposureQuantity'),\n            'contractSize': undefined,\n            'entryPrice': entryPrice,\n            'markPrice': markPrice,\n            'lastPrice': undefined,\n            'notional': Precise.stringAbs (netCost),\n            'leverage': undefined,\n            'collateral': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': this.safeString (position, 'imf'),\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': this.safeString (position, 'mmf'),\n            'realizedPnl': realizedPnl,\n            'unrealizedPnl': unrealizedPnl,\n            'liquidationPrice': liquidationPrice,\n            'marginMode': undefined,\n            'marginRatio': undefined,\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 844,
        "line_end": 896,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"firstPrice\": \"327.38\",\n         \"high\": \"337.99\",\n         \"lastPrice\": \"317.14\",\n         \"low\": \"300.01\",\n         \"priceChange\": \"-10.24\",\n         \"priceChangePercent\": \"-0.031279\",\n         \"quoteVolume\": \"21584.32278\",\n         \"symbol\": \"AAVE_USDC\",\n         \"trades\": \"245\",\n         \"volume\": \"65.823\"\n     }, ..."
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker/fetchTickers\n        //\n        //     {\n        //         \"firstPrice\": \"327.38\",\n        //         \"high\": \"337.99\",\n        //         \"lastPrice\": \"317.14\",\n        //         \"low\": \"300.01\",\n        //         \"priceChange\": \"-10.24\",\n        //         \"priceChangePercent\": \"-0.031279\",\n        //         \"quoteVolume\": \"21584.32278\",\n        //         \"symbol\": \"AAVE_USDC\",\n        //         \"trades\": \"245\",\n        //         \"volume\": \"65.823\"\n        //     }, ...\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market);\n        const open = this.safeString (ticker, 'firstPrice');\n        const last = this.safeString (ticker, 'lastPrice');\n        const high = this.safeString (ticker, 'high');\n        const low = this.safeString (ticker, 'low');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = this.safeString (ticker, 'quoteVolume');\n        const percentage = this.safeString (ticker, 'priceChangePercent');\n        const change = this.safeString (ticker, 'priceChange');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': high,\n            'low': low,\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1235,
        "line_end": 1303,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 8721563,\n         \"isBuyerMaker\": false,\n         \"price\": \"117427.6\",\n         \"quantity\": \"0.00016\",\n         \"quoteQuantity\": \"18.788416\",\n         \"timestamp\": 1753123916819\n     }",
          "{\n         \"clientId\": null,\n         \"fee\": \"0.004974\",\n         \"feeSymbol\": \"USDC\",\n         \"isMaker\": false,\n         \"orderId\": \"4238907375\",\n         \"price\": \"3826.15\",\n         \"quantity\": \"0.0026\",\n         \"side\": \"Bid\",\n         \"symbol\": \"ETH_USDC_PERP\",\n         \"systemOrderType\": null,\n         \"timestamp\": \"2025-07-27T17:39:00.092\",\n         \"tradeId\": 9748827\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //         \"id\": 8721563,\n        //         \"isBuyerMaker\": false,\n        //         \"price\": \"117427.6\",\n        //         \"quantity\": \"0.00016\",\n        //         \"quoteQuantity\": \"18.788416\",\n        //         \"timestamp\": 1753123916819\n        //     }\n        //\n        // fetchMyTrades\n        //     {\n        //         \"clientId\": null,\n        //         \"fee\": \"0.004974\",\n        //         \"feeSymbol\": \"USDC\",\n        //         \"isMaker\": false,\n        //         \"orderId\": \"4238907375\",\n        //         \"price\": \"3826.15\",\n        //         \"quantity\": \"0.0026\",\n        //         \"side\": \"Bid\",\n        //         \"symbol\": \"ETH_USDC_PERP\",\n        //         \"systemOrderType\": null,\n        //         \"timestamp\": \"2025-07-27T17:39:00.092\",\n        //         \"tradeId\": 9748827\n        //     }\n        //\n        const id = this.safeString2 (trade, 'id', 'tradeId');\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'quantity');\n        const isMaker = this.safeBool (trade, 'isMaker');\n        const takerOrMaker = isMaker ? 'maker' : 'taker';\n        const orderId = this.safeString (trade, 'orderId');\n        const side = this.parseOrderSide (this.safeString (trade, 'side'));\n        let fee = undefined;\n        const feeAmount = this.safeString (trade, 'fee');\n        let timestamp = this.safeInteger (trade, 'timestamp');\n        if (feeAmount !== undefined) {\n            // if fetchMyTrades\n            const datetime = this.safeString (trade, 'timestamp');\n            timestamp = this.parse8601 (datetime);\n        }\n        const feeSymbol = this.safeCurrencyCode (this.safeString (trade, 'feeSymbol'));\n        if (feeAmount !== undefined) {\n            fee = {\n                'cost': feeAmount,\n                'currency': feeSymbol,\n                'rate': undefined,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction, currency: Currency = undefined): Transaction",
        "line_start": 1491,
        "line_end": 1607,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"createdAt\": \"2025-07-23T13:55:54.267\",\n             \"fiatAmount\": null,\n             \"fiatCurrency\": null,\n             \"fromAddress\": \"0x2e3ab3e88a7dbdc763aadf5b28c18fb085af420a\",\n             \"id\": 6695353,\n             \"institutionBic\": null,\n             \"platformMemo\": null,\n             \"quantity\": \"120\",\n             \"source\": \"ethereum\",\n             \"status\": \"confirmed\",\n             \"symbol\": \"USDC\",\n             \"toAddress\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\",\n             \"transactionHash\": \"0x58edaac415398d617b34c6673fffcaf0024990d5700565030119db5cbf3765d1\"\n         }\n     ]",
          "{\n         \"accountIdentifier\": null,\n         \"bankIdentifier\": null,\n         \"bankName\": null,\n         \"blockchain\": \"Ethereum\",\n         \"clientId\": null,\n         \"createdAt\": \"2025-08-13T19:27:13.817\",\n         \"fee\": \"3\",\n         \"fiatFee\": null,\n         \"fiatState\": null,\n         \"fiatSymbol\": null,\n         \"id\": 5479929,\n         \"identifier\": null,\n         \"isInternal\": false,\n         \"providerId\": null,\n         \"quantity\": \"10\",\n         \"status\": \"pending\",\n         \"subaccountId\": null,\n         \"symbol\": \"USDC\",\n         \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n         \"transactionHash\": null,\n         \"triggerAt\": null\n     }",
          "[\n         {\n             \"accountIdentifier\": null,\n             \"bankIdentifier\": null,\n             \"bankName\": null,\n             \"blockchain\": \"Ethereum\",\n             \"clientId\": null,\n             \"createdAt\": \"2025-08-13T19:27:13.817\",\n             \"fee\": \"3\",\n             \"fiatFee\": null,\n             \"fiatState\": null,\n             \"fiatSymbol\": null,\n             \"id\": 5479929,\n             \"identifier\": null,\n             \"isInternal\": false,\n             \"providerId\": null,\n             \"quantity\": \"10\",\n             \"status\": \"confirmed\",\n             \"subaccountId\": null,\n             \"symbol\": \"USDC\",\n             \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n             \"transactionHash\": \"0x658b6d082af4afa0d3cf85caf344ff7c19d980117726bf193b00d8850f8746a1\",\n             \"triggerAt\": null\n         }\n     ]"
        ],
        "source": "parseTransaction (transaction, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //     [\n        //         {\n        //             \"createdAt\": \"2025-07-23T13:55:54.267\",\n        //             \"fiatAmount\": null,\n        //             \"fiatCurrency\": null,\n        //             \"fromAddress\": \"0x2e3ab3e88a7dbdc763aadf5b28c18fb085af420a\",\n        //             \"id\": 6695353,\n        //             \"institutionBic\": null,\n        //             \"platformMemo\": null,\n        //             \"quantity\": \"120\",\n        //             \"source\": \"ethereum\",\n        //             \"status\": \"confirmed\",\n        //             \"symbol\": \"USDC\",\n        //             \"toAddress\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\",\n        //             \"transactionHash\": \"0x58edaac415398d617b34c6673fffcaf0024990d5700565030119db5cbf3765d1\"\n        //         }\n        //     ]\n        //\n        // withdraw\n        //     {\n        //         \"accountIdentifier\": null,\n        //         \"bankIdentifier\": null,\n        //         \"bankName\": null,\n        //         \"blockchain\": \"Ethereum\",\n        //         \"clientId\": null,\n        //         \"createdAt\": \"2025-08-13T19:27:13.817\",\n        //         \"fee\": \"3\",\n        //         \"fiatFee\": null,\n        //         \"fiatState\": null,\n        //         \"fiatSymbol\": null,\n        //         \"id\": 5479929,\n        //         \"identifier\": null,\n        //         \"isInternal\": false,\n        //         \"providerId\": null,\n        //         \"quantity\": \"10\",\n        //         \"status\": \"pending\",\n        //         \"subaccountId\": null,\n        //         \"symbol\": \"USDC\",\n        //         \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n        //         \"transactionHash\": null,\n        //         \"triggerAt\": null\n        //     }\n        //\n        // fetchWithdrawals\n        //     [\n        //         {\n        //             \"accountIdentifier\": null,\n        //             \"bankIdentifier\": null,\n        //             \"bankName\": null,\n        //             \"blockchain\": \"Ethereum\",\n        //             \"clientId\": null,\n        //             \"createdAt\": \"2025-08-13T19:27:13.817\",\n        //             \"fee\": \"3\",\n        //             \"fiatFee\": null,\n        //             \"fiatState\": null,\n        //             \"fiatSymbol\": null,\n        //             \"id\": 5479929,\n        //             \"identifier\": null,\n        //             \"isInternal\": false,\n        //             \"providerId\": null,\n        //             \"quantity\": \"10\",\n        //             \"status\": \"confirmed\",\n        //             \"subaccountId\": null,\n        //             \"symbol\": \"USDC\",\n        //             \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n        //             \"transactionHash\": \"0x658b6d082af4afa0d3cf85caf344ff7c19d980117726bf193b00d8850f8746a1\",\n        //             \"triggerAt\": null\n        //         }\n        //     ]\n        //\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const id = this.safeString (transaction, 'id');\n        const txid = this.safeString (transaction, 'transactionHash');\n        const coin = this.safeString (transaction, 'symbol');\n        const code = this.safeCurrencyCode (coin, currency);\n        const timestamp = this.parse8601 (this.safeString (transaction, 'createdAt'));\n        const amount = this.safeNumber (transaction, 'quantity');\n        const networkId = this.safeStringLower2 (transaction, 'source', 'blockchain');\n        const network = this.networkIdToCode (networkId);\n        const addressTo = this.safeString (transaction, 'toAddress');\n        const addressFrom = this.safeString (transaction, 'fromAddress');\n        const tag = this.safeString (transaction, 'platformMemo');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        const internal = this.safeBool (transaction, 'isInternal', false);\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': undefined,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'internal': internal,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1609,
        "line_end": 1621,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'cancelled': 'cancelled',\n            'confirmed': 'ok',\n            'declined': 'declined',\n            'expired': 'expired',\n            'initiated': 'initiated',\n            'pending': 'pending',\n            'refunded': 'refunded',\n            'information required': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bequant": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1095,
        "line_end": 1107,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const currencyId = this.safeString (entry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (entry, 'available');\n            account['used'] = this.safeString (entry, 'reserved');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 3663,
        "line_end": 3712,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"full_name\": \"ConnectWealth\",\n         \"payin_enabled\": false,\n         \"payout_enabled\": false,\n         \"transfer_enabled\": true,\n         \"precision_transfer\": \"0.001\",\n         \"networks\": [\n           {\n             \"network\": \"ETH\",\n             \"protocol\": \"ERC20\",\n             \"default\": true,\n             \"payin_enabled\": false,\n             \"payout_enabled\": false,\n             \"precision_payout\": \"0.001\",\n             \"payout_fee\": \"0.016800000000\",\n             \"payout_is_payment_id\": false,\n             \"payin_payment_id\": false,\n             \"payin_confirmations\": \"2\"\n           }\n         ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //         \"full_name\": \"ConnectWealth\",\n        //         \"payin_enabled\": false,\n        //         \"payout_enabled\": false,\n        //         \"transfer_enabled\": true,\n        //         \"precision_transfer\": \"0.001\",\n        //         \"networks\": [\n        //           {\n        //             \"network\": \"ETH\",\n        //             \"protocol\": \"ERC20\",\n        //             \"default\": true,\n        //             \"payin_enabled\": false,\n        //             \"payout_enabled\": false,\n        //             \"precision_payout\": \"0.001\",\n        //             \"payout_fee\": \"0.016800000000\",\n        //             \"payout_is_payment_id\": false,\n        //             \"payin_payment_id\": false,\n        //             \"payin_confirmations\": \"2\"\n        //           }\n        //         ]\n        //    }\n        //\n        const networks = this.safeValue (fee, 'networks', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networks.length; j++) {\n            const networkEntry = networks[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            let networkCode = this.networkIdToCode (networkId);\n            networkCode = (networkCode !== undefined) ? networkCode.toUpperCase () : undefined;\n            const withdrawFee = this.safeNumber (networkEntry, 'payout_fee');\n            const isDefault = this.safeValue (networkEntry, 'default');\n            const withdrawResult: Dict = {\n                'fee': withdrawFee,\n                'percentage': (withdrawFee !== undefined) ? false : undefined,\n            };\n            if (isDefault === true) {\n                result['withdraw'] = withdrawResult;\n            }\n            result['networks'][networkCode] = {\n                'withdraw': withdrawResult,\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3332,
        "line_end": 3370,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'index_price')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (contract, 'interest_rate')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "this.parse8601 (fundingDateTime)",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "fundingDateTime",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'indicative_funding_rate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_type\": \"perpetual\",\n         \"mark_price\": \"42307.43\",\n         \"index_price\": \"42303.27\",\n         \"funding_rate\": \"0.0001\",\n         \"open_interest\": \"30.9826\",\n         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n         \"indicative_funding_rate\": \"0.0001\",\n         \"premium_index\": \"0\",\n         \"avg_premium_index\": \"0.000029587712038098\",\n         \"interest_rate\": \"0.0001\",\n         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"contract_type\": \"perpetual\",\n        //         \"mark_price\": \"42307.43\",\n        //         \"index_price\": \"42303.27\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"open_interest\": \"30.9826\",\n        //         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n        //         \"indicative_funding_rate\": \"0.0001\",\n        //         \"premium_index\": \"0\",\n        //         \"avg_premium_index\": \"0.000029587712038098\",\n        //         \"interest_rate\": \"0.0001\",\n        //         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n        //     }\n        //\n        const fundingDateTime = this.safeString (contract, 'next_funding_time');\n        const datetime = this.safeString (contract, 'timestamp');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': this.safeNumber (contract, 'mark_price'),\n            'indexPrice': this.safeNumber (contract, 'index_price'),\n            'interestRate': this.safeNumber (contract, 'interest_rate'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': this.parse8601 (fundingDateTime),\n            'fundingDatetime': fundingDateTime,\n            'nextFundingRate': this.safeNumber (contract, 'indicative_funding_rate'),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3575,
        "line_end": 3585,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'type')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'type'),\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 2669,
        "line_end": 2676,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (marginMode, 'margin_mode')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (marginMode, 'margin_mode'),\n        } as MarginMode;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 3432,
        "line_end": 3468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (currencyInfo, 'code')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT_PERP\",\n         \"type\": \"isolated\",\n         \"leverage\": \"8.00\",\n         \"created_at\": \"2022-03-30T23:34:27.161Z\",\n         \"updated_at\": \"2022-03-30T23:34:27.161Z\",\n         \"currencies\": [\n             {\n                 \"code\": \"USDT\",\n                 \"margin_balance\": \"7.000000000000\",\n                 \"reserved_orders\": \"0\",\n                 \"reserved_positions\": \"0\"\n             }\n         ],\n         \"positions\": null\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT_PERP\",\n        //         \"type\": \"isolated\",\n        //         \"leverage\": \"8.00\",\n        //         \"created_at\": \"2022-03-30T23:34:27.161Z\",\n        //         \"updated_at\": \"2022-03-30T23:34:27.161Z\",\n        //         \"currencies\": [\n        //             {\n        //                 \"code\": \"USDT\",\n        //                 \"margin_balance\": \"7.000000000000\",\n        //                 \"reserved_orders\": \"0\",\n        //                 \"reserved_positions\": \"0\"\n        //             }\n        //         ],\n        //         \"positions\": null\n        //     }\n        //\n        const currencies = this.safeValue (data, 'currencies', []);\n        const currencyInfo = this.safeValue (currencies, 0);\n        const datetime = this.safeString (data, 'updated_at');\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': this.safeString (currencyInfo, 'code'),\n            'status': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        };\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1892,
        "line_end": 1924,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"timestamp\":\"2015-08-20T19:01:00.000Z\",\n         \"open\":\"0.006\",\n         \"close\":\"0.006\",\n         \"min\":\"0.006\",\n         \"max\":\"0.006\",\n         \"volume\":\"0.003\",\n         \"volume_quote\":\"0.000018\"\n     }",
          "{\n         \"timestamp\": \"2022-04-01T01:28:00.000Z\",\n         \"open\": \"45146.39\",\n         \"close\": \"45219.43\",\n         \"min\": \"45146.39\",\n         \"max\": \"45219.43\"\n     },"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // Spot and Swap\n        //\n        //     {\n        //         \"timestamp\":\"2015-08-20T19:01:00.000Z\",\n        //         \"open\":\"0.006\",\n        //         \"close\":\"0.006\",\n        //         \"min\":\"0.006\",\n        //         \"max\":\"0.006\",\n        //         \"volume\":\"0.003\",\n        //         \"volume_quote\":\"0.000018\"\n        //     }\n        //\n        // Mark, Index and Premium Index\n        //\n        //     {\n        //         \"timestamp\": \"2022-04-01T01:28:00.000Z\",\n        //         \"open\": \"45146.39\",\n        //         \"close\": \"45219.43\",\n        //         \"min\": \"45146.39\",\n        //         \"max\": \"45219.43\"\n        //     },\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'timestamp')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'max'),\n            this.safeNumber (ohlcv, 'min'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3184,
        "line_end": 3210,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_type\": \"perpetual\",\n         \"mark_price\": \"42307.43\",\n         \"index_price\": \"42303.27\",\n         \"funding_rate\": \"0.0001\",\n         \"open_interest\": \"30.9826\",\n         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n         \"indicative_funding_rate\": \"0.0001\",\n         \"premium_index\": \"0\",\n         \"avg_premium_index\": \"0.000029587712038098\",\n         \"interest_rate\": \"0.0001\",\n         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"contract_type\": \"perpetual\",\n        //         \"mark_price\": \"42307.43\",\n        //         \"index_price\": \"42303.27\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"open_interest\": \"30.9826\",\n        //         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n        //         \"indicative_funding_rate\": \"0.0001\",\n        //         \"premium_index\": \"0\",\n        //         \"avg_premium_index\": \"0.000029587712038098\",\n        //         \"interest_rate\": \"0.0001\",\n        //         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n        //     }\n        //\n        const datetime = this.safeString (interest, 'timestamp');\n        const value = this.safeNumber (interest, 'open_interest');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (undefined, market),\n            'openInterestAmount': undefined,\n            'openInterestValue': value,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2485,
        "line_end": 2602,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeValue (order, 'reduce_only')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": 488953123149,\n       \"client_order_id\": \"103ad305301e4c3590045b13de15b36e\",\n       \"symbol\": \"BTCUSDT\",\n       \"side\": \"buy\",\n       \"status\": \"new\",\n       \"type\": \"limit\",\n       \"time_in_force\": \"GTC\",\n       \"quantity\": \"0.00001\",\n       \"quantity_cumulative\": \"0\",\n       \"price\": \"0.01\",\n       \"price_average\": \"0.01\",\n       \"post_only\": false,\n       \"created_at\": \"2021-04-13T13:06:16.567Z\",\n       \"updated_at\": \"2021-04-13T13:06:16.567Z\"\n     }",
          "{\n       \"id\": \"685877626834\",\n       \"client_order_id\": \"Yshl7G-EjaREyXQYaGbsmdtVbW-nzQwu\",\n       \"symbol\": \"BTCUSDT\",\n       \"side\": \"buy\",\n       \"status\": \"filled\",\n       \"type\": \"market\",\n       \"time_in_force\": \"GTC\",\n       \"quantity\": \"0.00010\",\n       \"quantity_cumulative\": \"0.00010\",\n       \"post_only\": false,\n       \"created_at\": \"2021-10-26T08:55:55.1Z\",\n       \"updated_at\": \"2021-10-26T08:55:55.1Z\",\n       \"trades\": [\n         {\n           \"id\": \"1437229630\",\n           \"position_id\": \"0\",\n           \"quantity\": \"0.00010\",\n           \"price\": \"62884.78\",\n           \"fee\": \"0.005659630200\",\n           \"timestamp\": \"2021-10-26T08:55:55.1Z\",\n           \"taker\": true\n         }\n       ]\n     }",
          "{\n         \"id\": 58418961892,\n         \"client_order_id\": \"r42gdPjNMZN-H_xs8RKl2wljg_dfgdg4\",\n         \"symbol\": \"BTCUSDT_PERP\",\n         \"side\": \"buy\",\n         \"status\": \"new\",\n         \"type\": \"limit\",\n         \"time_in_force\": \"GTC\",\n         \"quantity\": \"0.0005\",\n         \"quantity_cumulative\": \"0\",\n         \"price\": \"30000.00\",\n         \"post_only\": false,\n         \"reduce_only\": false,\n         \"created_at\": \"2022-03-16T08:16:53.039Z\",\n         \"updated_at\": \"2022-03-16T08:16:53.039Z\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // limit\n        //     {\n        //       \"id\": 488953123149,\n        //       \"client_order_id\": \"103ad305301e4c3590045b13de15b36e\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"side\": \"buy\",\n        //       \"status\": \"new\",\n        //       \"type\": \"limit\",\n        //       \"time_in_force\": \"GTC\",\n        //       \"quantity\": \"0.00001\",\n        //       \"quantity_cumulative\": \"0\",\n        //       \"price\": \"0.01\",\n        //       \"price_average\": \"0.01\",\n        //       \"post_only\": false,\n        //       \"created_at\": \"2021-04-13T13:06:16.567Z\",\n        //       \"updated_at\": \"2021-04-13T13:06:16.567Z\"\n        //     }\n        //\n        // market\n        //     {\n        //       \"id\": \"685877626834\",\n        //       \"client_order_id\": \"Yshl7G-EjaREyXQYaGbsmdtVbW-nzQwu\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"side\": \"buy\",\n        //       \"status\": \"filled\",\n        //       \"type\": \"market\",\n        //       \"time_in_force\": \"GTC\",\n        //       \"quantity\": \"0.00010\",\n        //       \"quantity_cumulative\": \"0.00010\",\n        //       \"post_only\": false,\n        //       \"created_at\": \"2021-10-26T08:55:55.1Z\",\n        //       \"updated_at\": \"2021-10-26T08:55:55.1Z\",\n        //       \"trades\": [\n        //         {\n        //           \"id\": \"1437229630\",\n        //           \"position_id\": \"0\",\n        //           \"quantity\": \"0.00010\",\n        //           \"price\": \"62884.78\",\n        //           \"fee\": \"0.005659630200\",\n        //           \"timestamp\": \"2021-10-26T08:55:55.1Z\",\n        //           \"taker\": true\n        //         }\n        //       ]\n        //     }\n        //\n        // swap and margin\n        //\n        //     {\n        //         \"id\": 58418961892,\n        //         \"client_order_id\": \"r42gdPjNMZN-H_xs8RKl2wljg_dfgdg4\",\n        //         \"symbol\": \"BTCUSDT_PERP\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"new\",\n        //         \"type\": \"limit\",\n        //         \"time_in_force\": \"GTC\",\n        //         \"quantity\": \"0.0005\",\n        //         \"quantity_cumulative\": \"0\",\n        //         \"price\": \"30000.00\",\n        //         \"post_only\": false,\n        //         \"reduce_only\": false,\n        //         \"created_at\": \"2022-03-16T08:16:53.039Z\",\n        //         \"updated_at\": \"2022-03-16T08:16:53.039Z\"\n        //     }\n        //\n        const id = this.safeString (order, 'client_order_id');\n        // we use clientOrderId as the order id with this exchange intentionally\n        // because most of their endpoints will require clientOrderId\n        // explained here: https://github.com/ccxt/ccxt/issues/5674\n        const side = this.safeString (order, 'side');\n        const type = this.safeString (order, 'type');\n        const amount = this.safeString (order, 'quantity');\n        const price = this.safeString (order, 'price');\n        const average = this.safeString (order, 'price_average');\n        const created = this.safeString (order, 'created_at');\n        const timestamp = this.parse8601 (created);\n        const updated = this.safeString (order, 'updated_at');\n        let lastTradeTimestamp = undefined;\n        if (updated !== created) {\n            lastTradeTimestamp = this.parse8601 (updated);\n        }\n        const filled = this.safeString (order, 'quantity_cumulative');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const postOnly = this.safeValue (order, 'post_only');\n        const timeInForce = this.safeString (order, 'time_in_force');\n        const rawTrades = this.safeValue (order, 'trades');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'price': price,\n            'amount': amount,\n            'type': type,\n            'side': side,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeValue (order, 'reduce_only'),\n            'filled': filled,\n            'remaining': undefined,\n            'cost': undefined,\n            'status': status,\n            'average': average,\n            'trades': rawTrades,\n            'fee': undefined,\n            'triggerPrice': this.safeString (order, 'stop_price'),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2473,
        "line_end": 2483,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'open',\n            'suspended': 'open',\n            'partiallyFilled': 'open',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'expired': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3097,
        "line_end": 3182,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETHUSDT_PERP\",\n             \"type\": \"isolated\",\n             \"leverage\": \"10.00\",\n             \"created_at\": \"2022-03-19T07:54:35.24Z\",\n             \"updated_at\": \"2022-03-19T07:54:58.922Z\",\n             currencies\": [\n                 {\n                     \"code\": \"USDT\",\n                     \"margin_balance\": \"7.478100643043\",\n                     \"reserved_orders\": \"0\",\n                     \"reserved_positions\": \"0.303530761300\"\n                 }\n             ],\n             \"positions\": [\n                 {\n                     \"id\": 2470568,\n                     \"symbol\": \"ETHUSDT_PERP\",\n                     \"quantity\": \"0.001\",\n                     \"price_entry\": \"2927.509\",\n                     \"price_margin_call\": \"0\",\n                     \"price_liquidation\": \"0\",\n                     \"pnl\": \"0\",\n                     \"created_at\": \"2022-03-19T07:54:35.24Z\",\n                     \"updated_at\": \"2022-03-19T07:54:58.922Z\"\n                 }\n             ]\n         },\n     ]"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETHUSDT_PERP\",\n        //             \"type\": \"isolated\",\n        //             \"leverage\": \"10.00\",\n        //             \"created_at\": \"2022-03-19T07:54:35.24Z\",\n        //             \"updated_at\": \"2022-03-19T07:54:58.922Z\",\n        //             currencies\": [\n        //                 {\n        //                     \"code\": \"USDT\",\n        //                     \"margin_balance\": \"7.478100643043\",\n        //                     \"reserved_orders\": \"0\",\n        //                     \"reserved_positions\": \"0.303530761300\"\n        //                 }\n        //             ],\n        //             \"positions\": [\n        //                 {\n        //                     \"id\": 2470568,\n        //                     \"symbol\": \"ETHUSDT_PERP\",\n        //                     \"quantity\": \"0.001\",\n        //                     \"price_entry\": \"2927.509\",\n        //                     \"price_margin_call\": \"0\",\n        //                     \"price_liquidation\": \"0\",\n        //                     \"pnl\": \"0\",\n        //                     \"created_at\": \"2022-03-19T07:54:35.24Z\",\n        //                     \"updated_at\": \"2022-03-19T07:54:58.922Z\"\n        //                 }\n        //             ]\n        //         },\n        //     ]\n        //\n        const marginMode = this.safeString (position, 'type');\n        const leverage = this.safeNumber (position, 'leverage');\n        const datetime = this.safeString (position, 'updated_at');\n        const positions = this.safeValue (position, 'positions', []);\n        let liquidationPrice = undefined;\n        let entryPrice = undefined;\n        let contracts = undefined;\n        for (let i = 0; i < positions.length; i++) {\n            const entry = positions[i];\n            liquidationPrice = this.safeNumber (entry, 'price_liquidation');\n            entryPrice = this.safeNumber (entry, 'price_entry');\n            contracts = this.safeNumber (entry, 'quantity');\n        }\n        const currencies = this.safeValue (position, 'currencies', []);\n        let collateral = undefined;\n        for (let i = 0; i < currencies.length; i++) {\n            const entry = currencies[i];\n            collateral = this.safeNumber (entry, 'margin_balance');\n        }\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'notional': undefined,\n            'marginMode': marginMode,\n            'marginType': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': entryPrice,\n            'unrealizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': contracts,\n            'contractSize': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': undefined,\n            'hedged': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': collateral,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': leverage,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1227,
        "line_end": 1269,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"ask\": \"62756.01\",\n       \"bid\": \"62754.09\",\n       \"last\": \"62755.87\",\n       \"low\": \"62010.00\",\n       \"high\": \"66657.99\",\n       \"open\": \"65089.27\",\n       \"volume\": \"16719.50366\",\n       \"volume_quote\": \"1063422878.8156828\",\n       \"timestamp\": \"2021-10-22T07:29:14.585Z\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //       \"ask\": \"62756.01\",\n        //       \"bid\": \"62754.09\",\n        //       \"last\": \"62755.87\",\n        //       \"low\": \"62010.00\",\n        //       \"high\": \"66657.99\",\n        //       \"open\": \"65089.27\",\n        //       \"volume\": \"16719.50366\",\n        //       \"volume_quote\": \"1063422878.8156828\",\n        //       \"timestamp\": \"2021-10-22T07:29:14.585Z\"\n        //     }\n        //\n        const timestamp = this.parse8601 (ticker['timestamp']);\n        const symbol = this.safeSymbol (undefined, market);\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = this.safeString (ticker, 'volume_quote');\n        const open = this.safeString (ticker, 'open');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1366,
        "line_end": 1468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"id\": \"1569252895\",\n      \"position_id\": \"0\",\n      \"quantity\": \"10\",\n      \"price\": \"0.03919424\",\n      \"fee\": \"0.000979856000\",\n      \"timestamp\": \"2022-01-25T19:38:36.153Z\",\n      \"taker\": true\n  }",
          "{\n      \"id\": 974786185,\n      \"price\": \"0.032462\",\n      \"qty\": \"0.3673\",\n      \"side\": \"buy\",\n      \"timestamp\": \"2020-10-16T12:57:39.846Z\"\n  }",
          "{\n      \"id\": 277210397,\n      \"clientOrderId\": \"6e102f3e7f3f4e04aeeb1cdc95592f1a\",\n      \"orderId\": 28102855393,\n      \"symbol\": \"ETHBTC\",\n      \"side\": \"sell\",\n      \"quantity\": \"0.002\",\n      \"price\": \"0.073365\",\n      \"fee\": \"0.000000147\",\n      \"timestamp\": \"2018-04-28T18:39:55.345Z\",\n      \"taker\": true\n  }",
          "{\n      \"id\": 4718564,\n      \"order_id\": 58730811958,\n      \"client_order_id\": \"475c47d97f867f09726186eb22b4c3d4\",\n      \"symbol\": \"BTCUSDT_PERP\",\n      \"side\": \"sell\",\n      \"quantity\": \"0.0001\",\n      \"price\": \"41118.51\",\n      \"fee\": \"0.002055925500\",\n      \"timestamp\": \"2022-03-17T05:23:17.795Z\",\n      \"taker\": true,\n      \"position_id\": 2350122,\n      \"pnl\": \"0.002255000000\",\n      \"liquidation\": false\n  }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // createOrder (market)\n        //\n        //  {\n        //      \"id\": \"1569252895\",\n        //      \"position_id\": \"0\",\n        //      \"quantity\": \"10\",\n        //      \"price\": \"0.03919424\",\n        //      \"fee\": \"0.000979856000\",\n        //      \"timestamp\": \"2022-01-25T19:38:36.153Z\",\n        //      \"taker\": true\n        //  }\n        //\n        // fetchTrades\n        //\n        //  {\n        //      \"id\": 974786185,\n        //      \"price\": \"0.032462\",\n        //      \"qty\": \"0.3673\",\n        //      \"side\": \"buy\",\n        //      \"timestamp\": \"2020-10-16T12:57:39.846Z\"\n        //  }\n        //\n        // fetchMyTrades spot\n        //\n        //  {\n        //      \"id\": 277210397,\n        //      \"clientOrderId\": \"6e102f3e7f3f4e04aeeb1cdc95592f1a\",\n        //      \"orderId\": 28102855393,\n        //      \"symbol\": \"ETHBTC\",\n        //      \"side\": \"sell\",\n        //      \"quantity\": \"0.002\",\n        //      \"price\": \"0.073365\",\n        //      \"fee\": \"0.000000147\",\n        //      \"timestamp\": \"2018-04-28T18:39:55.345Z\",\n        //      \"taker\": true\n        //  }\n        //\n        // fetchMyTrades swap and margin\n        //\n        //  {\n        //      \"id\": 4718564,\n        //      \"order_id\": 58730811958,\n        //      \"client_order_id\": \"475c47d97f867f09726186eb22b4c3d4\",\n        //      \"symbol\": \"BTCUSDT_PERP\",\n        //      \"side\": \"sell\",\n        //      \"quantity\": \"0.0001\",\n        //      \"price\": \"41118.51\",\n        //      \"fee\": \"0.002055925500\",\n        //      \"timestamp\": \"2022-03-17T05:23:17.795Z\",\n        //      \"taker\": true,\n        //      \"position_id\": 2350122,\n        //      \"pnl\": \"0.002255000000\",\n        //      \"liquidation\": false\n        //  }\n        //\n        const timestamp = this.parse8601 (trade['timestamp']);\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        const taker = this.safeValue (trade, 'taker');\n        let takerOrMaker: string;\n        if (taker !== undefined) {\n            takerOrMaker = taker ? 'taker' : 'maker';\n        } else {\n            takerOrMaker = 'taker'; // the only case when `taker` field is missing, is public fetchTrades and it must be taker\n        }\n        if (feeCostString !== undefined) {\n            const info = this.safeValue (market, 'info', {});\n            const feeCurrency = this.safeString (info, 'fee_currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrency);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        // we use clientOrderId as the order id with this exchange intentionally\n        // because most of their endpoints will require clientOrderId\n        // explained here: https://github.com/ccxt/ccxt/issues/5674\n        const orderId = this.safeString2 (trade, 'clientOrderId', 'client_order_id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString2 (trade, 'quantity', 'qty');\n        const side = this.safeString (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1721,
        "line_end": 1741,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"ARVUSDT\", // returned from fetchTradingFees only\n         \"take_rate\":\"0.0009\",\n         \"make_rate\":\"0.0009\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\":\"ARVUSDT\", // returned from fetchTradingFees only\n        //         \"take_rate\":\"0.0009\",\n        //         \"make_rate\":\"0.0009\"\n        //     }\n        //\n        const taker = this.safeNumber (fee, 'take_rate');\n        const maker = this.safeNumber (fee, 'make_rate');\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'taker': taker,\n            'maker': maker,\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1533,
        "line_end": 1617,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txhash",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": \"101609495\",\n       \"created_at\": \"2018-03-06T22:05:06.507Z\",\n       \"updated_at\": \"2018-03-06T22:11:45.03Z\",\n       \"status\": \"SUCCESS\",\n       \"type\": \"DEPOSIT\", // DEPOSIT, WITHDRAW, ..\n       \"subtype\": \"BLOCKCHAIN\",\n       \"native\": {\n         \"tx_id\": \"e20b0965-4024-44d0-b63f-7fb8996a6706\",\n         \"index\": \"881652766\",\n         \"currency\": \"ETH\",\n         \"amount\": \"0.01418088\",\n         \"hash\": \"d95dbbff3f9234114f1211ab0ba2a94f03f394866fd5749d74a1edab80e6c5d3\",\n         \"address\": \"0xd9259302c32c0a0295d86a39185c9e14f6ba0a0d\",\n         \"confirmations\": \"20\",\n         \"senders\": [\n           \"0x243bec9256c9a3469da22103891465b47583d9f1\"\n         ],\n         \"fee\": \"1.22\" // only for WITHDRAW\n       }\n     },",
          "{\n         \"id\":\"084cfcd5-06b9-4826-882e-fdb75ec3625d\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // transaction\n        //\n        //     {\n        //       \"id\": \"101609495\",\n        //       \"created_at\": \"2018-03-06T22:05:06.507Z\",\n        //       \"updated_at\": \"2018-03-06T22:11:45.03Z\",\n        //       \"status\": \"SUCCESS\",\n        //       \"type\": \"DEPOSIT\", // DEPOSIT, WITHDRAW, ..\n        //       \"subtype\": \"BLOCKCHAIN\",\n        //       \"native\": {\n        //         \"tx_id\": \"e20b0965-4024-44d0-b63f-7fb8996a6706\",\n        //         \"index\": \"881652766\",\n        //         \"currency\": \"ETH\",\n        //         \"amount\": \"0.01418088\",\n        //         \"hash\": \"d95dbbff3f9234114f1211ab0ba2a94f03f394866fd5749d74a1edab80e6c5d3\",\n        //         \"address\": \"0xd9259302c32c0a0295d86a39185c9e14f6ba0a0d\",\n        //         \"confirmations\": \"20\",\n        //         \"senders\": [\n        //           \"0x243bec9256c9a3469da22103891465b47583d9f1\"\n        //         ],\n        //         \"fee\": \"1.22\" // only for WITHDRAW\n        //       }\n        //     },\n        //     \"operation_id\": \"084cfcd5-06b9-4826-882e-fdb75ec3625d\", // only for WITHDRAW\n        //     \"commit_risk\": {}\n        // withdraw\n        //\n        //     {\n        //         \"id\":\"084cfcd5-06b9-4826-882e-fdb75ec3625d\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'operation_id', 'id');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n        const updated = this.parse8601 (this.safeString (transaction, 'updated_at'));\n        const type = this.parseTransactionType (this.safeString (transaction, 'type'));\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const native = this.safeValue (transaction, 'native', {});\n        const currencyId = this.safeString (native, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const txhash = this.safeString (native, 'hash');\n        const address = this.safeString (native, 'address');\n        const addressTo = address;\n        const tag = this.safeString (native, 'payment_id');\n        const tagTo = tag;\n        const sender = this.safeValue (native, 'senders');\n        const addressFrom = this.safeString (sender, 0);\n        const amount = this.safeNumber (native, 'amount');\n        const subType = this.safeString (transaction, 'subtype');\n        const internal = subType === 'OFFCHAIN';\n        // https://api.hitbtc.com/#check-if-offchain-is-available\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        const feeCost = this.safeNumber (native, 'fee');\n        if (feeCost !== undefined) {\n            fee['currency'] = code;\n            fee['cost'] = feeCost;\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txhash,\n            'type': type,\n            'currency': code,\n            'network': undefined,\n            'amount': amount,\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'updated': updated,\n            'comment': undefined,\n            'internal': internal,\n            'fee': fee,\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1514,
        "line_end": 1523,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'CREATED': 'pending',\n            'PENDING': 'pending',\n            'FAILED': 'failed',\n            'ROLLED_BACK': 'failed',\n            'SUCCESS': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 1525,
        "line_end": 1531,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'DEPOSIT': 'deposit',\n            'WITHDRAW': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2718,
        "line_end": 2737,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 0)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "[\n         \"2db6ebab-fb26-4537-9ef8-1a689472d236\"\n     ]"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     [\n        //         \"2db6ebab-fb26-4537-9ef8-1a689472d236\"\n        //     ]\n        //\n        return {\n            'id': this.safeString (transfer, 0),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n            'info': transfer,\n        };\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      }
    ],
    "bigone": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1397,
        "line_end": 1414,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const balances = this.safeList (response, 'data', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const symbol = this.safeString (balance, 'asset_symbol');\n            const code = this.safeCurrencyCode (symbol);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'balance');\n            account['used'] = this.safeString (balance, 'locked_balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseContractBidsAsks",
        "signature": "parseContractBidsAsks (bidsAsks)",
        "line_start": 1098,
        "line_end": 1107,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseContractBidsAsks (bidsAsks) {\n        const bidsAsksKeys = Object.keys (bidsAsks);\n        const result = [];\n        for (let i = 0; i < bidsAsksKeys.length; i++) {\n            const price = bidsAsksKeys[i];\n            const amount = bidsAsks[price];\n            result.push ([ this.parseNumber (price), this.parseNumber (amount) ]);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseContractOrderBook",
        "signature": "parseContractOrderBook (orderbook: object, symbol: string, limit: Int = undefined): OrderBook",
        "line_start": 1109,
        "line_end": 1122,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "bids",
            "value": "this.filterByLimit (this.sortBy (bids, 0, true), limit)",
            "comment": null
          },
          {
            "key": "asks",
            "value": "this.filterByLimit (this.sortBy (asks, 0), limit)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nonce",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseContractOrderBook (orderbook: object, symbol: string, limit: Int = undefined): OrderBook {\n        const responseBids = this.safeValue (orderbook, 'bids');\n        const responseAsks = this.safeValue (orderbook, 'asks');\n        const bids = this.parseContractBidsAsks (responseBids);\n        const asks = this.parseContractBidsAsks (responseAsks);\n        return {\n            'symbol': symbol,\n            'bids': this.filterByLimit (this.sortBy (bids, 0, true), limit),\n            'asks': this.filterByLimit (this.sortBy (asks, 0), limit),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'nonce': undefined,\n        } as any;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1305,
        "line_end": 1324,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"close\": \"0.021562\",\n         \"high\": \"0.021563\",\n         \"low\": \"0.02156\",\n         \"open\": \"0.021563\",\n         \"time\": \"2019-11-21T07:54:00Z\",\n         \"volume\": \"59.84376\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"close\": \"0.021562\",\n        //         \"high\": \"0.021563\",\n        //         \"low\": \"0.02156\",\n        //         \"open\": \"0.021563\",\n        //         \"time\": \"2019-11-21T07:54:00Z\",\n        //         \"volume\": \"59.84376\"\n        //     }\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'time')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1458,
        "line_end": 1531,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.parse8601 (this.safeString (order, 'updated_at'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "this.safeBool (order, 'post_only')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'avg_deal_price')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'state'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\": \"42154072252\",\n        \"asset_pair_name\": \"SOL-USDT\",\n        \"price\": \"20\",\n        \"amount\": \"0.5\",\n        \"filled_amount\": \"0\",\n        \"avg_deal_price\": \"0\",\n        \"side\": \"ASK\",\n        \"state\": \"PENDING\",\n        \"created_at\": \"2023-09-13T03:42:00Z\",\n        \"updated_at\": \"2023-09-13T03:42:00Z\",\n        \"type\": \"LIMIT\",\n        \"stop_price\": \"0\",\n        \"immediate_or_cancel\": false,\n        \"post_only\": false,\n        \"client_order_id\": ''\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //    {\n        //        \"id\": \"42154072252\",\n        //        \"asset_pair_name\": \"SOL-USDT\",\n        //        \"price\": \"20\",\n        //        \"amount\": \"0.5\",\n        //        \"filled_amount\": \"0\",\n        //        \"avg_deal_price\": \"0\",\n        //        \"side\": \"ASK\",\n        //        \"state\": \"PENDING\",\n        //        \"created_at\": \"2023-09-13T03:42:00Z\",\n        //        \"updated_at\": \"2023-09-13T03:42:00Z\",\n        //        \"type\": \"LIMIT\",\n        //        \"stop_price\": \"0\",\n        //        \"immediate_or_cancel\": false,\n        //        \"post_only\": false,\n        //        \"client_order_id\": ''\n        //    }\n        //\n        const id = this.safeString (order, 'id');\n        const marketId = this.safeString (order, 'asset_pair_name');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n        let side = this.safeString (order, 'side');\n        if (side === 'BID') {\n            side = 'buy';\n        } else {\n            side = 'sell';\n        }\n        let triggerPrice = this.safeString (order, 'stop_price');\n        if (Precise.stringEq (triggerPrice, '0')) {\n            triggerPrice = undefined;\n        }\n        const immediateOrCancel = this.safeBool (order, 'immediate_or_cancel');\n        let timeInForce = undefined;\n        if (immediateOrCancel) {\n            timeInForce = 'IOC';\n        }\n        const type = this.parseType (this.safeString (order, 'type'));\n        const price = this.safeString (order, 'price');\n        let amount = undefined;\n        let filled = undefined;\n        let cost = undefined;\n        if (type === 'market' && side === 'buy') {\n            cost = this.safeString (order, 'filled_amount');\n        } else {\n            amount = this.safeString (order, 'amount');\n            filled = this.safeString (order, 'filled_amount');\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.parse8601 (this.safeString (order, 'updated_at')),\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': this.safeBool (order, 'post_only'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': this.safeString (order, 'avg_deal_price'),\n            'filled': filled,\n            'remaining': undefined,\n            'status': this.parseOrderStatus (this.safeString (order, 'state')),\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1877,
        "line_end": 1884,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'PENDING': 'open',\n            'FILLED': 'closed',\n            'CANCELLED': 'canceled',\n        };\n        return this.safeString (statuses, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 792,
        "line_end": 869,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'high', 'last24hMaxPrice')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'low', 'last24hMinPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (bid, 'price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (bid, 'quantity')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ask, 'price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ask, 'quantity')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'daily_change')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'volume', 'volume24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'volume24hInUsd')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset_pair_name\": \"ETH-BTC\",\n        \"bid\": {\n            \"price\": \"0.021593\",\n            \"order_count\": 1,\n            \"quantity\": \"0.20936\"\n        },\n        \"ask\": {\n            \"price\": \"0.021613\",\n            \"order_count\": 1,\n            \"quantity\": \"2.87064\"\n        },\n        \"open\": \"0.021795\",\n        \"high\": \"0.021795\",\n        \"low\": \"0.021471\",\n        \"close\": \"0.021613\",\n        \"volume\": \"117078.90431\",\n        \"daily_change\": \"-0.000182\"\n    }",
          "{\n        \"usdtPrice\": 1.00031998,\n        \"symbol\": \"BTCUSD\",\n        \"btcPrice\": 34700.4,\n        \"ethPrice\": 1787.83,\n        \"nextFundingRate\": 0.00010,\n        \"fundingRate\": 0.00010,\n        \"latestPrice\": 34708.5,\n        \"last24hPriceChange\": 0.0321,\n        \"indexPrice\": 34700.4,\n        \"volume24h\": 261319063,\n        \"turnover24h\": 8204.129380685496,\n        \"nextFundingTime\": 1698285600000,\n        \"markPrice\": 34702.4646738,\n        \"last24hMaxPrice\": 35127.5,\n        \"volume24hInUsd\": 0.0,\n        \"openValue\": 32.88054722085945,\n        \"last24hMinPrice\": 33552.0,\n        \"openInterest\": 1141372.0\n    }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot\n        //\n        //    {\n        //        \"asset_pair_name\": \"ETH-BTC\",\n        //        \"bid\": {\n        //            \"price\": \"0.021593\",\n        //            \"order_count\": 1,\n        //            \"quantity\": \"0.20936\"\n        //        },\n        //        \"ask\": {\n        //            \"price\": \"0.021613\",\n        //            \"order_count\": 1,\n        //            \"quantity\": \"2.87064\"\n        //        },\n        //        \"open\": \"0.021795\",\n        //        \"high\": \"0.021795\",\n        //        \"low\": \"0.021471\",\n        //        \"close\": \"0.021613\",\n        //        \"volume\": \"117078.90431\",\n        //        \"daily_change\": \"-0.000182\"\n        //    }\n        //\n        // contract\n        //\n        //    {\n        //        \"usdtPrice\": 1.00031998,\n        //        \"symbol\": \"BTCUSD\",\n        //        \"btcPrice\": 34700.4,\n        //        \"ethPrice\": 1787.83,\n        //        \"nextFundingRate\": 0.00010,\n        //        \"fundingRate\": 0.00010,\n        //        \"latestPrice\": 34708.5,\n        //        \"last24hPriceChange\": 0.0321,\n        //        \"indexPrice\": 34700.4,\n        //        \"volume24h\": 261319063,\n        //        \"turnover24h\": 8204.129380685496,\n        //        \"nextFundingTime\": 1698285600000,\n        //        \"markPrice\": 34702.4646738,\n        //        \"last24hMaxPrice\": 35127.5,\n        //        \"volume24hInUsd\": 0.0,\n        //        \"openValue\": 32.88054722085945,\n        //        \"last24hMinPrice\": 33552.0,\n        //        \"openInterest\": 1141372.0\n        //    }\n        //\n        const marketType = ('asset_pair_name' in ticker) ? 'spot' : 'swap';\n        const marketId = this.safeString2 (ticker, 'asset_pair_name', 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '-', marketType);\n        const close = this.safeString2 (ticker, 'close', 'latestPrice');\n        const bid = this.safeDict (ticker, 'bid', {});\n        const ask = this.safeDict (ticker, 'ask', {});\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString2 (ticker, 'high', 'last24hMaxPrice'),\n            'low': this.safeString2 (ticker, 'low', 'last24hMinPrice'),\n            'bid': this.safeString (bid, 'price'),\n            'bidVolume': this.safeString (bid, 'quantity'),\n            'ask': this.safeString (ask, 'price'),\n            'askVolume': this.safeString (ask, 'quantity'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'), // openValue is a broken number, we don't use it\n            'close': close,\n            'last': close,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'daily_change'), // last24hPriceChange is incorrect value, eg see PUMPUSDT contract\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'volume', 'volume24h'),\n            'quoteVolume': this.safeString (ticker, 'volume24hInUsd'),\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1124,
        "line_end": 1257,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 38199941,\n         \"price\": \"3378.67\",\n         \"amount\": \"0.019812\",\n         \"taker_side\": \"ASK\",\n         \"created_at\": \"2019-01-29T06:05:56Z\"\n     }",
          "{\n         \"id\": 10854280,\n         \"asset_pair_name\": \"XIN-USDT\",\n         \"price\": \"70\",\n         \"amount\": \"1\",\n         \"taker_side\": \"ASK\",\n         \"maker_order_id\": 58284908,\n         \"taker_order_id\": 58284909,\n         \"maker_fee\": \"0.0008\",\n         \"taker_fee\": \"0.07\",\n         \"side\": \"SELF_TRADING\",\n         \"inserted_at\": \"2019-04-16T12:00:01Z\"\n     },",
          "{\n         \"id\": 10854263,\n         \"asset_pair_name\": \"XIN-USDT\",\n         \"price\": \"75.7\",\n         \"amount\": \"12.743149\",\n         \"taker_side\": \"BID\",\n         \"maker_order_id\": null,\n         \"taker_order_id\": 58284888,\n         \"maker_fee\": null,\n         \"taker_fee\": \"0.0025486298\",\n         \"side\": \"BID\",\n         \"inserted_at\": \"2019-04-15T06:20:57Z\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"id\": 38199941,\n        //         \"price\": \"3378.67\",\n        //         \"amount\": \"0.019812\",\n        //         \"taker_side\": \"ASK\",\n        //         \"created_at\": \"2019-01-29T06:05:56Z\"\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"id\": 10854280,\n        //         \"asset_pair_name\": \"XIN-USDT\",\n        //         \"price\": \"70\",\n        //         \"amount\": \"1\",\n        //         \"taker_side\": \"ASK\",\n        //         \"maker_order_id\": 58284908,\n        //         \"taker_order_id\": 58284909,\n        //         \"maker_fee\": \"0.0008\",\n        //         \"taker_fee\": \"0.07\",\n        //         \"side\": \"SELF_TRADING\",\n        //         \"inserted_at\": \"2019-04-16T12:00:01Z\"\n        //     },\n        //\n        //     {\n        //         \"id\": 10854263,\n        //         \"asset_pair_name\": \"XIN-USDT\",\n        //         \"price\": \"75.7\",\n        //         \"amount\": \"12.743149\",\n        //         \"taker_side\": \"BID\",\n        //         \"maker_order_id\": null,\n        //         \"taker_order_id\": 58284888,\n        //         \"maker_fee\": null,\n        //         \"taker_fee\": \"0.0025486298\",\n        //         \"side\": \"BID\",\n        //         \"inserted_at\": \"2019-04-15T06:20:57Z\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString2 (trade, 'created_at', 'inserted_at'));\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const marketId = this.safeString (trade, 'asset_pair_name');\n        market = this.safeMarket (marketId, market, '-');\n        let side = this.safeString (trade, 'side');\n        const takerSide = this.safeString (trade, 'taker_side');\n        let takerOrMaker: Str = undefined;\n        if ((takerSide !== undefined) && (side !== undefined) && (side !== 'SELF_TRADING')) {\n            takerOrMaker = (takerSide === side) ? 'taker' : 'maker';\n        }\n        if (side === undefined) {\n            // taker side is not related to buy/sell side\n            // the following code is probably a mistake\n            side = (takerSide === 'ASK') ? 'sell' : 'buy';\n        } else {\n            if (side === 'BID') {\n                side = 'buy';\n            } else if (side === 'ASK') {\n                side = 'sell';\n            }\n        }\n        const makerOrderId = this.safeString (trade, 'maker_order_id');\n        const takerOrderId = this.safeString (trade, 'taker_order_id');\n        let orderId: Str = undefined;\n        if (makerOrderId !== undefined) {\n            orderId = makerOrderId;\n        } else if (takerOrderId !== undefined) {\n            orderId = takerOrderId;\n        }\n        const id = this.safeString (trade, 'id');\n        const result: Dict = {\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': orderId,\n            'type': 'limit',\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'info': trade,\n        };\n        let makerCurrencyCode: string;\n        let takerCurrencyCode: string;\n        if (takerOrMaker !== undefined) {\n            if (side === 'buy') {\n                if (takerOrMaker === 'maker') {\n                    makerCurrencyCode = market['base'];\n                    takerCurrencyCode = market['quote'];\n                } else {\n                    makerCurrencyCode = market['quote'];\n                    takerCurrencyCode = market['base'];\n                }\n            } else {\n                if (takerOrMaker === 'maker') {\n                    makerCurrencyCode = market['quote'];\n                    takerCurrencyCode = market['base'];\n                } else {\n                    makerCurrencyCode = market['base'];\n                    takerCurrencyCode = market['quote'];\n                }\n            }\n        } else if (side === 'SELF_TRADING') {\n            if (takerSide === 'BID') {\n                makerCurrencyCode = market['quote'];\n                takerCurrencyCode = market['base'];\n            } else if (takerSide === 'ASK') {\n                makerCurrencyCode = market['base'];\n                takerCurrencyCode = market['quote'];\n            }\n        }\n        const makerFeeCost = this.safeString (trade, 'maker_fee');\n        const takerFeeCost = this.safeString (trade, 'taker_fee');\n        if (makerFeeCost !== undefined) {\n            if (takerFeeCost !== undefined) {\n                result['fees'] = [\n                    { 'cost': makerFeeCost, 'currency': makerCurrencyCode },\n                    { 'cost': takerFeeCost, 'currency': takerCurrencyCode },\n                ];\n            } else {\n                result['fee'] = { 'cost': makerFeeCost, 'currency': makerCurrencyCode };\n            }\n        } else if (takerFeeCost !== undefined) {\n            result['fee'] = { 'cost': takerFeeCost, 'currency': takerCurrencyCode };\n        } else {\n            result['fee'] = undefined;\n        }\n        return this.safeTrade (result as any, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2026,
        "line_end": 2112,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": \"25.0\",\n         \"asset_symbol\": \"BTS\"\n         \"confirms\": 100,\n         \"id\": 5,\n         \"inserted_at\": \"2018-02-16T11:39:58.000Z\",\n         \"is_internal\": false,\n         \"kind\": \"default\",\n         \"memo\": \"\",\n         \"state\": \"WITHHOLD\",\n         \"txid\": \"72e03037d144dae3d32b68b5045462b1049a0755\",\n         \"updated_at\": \"2018-11-09T10:20:09.000Z\",\n     }",
          "{\n         \"amount\": \"5\",\n         \"asset_symbol\": \"ETH\",\n         \"completed_at\": \"2018-03-15T16:13:45.610463Z\",\n         \"customer_id\": \"10\",\n         \"id\": 10,\n         \"inserted_at\": \"2018-03-15T16:13:45.610463Z\",\n         \"is_internal\": true,\n         \"note\": \"2018-03-15T16:13:45.610463Z\",\n         \"state\": \"CONFIRMED\",\n         \"target_address\": \"0x4643bb6b393ac20a6175c713175734a72517c63d6f7\"\n         \"txid\": \"0x4643bb6b393ac20a6175c713175734a72517c63d6f73a3ca90a15356f2e967da0\",\n     }",
          "{\n         \"id\":1077391,\n         \"customer_id\":1082679,\n         \"amount\":\"21.9000000000000000\",\n         \"txid\":\"\",\n         \"is_internal\":false,\n         \"kind\":\"on_chain\",\n         \"state\":\"PENDING\",\n         \"inserted_at\":\"2020-06-03T00:50:57+00:00\",\n         \"updated_at\":\"2020-06-03T00:50:57+00:00\",\n         \"memo\":\"\",\n         \"target_address\":\"rDYtYT3dBeuw376rvHqoZBKW3UmvguoBAf\",\n         \"fee\":\"0.1000000000000000\",\n         \"asset_symbol\":\"XRP\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"amount\": \"25.0\",\n        //         \"asset_symbol\": \"BTS\"\n        //         \"confirms\": 100,\n        //         \"id\": 5,\n        //         \"inserted_at\": \"2018-02-16T11:39:58.000Z\",\n        //         \"is_internal\": false,\n        //         \"kind\": \"default\",\n        //         \"memo\": \"\",\n        //         \"state\": \"WITHHOLD\",\n        //         \"txid\": \"72e03037d144dae3d32b68b5045462b1049a0755\",\n        //         \"updated_at\": \"2018-11-09T10:20:09.000Z\",\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"amount\": \"5\",\n        //         \"asset_symbol\": \"ETH\",\n        //         \"completed_at\": \"2018-03-15T16:13:45.610463Z\",\n        //         \"customer_id\": \"10\",\n        //         \"id\": 10,\n        //         \"inserted_at\": \"2018-03-15T16:13:45.610463Z\",\n        //         \"is_internal\": true,\n        //         \"note\": \"2018-03-15T16:13:45.610463Z\",\n        //         \"state\": \"CONFIRMED\",\n        //         \"target_address\": \"0x4643bb6b393ac20a6175c713175734a72517c63d6f7\"\n        //         \"txid\": \"0x4643bb6b393ac20a6175c713175734a72517c63d6f73a3ca90a15356f2e967da0\",\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\":1077391,\n        //         \"customer_id\":1082679,\n        //         \"amount\":\"21.9000000000000000\",\n        //         \"txid\":\"\",\n        //         \"is_internal\":false,\n        //         \"kind\":\"on_chain\",\n        //         \"state\":\"PENDING\",\n        //         \"inserted_at\":\"2020-06-03T00:50:57+00:00\",\n        //         \"updated_at\":\"2020-06-03T00:50:57+00:00\",\n        //         \"memo\":\"\",\n        //         \"target_address\":\"rDYtYT3dBeuw376rvHqoZBKW3UmvguoBAf\",\n        //         \"fee\":\"0.1000000000000000\",\n        //         \"asset_symbol\":\"XRP\"\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'asset_symbol');\n        const code = this.safeCurrencyCode (currencyId);\n        const id = this.safeString (transaction, 'id');\n        const amount = this.safeNumber (transaction, 'amount');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const timestamp = this.parse8601 (this.safeString (transaction, 'inserted_at'));\n        const updated = this.parse8601 (this.safeString2 (transaction, 'updated_at', 'completed_at'));\n        const txid = this.safeString (transaction, 'txid');\n        const address = this.safeString (transaction, 'target_address');\n        const tag = this.safeString (transaction, 'memo');\n        const type = ('customer_id' in transaction) ? 'withdrawal' : 'deposit';\n        const internal = this.safeBool (transaction, 'is_internal');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': undefined,\n            'addressTo': address,\n            'tagFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'fee': undefined,\n            'comment': undefined,\n            'internal': internal,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2014,
        "line_end": 2024,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // what are other statuses here?\n            'WITHHOLD': 'ok', // deposits\n            'UNCONFIRMED': 'pending',\n            'CONFIRMED': 'ok', // withdrawals\n            'COMPLETED': 'ok',\n            'PENDING': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2267,
        "line_end": 2286,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (code)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 0,\n         \"data\": null\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"data\": null\n        //     }\n        //\n        const code = this.safeString (transfer, 'code');\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': undefined,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.parseTransferStatus (code),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 2288,
        "line_end": 2293,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            '0': 'ok',\n        };\n        return this.safeString (statuses, status, 'failed');\n    }"
      },
      {
        "name": "parseType",
        "signature": "parseType (type: string)",
        "line_start": 1448,
        "line_end": 1456,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseType (type: string) {\n        const types: Dict = {\n            'STOP_LIMIT': 'limit',\n            'STOP_MARKET': 'market',\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      }
    ],
    "binance": [
      {
        "name": "parseAccountPosition",
        "signature": "parseAccountPosition (position, market: Market = undefined)",
        "line_start": 10081,
        "line_end": 10329,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "initialMargin",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"WLDUSDT\",\n        \"positionSide\": \"BOTH\",\n        \"positionAmt\": \"-849\",\n        \"unrealizedProfit\": \"11.17920750\",\n        \"notional\": \"-1992.46079250\",\n        \"isolatedMargin\": \"0\",\n        \"isolatedWallet\": \"0\",\n        \"initialMargin\": \"99.62303962\",\n        \"maintMargin\": \"11.95476475\",\n        \"updateTime\": \"1721995760449\"\n        \"leverage\": \"50\",                        // in v2\n        \"entryPrice\": \"2.34\",                    // in v2\n        \"positionInitialMargin\": \"118.82116614\", // in v2\n        \"openOrderInitialMargin\": \"0\",           // in v2\n        \"isolated\": false,                       // in v2\n        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        \"maxNotional\": \"25000\",                  // in v2\n        \"bidNotional\": \"0\",                      // in v2\n        \"askNotional\": \"0\"                       // in v2\n    }",
          "{\n       \"symbol\": \"BTCUSD_210625\",\n       \"initialMargin\": \"0.00024393\",\n       \"maintMargin\": \"0.00002439\",\n       \"unrealizedProfit\": \"-0.00000163\",\n       \"positionInitialMargin\": \"0.00024393\",\n       \"openOrderInitialMargin\": \"0\",\n       \"leverage\": \"10\",\n       \"isolated\": false,\n       \"positionSide\": \"BOTH\",\n       \"entryPrice\": \"41021.20000069\",\n       \"maxQty\": \"100\",\n       \"notionalValue\": \"0.00243939\",\n       \"isolatedWallet\": \"0\",\n       \"crossMargin\": \"0.314\"\n       \"crossWalletBalance\": \"34\",\n     }",
          "{\n         \"symbol\": \"CTSIUSDT\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.0\",\n         \"maxNotional\": \"25000\",\n         \"bidNotional\": \"0\",\n         \"askNotional\": \"0\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"updateTime\": 0,\n         \"notional\": \"0\",\n         \"breakEvenPrice\": \"0.0\"\n     }",
          "{\n         \"symbol\": \"TRXUSD_PERP\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.00000000\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"maxQty\": \"5000000\",\n         \"updateTime\": 0,\n         \"notionalValue\": \"0\",\n         \"breakEvenPrice\": \"0.00000000\"\n     }"
        ],
        "source": "parseAccountPosition (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        // v3 (similar for cross & isolated)\n        //\n        //    {\n        //        \"symbol\": \"WLDUSDT\",\n        //        \"positionSide\": \"BOTH\",\n        //        \"positionAmt\": \"-849\",\n        //        \"unrealizedProfit\": \"11.17920750\",\n        //        \"notional\": \"-1992.46079250\",\n        //        \"isolatedMargin\": \"0\",\n        //        \"isolatedWallet\": \"0\",\n        //        \"initialMargin\": \"99.62303962\",\n        //        \"maintMargin\": \"11.95476475\",\n        //        \"updateTime\": \"1721995760449\"\n        //        \"leverage\": \"50\",                        // in v2\n        //        \"entryPrice\": \"2.34\",                    // in v2\n        //        \"positionInitialMargin\": \"118.82116614\", // in v2\n        //        \"openOrderInitialMargin\": \"0\",           // in v2\n        //        \"isolated\": false,                       // in v2\n        //        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        //        \"maxNotional\": \"25000\",                  // in v2\n        //        \"bidNotional\": \"0\",                      // in v2\n        //        \"askNotional\": \"0\"                       // in v2\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_210625\",\n        //       \"initialMargin\": \"0.00024393\",\n        //       \"maintMargin\": \"0.00002439\",\n        //       \"unrealizedProfit\": \"-0.00000163\",\n        //       \"positionInitialMargin\": \"0.00024393\",\n        //       \"openOrderInitialMargin\": \"0\",\n        //       \"leverage\": \"10\",\n        //       \"isolated\": false,\n        //       \"positionSide\": \"BOTH\",\n        //       \"entryPrice\": \"41021.20000069\",\n        //       \"maxQty\": \"100\",\n        //       \"notionalValue\": \"0.00243939\",\n        //       \"isolatedWallet\": \"0\",\n        //       \"crossMargin\": \"0.314\"\n        //       \"crossWalletBalance\": \"34\",\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"CTSIUSDT\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.0\",\n        //         \"maxNotional\": \"25000\",\n        //         \"bidNotional\": \"0\",\n        //         \"askNotional\": \"0\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"updateTime\": 0,\n        //         \"notional\": \"0\",\n        //         \"breakEvenPrice\": \"0.0\"\n        //     }\n        //\n        // inverse portoflio margin\n        //\n        //     {\n        //         \"symbol\": \"TRXUSD_PERP\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.00000000\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"maxQty\": \"5000000\",\n        //         \"updateTime\": 0,\n        //         \"notionalValue\": \"0\",\n        //         \"breakEvenPrice\": \"0.00000000\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const leverageString = this.safeString (position, 'leverage');\n        const leverage = (leverageString !== undefined) ? parseInt (leverageString) : undefined;\n        const initialMarginString = this.safeString (position, 'initialMargin');\n        const initialMargin = this.parseNumber (initialMarginString);\n        let initialMarginPercentageString = undefined;\n        if (leverageString !== undefined) {\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            const rational = this.isRoundNumber (1000 % leverage);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringDiv (Precise.stringAdd (initialMarginPercentageString, '1e-8'), '1', 8);\n            }\n        }\n        // as oppose to notionalValue\n        const usdm = ('notional' in position);\n        const maintenanceMarginString = this.safeString (position, 'maintMargin');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        let entryPrice = this.parseNumber (entryPriceString);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        const notional = this.parseNumber (notionalStringAbs);\n        let contractsString = this.safeString (position, 'positionAmt');\n        let contractsStringAbs = Precise.stringAbs (contractsString);\n        if (contractsString === undefined) {\n            const entryNotional = Precise.stringMul (Precise.stringMul (leverageString, initialMarginString), entryPriceString);\n            const contractSizeNew = this.safeString (market, 'contractSize');\n            contractsString = Precise.stringDiv (entryNotional, contractSizeNew);\n            contractsStringAbs = Precise.stringDiv (Precise.stringAdd (contractsString, '0.5'), '1', 0);\n        }\n        const contracts = this.parseNumber (contractsStringAbs);\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        const unrealizedPnlString = this.safeString (position, 'unrealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        let isolated = this.safeBool (position, 'isolated');\n        if (isolated === undefined) {\n            const isolatedMarginRaw = this.safeString (position, 'isolatedMargin');\n            isolated = !Precise.stringEq (isolatedMarginRaw, '0');\n        }\n        let marginMode = undefined;\n        let collateralString = undefined;\n        let walletBalance = undefined;\n        if (isolated) {\n            marginMode = 'isolated';\n            walletBalance = this.safeString (position, 'isolatedWallet');\n            collateralString = Precise.stringAdd (walletBalance, unrealizedPnlString);\n        } else {\n            marginMode = 'cross';\n            walletBalance = this.safeString (position, 'crossWalletBalance');\n            collateralString = this.safeString (position, 'crossMargin');\n        }\n        const collateral = this.parseNumber (collateralString);\n        let marginRatio = undefined;\n        let side = undefined;\n        let percentage = undefined;\n        let liquidationPriceStringRaw = undefined;\n        let liquidationPrice = undefined;\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        if (Precise.stringEquals (notionalString, '0')) {\n            entryPrice = undefined;\n        } else {\n            side = Precise.stringLt (notionalString, '0') ? 'short' : 'long';\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n            if (usdm) {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (walletBalance / (contracts * (±1 + mmp))) + (±entryPrice / (±1 + mmp))\n                //\n                // mmp = maintenanceMarginPercentage\n                // where ± is negative for long and positive for short\n                // TODO: calculate liquidation price for coinm contracts\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const leftSide = Precise.stringDiv (walletBalance, Precise.stringMul (contractsStringAbs, onePlusMaintenanceMarginPercentageString));\n                const rightSide = Precise.stringDiv (entryPriceSignString, onePlusMaintenanceMarginPercentageString);\n                liquidationPriceStringRaw = Precise.stringAdd (leftSide, rightSide);\n            } else {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (contracts * contractSize(±1 - mmp)) / (±1/entryPrice * contracts * contractSize - walletBalance)\n                //\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const size = Precise.stringMul (contractsStringAbs, contractSizeString);\n                const leftSide = Precise.stringMul (size, onePlusMaintenanceMarginPercentageString);\n                const rightSide = Precise.stringSub (Precise.stringMul (Precise.stringDiv ('1', entryPriceSignString), size), walletBalance);\n                liquidationPriceStringRaw = Precise.stringDiv (leftSide, rightSide);\n            }\n            const pricePrecision = this.precisionFromString (this.safeString (market['precision'], 'price'));\n            const pricePrecisionPlusOne = pricePrecision + 1;\n            const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString ();\n            // round half up\n            const rounder = new Precise ('5e-' + pricePrecisionPlusOneString);\n            const rounderString = rounder.toString ();\n            const liquidationPriceRoundedString = Precise.stringAdd (rounderString, liquidationPriceStringRaw);\n            let truncatedLiquidationPrice = Precise.stringDiv (liquidationPriceRoundedString, '1', pricePrecision);\n            if (truncatedLiquidationPrice[0] === '-') {\n                // user cannot be liquidated\n                // since he has more collateral than the size of the position\n                truncatedLiquidationPrice = undefined;\n            }\n            liquidationPrice = this.parseNumber (truncatedLiquidationPrice);\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return {\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'initialMargin': initialMargin,\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'entryPrice': entryPrice,\n            'notional': notional,\n            'leverage': this.parseNumber (leverageString),\n            'unrealizedPnl': unrealizedPnl,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'marginRatio': marginRatio,\n            'liquidationPrice': liquidationPrice,\n            'markPrice': undefined,\n            'collateral': collateral,\n            'marginMode': marginMode,\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n        };\n    }"
      },
      {
        "name": "parseAccountPositions",
        "signature": "parseAccountPositions (account, filterClosed = false)",
        "line_start": 10043,
        "line_end": 10079,
        "comment": null,
        "mappings": [
          {
            "key": "crossMargin",
            "value": "balances[code]['crossMargin']",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "balances[code]['crossWalletBalance']",
            "comment": null
          },
          {
            "key": "crossMargin",
            "value": "Precise.stringAdd (crossWalletBalance, crossUnPnl)",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "crossWalletBalance",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccountPositions (account, filterClosed = false) {\n        const positions = this.safeList (account, 'positions');\n        const assets = this.safeList (account, 'assets', []);\n        const balances: Dict = {};\n        for (let i = 0; i < assets.length; i++) {\n            const entry = assets[i];\n            const currencyId = this.safeString (entry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const crossWalletBalance = this.safeString (entry, 'crossWalletBalance');\n            const crossUnPnl = this.safeString (entry, 'crossUnPnl');\n            balances[code] = {\n                'crossMargin': Precise.stringAdd (crossWalletBalance, crossUnPnl),\n                'crossWalletBalance': crossWalletBalance,\n            };\n        }\n        const result = [];\n        for (let i = 0; i < positions.length; i++) {\n            const position = positions[i];\n            const marketId = this.safeString (position, 'symbol');\n            const market = this.safeMarket (marketId, undefined, undefined, 'contract');\n            const code = market['linear'] ? market['quote'] : market['base'];\n            const maintenanceMargin = this.safeString (position, 'maintMargin');\n            // check for maintenance margin so empty positions are not returned\n            const isPositionOpen = (maintenanceMargin !== '0') && (maintenanceMargin !== '0.00000000');\n            if (!filterClosed || isPositionOpen) {\n                // sometimes not all the codes are correctly returned...\n                if (code in balances) {\n                    const parsed = this.parseAccountPosition (this.extend (position, {\n                        'crossMargin': balances[code]['crossMargin'],\n                        'crossWalletBalance': balances[code]['crossWalletBalance'],\n                    }), market);\n                    result.push (parsed);\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 14515,
        "line_end": 14563,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "rank",
            "comment": null
          },
          {
            "key": "rating",
            "value": "this.safeStringLower (info, 'adlRisk')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlRisk\": \"LOW\",\n         \"updateTime\": 1766827800453\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlQuantile\": {\n             \"LONG\": 0,\n             \"SHORT\": 0,\n             \"BOTH\": 1\n         }\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlRisk\": \"LOW\",\n        //         \"updateTime\": 1766827800453\n        //     }\n        //\n        // fetchPositionADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlQuantile\": {\n        //             \"LONG\": 0,\n        //             \"SHORT\": 0,\n        //             \"BOTH\": 1\n        //         }\n        //     }\n        //\n        const adlQuantile = this.safeDict (info, 'adlQuantile', {});\n        const longNum = this.safeNumber (adlQuantile, 'LONG');\n        const shortNum = this.safeNumber (adlQuantile, 'SHORT');\n        const both = this.safeNumber (adlQuantile, 'BOTH');\n        let rank = undefined;\n        if (both !== undefined) {\n            rank = both;\n        } else {\n            if (longNum !== undefined && shortNum !== undefined) {\n                if (longNum > shortNum) {\n                    rank = longNum;\n                } else {\n                    rank = shortNum;\n                }\n            }\n        }\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger2 (info, 'timestamp', 'updateTime');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': rank,\n            'rating': this.safeStringLower (info, 'adlRisk'),\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalanceCustom",
        "signature": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances",
        "line_start": 3606,
        "line_end": 3717,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances {\n        const result = {\n            'info': response,\n        };\n        let timestamp = undefined;\n        const isolated = marginMode === 'isolated';\n        const cross = (type === 'margin') || (marginMode === 'cross');\n        if (isPortfolioMargin) {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                if (type === 'linear') {\n                    account['free'] = this.safeString (entry, 'umWalletBalance');\n                    account['used'] = this.safeString (entry, 'umUnrealizedPNL');\n                } else if (type === 'inverse') {\n                    account['free'] = this.safeString (entry, 'cmWalletBalance');\n                    account['used'] = this.safeString (entry, 'cmUnrealizedPNL');\n                } else if (cross) {\n                    const borrowed = this.safeString (entry, 'crossMarginBorrowed');\n                    const interest = this.safeString (entry, 'crossMarginInterest');\n                    account['debt'] = Precise.stringAdd (borrowed, interest);\n                    account['free'] = this.safeString (entry, 'crossMarginFree');\n                    account['used'] = this.safeString (entry, 'crossMarginLocked');\n                    account['total'] = this.safeString (entry, 'crossMarginAsset');\n                } else {\n                    const usedLinear = this.safeString (entry, 'umUnrealizedPNL');\n                    const usedInverse = this.safeString (entry, 'cmUnrealizedPNL');\n                    const totalUsed = Precise.stringAdd (usedLinear, usedInverse);\n                    const totalWalletBalance = this.safeString (entry, 'totalWalletBalance');\n                    account['total'] = Precise.stringAdd (totalUsed, totalWalletBalance);\n                }\n                result[code] = account;\n            }\n        } else if (!isolated && ((type === 'spot') || cross)) {\n            timestamp = this.safeInteger (response, 'updateTime');\n            const balances = this.safeList2 (response, 'balances', 'userAssets', []);\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'free');\n                account['used'] = this.safeString (balance, 'locked');\n                if (cross) {\n                    const debt = this.safeString (balance, 'borrowed');\n                    const interest = this.safeString (balance, 'interest');\n                    account['debt'] = Precise.stringAdd (debt, interest);\n                }\n                result[code] = account;\n            }\n        } else if (isolated) {\n            const assets = this.safeList (response, 'assets');\n            for (let i = 0; i < assets.length; i++) {\n                const asset = assets[i];\n                const marketId = this.safeString (asset, 'symbol');\n                const symbol = this.safeSymbol (marketId, undefined, undefined, 'spot');\n                const base = this.safeDict (asset, 'baseAsset', {});\n                const quote = this.safeDict (asset, 'quoteAsset', {});\n                const baseCode = this.safeCurrencyCode (this.safeString (base, 'asset'));\n                const quoteCode = this.safeCurrencyCode (this.safeString (quote, 'asset'));\n                const subResult: Dict = {};\n                subResult[baseCode] = this.parseBalanceHelper (base);\n                subResult[quoteCode] = this.parseBalanceHelper (quote);\n                result[symbol] = this.safeBalance (subResult);\n            }\n        } else if (type === 'savings') {\n            const positionAmountVos = this.safeList (response, 'positionAmountVos', []);\n            for (let i = 0; i < positionAmountVos.length; i++) {\n                const entry = positionAmountVos[i];\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                const usedAndTotal = this.safeString (entry, 'amount');\n                account['total'] = usedAndTotal;\n                account['used'] = usedAndTotal;\n                result[code] = account;\n            }\n        } else if (type === 'funding') {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                account['free'] = this.safeString (entry, 'free');\n                const frozen = this.safeString (entry, 'freeze');\n                const withdrawing = this.safeString (entry, 'withdrawing');\n                const locked = this.safeString (entry, 'locked');\n                account['used'] = Precise.stringAdd (frozen, Precise.stringAdd (locked, withdrawing));\n                result[code] = account;\n            }\n        } else {\n            let balances = response;\n            if (!Array.isArray (response)) {\n                balances = this.safeList (response, 'assets', []);\n            }\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'availableBalance');\n                account['used'] = this.safeString (balance, 'initialMargin');\n                account['total'] = this.safeString2 (balance, 'marginBalance', 'balance');\n                result[code] = account;\n            }\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return isolated ? result : this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3596,
        "line_end": 3604,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString (entry, 'locked');\n        account['free'] = this.safeString (entry, 'free');\n        const interest = this.safeString (entry, 'interest');\n        const debt = this.safeString (entry, 'borrowed');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 12772,
        "line_end": 12787,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'asset'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'principal')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const symbol = this.safeString (info, 'isolatedSymbol');\n        const timestamp = this.safeInteger (info, 'interestAccuredTime');\n        const marginMode = (symbol === undefined) ? 'cross' : 'isolated';\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'asset')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'principal'),\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 12539,
        "line_end": 12558,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (info, 'dailyInterestRate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset\": \"USDT\",\n        \"timestamp\": 1638230400000,\n        \"dailyInterestRate\": \"0.0006\",\n        \"vipLevel\": 0\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"asset\": \"USDT\",\n        //        \"timestamp\": 1638230400000,\n        //        \"dailyInterestRate\": \"0.0006\",\n        //        \"vipLevel\": 0\n        //    }\n        //\n        const timestamp = this.safeInteger (info, 'timestamp');\n        const currencyId = this.safeString (info, 'asset');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber (info, 'dailyInterestRate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 14196,
        "line_end": 14284,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'targetAmount', 'toAmount')",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quoteId\":\"12415572564\",\n         \"ratio\":\"38163.7\",\n         \"inverseRatio\":\"0.0000262\",\n         \"validTimestamp\":1623319461670,\n         \"toAmount\":\"3816.37\",\n         \"fromAmount\":\"0.1\"\n     }",
          "{\n         \"orderId\":\"933256278426274426\",\n         \"createTime\":1623381330472,\n         \"orderStatus\":\"PROCESS\"\n     }",
          "{\n         \"tranId\": 118263407119,\n         \"status\": \"S\"\n     }",
          "{\n         \"tranId\": 118263615991,\n         \"type\": 244,\n         \"time\": 1664442078000,\n         \"deductedAsset\": \"BUSD\",\n         \"deductedAmount\": \"1\",\n         \"targetAsset\": \"USDC\",\n         \"targetAmount\": \"1\",\n         \"status\": \"S\",\n         \"accountType\": \"MAIN\"\n     }",
          "{\n         \"orderId\":933256278426274426,\n         \"orderStatus\":\"SUCCESS\",\n         \"fromAsset\":\"BTC\",\n         \"fromAmount\":\"0.00054414\",\n         \"toAsset\":\"USDT\",\n         \"toAmount\":\"20\",\n         \"ratio\":\"36755\",\n         \"inverseRatio\":\"0.00002721\",\n         \"createTime\":1623381330472\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"quoteId\":\"12415572564\",\n        //         \"ratio\":\"38163.7\",\n        //         \"inverseRatio\":\"0.0000262\",\n        //         \"validTimestamp\":1623319461670,\n        //         \"toAmount\":\"3816.37\",\n        //         \"fromAmount\":\"0.1\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"orderId\":\"933256278426274426\",\n        //         \"createTime\":1623381330472,\n        //         \"orderStatus\":\"PROCESS\"\n        //     }\n        //\n        // createConvertTrade BUSD\n        //\n        //     {\n        //         \"tranId\": 118263407119,\n        //         \"status\": \"S\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory BUSD\n        //\n        //     {\n        //         \"tranId\": 118263615991,\n        //         \"type\": 244,\n        //         \"time\": 1664442078000,\n        //         \"deductedAsset\": \"BUSD\",\n        //         \"deductedAmount\": \"1\",\n        //         \"targetAsset\": \"USDC\",\n        //         \"targetAmount\": \"1\",\n        //         \"status\": \"S\",\n        //         \"accountType\": \"MAIN\"\n        //     }\n        //\n        // fetchConvertTrade\n        //\n        //     {\n        //         \"orderId\":933256278426274426,\n        //         \"orderStatus\":\"SUCCESS\",\n        //         \"fromAsset\":\"BTC\",\n        //         \"fromAmount\":\"0.00054414\",\n        //         \"toAsset\":\"USDT\",\n        //         \"toAmount\":\"20\",\n        //         \"ratio\":\"36755\",\n        //         \"inverseRatio\":\"0.00002721\",\n        //         \"createTime\":1623381330472\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"quoteId\": \"f3b91c525b2644c7bc1e1cd31b6e1aa6\",\n        //         \"orderId\": 940708407462087195,\n        //         \"orderStatus\": \"SUCCESS\",\n        //         \"fromAsset\": \"USDT\",\n        //         \"fromAmount\": \"20\",\n        //         \"toAsset\": \"BNB\",\n        //         \"toAmount\": \"0.06154036\",\n        //         \"ratio\": \"0.00307702\",\n        //         \"inverseRatio\": \"324.99\",\n        //         \"createTime\": 1624248872184\n        //     }\n        //\n        const timestamp = this.safeIntegerN (conversion, [ 'time', 'validTimestamp', 'createTime' ]);\n        const fromCur = this.safeString2 (conversion, 'deductedAsset', 'fromAsset');\n        const fromCode = this.safeCurrencyCode (fromCur, fromCurrency);\n        const to = this.safeString2 (conversion, 'targetAsset', 'toAsset');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'targetAmount', 'toAmount'),\n            'price': undefined,\n            'fee': undefined,\n        } as Conversion;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress",
        "line_start": 9206,
        "line_end": 9234,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"XRP\",\n         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n         \"tag\": \"108618262\",\n         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n     }"
        ],
        "source": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"XRP\",\n        //         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n        //         \"tag\": \"108618262\",\n        //         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n        //     }\n        //\n        const url = this.safeString (response, 'url');\n        const address = this.safeString (response, 'address');\n        const currencyId = this.safeString (response, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        // deposit-address endpoint provides only network url (not network ID/CODE)\n        // so we should map the url to network (their data is inside currencies)\n        const networkCode = this.getNetworkCodeByNetworkUrl (code, url);\n        let tag = this.safeString (response, 'tag', '');\n        if (tag.length === 0) {\n            tag = undefined;\n        }\n        this.checkAddress (address);\n        return {\n            'info': response,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9409,
        "line_end": 9476,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"coin\": \"BAT\",\n        \"depositAllEnable\": true,\n        \"withdrawAllEnable\": true,\n        \"name\": \"Basic Attention Token\",\n        \"free\": \"0\",\n        \"locked\": \"0\",\n        \"freeze\": \"0\",\n        \"withdrawing\": \"0\",\n        \"ipoing\": \"0\",\n        \"ipoable\": \"0\",\n        \"storage\": \"0\",\n        \"isLegalMoney\": false,\n        \"trading\": true,\n        \"networkList\": [\n            {\n                \"network\": \"BNB\",\n                \"coin\": \"BAT\",\n                \"withdrawIntegerMultiple\": \"0.00000001\",\n                \"isDefault\": false,\n                \"depositEnable\": true,\n                \"withdrawEnable\": true,\n                \"depositDesc\": '',\n                \"withdrawDesc\": '',\n                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n                \"name\": \"BEP2\",\n                \"resetAddressStatus\": false,\n                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n                \"withdrawFee\": \"0.27\",\n                \"withdrawMin\": \"0.54\",\n                \"withdrawMax\": \"10000000000\",\n                \"minConfirm\": \"1\",\n                \"unLockConfirm\": \"0\"\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"coin\": \"BAT\",\n        //        \"depositAllEnable\": true,\n        //        \"withdrawAllEnable\": true,\n        //        \"name\": \"Basic Attention Token\",\n        //        \"free\": \"0\",\n        //        \"locked\": \"0\",\n        //        \"freeze\": \"0\",\n        //        \"withdrawing\": \"0\",\n        //        \"ipoing\": \"0\",\n        //        \"ipoable\": \"0\",\n        //        \"storage\": \"0\",\n        //        \"isLegalMoney\": false,\n        //        \"trading\": true,\n        //        \"networkList\": [\n        //            {\n        //                \"network\": \"BNB\",\n        //                \"coin\": \"BAT\",\n        //                \"withdrawIntegerMultiple\": \"0.00000001\",\n        //                \"isDefault\": false,\n        //                \"depositEnable\": true,\n        //                \"withdrawEnable\": true,\n        //                \"depositDesc\": '',\n        //                \"withdrawDesc\": '',\n        //                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n        //                \"name\": \"BEP2\",\n        //                \"resetAddressStatus\": false,\n        //                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n        //                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n        //                \"withdrawFee\": \"0.27\",\n        //                \"withdrawMin\": \"0.54\",\n        //                \"withdrawMax\": \"10000000000\",\n        //                \"minConfirm\": \"1\",\n        //                \"unLockConfirm\": \"0\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const networkList = this.safeList (fee, 'networkList', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.networkIdToCode (networkId);\n            const withdrawFee = this.safeNumber (networkEntry, 'withdrawFee');\n            const isDefault = this.safeBool (networkEntry, 'isDefault');\n            if (isDefault === true) {\n                result['withdraw'] = {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                };\n            }\n            result['networks'][networkCode] = {\n                'withdraw': {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }"
      },
      {
        "name": "parseDustTrade",
        "signature": "parseDustTrade (trade, market: Market = undefined)",
        "line_start": 8290,
        "line_end": 8360,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "currency",
            "value": "earnedCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostString)",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"fromAsset\": \"USDT\",\n       \"amount\": \"0.009669\",\n       \"transferedAmount\": \"0.00002992\",\n       \"serviceChargeAmount\": \"0.00000059\",\n       \"operateTime\": \"1628076010000\",\n       \"transId\": \"71416578712\",\n       \"isDustTrade\": true\n     }"
        ],
        "source": "parseDustTrade (trade, market: Market = undefined) {\n        //\n        //     {\n        //       \"fromAsset\": \"USDT\",\n        //       \"amount\": \"0.009669\",\n        //       \"transferedAmount\": \"0.00002992\",\n        //       \"serviceChargeAmount\": \"0.00000059\",\n        //       \"operateTime\": \"1628076010000\",\n        //       \"transId\": \"71416578712\",\n        //       \"isDustTrade\": true\n        //     }\n        //\n        const orderId = this.safeString (trade, 'transId');\n        const timestamp = this.safeInteger (trade, 'operateTime');\n        const currencyId = this.safeString (trade, 'fromAsset');\n        const tradedCurrency = this.safeCurrencyCode (currencyId);\n        const bnb = this.currency ('BNB');\n        const earnedCurrency = bnb['code'];\n        const applicantSymbol = earnedCurrency + '/' + tradedCurrency;\n        let tradedCurrencyIsQuote = false;\n        if (applicantSymbol in this.markets) {\n            tradedCurrencyIsQuote = true;\n        }\n        const feeCostString = this.safeString (trade, 'serviceChargeAmount');\n        const fee = {\n            'currency': earnedCurrency,\n            'cost': this.parseNumber (feeCostString),\n        };\n        let symbol = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        let side = undefined;\n        if (tradedCurrencyIsQuote) {\n            symbol = applicantSymbol;\n            amountString = this.safeString (trade, 'transferedAmount');\n            costString = this.safeString (trade, 'amount');\n            side = 'buy';\n        } else {\n            symbol = tradedCurrency + '/' + earnedCurrency;\n            amountString = this.safeString (trade, 'amount');\n            costString = this.safeString (trade, 'transferedAmount');\n            side = 'sell';\n        }\n        let priceString = undefined;\n        if (costString !== undefined) {\n            if (amountString) {\n                priceString = Precise.stringDiv (costString, amountString);\n            }\n        }\n        const id = undefined;\n        const amount = this.parseNumber (amountString);\n        const price = this.parseNumber (priceString);\n        const cost = this.parseNumber (costString);\n        const type = undefined;\n        const takerOrMaker = undefined;\n        return {\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'amount': amount,\n            'price': price,\n            'cost': cost,\n            'fee': fee,\n            'info': trade,\n        };\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 9981,
        "line_end": 10041,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "estimatedSettlePrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"45802.81129892\",\n         \"indexPrice\": \"45745.47701915\",\n         \"estimatedSettlePrice\": \"45133.91753671\",\n         \"lastFundingRate\": \"0.00063521\",\n         \"interestRate\": \"0.00010000\",\n         \"nextFundingTime\": \"1621267200000\",\n         \"time\": \"1621252344001\"\n     }",
          "{\n         \"symbol\": \"BLZUSDT\",\n         \"adjustedFundingRateCap\": \"0.03000000\",\n         \"adjustedFundingRateFloor\": \"-0.03000000\",\n         \"fundingIntervalHours\": 4,\n         \"disclaimer\": false\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        // ensure it matches with https://www.binance.com/en/futures/funding-history/0\n        //\n        // fetchFundingRate, fetchFundingRates\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"45802.81129892\",\n        //         \"indexPrice\": \"45745.47701915\",\n        //         \"estimatedSettlePrice\": \"45133.91753671\",\n        //         \"lastFundingRate\": \"0.00063521\",\n        //         \"interestRate\": \"0.00010000\",\n        //         \"nextFundingTime\": \"1621267200000\",\n        //         \"time\": \"1621252344001\"\n        //     }\n        //\n        // fetchFundingInterval, fetchFundingIntervals\n        //\n        //     {\n        //         \"symbol\": \"BLZUSDT\",\n        //         \"adjustedFundingRateCap\": \"0.03000000\",\n        //         \"adjustedFundingRateFloor\": \"-0.03000000\",\n        //         \"fundingIntervalHours\": 4,\n        //         \"disclaimer\": false\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'time');\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        const interestRate = this.safeNumber (contract, 'interestRate');\n        const estimatedSettlePrice = this.safeNumber (contract, 'estimatedSettlePrice');\n        const fundingRate = this.safeNumber (contract, 'lastFundingRate');\n        const fundingTime = this.safeInteger (contract, 'nextFundingTime');\n        const interval = this.safeString (contract, 'fundingIntervalHours');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'estimatedSettlePrice': estimatedSettlePrice,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 9933,
        "line_end": 9949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"fundingRate\": \"0.00063521\",\n         \"fundingTime\": \"1621267200000\",\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"fundingRate\": \"0.00063521\",\n        //         \"fundingTime\": \"1621267200000\",\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap'),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 13475,
        "line_end": 13514,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidIV')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askIV')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markIV')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-231229-40000-C\",\n         \"markPrice\": \"2012\",\n         \"bidIV\": \"0.60236275\",\n         \"askIV\": \"0.62267244\",\n         \"markIV\": \"0.6125176\",\n         \"delta\": \"0.39111646\",\n         \"theta\": \"-32.13948531\",\n         \"gamma\": \"0.00004656\",\n         \"vega\": \"51.70062218\",\n         \"highPriceLimit\": \"6474\",\n         \"lowPriceLimit\": \"5\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"symbol\": \"BTC-231229-40000-C\",\n        //         \"markPrice\": \"2012\",\n        //         \"bidIV\": \"0.60236275\",\n        //         \"askIV\": \"0.62267244\",\n        //         \"markIV\": \"0.6125176\",\n        //         \"delta\": \"0.39111646\",\n        //         \"theta\": \"-32.13948531\",\n        //         \"gamma\": \"0.00004656\",\n        //         \"vega\": \"51.70062218\",\n        //         \"highPriceLimit\": \"6474\",\n        //         \"lowPriceLimit\": \"5\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidIV'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askIV'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markIV'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': this.safeNumber (greeks, 'markPrice'),\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 8890,
        "line_end": 8915,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'tranId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'income')",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"ETHUSDT\",\n       \"incomeType\": \"FUNDING_FEE\",\n       \"income\": \"0.00134317\",\n       \"asset\": \"USDT\",\n       \"time\": \"1621584000000\",\n       \"info\": \"FUNDING_FEE\",\n       \"tranId\": \"4480321991774044580\",\n       \"tradeId\": \"\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"symbol\": \"ETHUSDT\",\n        //       \"incomeType\": \"FUNDING_FEE\",\n        //       \"income\": \"0.00134317\",\n        //       \"asset\": \"USDT\",\n        //       \"time\": \"1621584000000\",\n        //       \"info\": \"FUNDING_FEE\",\n        //       \"tranId\": \"4480321991774044580\",\n        //       \"tradeId\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const currencyId = this.safeString (income, 'asset');\n        const timestamp = this.safeInteger (income, 'time');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'tranId'),\n            'amount': this.safeNumber (income, 'income'),\n        };\n    }"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 12560,
        "line_end": 12596,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeString (baseInfo, 'coin')",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeString (quoteInfo, 'coin')",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"vipLevel\": 0,\n        \"symbol\": \"BTCUSDT\",\n        \"leverage\": \"10\",\n        \"data\": [\n            {\n                \"coin\": \"BTC\",\n                \"dailyInterest\": \"0.00026125\",\n                \"borrowLimit\": \"270\"\n            },\n            {\n                \"coin\": \"USDT\",\n                \"dailyInterest\": \"0.000475\",\n                \"borrowLimit\": \"2100000\"\n            }\n        ]\n    }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //    {\n        //        \"vipLevel\": 0,\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"leverage\": \"10\",\n        //        \"data\": [\n        //            {\n        //                \"coin\": \"BTC\",\n        //                \"dailyInterest\": \"0.00026125\",\n        //                \"borrowLimit\": \"270\"\n        //            },\n        //            {\n        //                \"coin\": \"USDT\",\n        //                \"dailyInterest\": \"0.000475\",\n        //                \"borrowLimit\": \"2100000\"\n        //            }\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'spot');\n        const data = this.safeList (info, 'data');\n        const baseInfo = this.safeDict (data, 0);\n        const quoteInfo = this.safeDict (data, 1);\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'base': this.safeString (baseInfo, 'coin'),\n            'baseRate': this.safeNumber (baseInfo, 'dailyInterest'),\n            'quote': this.safeString (quoteInfo, 'coin'),\n            'quoteRate': this.safeNumber (quoteInfo, 'dailyInterest'),\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 4424,
        "line_end": 4463,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumberOmitZero (entry, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"price\": \"4.00000200\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"price\": \"6000.01\",\n         \"time\": 1589437530011   // Transaction time\n     }",
          "{\n         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n         \"ps\": \"BTCUSD\", // pair\n         \"price\": \"9647.8\",\n         \"time\": 1591257246176\n     }"
        ],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"price\": \"4.00000200\"\n        //     }\n        //\n        // usdm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"price\": \"6000.01\",\n        //         \"time\": 1589437530011   // Transaction time\n        //     }\n        //\n        //\n        // coinm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n        //         \"ps\": \"BTCUSD\", // pair\n        //         \"price\": \"9647.8\",\n        //         \"time\": 1591257246176\n        //     }\n        //\n        const timestamp = this.safeInteger (entry, 'time');\n        const type = (timestamp === undefined) ? 'spot' : 'swap';\n        const marketId = this.safeString (entry, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, type);\n        return {\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'price': this.safeNumberOmitZero (entry, 'price'),\n            'side': undefined,\n            'info': entry,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 11884,
        "line_end": 11939,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (item, 'id', 'tranId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tradeId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1125899906845701870\",\n         \"asset\": \"USDT\",\n         \"amount\": \"-0.16518203\",\n         \"type\": \"FEE\",\n         \"createDate\": 167662104241\n     }",
          "{\n         \"symbol\": \"\",\n         \"incomeType\": \"TRANSFER\",\n         \"income\": \"10.00000000\",\n         \"asset\": \"USDT\",\n         \"time\": 1677645250000,\n         \"info\": \"TRANSFER\",\n         \"tranId\": 131001573082,\n         \"tradeId\": \"\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // options (eapi)\n        //\n        //     {\n        //         \"id\": \"1125899906845701870\",\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"-0.16518203\",\n        //         \"type\": \"FEE\",\n        //         \"createDate\": 167662104241\n        //     }\n        //\n        // futures (fapi, dapi, papi)\n        //\n        //     {\n        //         \"symbol\": \"\",\n        //         \"incomeType\": \"TRANSFER\",\n        //         \"income\": \"10.00000000\",\n        //         \"asset\": \"USDT\",\n        //         \"time\": 1677645250000,\n        //         \"info\": \"TRANSFER\",\n        //         \"tranId\": 131001573082,\n        //         \"tradeId\": \"\"\n        //     }\n        //\n        let amount = this.safeString2 (item, 'amount', 'income');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger2 (item, 'createDate', 'time');\n        const type = this.safeString2 (item, 'type', 'incomeType');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString2 (item, 'id', 'tranId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tradeId'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 11941,
        "line_end": 11964,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'FEE': 'fee',\n            'FUNDING_FEE': 'fee',\n            'OPTIONS_PREMIUM_FEE': 'fee',\n            'POSITION_LIMIT_INCREASE_FEE': 'fee',\n            'CONTRACT': 'trade',\n            'REALIZED_PNL': 'trade',\n            'TRANSFER': 'transfer',\n            'CROSS_COLLATERAL_TRANSFER': 'transfer',\n            'INTERNAL_TRANSFER': 'transfer',\n            'COIN_SWAP_DEPOSIT': 'deposit',\n            'COIN_SWAP_WITHDRAW': 'withdrawal',\n            'OPTIONS_SETTLE_PROFIT': 'settlement',\n            'DELIVERED_SETTELMENT': 'settlement',\n            'WELCOME_BONUS': 'cashback',\n            'CONTEST_REWARD': 'cashback',\n            'COMMISSION_REBATE': 'rebate',\n            'API_REBATE': 'rebate',\n            'REFERRAL_KICKBACK': 'referral',\n            'COMMISSION': 'commission',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 11527,
        "line_end": 11557,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const marginModeRaw = this.safeBool (leverage, 'isolated');\n        let marginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            marginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (leverage, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            marginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        const side = this.safeStringLower (leverage, 'positionSide');\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        if ((side === undefined) || (side === 'both')) {\n            longLeverage = leverageValue;\n            shortLeverage = leverageValue;\n        } else if (side === 'long') {\n            longLeverage = leverageValue;\n        } else if (side === 'short') {\n            shortLeverage = leverageValue;\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 13312,
        "line_end": 13395,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (liquidation, 'executedQty')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'avgPrice')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'side')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'cumBase')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.safeNumber (liquidation, 'cumQuote')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"avgPrice\": \"0.00388359\",\n         \"executedQty\": \"31.39000000\",\n         \"orderId\": 180015097,\n         \"price\": \"0.00388110\",\n         \"qty\": \"31.39000000\",\n         \"side\": \"SELL\",\n         \"symbol\": \"BNBBTC\",\n         \"timeInForce\": \"GTC\",\n         \"isIsolated\": true,\n         \"updatedTime\": 1558941374745\n     }",
          "{\n         \"orderId\": 6071832819,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596107620040000020\",\n         \"price\": \"10871.09\",\n         \"avgPrice\": \"10913.21000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0.002\",\n         \"cumQuote\": \"10.91321\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"origType\": \"LIMIT\",\n         \"time\": 1596107620044,\n         \"updateTime\": 1596107620087\n     }",
          "{\n         \"orderId\": 165123080,\n         \"symbol\": \"BTCUSD_200925\",\n         \"pair\": \"BTCUSD\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596542005017000006\",\n         \"price\": \"11326.9\",\n         \"avgPrice\": \"11326.9\",\n         \"origQty\": \"1\",\n         \"executedQty\": \"1\",\n         \"cumBase\": \"0.00882854\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"time\": 1596542005019,\n         \"updateTime\": 1596542005050\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // margin\n        //\n        //     {\n        //         \"avgPrice\": \"0.00388359\",\n        //         \"executedQty\": \"31.39000000\",\n        //         \"orderId\": 180015097,\n        //         \"price\": \"0.00388110\",\n        //         \"qty\": \"31.39000000\",\n        //         \"side\": \"SELL\",\n        //         \"symbol\": \"BNBBTC\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"isIsolated\": true,\n        //         \"updatedTime\": 1558941374745\n        //     }\n        //\n        // linear\n        //\n        //     {\n        //         \"orderId\": 6071832819,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596107620040000020\",\n        //         \"price\": \"10871.09\",\n        //         \"avgPrice\": \"10913.21000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0.002\",\n        //         \"cumQuote\": \"10.91321\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596107620044,\n        //         \"updateTime\": 1596107620087\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"orderId\": 165123080,\n        //         \"symbol\": \"BTCUSD_200925\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596542005017000006\",\n        //         \"price\": \"11326.9\",\n        //         \"avgPrice\": \"11326.9\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"1\",\n        //         \"cumBase\": \"0.00882854\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596542005019,\n        //         \"updateTime\": 1596542005050\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger2 (liquidation, 'updatedTime', 'updateTime');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.safeNumber (liquidation, 'executedQty'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'avgPrice'),\n            'side': this.safeStringLower (liquidation, 'side'),\n            'baseValue': this.safeNumber (liquidation, 'cumBase'),\n            'quoteValue': this.safeNumber (liquidation, 'cumQuote'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 14396,
        "line_end": 14428,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"longAccount\": \"0.4558\",\n         \"longShortRatio\": \"0.8376\",\n         \"shortAccount\": \"0.5442\",\n         \"timestamp\": 1726790400000\n     }",
          "{\n         \"longAccount\": \"0.7262\",\n         \"longShortRatio\": \"2.6523\",\n         \"shortAccount\": \"0.2738\",\n         \"pair\": \"BTCUSD\",\n         \"timestamp\": 1726790400000\n     }"
        ],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        //\n        // linear\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"longAccount\": \"0.4558\",\n        //         \"longShortRatio\": \"0.8376\",\n        //         \"shortAccount\": \"0.5442\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"longAccount\": \"0.7262\",\n        //         \"longShortRatio\": \"2.6523\",\n        //         \"shortAccount\": \"0.2738\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeIntegerOmitZero (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 12953,
        "line_end": 12981,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'tranId')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\": 108988250265,\n         \"clientTag\":\"\"\n     }",
          "{\n         \"asset\": \"USDC\",\n         \"amount\": 10,\n         \"specifyRepayAssets\": null,\n         \"updateTime\": 1727170761267,\n         \"success\": true\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"tranId\": 108988250265,\n        //         \"clientTag\":\"\"\n        //     }\n        //\n        // repayCrossMargin alternative endpoint\n        //\n        //     {\n        //         \"asset\": \"USDC\",\n        //         \"amount\": 10,\n        //         \"specifyRepayAssets\": null,\n        //         \"updateTime\": 1727170761267,\n        //         \"success\": true\n        //     }\n        //\n        const currencyId = this.safeString (info, 'asset');\n        const timestamp = this.safeInteger (info, 'updateTime');\n        return {\n            'id': this.safeInteger (info, 'tranId'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amount'),\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 13705,
        "line_end": 13722,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "reMarginMode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const marginModeRaw = this.safeBool (marginMode, 'isolated');\n        let reMarginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            reMarginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (marginMode, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            reMarginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': reMarginMode,\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 12323,
        "line_end": 12366,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "(rawType === 1) ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (data, 'asset')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "(success || noErrorCode) ? 'ok' : 'failed'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 200,\n         \"msg\": \"Successfully modify position margin.\",\n         \"amount\": 0.001,\n         \"type\": 1\n     }",
          "{\n        symbol: \"XRPUSDT\",\n        type: \"1\",\n        deltaType: \"TRADE\",\n        amount: \"2.57148240\",\n        asset: \"USDT\",\n        time: \"1711046271555\",\n        positionSide: \"BOTH\",\n        clientTranId: \"\"\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // add/reduce margin\n        //\n        //     {\n        //         \"code\": 200,\n        //         \"msg\": \"Successfully modify position margin.\",\n        //         \"amount\": 0.001,\n        //         \"type\": 1\n        //     }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        symbol: \"XRPUSDT\",\n        //        type: \"1\",\n        //        deltaType: \"TRADE\",\n        //        amount: \"2.57148240\",\n        //        asset: \"USDT\",\n        //        time: \"1711046271555\",\n        //        positionSide: \"BOTH\",\n        //        clientTranId: \"\"\n        //    }\n        //\n        const rawType = this.safeInteger (data, 'type');\n        const errorCode = this.safeString (data, 'code');\n        const marketId = this.safeString (data, 'symbol');\n        const timestamp = this.safeInteger (data, 'time');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const noErrorCode = errorCode === undefined;\n        const success = errorCode === '200';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': (rawType === 1) ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'code': this.safeString (data, 'asset'),\n            'total': undefined,\n            'status': (success || noErrorCode) ? 'ok' : 'failed',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 3413,
        "line_end": 3594,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "lowercaseId",
            "value": "lowercaseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "unifiedType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && isMarginTradingAllowed",
            "comment": null
          },
          {
            "key": "marginModes",
            "value": "marginModes",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "parsedStrike",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "this.safeStringLower (market, 'side')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'onboardDate')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale')))",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision')))",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (filter, 'minQty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (filter, 'maxQty')",
            "comment": null
          }
        ],
        "examples": [
          "therefore limits['price']['max'] doesn't have any meaningful value except undefined"
        ],
        "source": "parseMarket (market: Dict): Market {\n        let swap = false;\n        let future = false;\n        let option = false;\n        const underlying = this.safeString (market, 'underlying');\n        const id = this.safeString (market, 'symbol');\n        const optionParts = id.split ('-');\n        const optionBase = this.safeString (optionParts, 0);\n        const lowercaseId = this.safeStringLower (market, 'symbol');\n        const baseId = this.safeString (market, 'baseAsset', optionBase);\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const contractType = this.safeString (market, 'contractType');\n        let contract = ('contractType' in market);\n        let expiry = this.safeInteger2 (market, 'deliveryDate', 'expiryDate');\n        let settleId = this.safeString (market, 'marginAsset');\n        if ((contractType === 'PERPETUAL') || (expiry === 4133404800000)) { // some swap markets do not have contract type, eg: BTCST\n            expiry = undefined;\n            swap = true;\n        } else if (underlying !== undefined) {\n            contract = true;\n            option = true;\n            settleId = (settleId === undefined) ? 'USDT' : settleId;\n        } else if (expiry !== undefined) {\n            future = true;\n        }\n        const settle = this.safeCurrencyCode (settleId);\n        const spot = !contract;\n        const filters = this.safeList (market, 'filters', []);\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const status = this.safeString2 (market, 'status', 'contractStatus');\n        let contractSize = undefined;\n        let fees = this.fees;\n        let linear = undefined;\n        let inverse = undefined;\n        let symbol = base + '/' + quote;\n        let strike = undefined;\n        if (contract) {\n            if (swap) {\n                symbol = symbol + ':' + settle;\n            } else if (future) {\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry);\n            } else if (option) {\n                strike = this.numberToString (this.parseToNumeric (this.safeString (market, 'strikePrice')));\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry) + '-' + strike + '-' + this.safeString (optionParts, 3);\n            }\n            contractSize = this.safeNumber2 (market, 'contractSize', 'unit', this.parseNumber ('1'));\n            linear = settle === quote;\n            inverse = settle === base;\n            const feesType = linear ? 'linear' : 'inverse';\n            fees = this.safeDict (this.fees, feesType, {}) as any;\n        }\n        let active = (status === 'TRADING');\n        if (spot) {\n            const permissions = this.safeList (market, 'permissions', []);\n            for (let j = 0; j < permissions.length; j++) {\n                if (permissions[j] === 'TRD_GRP_003') {\n                    active = false;\n                    break;\n                }\n            }\n        }\n        const isMarginTradingAllowed = this.safeBool (market, 'isMarginTradingAllowed', false);\n        let marginModes = undefined;\n        if (spot) {\n            const hasCrossMargin = this.inArray (id, this.options['crossMarginPairsData']);\n            const hasIsolatedMargin = this.inArray (id, this.options['isolatedMarginPairsData']);\n            marginModes = {\n                'cross': hasCrossMargin,\n                'isolated': hasIsolatedMargin,\n            };\n        } else if (linear || inverse) {\n            marginModes = {\n                'cross': true,\n                'isolated': true,\n            };\n        }\n        let unifiedType = undefined;\n        if (spot) {\n            unifiedType = 'spot';\n        } else if (swap) {\n            unifiedType = 'swap';\n        } else if (future) {\n            unifiedType = 'future';\n        } else if (option) {\n            unifiedType = 'option';\n            active = undefined;\n        }\n        let parsedStrike = undefined;\n        if (strike !== undefined) {\n            parsedStrike = this.parseToNumeric (strike);\n        }\n        const entry = {\n            'id': id,\n            'lowercaseId': lowercaseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': unifiedType,\n            'spot': spot,\n            'margin': spot && isMarginTradingAllowed,\n            'marginModes': marginModes,\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': fees['trading']['taker'],\n            'maker': fees['trading']['maker'],\n            'contractSize': contractSize,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': parsedStrike,\n            'optionType': this.safeStringLower (market, 'side'),\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n            'created': this.safeInteger (market, 'onboardDate'), // present in inverse & linear apis\n        };\n        if ('PRICE_FILTER' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n            // PRICE_FILTER reports zero values for maxPrice\n            // since they updated filter types in November 2018\n            // https://github.com/ccxt/ccxt/issues/4286\n            // therefore limits['price']['max'] doesn't have any meaningful value except undefined\n            entry['limits']['price'] = {\n                'min': this.safeNumber (filter, 'minPrice'),\n                'max': this.safeNumber (filter, 'maxPrice'),\n            };\n            entry['precision']['price'] = this.safeNumber (filter, 'tickSize');\n        }\n        if ('LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n            entry['precision']['amount'] = this.safeNumber (filter, 'stepSize');\n            entry['limits']['amount'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if ('MARKET_LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'MARKET_LOT_SIZE', {});\n            entry['limits']['market'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if (('MIN_NOTIONAL' in filtersByType) || ('NOTIONAL' in filtersByType)) { // notional added in 12/04/23 to spot testnet\n            const filter = this.safeDict2 (filtersByType, 'MIN_NOTIONAL', 'NOTIONAL', {});\n            entry['limits']['cost']['min'] = this.safeNumber2 (filter, 'minNotional', 'notional');\n            entry['limits']['cost']['max'] = this.safeNumber (filter, 'maxNotional');\n        }\n        return entry;\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 10697,
        "line_end": 10738,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "{\n        \"symbol\": \"SUSHIUSDT\",\n        \"brackets\": [\n            {\n                \"bracket\": 1,\n                \"initialLeverage\": 50,\n                \"notionalCap\": 50000,\n                \"notionalFloor\": 0,\n                \"maintMarginRatio\": 0.01,\n                \"cum\": 0.0\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\": \"SUSHIUSDT\",\n        //        \"brackets\": [\n        //            {\n        //                \"bracket\": 1,\n        //                \"initialLeverage\": 50,\n        //                \"notionalCap\": 50000,\n        //                \"notionalFloor\": 0,\n        //                \"maintMarginRatio\": 0.01,\n        //                \"cum\": 0.0\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const brackets = this.safeList (info, 'brackets', []);\n        const tiers = [];\n        for (let j = 0; j < brackets.length; j++) {\n            const bracket = brackets[j];\n            tiers.push ({\n                'tier': this.safeNumber (bracket, 'bracket'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber2 (bracket, 'notionalFloor', 'qtyFloor'),\n                'maxNotional': this.safeNumber2 (bracket, 'notionalCap', 'qtyCap'),\n                'maintenanceMarginRate': this.safeNumber (bracket, 'maintMarginRatio'),\n                'maxLeverage': this.safeNumber (bracket, 'initialLeverage'),\n                'info': bracket,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 4595,
        "line_end": 4657,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591478520000, // open time\n         \"0.02501300\",  // open\n         \"0.02501800\",  // high\n         \"0.02500000\",  // low\n         \"0.02500000\",  // close\n         \"22.19000000\", // volume\n         1591478579999, // close time\n         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n         40,            // number of trades\n         \"10.92900000\", // taker buy base asset volume\n         \"0.27336462\",  // taker buy quote asset volume\n         \"0\"            // ignore\n     ]",
          "[\n         [\n         1591256460000,          // Open time\n         \"9653.29201333\",        // Open\n         \"9654.56401333\",        // High\n         \"9653.07367333\",        // Low\n         \"9653.07367333\",        // Close (or latest price)\n         \"0\",                    // Ignore\n         1591256519999,          // Close time\n         \"0\",                    // Ignore\n         60,                     // Number of bisic data\n         \"0\",                    // Ignore\n         \"0\",                    // Ignore\n         \"0\"                     // Ignore\n         ]\n     ]",
          "{\n         \"open\": \"32.2\",\n         \"high\": \"32.2\",\n         \"low\": \"32.2\",\n         \"close\": \"32.2\",\n         \"volume\": \"0\",\n         \"interval\": \"5m\",\n         \"tradeCount\": 0,\n         \"takerVolume\": \"0\",\n         \"takerAmount\": \"0\",\n         \"amount\": \"0\",\n         \"openTime\": 1677096900000,\n         \"closeTime\": 1677097200000\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // when api method = publicGetKlines || fapiPublicGetKlines || dapiPublicGetKlines\n        //     [\n        //         1591478520000, // open time\n        //         \"0.02501300\",  // open\n        //         \"0.02501800\",  // high\n        //         \"0.02500000\",  // low\n        //         \"0.02500000\",  // close\n        //         \"22.19000000\", // volume\n        //         1591478579999, // close time\n        //         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n        //         40,            // number of trades\n        //         \"10.92900000\", // taker buy base asset volume\n        //         \"0.27336462\",  // taker buy quote asset volume\n        //         \"0\"            // ignore\n        //     ]\n        //\n        //  when api method = fapiPublicGetMarkPriceKlines || fapiPublicGetIndexPriceKlines\n        //     [\n        //         [\n        //         1591256460000,          // Open time\n        //         \"9653.29201333\",        // Open\n        //         \"9654.56401333\",        // High\n        //         \"9653.07367333\",        // Low\n        //         \"9653.07367333\",        // Close (or latest price)\n        //         \"0\",                    // Ignore\n        //         1591256519999,          // Close time\n        //         \"0\",                    // Ignore\n        //         60,                     // Number of bisic data\n        //         \"0\",                    // Ignore\n        //         \"0\",                    // Ignore\n        //         \"0\"                     // Ignore\n        //         ]\n        //     ]\n        //\n        // options\n        //\n        //     {\n        //         \"open\": \"32.2\",\n        //         \"high\": \"32.2\",\n        //         \"low\": \"32.2\",\n        //         \"close\": \"32.2\",\n        //         \"volume\": \"0\",\n        //         \"interval\": \"5m\",\n        //         \"tradeCount\": 0,\n        //         \"takerVolume\": \"0\",\n        //         \"takerAmount\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"openTime\": 1677096900000,\n        //         \"closeTime\": 1677097200000\n        //     }\n        //\n        const inverse = this.safeBool (market, 'inverse');\n        const volumeIndex = inverse ? 7 : 5;\n        return [\n            this.safeInteger2 (ohlcv, 0, 'openTime'),\n            this.safeNumber2 (ohlcv, 1, 'open'),\n            this.safeNumber2 (ohlcv, 2, 'high'),\n            this.safeNumber2 (ohlcv, 3, 'low'),\n            this.safeNumber2 (ohlcv, 4, 'close'),\n            this.safeNumber2 (ohlcv, volumeIndex, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 13132,
        "line_end": 13149,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "market['inverse'] ? undefined : amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        const timestamp = this.safeInteger2 (interest, 'timestamp', 'time');\n        const id = this.safeString (interest, 'symbol');\n        const amount = this.safeNumber2 (interest, 'sumOpenInterest', 'openInterest');\n        const value = this.safeNumber2 (interest, 'sumOpenInterestValue', 'sumOpenInterestUsd');\n        // Inverse returns the number of contracts different from the base or quote volume in this case\n        // compared with https://www.binance.com/en/futures/funding-history/quarterly/4\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id, market, undefined, 'contract'),\n            'baseVolume': market['inverse'] ? undefined : amount,  // deprecated\n            'quoteVolume': value,  // deprecated\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 13768,
        "line_end": 13812,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPrice')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPrice')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'lastPrice')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'exercisePrice')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (chain, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (chain, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-241227-80000-C\",\n         \"priceChange\": \"0\",\n         \"priceChangePercent\": \"0\",\n         \"lastPrice\": \"2750\",\n         \"lastQty\": \"0\",\n         \"open\": \"2750\",\n         \"high\": \"2750\",\n         \"low\": \"2750\",\n         \"volume\": \"0\",\n         \"amount\": \"0\",\n         \"bidPrice\": \"4880\",\n         \"askPrice\": \"0\",\n         \"openTime\": 0,\n         \"closeTime\": 0,\n         \"firstTradeId\": 0,\n         \"tradeCount\": 0,\n         \"strikePrice\": \"80000\",\n         \"exercisePrice\": \"63944.09893617\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"symbol\": \"BTC-241227-80000-C\",\n        //         \"priceChange\": \"0\",\n        //         \"priceChangePercent\": \"0\",\n        //         \"lastPrice\": \"2750\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"2750\",\n        //         \"high\": \"2750\",\n        //         \"low\": \"2750\",\n        //         \"volume\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"bidPrice\": \"4880\",\n        //         \"askPrice\": \"0\",\n        //         \"openTime\": 0,\n        //         \"closeTime\": 0,\n        //         \"firstTradeId\": 0,\n        //         \"tradeCount\": 0,\n        //         \"strikePrice\": \"80000\",\n        //         \"exercisePrice\": \"63944.09893617\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPrice'),\n            'askPrice': this.safeNumber (chain, 'askPrice'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'lastPrice'),\n            'underlyingPrice': this.safeNumber (chain, 'exercisePrice'),\n            'change': this.safeNumber (chain, 'priceChange'),\n            'percentage': this.safeNumber (chain, 'priceChangePercent'),\n            'baseVolume': this.safeNumber (chain, 'volume'),\n            'quoteVolume': undefined,\n        };\n    }"
      },
      {
        "name": "parseOptionPosition",
        "signature": "parseOptionPosition (position: Dict, market: Market = undefined)",
        "line_start": 10844,
        "line_end": 10900,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'markValue')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'positionCost')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPNL')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"entryPrice\": \"27.70000000\",\n         \"symbol\": \"ETH-230426-1850-C\",\n         \"side\": \"LONG\",\n         \"quantity\": \"0.50000000\",\n         \"reducibleQty\": \"0.50000000\",\n         \"markValue\": \"10.250000000\",\n         \"ror\": \"-0.2599\",\n         \"unrealizedPNL\": \"-3.600000000\",\n         \"markPrice\": \"20.5\",\n         \"strikePrice\": \"1850.00000000\",\n         \"positionCost\": \"13.85000000\",\n         \"expiryDate\": 1682496000000,\n         \"priceScale\": 1,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"quoteAsset\": \"USDT\",\n         \"time\": 1682492427106\n     }"
        ],
        "source": "parseOptionPosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"entryPrice\": \"27.70000000\",\n        //         \"symbol\": \"ETH-230426-1850-C\",\n        //         \"side\": \"LONG\",\n        //         \"quantity\": \"0.50000000\",\n        //         \"reducibleQty\": \"0.50000000\",\n        //         \"markValue\": \"10.250000000\",\n        //         \"ror\": \"-0.2599\",\n        //         \"unrealizedPNL\": \"-3.600000000\",\n        //         \"markPrice\": \"20.5\",\n        //         \"strikePrice\": \"1850.00000000\",\n        //         \"positionCost\": \"13.85000000\",\n        //         \"expiryDate\": 1682496000000,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"time\": 1682492427106\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        let quantity = this.safeString (position, 'quantity');\n        if (side !== 'long') {\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        const timestamp = this.safeInteger (position, 'time');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'notional': this.safeNumber (position, 'markValue'),\n            'collateral': this.safeNumber (position, 'positionCost'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPNL'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 5636,
        "line_end": 6236,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "fills",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"0.0\",\n         \"cummulativeQuoteQty\": \"0.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"icebergQty\": \"0.0\",\n         \"time\": 1499827319559,\n         \"updateTime\": 1499827319559,\n         \"isWorking\": true\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 16383176297,\n         \"orderListId\": -1,\n         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n         \"transactTime\": 1670891847932,\n         \"price\": \"13500.00000000\",\n         \"origQty\": \"0.00085000\",\n         \"executedQty\": \"0.00000000\",\n         \"cummulativeQuoteQty\": \"0.00000000\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"fills\": []\n     }",
          "{\n         \"orderId\": 151007482392,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"NEW\",\n         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n         \"price\": \"25000\",\n         \"avgPrice\": \"0.00000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0\",\n         \"cumQty\": \"0\",\n         \"cumQuote\": \"0\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"BUY\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"updateTime\": 1684300587845\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"1.0\",\n         \"cumQuote\": \"10.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"updateTime\": 1499827319559\n     }",
          "createOrder with { \"newOrderRespType\": \"FULL\" }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"0.0\",\n        //         \"cummulativeQuoteQty\": \"0.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"icebergQty\": \"0.0\",\n        //         \"time\": 1499827319559,\n        //         \"updateTime\": 1499827319559,\n        //         \"isWorking\": true\n        //     }\n        //\n        // spot: editOrder\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 16383176297,\n        //         \"orderListId\": -1,\n        //         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n        //         \"transactTime\": 1670891847932,\n        //         \"price\": \"13500.00000000\",\n        //         \"origQty\": \"0.00085000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"fills\": []\n        //     }\n        //\n        // swap and future: editOrder\n        //\n        //     {\n        //         \"orderId\": 151007482392,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n        //         \"price\": \"25000\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"updateTime\": 1684300587845\n        //     }\n        //\n        // futures\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"1.0\",\n        //         \"cumQuote\": \"10.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"updateTime\": 1499827319559\n        //     }\n        //\n        // createOrder with { \"newOrderRespType\": \"FULL\" }\n        //\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"orderId\": 5403233939,\n        //       \"orderListId\": -1,\n        //       \"clientOrderId\": \"x-TKT5PX2F5e669e75b6c14f69a2c43e\",\n        //       \"transactTime\": 1617151923742,\n        //       \"price\": \"0.00000000\",\n        //       \"origQty\": \"0.00050000\",\n        //       \"executedQty\": \"0.00050000\",\n        //       \"cummulativeQuoteQty\": \"29.47081500\",\n        //       \"status\": \"FILLED\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"side\": \"BUY\",\n        //       \"fills\": [\n        //         {\n        //           \"price\": \"58941.63000000\",\n        //           \"qty\": \"0.00050000\",\n        //           \"commission\": \"0.00007050\",\n        //           \"commissionAsset\": \"BNB\",\n        //           \"tradeId\": 737466631\n        //         }\n        //       ]\n        //     }\n        //\n        // delivery\n        //\n        //     {\n        //       \"orderId\": \"18742727411\",\n        //       \"symbol\": \"ETHUSD_PERP\",\n        //       \"pair\": \"ETHUSD\",\n        //       \"status\": \"FILLED\",\n        //       \"clientOrderId\": \"x-xcKtGhcu3e2d1503fdd543b3b02419\",\n        //       \"price\": \"0\",\n        //       \"avgPrice\": \"4522.14\",\n        //       \"origQty\": \"1\",\n        //       \"executedQty\": \"1\",\n        //       \"cumBase\": \"0.00221134\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"reduceOnly\": false,\n        //       \"closePosition\": false,\n        //       \"side\": \"SELL\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"stopPrice\": \"0\",\n        //       \"workingType\": \"CONTRACT_PRICE\",\n        //       \"priceProtect\": false,\n        //       \"origType\": \"MARKET\",\n        //       \"time\": \"1636061952660\",\n        //       \"updateTime\": \"1636061952660\"\n        //     }\n        //\n        // option: createOrder, fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"orderId\": 4728833085436977152,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"10.0\",\n        //         \"quantity\": \"1.00\",\n        //         \"executedQty\": \"0.00\",\n        //         \"fee\": \"0\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"reduceOnly\": false,\n        //         \"postOnly\": false,\n        //         \"createTime\": 1676083034462,\n        //         \"updateTime\": 1676083034462,\n        //         \"status\": \"ACCEPTED\",\n        //         \"avgPrice\": \"0\",\n        //         \"source\": \"API\",\n        //         \"clientOrderId\": \"\",\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"lastTrade\": {\"id\":\"69\",\"time\":\"1676084430567\",\"price\":\"24.9\",\"qty\":\"1.00\"},\n        //         \"mmp\": false\n        //     }\n        //\n        // cancelOrders/createOrders\n        //\n        //     {\n        //         \"code\": -4005,\n        //         \"msg\": \"Quantity greater than max quantity.\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin linear swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"executedQty\": \"0.000\",\n        //         \"orderId\": 258649539704,\n        //         \"goodTillDate\": 0,\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"clientOrderId\": \"x-xcKtGhcu02573c6f15e544e990057b\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0.000\",\n        //         \"updateTime\": 1707110415436,\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"35000.00\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin inverse swap and future\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"side\": \"BUY\",\n        //         \"cumBase\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"orderId\": 71275227732,\n        //         \"avgPrice\": \"0.00\",\n        //         \"origQty\": \"1\",\n        //         \"clientOrderId\": \"x-xcKtGhcuca5af3acfb5044198c5398\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0\",\n        //         \"updateTime\": 1707110994334,\n        //         \"type\": \"LIMIT\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"2000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOpenOrder: portfolio margin linear swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu27f109953d6e4dc0974006\",\n        //         \"strategyId\": 3645916,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"45000.00\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707112625879,\n        //         \"updateTime\": 1707112625879,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders: portfolio margin inverse swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuc6b86f053bb34933850739\",\n        //         \"strategyId\": 1423462,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2000\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"3000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707113098840,\n        //         \"updateTime\": 1707113098840,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin\n        //\n        //     {\n        //         \"clientOrderId\": \"x-TKT5PX2Fe9ef29d8346440f0b28b86\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"fills\": [],\n        //         \"orderId\": 24684460474,\n        //         \"origQty\": \"0.00100000\",\n        //         \"price\": \"35000.00000000\",\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"side\": \"BUY\",\n        //         \"status\": \"NEW\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"transactTime\": 1707113538870,\n        //         \"type\": \"LIMIT\"\n        //     }\n        //\n        // fetchOpenOrders, fetchOrder, fetchOrders: portfolio margin spot margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 24700763749,\n        //         \"clientOrderId\": \"x-TKT5PX2F6f724c2a4af6425f98c7b6\",\n        //         \"price\": \"35000.00000000\",\n        //         \"origQty\": \"0.00100000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.00000000\",\n        //         \"icebergQty\": \"0.00000000\",\n        //         \"time\": 1707199187679,\n        //         \"updateTime\": 1707199187679,\n        //         \"isWorking\": true,\n        //         \"accountId\": 200180970,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"preventedMatchId\": null,\n        //         \"preventedQuantity\": null\n        //     }\n        //\n        // cancelOrder: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"strategyId\": 3733211,\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyType\": \"STOP\",\n        //         \"strategyStatus\": \"CANCELED\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000.00\", // ignored with trailing orders\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"activatePrice\": null,  // only return with trailing orders\n        //         \"priceRate\": null,      // only return with trailing orders\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOrders: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyId\": 3733211,\n        //         \"strategyStatus\": \"CANCELLED\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000\",\n        //         \"orderId\": 0,\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"type\": \"LIMIT\",\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerTime\": 0,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: linear swap\n        //\n        //     {\n        //         \"orderId\": 3697213934,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcufb20c5a7761a4aa09aa156\",\n        //         \"price\": \"33000.00\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0.000\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0.00\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"goodTillDate\": 0,\n        //         \"time\": 1707892893502,\n        //         \"updateTime\": 1707892893515\n        //     }\n        //\n        // fetchOpenOrder: inverse swap\n        //\n        //     {\n        //         \"orderId\": 597368542,\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcubbde7ba93b1a4ab881eff3\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893453199,\n        //         \"updateTime\": 1707893453199\n        //     }\n        //\n        // fetchOpenOrder: linear portfolio margin\n        //\n        //     {\n        //         \"orderId\": 264895013409,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcu6278f1adbdf14f74ab432e\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893839364,\n        //         \"updateTime\": 1707893839364,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin\n        //\n        //     {\n        //         \"orderId\": 71790316950,\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcuec11030474204ab08ba2c2\",\n        //         \"price\": \"2500\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707894181694,\n        //         \"updateTime\": 1707894181694\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu2da9c765294b433994ffce\",\n        //         \"strategyId\": 1423501,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2500\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"stopPrice\": \"4000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"bookTime\": 1707894782679,\n        //         \"updateTime\": 1707894782679,\n        //         \"timeInForce\": \"GTC\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, fetchOrder, fetchOpenOrders, fetchOrders, cancelOrderWs, createOrderWs: linear swap conditional order\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"algoType\": \"CONDITIONAL\",\n        //         \"orderType\": \"STOP\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"quantity\": \"0.002\",\n        //         \"algoStatus\": \"NEW\",\n        //         \"triggerPrice\": \"100000.00\",\n        //         \"price\": \"102000.00\",\n        //         \"icebergQuantity\": null,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"closePosition\": false,\n        //         \"priceProtect\": false,\n        //         \"reduceOnly\": false,\n        //         \"createTime\": 1763458576201,\n        //         \"updateTime\": 1763458576201,\n        //         \"triggerTime\": 0,\n        //         \"goodTillDate\": 0\n        //     }\n        //\n        // cancelOrder: linear swap conditional\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"code\": \"200\",\n        //         \"msg\": \"success\"\n        //     }\n        //\n        const code = this.safeString (order, 'code');\n        if (code !== undefined) {\n            // cancelOrders/createOrders might have a partial success\n            const msg = this.safeString (order, 'msg');\n            if ((code !== '200') && !((msg === 'success') || (msg === 'The operation of cancel all open order is done.'))) {\n                return this.safeOrder ({ 'info': order, 'status': 'rejected' }, market);\n            }\n        }\n        const status = this.parseOrderStatus (this.safeStringN (order, [ 'status', 'strategyStatus', 'algoStatus' ]));\n        const marketId = this.safeString (order, 'symbol');\n        const isContract = ('positionSide' in order) || ('cumQuote' in order);\n        const marketType = isContract ? 'contract' : 'spot';\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const filled = this.safeString (order, 'executedQty', '0');\n        const timestamp = this.safeIntegerN (order, [ 'time', 'createTime', 'workingTime', 'transactTime', 'updateTime' ]); // order of the keys matters here\n        let lastTradeTimestamp = undefined;\n        if (('transactTime' in order) || ('updateTime' in order)) {\n            const timestampValue = this.safeInteger2 (order, 'updateTime', 'transactTime');\n            if (status === 'open') {\n                if (Precise.stringGt (filled, '0')) {\n                    lastTradeTimestamp = timestampValue;\n                }\n            } else if (status === 'closed') {\n                lastTradeTimestamp = timestampValue;\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger2 (order, 'transactTime', 'updateTime');\n        const average = this.safeString (order, 'avgPrice');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString2 (order, 'origQty', 'quantity');\n        // - Spot/Margin market: cummulativeQuoteQty\n        // - Futures market: cumQuote.\n        //   Note this is not the actual cost, since Binance futures uses leverage to calculate margins.\n        let cost = this.safeString2 (order, 'cummulativeQuoteQty', 'cumQuote');\n        cost = this.safeString (order, 'cumBase', cost);\n        const type = this.safeStringLower2 (order, 'type', 'orderType');\n        const side = this.safeStringLower (order, 'side');\n        const fills = this.safeList (order, 'fills', []);\n        let timeInForce = this.safeString (order, 'timeInForce');\n        if (timeInForce === 'GTX') {\n            // GTX means \"Good Till Crossing\" and is an equivalent way of saying Post Only\n            timeInForce = 'PO';\n        }\n        const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');\n        const stopPriceString = this.safeString2 (order, 'stopPrice', 'triggerPrice');\n        const triggerPrice = this.parseNumber (this.omitZero (stopPriceString));\n        const feeCost = this.safeNumber (order, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': this.safeString (order, 'quoteAsset'),\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ]),\n            'clientOrderId': this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': fills,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 5605,
        "line_end": 5622,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'ACCEPTED': 'open',\n            'TRIGGERING': 'open',\n            'FILLED': 'closed',\n            'TRIGGERED': 'closed',\n            'FINISHED': 'closed',\n            'CANCELED': 'canceled',\n            'CANCELLED': 'canceled',\n            'PENDING_CANCEL': 'canceling', // currently unused\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n            'EXPIRED_IN_MATCH': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 5624,
        "line_end": 5634,
        "comment": null,
        "mappings": [
          {
            "key": "limit_maker",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "take_profit",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "take_profit_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "trailing_stop_market",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types = {\n            'limit_maker': 'limit',\n            'stop': 'limit',\n            'stop_market': 'market',\n            'take_profit': 'limit',\n            'take_profit_market': 'market',\n            'trailing_stop_market': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePositionRisk",
        "signature": "parsePositionRisk (position, market: Market = undefined)",
        "line_start": 10331,
        "line_end": 10568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePositionRisk (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        //  {\n        //     symbol: \"WLDUSDT\",\n        //     positionSide: \"BOTH\",\n        //     positionAmt: \"5\",\n        //     entryPrice: \"2.3483\",\n        //     breakEvenPrice: \"2.349356735\",\n        //     markPrice: \"2.39560000\",\n        //     unRealizedProfit: \"0.23650000\",\n        //     liquidationPrice: \"0\",\n        //     isolatedMargin: \"0\",\n        //     notional: \"11.97800000\",\n        //     isolatedWallet: \"0\",\n        //     updateTime: \"1722062678998\",\n        //     initialMargin: \"2.39560000\",         // not in v2\n        //     maintMargin: \"0.07186800\",           // not in v2\n        //     positionInitialMargin: \"2.39560000\", // not in v2\n        //     openOrderInitialMargin: \"0\",         // not in v2\n        //     adl: \"2\",                            // not in v2\n        //     bidNotional: \"0\",                    // not in v2\n        //     askNotional: \"0\",                    // not in v2\n        //     marginAsset: \"USDT\",                 // not in v2\n        //     // the below fields are only in v2\n        //     leverage: \"5\",\n        //     maxNotionalValue: \"6000000\",\n        //     marginType: \"cross\",\n        //     isAutoAddMargin: \"false\",\n        //     isolated: false,\n        //     adlQuantile: \"2\",\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_PERP\",\n        //       \"positionAmt\": \"2\",\n        //       \"entryPrice\": \"37643.10000021\",\n        //       \"markPrice\": \"38103.05510455\",\n        //       \"unRealizedProfit\": \"0.00006413\",\n        //       \"liquidationPrice\": \"25119.97445760\",\n        //       \"leverage\": \"2\",\n        //       \"maxQty\": \"1500\",\n        //       \"marginType\": \"isolated\",\n        //       \"isolatedMargin\": \"0.00274471\",\n        //       \"isAutoAddMargin\": \"false\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"notionalValue\": \"0.00524892\",\n        //       \"isolatedWallet\": \"0.00268058\"\n        //     }\n        //\n        // inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"positionAmt\": \"1\",\n        //         \"entryPrice\": \"2422.400000007\",\n        //         \"markPrice\": \"2424.51267823\",\n        //         \"unRealizedProfit\": \"0.0000036\",\n        //         \"liquidationPrice\": \"293.57678898\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371941861,\n        //         \"maxQty\": \"15\",\n        //         \"notionalValue\": \"0.00412454\",\n        //         \"breakEvenPrice\": \"2423.368960034\"\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"positionAmt\": \"0.01\",\n        //         \"entryPrice\": \"44525.0\",\n        //         \"markPrice\": \"45464.1735922\",\n        //         \"unRealizedProfit\": \"9.39173592\",\n        //         \"liquidationPrice\": \"38007.16308568\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371879042,\n        //         \"maxNotionalValue\": \"500000.0\",\n        //         \"notional\": \"454.64173592\",\n        //         \"breakEvenPrice\": \"44542.81\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const isolatedMarginString = this.safeString (position, 'isolatedMargin');\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const notional = this.parseNumber (notionalStringAbs);\n        const contractsAbs = Precise.stringAbs (this.safeString (position, 'positionAmt'));\n        const contracts = this.parseNumber (contractsAbs);\n        const unrealizedPnlString = this.safeString (position, 'unRealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        const liquidationPriceString = this.omitZero (this.safeString (position, 'liquidationPrice'));\n        const liquidationPrice = this.parseNumber (liquidationPriceString);\n        let collateralString = undefined;\n        let marginMode = this.safeString (position, 'marginType');\n        if (marginMode === undefined && isolatedMarginString !== undefined) {\n            marginMode = Precise.stringEq (isolatedMarginString, '0') ? 'cross' : 'isolated';\n        }\n        let side = undefined;\n        if (Precise.stringGt (notionalString, '0')) {\n            side = 'long';\n        } else if (Precise.stringLt (notionalString, '0')) {\n            side = 'short';\n        }\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        const entryPrice = this.parseNumber (entryPriceString);\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        // as oppose to notionalValue\n        const linear = ('notional' in position);\n        if (marginMode === 'cross') {\n            // calculate collateral\n            const precision = this.safeDict (market, 'precision', {});\n            const basePrecisionValue = this.safeString (precision, 'base');\n            const quotePrecisionValue = this.safeString2 (precision, 'quote', 'price');\n            const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);\n            if (!precisionIsUndefined) {\n                if (linear) {\n                    // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    }\n                    const inner = Precise.stringMul (liquidationPriceString, onePlusMaintenanceMarginPercentageString);\n                    const leftSide = Precise.stringAdd (inner, entryPriceSignString);\n                    const quotePrecision = this.precisionFromString (this.safeString2 (precision, 'quote', 'price'));\n                    if (quotePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, contractsAbs), '1', quotePrecision);\n                    }\n                } else {\n                    // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    }\n                    const leftSide = Precise.stringMul (contractsAbs, contractSizeString);\n                    const rightSide = Precise.stringSub (Precise.stringDiv ('1', entryPriceSignString), Precise.stringDiv (onePlusMaintenanceMarginPercentageString, liquidationPriceString));\n                    const basePrecision = this.precisionFromString (this.safeString (precision, 'base'));\n                    if (basePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, rightSide), '1', basePrecision);\n                    }\n                }\n            }\n        } else {\n            collateralString = this.safeString (position, 'isolatedMargin');\n        }\n        collateralString = (collateralString === undefined) ? '0' : collateralString;\n        const collateral = this.parseNumber (collateralString);\n        const markPrice = this.parseNumber (this.omitZero (this.safeString (position, 'markPrice')));\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        let maintenanceMarginString = Precise.stringMul (maintenanceMarginPercentageString, notionalStringAbs);\n        if (maintenanceMarginString === undefined) {\n            // for a while, this new value was a backup to the existing calculations, but in future we might prioritize this\n            maintenanceMarginString = this.safeString (position, 'maintMargin');\n        }\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        let initialMarginString = undefined;\n        let initialMarginPercentageString = undefined;\n        const leverageString = this.safeString (position, 'leverage');\n        if (leverageString !== undefined) {\n            const leverage = parseInt (leverageString);\n            const rational = this.isRoundNumber (1000 % leverage);\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringAdd (initialMarginPercentageString, '1e-8');\n            }\n            const unrounded = Precise.stringMul (notionalStringAbs, initialMarginPercentageString);\n            initialMarginString = Precise.stringDiv (unrounded, '1', 8);\n        } else {\n            initialMarginString = this.safeString (position, 'initialMargin');\n            const unrounded = Precise.stringMul (initialMarginString, '1');\n            initialMarginPercentageString = Precise.stringDiv (unrounded, notionalStringAbs, 8);\n        }\n        let marginRatio = undefined;\n        let percentage = undefined;\n        if (!Precise.stringEquals (collateralString, '0')) {\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'unrealizedPnl': unrealizedPnl,\n            'leverage': this.parseNumber (leverageString),\n            'liquidationPrice': liquidationPrice,\n            'collateral': collateral,\n            'notional': notional,\n            'markPrice': markPrice,\n            'entryPrice': entryPrice,\n            'timestamp': timestamp,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'marginRatio': marginRatio,\n            'datetime': this.iso8601 (timestamp),\n            'marginMode': marginMode,\n            'marginType': marginMode, // deprecated\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 11662,
        "line_end": 11702,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH-230223-1900-P\",\n         \"strikePrice\": \"1900\",\n         \"realStrikePrice\": \"1665.5897334\",\n         \"expiryDate\": 1677139200000,\n         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n     }",
          "{\n         \"id\": \"1125899906842897036\",\n         \"currency\": \"USDT\",\n         \"symbol\": \"BTC-230728-30000-C\",\n         \"exercisePrice\": \"30000.00000000\",\n         \"markPrice\": \"29160.71284993\",\n         \"quantity\": \"1.00000000\",\n         \"amount\": \"0.00000000\",\n         \"fee\": \"0.00000000\",\n         \"createDate\": 1690531200000,\n         \"priceScale\": 0,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"positionSide\": \"LONG\",\n         \"quoteAsset\": \"USDT\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"symbol\": \"ETH-230223-1900-P\",\n        //         \"strikePrice\": \"1900\",\n        //         \"realStrikePrice\": \"1665.5897334\",\n        //         \"expiryDate\": 1677139200000,\n        //         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"id\": \"1125899906842897036\",\n        //         \"currency\": \"USDT\",\n        //         \"symbol\": \"BTC-230728-30000-C\",\n        //         \"exercisePrice\": \"30000.00000000\",\n        //         \"markPrice\": \"29160.71284993\",\n        //         \"quantity\": \"1.00000000\",\n        //         \"amount\": \"0.00000000\",\n        //         \"fee\": \"0.00000000\",\n        //         \"createDate\": 1690531200000,\n        //         \"priceScale\": 0,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"positionSide\": \"LONG\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (settlement, 'expiryDate', 'createDate');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 11704,
        "line_end": 11744,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETH-230223-1900-P\",\n             \"strikePrice\": \"1900\",\n             \"realStrikePrice\": \"1665.5897334\",\n             \"expiryDate\": 1677139200000,\n             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n         }\n     ]",
          "[\n         {\n             \"id\": \"1125899906842897036\",\n             \"currency\": \"USDT\",\n             \"symbol\": \"BTC-230728-30000-C\",\n             \"exercisePrice\": \"30000.00000000\",\n             \"markPrice\": \"29160.71284993\",\n             \"quantity\": \"1.00000000\",\n             \"amount\": \"0.00000000\",\n             \"fee\": \"0.00000000\",\n             \"createDate\": 1690531200000,\n             \"priceScale\": 0,\n             \"quantityScale\": 2,\n             \"optionSide\": \"CALL\",\n             \"positionSide\": \"LONG\",\n             \"quoteAsset\": \"USDT\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETH-230223-1900-P\",\n        //             \"strikePrice\": \"1900\",\n        //             \"realStrikePrice\": \"1665.5897334\",\n        //             \"expiryDate\": 1677139200000,\n        //             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"id\": \"1125899906842897036\",\n        //             \"currency\": \"USDT\",\n        //             \"symbol\": \"BTC-230728-30000-C\",\n        //             \"exercisePrice\": \"30000.00000000\",\n        //             \"markPrice\": \"29160.71284993\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"amount\": \"0.00000000\",\n        //             \"fee\": \"0.00000000\",\n        //             \"createDate\": 1690531200000,\n        //             \"priceScale\": 0,\n        //             \"quantityScale\": 2,\n        //             \"optionSide\": \"CALL\",\n        //             \"positionSide\": \"LONG\",\n        //             \"quoteAsset\": \"USDT\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 4068,
        "line_end": 4254,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'highPrice', 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'lowPrice', 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "wAvg",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'openPrice', 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'prevClosePrice')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"11793.63104562\", // mark price\n         \"indexPrice\": \"11781.80495970\", // index price\n         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n         \"nextFundingTime\": 1597392000000,\n         \"interestRate\": \"0.00010000\",\n         \"time\": 1597370495002\n     }",
          "{\n        \"symbol\": \"BTCUSDT\",\n        \"priceChange\": \"-188.18000000\",\n        \"priceChangePercent\": \"-0.159\",\n        \"weightedAvgPrice\": \"118356.64734074\",\n        \"lastPrice\": \"118449.03000000\",\n        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        \"openPrice\": \"118637.21000000\",\n        \"highPrice\": \"119273.36000000\",\n        \"lowPrice\": \"117427.50000000\",\n        \"volume\": \"14741.41491000\",\n        \"quoteVolume\": \"1744744445.80640740\",\n        \"openTime\": \"1753701474013\",\n        \"closeTime\": \"1753787874013\",\n        \"firstId\": \"5116031635\",\n        \"lastId\": \"5117964946\",\n        \"count\": \"1933312\"\n    }",
          "{\n        \"symbol\": \"SUSDT\",\n        \"priceChange\": \"-0.0229000\",\n        \"priceChangePercent\": \"-6.777\",\n        \"weightedAvgPrice\": \"0.3210035\",\n        \"lastPrice\": \"0.3150000\",\n        \"lastQty\": \"16\",\n        \"openPrice\": \"0.3379000\",\n        \"highPrice\": \"0.3411000\",\n        \"lowPrice\": \"0.3071000\",\n        \"volume\": \"120588225\",\n        \"quoteVolume\": \"38709237.2289000\",\n        \"openTime\": \"1753701720000\",\n        \"closeTime\": \"1753788172414\",\n        \"firstId\": \"72234973\",\n        \"lastId\": \"72423677\",\n        \"count\": \"188700\"\n    }",
          "{\n         \"baseVolume\": \"214549.95171161\",\n         \"closeTime\": \"1621965286847\",\n         \"count\": \"1283779\",\n         \"firstId\": \"152560106\",\n         \"highPrice\": \"39938.3\",\n         \"lastId\": \"153843955\",\n         \"lastPrice\": \"37993.4\",\n         \"lastQty\": \"1\",\n         \"lowPrice\": \"36457.2\",\n         \"openPrice\": \"37783.4\",\n         \"openTime\": \"1621878840000\",\n         \"pair\": \"BTCUSD\",\n         \"priceChange\": \"210.0\",\n         \"priceChangePercent\": \"0.556\",\n         \"symbol\": \"BTCUSD_PERP\",\n         \"volume\": \"81990451\",\n         \"weightedAvgPrice\": \"38215.08713747\"\n     }",
          "{\n         \"symbol\": \"ETH-230510-1825-C\",\n         \"priceChange\": \"-5.1\",\n         \"priceChangePercent\": \"-0.1854\",\n         \"lastPrice\": \"22.4\",\n         \"lastQty\": \"0\",\n         \"open\": \"27.5\",\n         \"high\": \"34.1\",\n         \"low\": \"22.4\",\n         \"volume\": \"6.83\",\n         \"amount\": \"201.44\",\n         \"bidPrice\": \"21.9\",\n         \"askPrice\": \"22.4\",\n         \"openTime\": 1683614771898,\n         \"closeTime\": 1683695017784,\n         \"firstTradeId\": 12,\n         \"tradeCount\": 22,\n         \"strikePrice\": \"1825\",\n         \"exercisePrice\": \"1845.95341176\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // markPrices\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"11793.63104562\", // mark price\n        //         \"indexPrice\": \"11781.80495970\", // index price\n        //         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n        //         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n        //         \"nextFundingTime\": 1597392000000,\n        //         \"interestRate\": \"0.00010000\",\n        //         \"time\": 1597370495002\n        //     }\n        //\n        // spot - ticker\n        //\n        //    {\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"priceChange\": \"-188.18000000\",\n        //        \"priceChangePercent\": \"-0.159\",\n        //        \"weightedAvgPrice\": \"118356.64734074\",\n        //        \"lastPrice\": \"118449.03000000\",\n        //        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        //        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        //        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        //        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        //        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        //        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        //        \"openPrice\": \"118637.21000000\",\n        //        \"highPrice\": \"119273.36000000\",\n        //        \"lowPrice\": \"117427.50000000\",\n        //        \"volume\": \"14741.41491000\",\n        //        \"quoteVolume\": \"1744744445.80640740\",\n        //        \"openTime\": \"1753701474013\",\n        //        \"closeTime\": \"1753787874013\",\n        //        \"firstId\": \"5116031635\",\n        //        \"lastId\": \"5117964946\",\n        //        \"count\": \"1933312\"\n        //    }\n        //\n        // usdm tickers\n        //\n        //    {\n        //        \"symbol\": \"SUSDT\",\n        //        \"priceChange\": \"-0.0229000\",\n        //        \"priceChangePercent\": \"-6.777\",\n        //        \"weightedAvgPrice\": \"0.3210035\",\n        //        \"lastPrice\": \"0.3150000\",\n        //        \"lastQty\": \"16\",\n        //        \"openPrice\": \"0.3379000\",\n        //        \"highPrice\": \"0.3411000\",\n        //        \"lowPrice\": \"0.3071000\",\n        //        \"volume\": \"120588225\",\n        //        \"quoteVolume\": \"38709237.2289000\",\n        //        \"openTime\": \"1753701720000\",\n        //        \"closeTime\": \"1753788172414\",\n        //        \"firstId\": \"72234973\",\n        //        \"lastId\": \"72423677\",\n        //        \"count\": \"188700\"\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //         \"baseVolume\": \"214549.95171161\",\n        //         \"closeTime\": \"1621965286847\",\n        //         \"count\": \"1283779\",\n        //         \"firstId\": \"152560106\",\n        //         \"highPrice\": \"39938.3\",\n        //         \"lastId\": \"153843955\",\n        //         \"lastPrice\": \"37993.4\",\n        //         \"lastQty\": \"1\",\n        //         \"lowPrice\": \"36457.2\",\n        //         \"openPrice\": \"37783.4\",\n        //         \"openTime\": \"1621878840000\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"priceChange\": \"210.0\",\n        //         \"priceChangePercent\": \"0.556\",\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"volume\": \"81990451\",\n        //         \"weightedAvgPrice\": \"38215.08713747\"\n        //     }\n        //\n        // eapi: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"ETH-230510-1825-C\",\n        //         \"priceChange\": \"-5.1\",\n        //         \"priceChangePercent\": \"-0.1854\",\n        //         \"lastPrice\": \"22.4\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"27.5\",\n        //         \"high\": \"34.1\",\n        //         \"low\": \"22.4\",\n        //         \"volume\": \"6.83\",\n        //         \"amount\": \"201.44\",\n        //         \"bidPrice\": \"21.9\",\n        //         \"askPrice\": \"22.4\",\n        //         \"openTime\": 1683614771898,\n        //         \"closeTime\": 1683695017784,\n        //         \"firstTradeId\": 12,\n        //         \"tradeCount\": 22,\n        //         \"strikePrice\": \"1825\",\n        //         \"exercisePrice\": \"1845.95341176\"\n        //     }\n        //\n        // spot bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"ETHBTC\",\n        //         \"bidPrice\":\"0.07466800\",\n        //         \"bidQty\":\"5.31990000\",\n        //         \"askPrice\":\"0.07466900\",\n        //         \"askQty\":\"10.93540000\"\n        //     }\n        //\n        // usdm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"bidPrice\":\"21321.90\",\n        //         \"bidQty\":\"33.592\",\n        //         \"askPrice\":\"21322.00\",\n        //         \"askQty\":\"1.427\",\n        //         \"time\":\"1673899207538\"\n        //     }\n        //\n        // coinm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD_PERP\",\n        //         \"pair\":\"BTCUSD\",\n        //         \"bidPrice\":\"21301.2\",\n        //         \"bidQty\":\"188\",\n        //         \"askPrice\":\"21301.3\",\n        //         \"askQty\":\"10302\",\n        //         \"time\":\"1673899278514\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (ticker, 'closeTime', 'time');\n        let marketType = undefined;\n        if (('time' in ticker)) {\n            marketType = 'contract';\n        }\n        if (marketType === undefined) {\n            marketType = ('bidQty' in ticker) ? 'spot' : 'contract';\n        }\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const last = this.safeString (ticker, 'lastPrice');\n        const wAvg = this.safeString (ticker, 'weightedAvgPrice');\n        const isCoinm = ('baseVolume' in ticker);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        if (isCoinm) {\n            baseVolume = this.safeString (ticker, 'baseVolume');\n            // 'volume' field in inverse markets is not quoteVolume, but traded amount (per contracts)\n            quoteVolume = Precise.stringMul (baseVolume, wAvg);\n        } else {\n            baseVolume = this.safeString (ticker, 'volume');\n            quoteVolume = this.safeString2 (ticker, 'quoteVolume', 'amount');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'highPrice', 'high'),\n            'low': this.safeString2 (ticker, 'lowPrice', 'low'),\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': wAvg,\n            'open': this.safeString2 (ticker, 'openPrice', 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'prevClosePrice'), // previous day close\n            'change': this.safeString (ticker, 'priceChange'),\n            'percentage': this.safeString (ticker, 'priceChangePercent'),\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTickersForRolling",
        "signature": "parseTickersForRolling (response, symbols)",
        "line_start": 4518,
        "line_end": 4528,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTickersForRolling (response, symbols) {\n        const results = [];\n        for (let i = 0; i < response.length; i++) {\n            const marketId = this.safeString (response[i], 'symbol');\n            const tickerMarket = this.safeMarket (marketId, undefined, undefined, 'spot');\n            const parsedTicker = this.parseTicker (response[i]);\n            parsedTicker['symbol'] = tickerMarket['symbol'];\n            results.push (parsedTicker);\n        }\n        return this.filterByArray (results, 'symbol', symbols);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 4791,
        "line_end": 5057,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ])",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'type')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'p', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (trade, 'quoteQty', 'baseQty')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"a\": 26129,         // Aggregate tradeId\n         \"p\": \"0.01633102\",  // Price\n         \"q\": \"4.70443515\",  // Quantity\n         \"f\": 27781,         // First tradeId\n         \"l\": 27781,         // Last tradeId\n         \"T\": 1498793709153, // Timestamp\n         \"m\": true,          // Was the buyer the maker?\n         \"M\": true           // Was the trade the best price match?\n     }",
          "{\n         \"a\": \"269772814\",\n         \"p\": \"25864.1\",\n         \"q\": \"3\",\n         \"f\": \"662149354\",\n         \"l\": \"662149355\",\n         \"T\": \"1694209776022\",\n         \"m\": false,\n     }",
          "{\n         \"id\": 28457,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"time\": 1499865549590,\n         \"isBuyerMaker\": true,\n         \"isBestMatch\": true\n     }",
          "{\n         \"symbol\": \"BNBBTC\",\n         \"id\": 28457,\n         \"orderId\": 100234,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"commission\": \"10.10000000\",\n         \"commissionAsset\": \"BNB\",\n         \"time\": 1499865549590,\n         \"isBuyer\": true,\n         \"isMaker\": false,\n         \"isBestMatch\": true\n     }",
          "{\n       \"accountId\": 20,\n       \"buyer\": False,\n       \"commission\": \"-0.07819010\",\n       \"commissionAsset\": \"USDT\",\n       \"counterPartyId\": 653,\n       \"id\": 698759,\n       \"maker\": False,\n       \"orderId\": 25851813,\n       \"price\": \"7819.01\",\n       \"qty\": \"0.002\",\n       \"quoteQty\": \"0.01563\",\n       \"realizedPnl\": \"-0.91539999\",\n       \"side\": \"SELL\",\n       \"symbol\": \"BTCUSDT\",\n       \"time\": 1569514978020\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        if ('isDustTrade' in trade) {\n            return this.parseDustTrade (trade, market);\n        }\n        //\n        // aggregate trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list\n        //\n        //     {\n        //         \"a\": 26129,         // Aggregate tradeId\n        //         \"p\": \"0.01633102\",  // Price\n        //         \"q\": \"4.70443515\",  // Quantity\n        //         \"f\": 27781,         // First tradeId\n        //         \"l\": 27781,         // Last tradeId\n        //         \"T\": 1498793709153, // Timestamp\n        //         \"m\": true,          // Was the buyer the maker?\n        //         \"M\": true           // Was the trade the best price match?\n        //     }\n        //\n        // REST: aggregate trades for swap & future (both linear and inverse)\n        //\n        //     {\n        //         \"a\": \"269772814\",\n        //         \"p\": \"25864.1\",\n        //         \"q\": \"3\",\n        //         \"f\": \"662149354\",\n        //         \"l\": \"662149355\",\n        //         \"T\": \"1694209776022\",\n        //         \"m\": false,\n        //     }\n        //\n        // recent public trades and old public trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#recent-trades-list\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data\n        //\n        //     {\n        //         \"id\": 28457,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyerMaker\": true,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // private trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-trade-list-user_data\n        //\n        //     {\n        //         \"symbol\": \"BNBBTC\",\n        //         \"id\": 28457,\n        //         \"orderId\": 100234,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"commission\": \"10.10000000\",\n        //         \"commissionAsset\": \"BNB\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // futures trades\n        //\n        //     {\n        //       \"accountId\": 20,\n        //       \"buyer\": False,\n        //       \"commission\": \"-0.07819010\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"counterPartyId\": 653,\n        //       \"id\": 698759,\n        //       \"maker\": False,\n        //       \"orderId\": 25851813,\n        //       \"price\": \"7819.01\",\n        //       \"qty\": \"0.002\",\n        //       \"quoteQty\": \"0.01563\",\n        //       \"realizedPnl\": \"-0.91539999\",\n        //       \"side\": \"SELL\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"time\": 1569514978020\n        //     }\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"id\": 477128891,\n        //       \"orderId\": 13809777875,\n        //       \"side\": \"SELL\",\n        //       \"price\": \"38479.55\",\n        //       \"qty\": \"0.001\",\n        //       \"realizedPnl\": \"-0.00009534\",\n        //       \"marginAsset\": \"USDT\",\n        //       \"quoteQty\": \"38.47955\",\n        //       \"commission\": \"-0.00076959\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"time\": 1612733566708,\n        //       \"positionSide\": \"BOTH\",\n        //       \"maker\": true,\n        //       \"buyer\": false\n        //     }\n        //\n        // { respType: FULL }\n        //\n        //     {\n        //       \"price\": \"4000.00000000\",\n        //       \"qty\": \"1.00000000\",\n        //       \"commission\": \"4.00000000\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"tradeId\": \"1234\",\n        //     }\n        //\n        // options: fetchMyTrades\n        //\n        //     {\n        //         \"id\": 1125899906844226012,\n        //         \"tradeId\": 73,\n        //         \"orderId\": 4638761100843040768,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"18.70000000\",\n        //         \"quantity\": \"-0.57000000\",\n        //         \"fee\": \"0.17305890\",\n        //         \"realizedProfit\": \"-3.53400000\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"LIMIT\",\n        //         \"volatility\": \"0.30000000\",\n        //         \"liquidity\": \"MAKER\",\n        //         \"time\": 1676085216845,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        // options: fetchTrades\n        //\n        //     {\n        //         \"id\": 1,\n        //         \"symbol\": \"ETH-230216-1500-C\",\n        //         \"price\": \"35.5\",\n        //         \"qty\": \"0.03\",\n        //         \"quoteQty\": \"1.065\",\n        //         \"side\": 1,\n        //         \"time\": 1676366446072\n        //     }\n        //\n        // fetchMyTrades: linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"id\": 4575108247,\n        //         \"orderId\": 261942655610,\n        //         \"side\": \"SELL\",\n        //         \"price\": \"47263.40\",\n        //         \"qty\": \"0.010\",\n        //         \"realizedPnl\": \"27.38400000\",\n        //         \"marginAsset\": \"USDT\",\n        //         \"quoteQty\": \"472.63\",\n        //         \"commission\": \"0.18905360\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707530039409,\n        //         \"buyer\": false,\n        //         \"maker\": false,\n        //         \"positionSide\": \"LONG\"\n        //     }\n        //\n        // fetchMyTrades: inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"id\": 701907838,\n        //         \"orderId\": 71548909034,\n        //         \"pair\": \"ETHUSD\",\n        //         \"side\": \"SELL\",\n        //         \"price\": \"2498.15\",\n        //         \"qty\": \"1\",\n        //         \"realizedPnl\": \"0.00012517\",\n        //         \"marginAsset\": \"ETH\",\n        //         \"baseQty\": \"0.00400296\",\n        //         \"commission\": \"0.00000160\",\n        //         \"commissionAsset\": \"ETH\",\n        //         \"time\": 1707530317519,\n        //         \"positionSide\": \"LONG\",\n        //         \"buyer\": false,\n        //         \"maker\": false\n        //     }\n        //\n        // fetchMyTrades: spot margin portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ADAUSDT\",\n        //         \"id\": 470227543,\n        //         \"orderId\": 4421170947,\n        //         \"price\": \"0.53880000\",\n        //         \"qty\": \"10.00000000\",\n        //         \"quoteQty\": \"5.38800000\",\n        //         \"commission\": \"0.00538800\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707545780522,\n        //         \"isBuyer\": false,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'T', 'time');\n        let amount = this.safeString2 (trade, 'q', 'qty');\n        amount = this.safeString (trade, 'quantity', amount);\n        const marketId = this.safeString (trade, 'symbol');\n        const isSpotTrade = ('isIsolated' in trade) || ('M' in trade) || ('orderListId' in trade) || ('isMaker' in trade);\n        const marketType = isSpotTrade ? 'spot' : 'contract';\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        let side = undefined;\n        const buyerMaker = this.safeBool2 (trade, 'm', 'isBuyerMaker');\n        let takerOrMaker = undefined;\n        if (buyerMaker !== undefined) {\n            side = buyerMaker ? 'sell' : 'buy'; // this is reversed intentionally\n        } else if ('side' in trade) {\n            side = this.safeStringLower (trade, 'side');\n        } else {\n            if ('isBuyer' in trade) {\n                side = trade['isBuyer'] ? 'buy' : 'sell'; // this is a true side\n            }\n        }\n        let fee = undefined;\n        if ('commission' in trade) {\n            fee = {\n                'cost': this.safeString (trade, 'commission'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'commissionAsset')),\n            };\n        }\n        if ('isMaker' in trade) {\n            takerOrMaker = trade['isMaker'] ? 'maker' : 'taker';\n        }\n        if ('maker' in trade) {\n            takerOrMaker = trade['maker'] ? 'maker' : 'taker';\n        }\n        if (('optionSide' in trade) || market['option']) {\n            const settle = this.safeCurrencyCode (this.safeString (trade, 'quoteAsset', 'USDT'));\n            takerOrMaker = this.safeStringLower (trade, 'liquidity');\n            if ('fee' in trade) {\n                fee = {\n                    'cost': this.safeString (trade, 'fee'),\n                    'currency': settle,\n                };\n            }\n            if ((side !== 'buy') && (side !== 'sell')) {\n                side = (side === '1') ? 'buy' : 'sell';\n            }\n            if ('optionSide' in trade) {\n                if (side !== 'buy') {\n                    amount = Precise.stringMul ('-1', amount);\n                }\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ]),\n            'order': this.safeString (trade, 'orderId'),\n            'type': this.safeStringLower (trade, 'type'),\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString2 (trade, 'p', 'price'),\n            'amount': amount,\n            'cost': this.safeString2 (trade, 'quoteQty', 'baseQty'),\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 9517,
        "line_end": 9545,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n       {\n         \"symbol\": \"BTCUSDT\",\n         \"makerCommission\": \"0.001\",\n         \"takerCommission\": \"0.001\"\n       }\n     ]",
          "{\n         \"symbol\": \"BTCUSD_PERP\",\n         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        // spot\n        //     [\n        //       {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"makerCommission\": \"0.001\",\n        //         \"takerCommission\": \"0.001\"\n        //       }\n        //     ]\n        //\n        // swap\n        //     {\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n        //         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate'),\n            'taker': this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 8648,
        "line_end": 8777,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"amount\": \"4500\",\n       \"coin\": \"USDT\",\n       \"network\": \"BSC\",\n       \"status\": 1,\n       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n       \"addressTag\": \"\",\n       \"txId\": \"Internal transfer 51376627901\",\n       \"insertTime\": 1618394381000,\n       \"transferType\": 1,\n       \"confirmTimes\": \"1/15\"\n     }",
          "{\n       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n       \"amount\": \"28.75\",\n       \"transactionFee\": \"0.25\",\n       \"coin\": \"XRP\",\n       \"status\": 6,\n       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n       \"addressTag\": \"101286922\",\n       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n       \"applyTime\": \"2021-04-15 12:09:16\",\n       \"network\": \"XRP\",\n       \"transferType\": 0\n     }",
          "{\n       \"orderNo\": \"CJW684897551397171200\",\n       \"fiatCurrency\": \"GBP\",\n       \"indicatedAmount\": \"29.99\",\n       \"amount\": \"28.49\",\n       \"totalFee\": \"1.50\",\n       \"method\": \"bank transfer\",\n       \"status\": \"Successful\",\n       \"createTime\": 1614898701000,\n       \"updateTime\": 1614898820000\n     }",
          "{\n       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n       \"fiatCurrency\": \"EUR\",\n       \"transactionType\": 0,\n       \"indicatedAmount\": \"15.00\",\n       \"amount\": \"15.00\",\n       \"totalFee\": \"0.00\",\n       \"method\": \"card\",\n       \"status\": \"Failed\",\n       \"createTime\": \"1627501026000\",\n       \"updateTime\": \"1627501027000\"\n     }",
          "{ id: \"9a67628b16ba4988ae20d329333f16bc\" }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //       \"amount\": \"4500\",\n        //       \"coin\": \"USDT\",\n        //       \"network\": \"BSC\",\n        //       \"status\": 1,\n        //       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n        //       \"addressTag\": \"\",\n        //       \"txId\": \"Internal transfer 51376627901\",\n        //       \"insertTime\": 1618394381000,\n        //       \"transferType\": 1,\n        //       \"confirmTimes\": \"1/15\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n        //       \"amount\": \"28.75\",\n        //       \"transactionFee\": \"0.25\",\n        //       \"coin\": \"XRP\",\n        //       \"status\": 6,\n        //       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n        //       \"addressTag\": \"101286922\",\n        //       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n        //       \"applyTime\": \"2021-04-15 12:09:16\",\n        //       \"network\": \"XRP\",\n        //       \"transferType\": 0\n        //     }\n        //\n        // fiat transaction\n        // withdraw\n        //     {\n        //       \"orderNo\": \"CJW684897551397171200\",\n        //       \"fiatCurrency\": \"GBP\",\n        //       \"indicatedAmount\": \"29.99\",\n        //       \"amount\": \"28.49\",\n        //       \"totalFee\": \"1.50\",\n        //       \"method\": \"bank transfer\",\n        //       \"status\": \"Successful\",\n        //       \"createTime\": 1614898701000,\n        //       \"updateTime\": 1614898820000\n        //     }\n        //\n        // deposit\n        //     {\n        //       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n        //       \"fiatCurrency\": \"EUR\",\n        //       \"transactionType\": 0,\n        //       \"indicatedAmount\": \"15.00\",\n        //       \"amount\": \"15.00\",\n        //       \"totalFee\": \"0.00\",\n        //       \"method\": \"card\",\n        //       \"status\": \"Failed\",\n        //       \"createTime\": \"1627501026000\",\n        //       \"updateTime\": \"1627501027000\"\n        //     }\n        //\n        // withdraw\n        //\n        //    { id: \"9a67628b16ba4988ae20d329333f16bc\" }\n        //\n        const id = this.safeString2 (transaction, 'id', 'orderNo');\n        const address = this.safeString (transaction, 'address');\n        let tag = this.safeString (transaction, 'addressTag'); // set but unused\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        let txid = this.safeString (transaction, 'txId');\n        if ((txid !== undefined) && (txid.indexOf ('Internal transfer ') >= 0)) {\n            txid = txid.slice (18);\n        }\n        const currencyId = this.safeString2 (transaction, 'coin', 'fiatCurrency');\n        let code = this.safeCurrencyCode (currencyId, currency);\n        let timestamp = undefined;\n        timestamp = this.safeInteger2 (transaction, 'insertTime', 'createTime');\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (transaction, 'applyTime'));\n        }\n        const updated = this.safeInteger2 (transaction, 'successTime', 'updateTime');\n        let type = this.safeString (transaction, 'type');\n        if (type === undefined) {\n            const txType = this.safeString (transaction, 'transactionType');\n            if (txType !== undefined) {\n                type = (txType === '0') ? 'deposit' : 'withdrawal';\n            }\n            const legalMoneyCurrenciesById = this.safeDict (this.options, 'legalMoneyCurrenciesById');\n            code = this.safeString (legalMoneyCurrenciesById, code, code);\n        }\n        const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber2 (transaction, 'transactionFee', 'totalFee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const internalInteger = this.safeInteger (transaction, 'transferType');\n        let internal = undefined;\n        if (internalInteger !== undefined) {\n            internal = (internalInteger !== 0) ? true : false;\n        }\n        const network = this.safeString (transaction, 'network');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': internal,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 8608,
        "line_end": 8646,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        if (type === undefined) {\n            return status;\n        }\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n                '6': 'ok',\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n                '2': 'pending', // Awaiting Approval\n                '3': 'failed', // Rejected\n                '4': 'pending', // Processing\n                '5': 'failed', // Failure\n                '6': 'ok', // Completed\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 8786,
        "line_end": 8888,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\":13526853623\n     }",
          "{\n         \"timestamp\": 1614640878000,\n         \"asset\": \"USDT\",\n         \"amount\": \"25\",\n         \"type\": \"MAIN_UMFUTURE\",\n         \"status\": \"CONFIRMED\",\n         \"tranId\": 43000126248\n     }",
          "{\n             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n             \"transactionId\": \"M_P_71505104267788288\",\n             \"transactionTime\": 1610090460133, //trade timestamp\n             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n             \"currency\": \"BNB\",\n             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n             \"fundsDetail\": [ // details\n                     {\n                         \"currency\": \"USDT\", //asset\n                         \"amount\": \"1.2\",\n                         \"walletAssetCost\":[ //details of asset cost per wallet\n                             {\"1\":\"0.6\"},\n                             {\"2\":\"0.6\"}\n                         ]\n                     },\n                     {\n                         \"currency\": \"ETH\",\n                         \"amount\": \"0.0001\",\n                         \"walletAssetCost\":[\n                             {\"1\":\"0.00005\"},\n                             {\"2\":\"0.00005\"}\n                         ]\n                     }\n                 ],\n             \"payerInfo\":{\n                     \"name\":\"Jack\", //nickname or merchant name\n                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n                     \"binanceId\":\"12345678\", //binance uid\n                     \"accountId\":\"67736251\" //binance pay id\n                 },\n             \"receiverInfo\":{\n                     \"name\":\"Alan\", //nickname or merchant name\n                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n                     \"email\":\"alan@binance.com\", //email\n                     \"binanceId\":\"34355667\", //binance uid\n                     \"accountId\":\"21326891\", //binance pay id\n                     \"countryCode\":\"1\", //International area code\n                     \"phoneNumber\":\"8057651210\",\n                     \"mobileCode\":\"US\", //country code\n                     \"extend\":[ //extension field\n                             \"institutionName\": \"\",\n                             \"cardNumber\": \"\",\n                             \"digitalWalletId\": \"\"\n                     ]\n                 }\n             }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"tranId\":13526853623\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"timestamp\": 1614640878000,\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"25\",\n        //         \"type\": \"MAIN_UMFUTURE\",\n        //         \"status\": \"CONFIRMED\",\n        //         \"tranId\": 43000126248\n        //     }\n        //\n        //     {\n        //             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n        //             \"transactionId\": \"M_P_71505104267788288\",\n        //             \"transactionTime\": 1610090460133, //trade timestamp\n        //             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n        //             \"currency\": \"BNB\",\n        //             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n        //             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n        //             \"fundsDetail\": [ // details\n        //                     {\n        //                         \"currency\": \"USDT\", //asset\n        //                         \"amount\": \"1.2\",\n        //                         \"walletAssetCost\":[ //details of asset cost per wallet\n        //                             {\"1\":\"0.6\"},\n        //                             {\"2\":\"0.6\"}\n        //                         ]\n        //                     },\n        //                     {\n        //                         \"currency\": \"ETH\",\n        //                         \"amount\": \"0.0001\",\n        //                         \"walletAssetCost\":[\n        //                             {\"1\":\"0.00005\"},\n        //                             {\"2\":\"0.00005\"}\n        //                         ]\n        //                     }\n        //                 ],\n        //             \"payerInfo\":{\n        //                     \"name\":\"Jack\", //nickname or merchant name\n        //                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"binanceId\":\"12345678\", //binance uid\n        //                     \"accountId\":\"67736251\" //binance pay id\n        //                 },\n        //             \"receiverInfo\":{\n        //                     \"name\":\"Alan\", //nickname or merchant name\n        //                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"email\":\"alan@binance.com\", //email\n        //                     \"binanceId\":\"34355667\", //binance uid\n        //                     \"accountId\":\"21326891\", //binance pay id\n        //                     \"countryCode\":\"1\", //International area code\n        //                     \"phoneNumber\":\"8057651210\",\n        //                     \"mobileCode\":\"US\", //country code\n        //                     \"extend\":[ //extension field\n        //                             \"institutionName\": \"\",\n        //                             \"cardNumber\": \"\",\n        //                             \"digitalWalletId\": \"\"\n        //                     ]\n        //                 }\n        //             }\n        const id = this.safeString2 (transfer, 'tranId', 'transactionId');\n        const currencyId = this.safeString2 (transfer, 'asset', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const amount = this.safeNumber (transfer, 'amount');\n        const type = this.safeString (transfer, 'type');\n        let fromAccount = undefined;\n        let toAccount = undefined;\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        if (type !== undefined) {\n            const parts = type.split ('_');\n            fromAccount = this.safeValue (parts, 0);\n            toAccount = this.safeValue (parts, 1);\n            fromAccount = this.safeString (accountsById, fromAccount, fromAccount);\n            toAccount = this.safeString (accountsById, toAccount, toAccount);\n        }\n        const walletType = this.safeInteger (transfer, 'walletType');\n        if (walletType !== undefined) {\n            const payer = this.safeDict (transfer, 'payerInfo', {});\n            const receiver = this.safeDict (transfer, 'receiverInfo', {});\n            fromAccount = this.safeString (payer, 'accountId');\n            toAccount = this.safeString (receiver, 'accountId');\n        }\n        const timestamp = this.safeInteger2 (transfer, 'timestamp', 'transactionTime');\n        const status = this.parseTransferStatus (this.safeString (transfer, 'status'));\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': status,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 8779,
        "line_end": 8784,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'CONFIRMED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "binancecoinm": [
      {
        "name": "parseAccountPosition",
        "signature": "parseAccountPosition (position, market: Market = undefined)",
        "line_start": 10081,
        "line_end": 10329,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "initialMargin",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"WLDUSDT\",\n        \"positionSide\": \"BOTH\",\n        \"positionAmt\": \"-849\",\n        \"unrealizedProfit\": \"11.17920750\",\n        \"notional\": \"-1992.46079250\",\n        \"isolatedMargin\": \"0\",\n        \"isolatedWallet\": \"0\",\n        \"initialMargin\": \"99.62303962\",\n        \"maintMargin\": \"11.95476475\",\n        \"updateTime\": \"1721995760449\"\n        \"leverage\": \"50\",                        // in v2\n        \"entryPrice\": \"2.34\",                    // in v2\n        \"positionInitialMargin\": \"118.82116614\", // in v2\n        \"openOrderInitialMargin\": \"0\",           // in v2\n        \"isolated\": false,                       // in v2\n        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        \"maxNotional\": \"25000\",                  // in v2\n        \"bidNotional\": \"0\",                      // in v2\n        \"askNotional\": \"0\"                       // in v2\n    }",
          "{\n       \"symbol\": \"BTCUSD_210625\",\n       \"initialMargin\": \"0.00024393\",\n       \"maintMargin\": \"0.00002439\",\n       \"unrealizedProfit\": \"-0.00000163\",\n       \"positionInitialMargin\": \"0.00024393\",\n       \"openOrderInitialMargin\": \"0\",\n       \"leverage\": \"10\",\n       \"isolated\": false,\n       \"positionSide\": \"BOTH\",\n       \"entryPrice\": \"41021.20000069\",\n       \"maxQty\": \"100\",\n       \"notionalValue\": \"0.00243939\",\n       \"isolatedWallet\": \"0\",\n       \"crossMargin\": \"0.314\"\n       \"crossWalletBalance\": \"34\",\n     }",
          "{\n         \"symbol\": \"CTSIUSDT\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.0\",\n         \"maxNotional\": \"25000\",\n         \"bidNotional\": \"0\",\n         \"askNotional\": \"0\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"updateTime\": 0,\n         \"notional\": \"0\",\n         \"breakEvenPrice\": \"0.0\"\n     }",
          "{\n         \"symbol\": \"TRXUSD_PERP\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.00000000\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"maxQty\": \"5000000\",\n         \"updateTime\": 0,\n         \"notionalValue\": \"0\",\n         \"breakEvenPrice\": \"0.00000000\"\n     }"
        ],
        "source": "parseAccountPosition (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        // v3 (similar for cross & isolated)\n        //\n        //    {\n        //        \"symbol\": \"WLDUSDT\",\n        //        \"positionSide\": \"BOTH\",\n        //        \"positionAmt\": \"-849\",\n        //        \"unrealizedProfit\": \"11.17920750\",\n        //        \"notional\": \"-1992.46079250\",\n        //        \"isolatedMargin\": \"0\",\n        //        \"isolatedWallet\": \"0\",\n        //        \"initialMargin\": \"99.62303962\",\n        //        \"maintMargin\": \"11.95476475\",\n        //        \"updateTime\": \"1721995760449\"\n        //        \"leverage\": \"50\",                        // in v2\n        //        \"entryPrice\": \"2.34\",                    // in v2\n        //        \"positionInitialMargin\": \"118.82116614\", // in v2\n        //        \"openOrderInitialMargin\": \"0\",           // in v2\n        //        \"isolated\": false,                       // in v2\n        //        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        //        \"maxNotional\": \"25000\",                  // in v2\n        //        \"bidNotional\": \"0\",                      // in v2\n        //        \"askNotional\": \"0\"                       // in v2\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_210625\",\n        //       \"initialMargin\": \"0.00024393\",\n        //       \"maintMargin\": \"0.00002439\",\n        //       \"unrealizedProfit\": \"-0.00000163\",\n        //       \"positionInitialMargin\": \"0.00024393\",\n        //       \"openOrderInitialMargin\": \"0\",\n        //       \"leverage\": \"10\",\n        //       \"isolated\": false,\n        //       \"positionSide\": \"BOTH\",\n        //       \"entryPrice\": \"41021.20000069\",\n        //       \"maxQty\": \"100\",\n        //       \"notionalValue\": \"0.00243939\",\n        //       \"isolatedWallet\": \"0\",\n        //       \"crossMargin\": \"0.314\"\n        //       \"crossWalletBalance\": \"34\",\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"CTSIUSDT\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.0\",\n        //         \"maxNotional\": \"25000\",\n        //         \"bidNotional\": \"0\",\n        //         \"askNotional\": \"0\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"updateTime\": 0,\n        //         \"notional\": \"0\",\n        //         \"breakEvenPrice\": \"0.0\"\n        //     }\n        //\n        // inverse portoflio margin\n        //\n        //     {\n        //         \"symbol\": \"TRXUSD_PERP\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.00000000\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"maxQty\": \"5000000\",\n        //         \"updateTime\": 0,\n        //         \"notionalValue\": \"0\",\n        //         \"breakEvenPrice\": \"0.00000000\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const leverageString = this.safeString (position, 'leverage');\n        const leverage = (leverageString !== undefined) ? parseInt (leverageString) : undefined;\n        const initialMarginString = this.safeString (position, 'initialMargin');\n        const initialMargin = this.parseNumber (initialMarginString);\n        let initialMarginPercentageString = undefined;\n        if (leverageString !== undefined) {\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            const rational = this.isRoundNumber (1000 % leverage);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringDiv (Precise.stringAdd (initialMarginPercentageString, '1e-8'), '1', 8);\n            }\n        }\n        // as oppose to notionalValue\n        const usdm = ('notional' in position);\n        const maintenanceMarginString = this.safeString (position, 'maintMargin');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        let entryPrice = this.parseNumber (entryPriceString);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        const notional = this.parseNumber (notionalStringAbs);\n        let contractsString = this.safeString (position, 'positionAmt');\n        let contractsStringAbs = Precise.stringAbs (contractsString);\n        if (contractsString === undefined) {\n            const entryNotional = Precise.stringMul (Precise.stringMul (leverageString, initialMarginString), entryPriceString);\n            const contractSizeNew = this.safeString (market, 'contractSize');\n            contractsString = Precise.stringDiv (entryNotional, contractSizeNew);\n            contractsStringAbs = Precise.stringDiv (Precise.stringAdd (contractsString, '0.5'), '1', 0);\n        }\n        const contracts = this.parseNumber (contractsStringAbs);\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        const unrealizedPnlString = this.safeString (position, 'unrealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        let isolated = this.safeBool (position, 'isolated');\n        if (isolated === undefined) {\n            const isolatedMarginRaw = this.safeString (position, 'isolatedMargin');\n            isolated = !Precise.stringEq (isolatedMarginRaw, '0');\n        }\n        let marginMode = undefined;\n        let collateralString = undefined;\n        let walletBalance = undefined;\n        if (isolated) {\n            marginMode = 'isolated';\n            walletBalance = this.safeString (position, 'isolatedWallet');\n            collateralString = Precise.stringAdd (walletBalance, unrealizedPnlString);\n        } else {\n            marginMode = 'cross';\n            walletBalance = this.safeString (position, 'crossWalletBalance');\n            collateralString = this.safeString (position, 'crossMargin');\n        }\n        const collateral = this.parseNumber (collateralString);\n        let marginRatio = undefined;\n        let side = undefined;\n        let percentage = undefined;\n        let liquidationPriceStringRaw = undefined;\n        let liquidationPrice = undefined;\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        if (Precise.stringEquals (notionalString, '0')) {\n            entryPrice = undefined;\n        } else {\n            side = Precise.stringLt (notionalString, '0') ? 'short' : 'long';\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n            if (usdm) {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (walletBalance / (contracts * (±1 + mmp))) + (±entryPrice / (±1 + mmp))\n                //\n                // mmp = maintenanceMarginPercentage\n                // where ± is negative for long and positive for short\n                // TODO: calculate liquidation price for coinm contracts\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const leftSide = Precise.stringDiv (walletBalance, Precise.stringMul (contractsStringAbs, onePlusMaintenanceMarginPercentageString));\n                const rightSide = Precise.stringDiv (entryPriceSignString, onePlusMaintenanceMarginPercentageString);\n                liquidationPriceStringRaw = Precise.stringAdd (leftSide, rightSide);\n            } else {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (contracts * contractSize(±1 - mmp)) / (±1/entryPrice * contracts * contractSize - walletBalance)\n                //\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const size = Precise.stringMul (contractsStringAbs, contractSizeString);\n                const leftSide = Precise.stringMul (size, onePlusMaintenanceMarginPercentageString);\n                const rightSide = Precise.stringSub (Precise.stringMul (Precise.stringDiv ('1', entryPriceSignString), size), walletBalance);\n                liquidationPriceStringRaw = Precise.stringDiv (leftSide, rightSide);\n            }\n            const pricePrecision = this.precisionFromString (this.safeString (market['precision'], 'price'));\n            const pricePrecisionPlusOne = pricePrecision + 1;\n            const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString ();\n            // round half up\n            const rounder = new Precise ('5e-' + pricePrecisionPlusOneString);\n            const rounderString = rounder.toString ();\n            const liquidationPriceRoundedString = Precise.stringAdd (rounderString, liquidationPriceStringRaw);\n            let truncatedLiquidationPrice = Precise.stringDiv (liquidationPriceRoundedString, '1', pricePrecision);\n            if (truncatedLiquidationPrice[0] === '-') {\n                // user cannot be liquidated\n                // since he has more collateral than the size of the position\n                truncatedLiquidationPrice = undefined;\n            }\n            liquidationPrice = this.parseNumber (truncatedLiquidationPrice);\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return {\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'initialMargin': initialMargin,\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'entryPrice': entryPrice,\n            'notional': notional,\n            'leverage': this.parseNumber (leverageString),\n            'unrealizedPnl': unrealizedPnl,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'marginRatio': marginRatio,\n            'liquidationPrice': liquidationPrice,\n            'markPrice': undefined,\n            'collateral': collateral,\n            'marginMode': marginMode,\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseAccountPositions",
        "signature": "parseAccountPositions (account, filterClosed = false)",
        "line_start": 10043,
        "line_end": 10079,
        "comment": null,
        "mappings": [
          {
            "key": "crossMargin",
            "value": "balances[code]['crossMargin']",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "balances[code]['crossWalletBalance']",
            "comment": null
          },
          {
            "key": "crossMargin",
            "value": "Precise.stringAdd (crossWalletBalance, crossUnPnl)",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "crossWalletBalance",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccountPositions (account, filterClosed = false) {\n        const positions = this.safeList (account, 'positions');\n        const assets = this.safeList (account, 'assets', []);\n        const balances: Dict = {};\n        for (let i = 0; i < assets.length; i++) {\n            const entry = assets[i];\n            const currencyId = this.safeString (entry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const crossWalletBalance = this.safeString (entry, 'crossWalletBalance');\n            const crossUnPnl = this.safeString (entry, 'crossUnPnl');\n            balances[code] = {\n                'crossMargin': Precise.stringAdd (crossWalletBalance, crossUnPnl),\n                'crossWalletBalance': crossWalletBalance,\n            };\n        }\n        const result = [];\n        for (let i = 0; i < positions.length; i++) {\n            const position = positions[i];\n            const marketId = this.safeString (position, 'symbol');\n            const market = this.safeMarket (marketId, undefined, undefined, 'contract');\n            const code = market['linear'] ? market['quote'] : market['base'];\n            const maintenanceMargin = this.safeString (position, 'maintMargin');\n            // check for maintenance margin so empty positions are not returned\n            const isPositionOpen = (maintenanceMargin !== '0') && (maintenanceMargin !== '0.00000000');\n            if (!filterClosed || isPositionOpen) {\n                // sometimes not all the codes are correctly returned...\n                if (code in balances) {\n                    const parsed = this.parseAccountPosition (this.extend (position, {\n                        'crossMargin': balances[code]['crossMargin'],\n                        'crossWalletBalance': balances[code]['crossWalletBalance'],\n                    }), market);\n                    result.push (parsed);\n                }\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 14515,
        "line_end": 14563,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "rank",
            "comment": null
          },
          {
            "key": "rating",
            "value": "this.safeStringLower (info, 'adlRisk')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlRisk\": \"LOW\",\n         \"updateTime\": 1766827800453\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlQuantile\": {\n             \"LONG\": 0,\n             \"SHORT\": 0,\n             \"BOTH\": 1\n         }\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlRisk\": \"LOW\",\n        //         \"updateTime\": 1766827800453\n        //     }\n        //\n        // fetchPositionADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlQuantile\": {\n        //             \"LONG\": 0,\n        //             \"SHORT\": 0,\n        //             \"BOTH\": 1\n        //         }\n        //     }\n        //\n        const adlQuantile = this.safeDict (info, 'adlQuantile', {});\n        const longNum = this.safeNumber (adlQuantile, 'LONG');\n        const shortNum = this.safeNumber (adlQuantile, 'SHORT');\n        const both = this.safeNumber (adlQuantile, 'BOTH');\n        let rank = undefined;\n        if (both !== undefined) {\n            rank = both;\n        } else {\n            if (longNum !== undefined && shortNum !== undefined) {\n                if (longNum > shortNum) {\n                    rank = longNum;\n                } else {\n                    rank = shortNum;\n                }\n            }\n        }\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger2 (info, 'timestamp', 'updateTime');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': rank,\n            'rating': this.safeStringLower (info, 'adlRisk'),\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBalanceCustom",
        "signature": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances",
        "line_start": 3606,
        "line_end": 3717,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances {\n        const result = {\n            'info': response,\n        };\n        let timestamp = undefined;\n        const isolated = marginMode === 'isolated';\n        const cross = (type === 'margin') || (marginMode === 'cross');\n        if (isPortfolioMargin) {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                if (type === 'linear') {\n                    account['free'] = this.safeString (entry, 'umWalletBalance');\n                    account['used'] = this.safeString (entry, 'umUnrealizedPNL');\n                } else if (type === 'inverse') {\n                    account['free'] = this.safeString (entry, 'cmWalletBalance');\n                    account['used'] = this.safeString (entry, 'cmUnrealizedPNL');\n                } else if (cross) {\n                    const borrowed = this.safeString (entry, 'crossMarginBorrowed');\n                    const interest = this.safeString (entry, 'crossMarginInterest');\n                    account['debt'] = Precise.stringAdd (borrowed, interest);\n                    account['free'] = this.safeString (entry, 'crossMarginFree');\n                    account['used'] = this.safeString (entry, 'crossMarginLocked');\n                    account['total'] = this.safeString (entry, 'crossMarginAsset');\n                } else {\n                    const usedLinear = this.safeString (entry, 'umUnrealizedPNL');\n                    const usedInverse = this.safeString (entry, 'cmUnrealizedPNL');\n                    const totalUsed = Precise.stringAdd (usedLinear, usedInverse);\n                    const totalWalletBalance = this.safeString (entry, 'totalWalletBalance');\n                    account['total'] = Precise.stringAdd (totalUsed, totalWalletBalance);\n                }\n                result[code] = account;\n            }\n        } else if (!isolated && ((type === 'spot') || cross)) {\n            timestamp = this.safeInteger (response, 'updateTime');\n            const balances = this.safeList2 (response, 'balances', 'userAssets', []);\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'free');\n                account['used'] = this.safeString (balance, 'locked');\n                if (cross) {\n                    const debt = this.safeString (balance, 'borrowed');\n                    const interest = this.safeString (balance, 'interest');\n                    account['debt'] = Precise.stringAdd (debt, interest);\n                }\n                result[code] = account;\n            }\n        } else if (isolated) {\n            const assets = this.safeList (response, 'assets');\n            for (let i = 0; i < assets.length; i++) {\n                const asset = assets[i];\n                const marketId = this.safeString (asset, 'symbol');\n                const symbol = this.safeSymbol (marketId, undefined, undefined, 'spot');\n                const base = this.safeDict (asset, 'baseAsset', {});\n                const quote = this.safeDict (asset, 'quoteAsset', {});\n                const baseCode = this.safeCurrencyCode (this.safeString (base, 'asset'));\n                const quoteCode = this.safeCurrencyCode (this.safeString (quote, 'asset'));\n                const subResult: Dict = {};\n                subResult[baseCode] = this.parseBalanceHelper (base);\n                subResult[quoteCode] = this.parseBalanceHelper (quote);\n                result[symbol] = this.safeBalance (subResult);\n            }\n        } else if (type === 'savings') {\n            const positionAmountVos = this.safeList (response, 'positionAmountVos', []);\n            for (let i = 0; i < positionAmountVos.length; i++) {\n                const entry = positionAmountVos[i];\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                const usedAndTotal = this.safeString (entry, 'amount');\n                account['total'] = usedAndTotal;\n                account['used'] = usedAndTotal;\n                result[code] = account;\n            }\n        } else if (type === 'funding') {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                account['free'] = this.safeString (entry, 'free');\n                const frozen = this.safeString (entry, 'freeze');\n                const withdrawing = this.safeString (entry, 'withdrawing');\n                const locked = this.safeString (entry, 'locked');\n                account['used'] = Precise.stringAdd (frozen, Precise.stringAdd (locked, withdrawing));\n                result[code] = account;\n            }\n        } else {\n            let balances = response;\n            if (!Array.isArray (response)) {\n                balances = this.safeList (response, 'assets', []);\n            }\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'availableBalance');\n                account['used'] = this.safeString (balance, 'initialMargin');\n                account['total'] = this.safeString2 (balance, 'marginBalance', 'balance');\n                result[code] = account;\n            }\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return isolated ? result : this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3596,
        "line_end": 3604,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString (entry, 'locked');\n        account['free'] = this.safeString (entry, 'free');\n        const interest = this.safeString (entry, 'interest');\n        const debt = this.safeString (entry, 'borrowed');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 12772,
        "line_end": 12787,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'asset'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'principal')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const symbol = this.safeString (info, 'isolatedSymbol');\n        const timestamp = this.safeInteger (info, 'interestAccuredTime');\n        const marginMode = (symbol === undefined) ? 'cross' : 'isolated';\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'asset')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'principal'),\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 12539,
        "line_end": 12558,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (info, 'dailyInterestRate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset\": \"USDT\",\n        \"timestamp\": 1638230400000,\n        \"dailyInterestRate\": \"0.0006\",\n        \"vipLevel\": 0\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"asset\": \"USDT\",\n        //        \"timestamp\": 1638230400000,\n        //        \"dailyInterestRate\": \"0.0006\",\n        //        \"vipLevel\": 0\n        //    }\n        //\n        const timestamp = this.safeInteger (info, 'timestamp');\n        const currencyId = this.safeString (info, 'asset');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber (info, 'dailyInterestRate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 14196,
        "line_end": 14284,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'targetAmount', 'toAmount')",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quoteId\":\"12415572564\",\n         \"ratio\":\"38163.7\",\n         \"inverseRatio\":\"0.0000262\",\n         \"validTimestamp\":1623319461670,\n         \"toAmount\":\"3816.37\",\n         \"fromAmount\":\"0.1\"\n     }",
          "{\n         \"orderId\":\"933256278426274426\",\n         \"createTime\":1623381330472,\n         \"orderStatus\":\"PROCESS\"\n     }",
          "{\n         \"tranId\": 118263407119,\n         \"status\": \"S\"\n     }",
          "{\n         \"tranId\": 118263615991,\n         \"type\": 244,\n         \"time\": 1664442078000,\n         \"deductedAsset\": \"BUSD\",\n         \"deductedAmount\": \"1\",\n         \"targetAsset\": \"USDC\",\n         \"targetAmount\": \"1\",\n         \"status\": \"S\",\n         \"accountType\": \"MAIN\"\n     }",
          "{\n         \"orderId\":933256278426274426,\n         \"orderStatus\":\"SUCCESS\",\n         \"fromAsset\":\"BTC\",\n         \"fromAmount\":\"0.00054414\",\n         \"toAsset\":\"USDT\",\n         \"toAmount\":\"20\",\n         \"ratio\":\"36755\",\n         \"inverseRatio\":\"0.00002721\",\n         \"createTime\":1623381330472\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"quoteId\":\"12415572564\",\n        //         \"ratio\":\"38163.7\",\n        //         \"inverseRatio\":\"0.0000262\",\n        //         \"validTimestamp\":1623319461670,\n        //         \"toAmount\":\"3816.37\",\n        //         \"fromAmount\":\"0.1\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"orderId\":\"933256278426274426\",\n        //         \"createTime\":1623381330472,\n        //         \"orderStatus\":\"PROCESS\"\n        //     }\n        //\n        // createConvertTrade BUSD\n        //\n        //     {\n        //         \"tranId\": 118263407119,\n        //         \"status\": \"S\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory BUSD\n        //\n        //     {\n        //         \"tranId\": 118263615991,\n        //         \"type\": 244,\n        //         \"time\": 1664442078000,\n        //         \"deductedAsset\": \"BUSD\",\n        //         \"deductedAmount\": \"1\",\n        //         \"targetAsset\": \"USDC\",\n        //         \"targetAmount\": \"1\",\n        //         \"status\": \"S\",\n        //         \"accountType\": \"MAIN\"\n        //     }\n        //\n        // fetchConvertTrade\n        //\n        //     {\n        //         \"orderId\":933256278426274426,\n        //         \"orderStatus\":\"SUCCESS\",\n        //         \"fromAsset\":\"BTC\",\n        //         \"fromAmount\":\"0.00054414\",\n        //         \"toAsset\":\"USDT\",\n        //         \"toAmount\":\"20\",\n        //         \"ratio\":\"36755\",\n        //         \"inverseRatio\":\"0.00002721\",\n        //         \"createTime\":1623381330472\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"quoteId\": \"f3b91c525b2644c7bc1e1cd31b6e1aa6\",\n        //         \"orderId\": 940708407462087195,\n        //         \"orderStatus\": \"SUCCESS\",\n        //         \"fromAsset\": \"USDT\",\n        //         \"fromAmount\": \"20\",\n        //         \"toAsset\": \"BNB\",\n        //         \"toAmount\": \"0.06154036\",\n        //         \"ratio\": \"0.00307702\",\n        //         \"inverseRatio\": \"324.99\",\n        //         \"createTime\": 1624248872184\n        //     }\n        //\n        const timestamp = this.safeIntegerN (conversion, [ 'time', 'validTimestamp', 'createTime' ]);\n        const fromCur = this.safeString2 (conversion, 'deductedAsset', 'fromAsset');\n        const fromCode = this.safeCurrencyCode (fromCur, fromCurrency);\n        const to = this.safeString2 (conversion, 'targetAsset', 'toAsset');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'targetAmount', 'toAmount'),\n            'price': undefined,\n            'fee': undefined,\n        } as Conversion;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress",
        "line_start": 9206,
        "line_end": 9234,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"XRP\",\n         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n         \"tag\": \"108618262\",\n         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n     }"
        ],
        "source": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"XRP\",\n        //         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n        //         \"tag\": \"108618262\",\n        //         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n        //     }\n        //\n        const url = this.safeString (response, 'url');\n        const address = this.safeString (response, 'address');\n        const currencyId = this.safeString (response, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        // deposit-address endpoint provides only network url (not network ID/CODE)\n        // so we should map the url to network (their data is inside currencies)\n        const networkCode = this.getNetworkCodeByNetworkUrl (code, url);\n        let tag = this.safeString (response, 'tag', '');\n        if (tag.length === 0) {\n            tag = undefined;\n        }\n        this.checkAddress (address);\n        return {\n            'info': response,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9409,
        "line_end": 9476,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"coin\": \"BAT\",\n        \"depositAllEnable\": true,\n        \"withdrawAllEnable\": true,\n        \"name\": \"Basic Attention Token\",\n        \"free\": \"0\",\n        \"locked\": \"0\",\n        \"freeze\": \"0\",\n        \"withdrawing\": \"0\",\n        \"ipoing\": \"0\",\n        \"ipoable\": \"0\",\n        \"storage\": \"0\",\n        \"isLegalMoney\": false,\n        \"trading\": true,\n        \"networkList\": [\n            {\n                \"network\": \"BNB\",\n                \"coin\": \"BAT\",\n                \"withdrawIntegerMultiple\": \"0.00000001\",\n                \"isDefault\": false,\n                \"depositEnable\": true,\n                \"withdrawEnable\": true,\n                \"depositDesc\": '',\n                \"withdrawDesc\": '',\n                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n                \"name\": \"BEP2\",\n                \"resetAddressStatus\": false,\n                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n                \"withdrawFee\": \"0.27\",\n                \"withdrawMin\": \"0.54\",\n                \"withdrawMax\": \"10000000000\",\n                \"minConfirm\": \"1\",\n                \"unLockConfirm\": \"0\"\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"coin\": \"BAT\",\n        //        \"depositAllEnable\": true,\n        //        \"withdrawAllEnable\": true,\n        //        \"name\": \"Basic Attention Token\",\n        //        \"free\": \"0\",\n        //        \"locked\": \"0\",\n        //        \"freeze\": \"0\",\n        //        \"withdrawing\": \"0\",\n        //        \"ipoing\": \"0\",\n        //        \"ipoable\": \"0\",\n        //        \"storage\": \"0\",\n        //        \"isLegalMoney\": false,\n        //        \"trading\": true,\n        //        \"networkList\": [\n        //            {\n        //                \"network\": \"BNB\",\n        //                \"coin\": \"BAT\",\n        //                \"withdrawIntegerMultiple\": \"0.00000001\",\n        //                \"isDefault\": false,\n        //                \"depositEnable\": true,\n        //                \"withdrawEnable\": true,\n        //                \"depositDesc\": '',\n        //                \"withdrawDesc\": '',\n        //                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n        //                \"name\": \"BEP2\",\n        //                \"resetAddressStatus\": false,\n        //                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n        //                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n        //                \"withdrawFee\": \"0.27\",\n        //                \"withdrawMin\": \"0.54\",\n        //                \"withdrawMax\": \"10000000000\",\n        //                \"minConfirm\": \"1\",\n        //                \"unLockConfirm\": \"0\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const networkList = this.safeList (fee, 'networkList', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.networkIdToCode (networkId);\n            const withdrawFee = this.safeNumber (networkEntry, 'withdrawFee');\n            const isDefault = this.safeBool (networkEntry, 'isDefault');\n            if (isDefault === true) {\n                result['withdraw'] = {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                };\n            }\n            result['networks'][networkCode] = {\n                'withdraw': {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDustTrade",
        "signature": "parseDustTrade (trade, market: Market = undefined)",
        "line_start": 8290,
        "line_end": 8360,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "currency",
            "value": "earnedCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostString)",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"fromAsset\": \"USDT\",\n       \"amount\": \"0.009669\",\n       \"transferedAmount\": \"0.00002992\",\n       \"serviceChargeAmount\": \"0.00000059\",\n       \"operateTime\": \"1628076010000\",\n       \"transId\": \"71416578712\",\n       \"isDustTrade\": true\n     }"
        ],
        "source": "parseDustTrade (trade, market: Market = undefined) {\n        //\n        //     {\n        //       \"fromAsset\": \"USDT\",\n        //       \"amount\": \"0.009669\",\n        //       \"transferedAmount\": \"0.00002992\",\n        //       \"serviceChargeAmount\": \"0.00000059\",\n        //       \"operateTime\": \"1628076010000\",\n        //       \"transId\": \"71416578712\",\n        //       \"isDustTrade\": true\n        //     }\n        //\n        const orderId = this.safeString (trade, 'transId');\n        const timestamp = this.safeInteger (trade, 'operateTime');\n        const currencyId = this.safeString (trade, 'fromAsset');\n        const tradedCurrency = this.safeCurrencyCode (currencyId);\n        const bnb = this.currency ('BNB');\n        const earnedCurrency = bnb['code'];\n        const applicantSymbol = earnedCurrency + '/' + tradedCurrency;\n        let tradedCurrencyIsQuote = false;\n        if (applicantSymbol in this.markets) {\n            tradedCurrencyIsQuote = true;\n        }\n        const feeCostString = this.safeString (trade, 'serviceChargeAmount');\n        const fee = {\n            'currency': earnedCurrency,\n            'cost': this.parseNumber (feeCostString),\n        };\n        let symbol = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        let side = undefined;\n        if (tradedCurrencyIsQuote) {\n            symbol = applicantSymbol;\n            amountString = this.safeString (trade, 'transferedAmount');\n            costString = this.safeString (trade, 'amount');\n            side = 'buy';\n        } else {\n            symbol = tradedCurrency + '/' + earnedCurrency;\n            amountString = this.safeString (trade, 'amount');\n            costString = this.safeString (trade, 'transferedAmount');\n            side = 'sell';\n        }\n        let priceString = undefined;\n        if (costString !== undefined) {\n            if (amountString) {\n                priceString = Precise.stringDiv (costString, amountString);\n            }\n        }\n        const id = undefined;\n        const amount = this.parseNumber (amountString);\n        const price = this.parseNumber (priceString);\n        const cost = this.parseNumber (costString);\n        const type = undefined;\n        const takerOrMaker = undefined;\n        return {\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'amount': amount,\n            'price': price,\n            'cost': cost,\n            'fee': fee,\n            'info': trade,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 9981,
        "line_end": 10041,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "estimatedSettlePrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"45802.81129892\",\n         \"indexPrice\": \"45745.47701915\",\n         \"estimatedSettlePrice\": \"45133.91753671\",\n         \"lastFundingRate\": \"0.00063521\",\n         \"interestRate\": \"0.00010000\",\n         \"nextFundingTime\": \"1621267200000\",\n         \"time\": \"1621252344001\"\n     }",
          "{\n         \"symbol\": \"BLZUSDT\",\n         \"adjustedFundingRateCap\": \"0.03000000\",\n         \"adjustedFundingRateFloor\": \"-0.03000000\",\n         \"fundingIntervalHours\": 4,\n         \"disclaimer\": false\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        // ensure it matches with https://www.binance.com/en/futures/funding-history/0\n        //\n        // fetchFundingRate, fetchFundingRates\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"45802.81129892\",\n        //         \"indexPrice\": \"45745.47701915\",\n        //         \"estimatedSettlePrice\": \"45133.91753671\",\n        //         \"lastFundingRate\": \"0.00063521\",\n        //         \"interestRate\": \"0.00010000\",\n        //         \"nextFundingTime\": \"1621267200000\",\n        //         \"time\": \"1621252344001\"\n        //     }\n        //\n        // fetchFundingInterval, fetchFundingIntervals\n        //\n        //     {\n        //         \"symbol\": \"BLZUSDT\",\n        //         \"adjustedFundingRateCap\": \"0.03000000\",\n        //         \"adjustedFundingRateFloor\": \"-0.03000000\",\n        //         \"fundingIntervalHours\": 4,\n        //         \"disclaimer\": false\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'time');\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        const interestRate = this.safeNumber (contract, 'interestRate');\n        const estimatedSettlePrice = this.safeNumber (contract, 'estimatedSettlePrice');\n        const fundingRate = this.safeNumber (contract, 'lastFundingRate');\n        const fundingTime = this.safeInteger (contract, 'nextFundingTime');\n        const interval = this.safeString (contract, 'fundingIntervalHours');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'estimatedSettlePrice': estimatedSettlePrice,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 9933,
        "line_end": 9949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"fundingRate\": \"0.00063521\",\n         \"fundingTime\": \"1621267200000\",\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"fundingRate\": \"0.00063521\",\n        //         \"fundingTime\": \"1621267200000\",\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap'),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 13475,
        "line_end": 13514,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidIV')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askIV')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markIV')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-231229-40000-C\",\n         \"markPrice\": \"2012\",\n         \"bidIV\": \"0.60236275\",\n         \"askIV\": \"0.62267244\",\n         \"markIV\": \"0.6125176\",\n         \"delta\": \"0.39111646\",\n         \"theta\": \"-32.13948531\",\n         \"gamma\": \"0.00004656\",\n         \"vega\": \"51.70062218\",\n         \"highPriceLimit\": \"6474\",\n         \"lowPriceLimit\": \"5\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"symbol\": \"BTC-231229-40000-C\",\n        //         \"markPrice\": \"2012\",\n        //         \"bidIV\": \"0.60236275\",\n        //         \"askIV\": \"0.62267244\",\n        //         \"markIV\": \"0.6125176\",\n        //         \"delta\": \"0.39111646\",\n        //         \"theta\": \"-32.13948531\",\n        //         \"gamma\": \"0.00004656\",\n        //         \"vega\": \"51.70062218\",\n        //         \"highPriceLimit\": \"6474\",\n        //         \"lowPriceLimit\": \"5\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidIV'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askIV'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markIV'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': this.safeNumber (greeks, 'markPrice'),\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 8890,
        "line_end": 8915,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'tranId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'income')",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"ETHUSDT\",\n       \"incomeType\": \"FUNDING_FEE\",\n       \"income\": \"0.00134317\",\n       \"asset\": \"USDT\",\n       \"time\": \"1621584000000\",\n       \"info\": \"FUNDING_FEE\",\n       \"tranId\": \"4480321991774044580\",\n       \"tradeId\": \"\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"symbol\": \"ETHUSDT\",\n        //       \"incomeType\": \"FUNDING_FEE\",\n        //       \"income\": \"0.00134317\",\n        //       \"asset\": \"USDT\",\n        //       \"time\": \"1621584000000\",\n        //       \"info\": \"FUNDING_FEE\",\n        //       \"tranId\": \"4480321991774044580\",\n        //       \"tradeId\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const currencyId = this.safeString (income, 'asset');\n        const timestamp = this.safeInteger (income, 'time');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'tranId'),\n            'amount': this.safeNumber (income, 'income'),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 12560,
        "line_end": 12596,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeString (baseInfo, 'coin')",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeString (quoteInfo, 'coin')",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"vipLevel\": 0,\n        \"symbol\": \"BTCUSDT\",\n        \"leverage\": \"10\",\n        \"data\": [\n            {\n                \"coin\": \"BTC\",\n                \"dailyInterest\": \"0.00026125\",\n                \"borrowLimit\": \"270\"\n            },\n            {\n                \"coin\": \"USDT\",\n                \"dailyInterest\": \"0.000475\",\n                \"borrowLimit\": \"2100000\"\n            }\n        ]\n    }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //    {\n        //        \"vipLevel\": 0,\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"leverage\": \"10\",\n        //        \"data\": [\n        //            {\n        //                \"coin\": \"BTC\",\n        //                \"dailyInterest\": \"0.00026125\",\n        //                \"borrowLimit\": \"270\"\n        //            },\n        //            {\n        //                \"coin\": \"USDT\",\n        //                \"dailyInterest\": \"0.000475\",\n        //                \"borrowLimit\": \"2100000\"\n        //            }\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'spot');\n        const data = this.safeList (info, 'data');\n        const baseInfo = this.safeDict (data, 0);\n        const quoteInfo = this.safeDict (data, 1);\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'base': this.safeString (baseInfo, 'coin'),\n            'baseRate': this.safeNumber (baseInfo, 'dailyInterest'),\n            'quote': this.safeString (quoteInfo, 'coin'),\n            'quoteRate': this.safeNumber (quoteInfo, 'dailyInterest'),\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 4424,
        "line_end": 4463,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumberOmitZero (entry, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"price\": \"4.00000200\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"price\": \"6000.01\",\n         \"time\": 1589437530011   // Transaction time\n     }",
          "{\n         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n         \"ps\": \"BTCUSD\", // pair\n         \"price\": \"9647.8\",\n         \"time\": 1591257246176\n     }"
        ],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"price\": \"4.00000200\"\n        //     }\n        //\n        // usdm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"price\": \"6000.01\",\n        //         \"time\": 1589437530011   // Transaction time\n        //     }\n        //\n        //\n        // coinm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n        //         \"ps\": \"BTCUSD\", // pair\n        //         \"price\": \"9647.8\",\n        //         \"time\": 1591257246176\n        //     }\n        //\n        const timestamp = this.safeInteger (entry, 'time');\n        const type = (timestamp === undefined) ? 'spot' : 'swap';\n        const marketId = this.safeString (entry, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, type);\n        return {\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'price': this.safeNumberOmitZero (entry, 'price'),\n            'side': undefined,\n            'info': entry,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 11884,
        "line_end": 11939,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (item, 'id', 'tranId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tradeId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1125899906845701870\",\n         \"asset\": \"USDT\",\n         \"amount\": \"-0.16518203\",\n         \"type\": \"FEE\",\n         \"createDate\": 167662104241\n     }",
          "{\n         \"symbol\": \"\",\n         \"incomeType\": \"TRANSFER\",\n         \"income\": \"10.00000000\",\n         \"asset\": \"USDT\",\n         \"time\": 1677645250000,\n         \"info\": \"TRANSFER\",\n         \"tranId\": 131001573082,\n         \"tradeId\": \"\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // options (eapi)\n        //\n        //     {\n        //         \"id\": \"1125899906845701870\",\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"-0.16518203\",\n        //         \"type\": \"FEE\",\n        //         \"createDate\": 167662104241\n        //     }\n        //\n        // futures (fapi, dapi, papi)\n        //\n        //     {\n        //         \"symbol\": \"\",\n        //         \"incomeType\": \"TRANSFER\",\n        //         \"income\": \"10.00000000\",\n        //         \"asset\": \"USDT\",\n        //         \"time\": 1677645250000,\n        //         \"info\": \"TRANSFER\",\n        //         \"tranId\": 131001573082,\n        //         \"tradeId\": \"\"\n        //     }\n        //\n        let amount = this.safeString2 (item, 'amount', 'income');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger2 (item, 'createDate', 'time');\n        const type = this.safeString2 (item, 'type', 'incomeType');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString2 (item, 'id', 'tranId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tradeId'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 11941,
        "line_end": 11964,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'FEE': 'fee',\n            'FUNDING_FEE': 'fee',\n            'OPTIONS_PREMIUM_FEE': 'fee',\n            'POSITION_LIMIT_INCREASE_FEE': 'fee',\n            'CONTRACT': 'trade',\n            'REALIZED_PNL': 'trade',\n            'TRANSFER': 'transfer',\n            'CROSS_COLLATERAL_TRANSFER': 'transfer',\n            'INTERNAL_TRANSFER': 'transfer',\n            'COIN_SWAP_DEPOSIT': 'deposit',\n            'COIN_SWAP_WITHDRAW': 'withdrawal',\n            'OPTIONS_SETTLE_PROFIT': 'settlement',\n            'DELIVERED_SETTELMENT': 'settlement',\n            'WELCOME_BONUS': 'cashback',\n            'CONTEST_REWARD': 'cashback',\n            'COMMISSION_REBATE': 'rebate',\n            'API_REBATE': 'rebate',\n            'REFERRAL_KICKBACK': 'referral',\n            'COMMISSION': 'commission',\n        };\n        return this.safeString (ledgerType, type, type);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 11527,
        "line_end": 11557,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const marginModeRaw = this.safeBool (leverage, 'isolated');\n        let marginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            marginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (leverage, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            marginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        const side = this.safeStringLower (leverage, 'positionSide');\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        if ((side === undefined) || (side === 'both')) {\n            longLeverage = leverageValue;\n            shortLeverage = leverageValue;\n        } else if (side === 'long') {\n            longLeverage = leverageValue;\n        } else if (side === 'short') {\n            shortLeverage = leverageValue;\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 13312,
        "line_end": 13395,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (liquidation, 'executedQty')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'avgPrice')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'side')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'cumBase')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.safeNumber (liquidation, 'cumQuote')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"avgPrice\": \"0.00388359\",\n         \"executedQty\": \"31.39000000\",\n         \"orderId\": 180015097,\n         \"price\": \"0.00388110\",\n         \"qty\": \"31.39000000\",\n         \"side\": \"SELL\",\n         \"symbol\": \"BNBBTC\",\n         \"timeInForce\": \"GTC\",\n         \"isIsolated\": true,\n         \"updatedTime\": 1558941374745\n     }",
          "{\n         \"orderId\": 6071832819,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596107620040000020\",\n         \"price\": \"10871.09\",\n         \"avgPrice\": \"10913.21000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0.002\",\n         \"cumQuote\": \"10.91321\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"origType\": \"LIMIT\",\n         \"time\": 1596107620044,\n         \"updateTime\": 1596107620087\n     }",
          "{\n         \"orderId\": 165123080,\n         \"symbol\": \"BTCUSD_200925\",\n         \"pair\": \"BTCUSD\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596542005017000006\",\n         \"price\": \"11326.9\",\n         \"avgPrice\": \"11326.9\",\n         \"origQty\": \"1\",\n         \"executedQty\": \"1\",\n         \"cumBase\": \"0.00882854\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"time\": 1596542005019,\n         \"updateTime\": 1596542005050\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // margin\n        //\n        //     {\n        //         \"avgPrice\": \"0.00388359\",\n        //         \"executedQty\": \"31.39000000\",\n        //         \"orderId\": 180015097,\n        //         \"price\": \"0.00388110\",\n        //         \"qty\": \"31.39000000\",\n        //         \"side\": \"SELL\",\n        //         \"symbol\": \"BNBBTC\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"isIsolated\": true,\n        //         \"updatedTime\": 1558941374745\n        //     }\n        //\n        // linear\n        //\n        //     {\n        //         \"orderId\": 6071832819,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596107620040000020\",\n        //         \"price\": \"10871.09\",\n        //         \"avgPrice\": \"10913.21000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0.002\",\n        //         \"cumQuote\": \"10.91321\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596107620044,\n        //         \"updateTime\": 1596107620087\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"orderId\": 165123080,\n        //         \"symbol\": \"BTCUSD_200925\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596542005017000006\",\n        //         \"price\": \"11326.9\",\n        //         \"avgPrice\": \"11326.9\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"1\",\n        //         \"cumBase\": \"0.00882854\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596542005019,\n        //         \"updateTime\": 1596542005050\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger2 (liquidation, 'updatedTime', 'updateTime');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.safeNumber (liquidation, 'executedQty'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'avgPrice'),\n            'side': this.safeStringLower (liquidation, 'side'),\n            'baseValue': this.safeNumber (liquidation, 'cumBase'),\n            'quoteValue': this.safeNumber (liquidation, 'cumQuote'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 14396,
        "line_end": 14428,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"longAccount\": \"0.4558\",\n         \"longShortRatio\": \"0.8376\",\n         \"shortAccount\": \"0.5442\",\n         \"timestamp\": 1726790400000\n     }",
          "{\n         \"longAccount\": \"0.7262\",\n         \"longShortRatio\": \"2.6523\",\n         \"shortAccount\": \"0.2738\",\n         \"pair\": \"BTCUSD\",\n         \"timestamp\": 1726790400000\n     }"
        ],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        //\n        // linear\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"longAccount\": \"0.4558\",\n        //         \"longShortRatio\": \"0.8376\",\n        //         \"shortAccount\": \"0.5442\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"longAccount\": \"0.7262\",\n        //         \"longShortRatio\": \"2.6523\",\n        //         \"shortAccount\": \"0.2738\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeIntegerOmitZero (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 12953,
        "line_end": 12981,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'tranId')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\": 108988250265,\n         \"clientTag\":\"\"\n     }",
          "{\n         \"asset\": \"USDC\",\n         \"amount\": 10,\n         \"specifyRepayAssets\": null,\n         \"updateTime\": 1727170761267,\n         \"success\": true\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"tranId\": 108988250265,\n        //         \"clientTag\":\"\"\n        //     }\n        //\n        // repayCrossMargin alternative endpoint\n        //\n        //     {\n        //         \"asset\": \"USDC\",\n        //         \"amount\": 10,\n        //         \"specifyRepayAssets\": null,\n        //         \"updateTime\": 1727170761267,\n        //         \"success\": true\n        //     }\n        //\n        const currencyId = this.safeString (info, 'asset');\n        const timestamp = this.safeInteger (info, 'updateTime');\n        return {\n            'id': this.safeInteger (info, 'tranId'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amount'),\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 13705,
        "line_end": 13722,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "reMarginMode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const marginModeRaw = this.safeBool (marginMode, 'isolated');\n        let reMarginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            reMarginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (marginMode, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            reMarginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': reMarginMode,\n        } as MarginMode;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 12323,
        "line_end": 12366,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "(rawType === 1) ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (data, 'asset')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "(success || noErrorCode) ? 'ok' : 'failed'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 200,\n         \"msg\": \"Successfully modify position margin.\",\n         \"amount\": 0.001,\n         \"type\": 1\n     }",
          "{\n        symbol: \"XRPUSDT\",\n        type: \"1\",\n        deltaType: \"TRADE\",\n        amount: \"2.57148240\",\n        asset: \"USDT\",\n        time: \"1711046271555\",\n        positionSide: \"BOTH\",\n        clientTranId: \"\"\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // add/reduce margin\n        //\n        //     {\n        //         \"code\": 200,\n        //         \"msg\": \"Successfully modify position margin.\",\n        //         \"amount\": 0.001,\n        //         \"type\": 1\n        //     }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        symbol: \"XRPUSDT\",\n        //        type: \"1\",\n        //        deltaType: \"TRADE\",\n        //        amount: \"2.57148240\",\n        //        asset: \"USDT\",\n        //        time: \"1711046271555\",\n        //        positionSide: \"BOTH\",\n        //        clientTranId: \"\"\n        //    }\n        //\n        const rawType = this.safeInteger (data, 'type');\n        const errorCode = this.safeString (data, 'code');\n        const marketId = this.safeString (data, 'symbol');\n        const timestamp = this.safeInteger (data, 'time');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const noErrorCode = errorCode === undefined;\n        const success = errorCode === '200';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': (rawType === 1) ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'code': this.safeString (data, 'asset'),\n            'total': undefined,\n            'status': (success || noErrorCode) ? 'ok' : 'failed',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 3413,
        "line_end": 3594,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "lowercaseId",
            "value": "lowercaseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "unifiedType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && isMarginTradingAllowed",
            "comment": null
          },
          {
            "key": "marginModes",
            "value": "marginModes",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "parsedStrike",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "this.safeStringLower (market, 'side')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'onboardDate')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale')))",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision')))",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (filter, 'minQty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (filter, 'maxQty')",
            "comment": null
          }
        ],
        "examples": [
          "therefore limits['price']['max'] doesn't have any meaningful value except undefined"
        ],
        "source": "parseMarket (market: Dict): Market {\n        let swap = false;\n        let future = false;\n        let option = false;\n        const underlying = this.safeString (market, 'underlying');\n        const id = this.safeString (market, 'symbol');\n        const optionParts = id.split ('-');\n        const optionBase = this.safeString (optionParts, 0);\n        const lowercaseId = this.safeStringLower (market, 'symbol');\n        const baseId = this.safeString (market, 'baseAsset', optionBase);\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const contractType = this.safeString (market, 'contractType');\n        let contract = ('contractType' in market);\n        let expiry = this.safeInteger2 (market, 'deliveryDate', 'expiryDate');\n        let settleId = this.safeString (market, 'marginAsset');\n        if ((contractType === 'PERPETUAL') || (expiry === 4133404800000)) { // some swap markets do not have contract type, eg: BTCST\n            expiry = undefined;\n            swap = true;\n        } else if (underlying !== undefined) {\n            contract = true;\n            option = true;\n            settleId = (settleId === undefined) ? 'USDT' : settleId;\n        } else if (expiry !== undefined) {\n            future = true;\n        }\n        const settle = this.safeCurrencyCode (settleId);\n        const spot = !contract;\n        const filters = this.safeList (market, 'filters', []);\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const status = this.safeString2 (market, 'status', 'contractStatus');\n        let contractSize = undefined;\n        let fees = this.fees;\n        let linear = undefined;\n        let inverse = undefined;\n        let symbol = base + '/' + quote;\n        let strike = undefined;\n        if (contract) {\n            if (swap) {\n                symbol = symbol + ':' + settle;\n            } else if (future) {\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry);\n            } else if (option) {\n                strike = this.numberToString (this.parseToNumeric (this.safeString (market, 'strikePrice')));\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry) + '-' + strike + '-' + this.safeString (optionParts, 3);\n            }\n            contractSize = this.safeNumber2 (market, 'contractSize', 'unit', this.parseNumber ('1'));\n            linear = settle === quote;\n            inverse = settle === base;\n            const feesType = linear ? 'linear' : 'inverse';\n            fees = this.safeDict (this.fees, feesType, {}) as any;\n        }\n        let active = (status === 'TRADING');\n        if (spot) {\n            const permissions = this.safeList (market, 'permissions', []);\n            for (let j = 0; j < permissions.length; j++) {\n                if (permissions[j] === 'TRD_GRP_003') {\n                    active = false;\n                    break;\n                }\n            }\n        }\n        const isMarginTradingAllowed = this.safeBool (market, 'isMarginTradingAllowed', false);\n        let marginModes = undefined;\n        if (spot) {\n            const hasCrossMargin = this.inArray (id, this.options['crossMarginPairsData']);\n            const hasIsolatedMargin = this.inArray (id, this.options['isolatedMarginPairsData']);\n            marginModes = {\n                'cross': hasCrossMargin,\n                'isolated': hasIsolatedMargin,\n            };\n        } else if (linear || inverse) {\n            marginModes = {\n                'cross': true,\n                'isolated': true,\n            };\n        }\n        let unifiedType = undefined;\n        if (spot) {\n            unifiedType = 'spot';\n        } else if (swap) {\n            unifiedType = 'swap';\n        } else if (future) {\n            unifiedType = 'future';\n        } else if (option) {\n            unifiedType = 'option';\n            active = undefined;\n        }\n        let parsedStrike = undefined;\n        if (strike !== undefined) {\n            parsedStrike = this.parseToNumeric (strike);\n        }\n        const entry = {\n            'id': id,\n            'lowercaseId': lowercaseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': unifiedType,\n            'spot': spot,\n            'margin': spot && isMarginTradingAllowed,\n            'marginModes': marginModes,\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': fees['trading']['taker'],\n            'maker': fees['trading']['maker'],\n            'contractSize': contractSize,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': parsedStrike,\n            'optionType': this.safeStringLower (market, 'side'),\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n            'created': this.safeInteger (market, 'onboardDate'), // present in inverse & linear apis\n        };\n        if ('PRICE_FILTER' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n            // PRICE_FILTER reports zero values for maxPrice\n            // since they updated filter types in November 2018\n            // https://github.com/ccxt/ccxt/issues/4286\n            // therefore limits['price']['max'] doesn't have any meaningful value except undefined\n            entry['limits']['price'] = {\n                'min': this.safeNumber (filter, 'minPrice'),\n                'max': this.safeNumber (filter, 'maxPrice'),\n            };\n            entry['precision']['price'] = this.safeNumber (filter, 'tickSize');\n        }\n        if ('LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n            entry['precision']['amount'] = this.safeNumber (filter, 'stepSize');\n            entry['limits']['amount'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if ('MARKET_LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'MARKET_LOT_SIZE', {});\n            entry['limits']['market'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if (('MIN_NOTIONAL' in filtersByType) || ('NOTIONAL' in filtersByType)) { // notional added in 12/04/23 to spot testnet\n            const filter = this.safeDict2 (filtersByType, 'MIN_NOTIONAL', 'NOTIONAL', {});\n            entry['limits']['cost']['min'] = this.safeNumber2 (filter, 'minNotional', 'notional');\n            entry['limits']['cost']['max'] = this.safeNumber (filter, 'maxNotional');\n        }\n        return entry;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 10697,
        "line_end": 10738,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "{\n        \"symbol\": \"SUSHIUSDT\",\n        \"brackets\": [\n            {\n                \"bracket\": 1,\n                \"initialLeverage\": 50,\n                \"notionalCap\": 50000,\n                \"notionalFloor\": 0,\n                \"maintMarginRatio\": 0.01,\n                \"cum\": 0.0\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\": \"SUSHIUSDT\",\n        //        \"brackets\": [\n        //            {\n        //                \"bracket\": 1,\n        //                \"initialLeverage\": 50,\n        //                \"notionalCap\": 50000,\n        //                \"notionalFloor\": 0,\n        //                \"maintMarginRatio\": 0.01,\n        //                \"cum\": 0.0\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const brackets = this.safeList (info, 'brackets', []);\n        const tiers = [];\n        for (let j = 0; j < brackets.length; j++) {\n            const bracket = brackets[j];\n            tiers.push ({\n                'tier': this.safeNumber (bracket, 'bracket'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber2 (bracket, 'notionalFloor', 'qtyFloor'),\n                'maxNotional': this.safeNumber2 (bracket, 'notionalCap', 'qtyCap'),\n                'maintenanceMarginRate': this.safeNumber (bracket, 'maintMarginRatio'),\n                'maxLeverage': this.safeNumber (bracket, 'initialLeverage'),\n                'info': bracket,\n            });\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 4595,
        "line_end": 4657,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591478520000, // open time\n         \"0.02501300\",  // open\n         \"0.02501800\",  // high\n         \"0.02500000\",  // low\n         \"0.02500000\",  // close\n         \"22.19000000\", // volume\n         1591478579999, // close time\n         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n         40,            // number of trades\n         \"10.92900000\", // taker buy base asset volume\n         \"0.27336462\",  // taker buy quote asset volume\n         \"0\"            // ignore\n     ]",
          "[\n         [\n         1591256460000,          // Open time\n         \"9653.29201333\",        // Open\n         \"9654.56401333\",        // High\n         \"9653.07367333\",        // Low\n         \"9653.07367333\",        // Close (or latest price)\n         \"0\",                    // Ignore\n         1591256519999,          // Close time\n         \"0\",                    // Ignore\n         60,                     // Number of bisic data\n         \"0\",                    // Ignore\n         \"0\",                    // Ignore\n         \"0\"                     // Ignore\n         ]\n     ]",
          "{\n         \"open\": \"32.2\",\n         \"high\": \"32.2\",\n         \"low\": \"32.2\",\n         \"close\": \"32.2\",\n         \"volume\": \"0\",\n         \"interval\": \"5m\",\n         \"tradeCount\": 0,\n         \"takerVolume\": \"0\",\n         \"takerAmount\": \"0\",\n         \"amount\": \"0\",\n         \"openTime\": 1677096900000,\n         \"closeTime\": 1677097200000\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // when api method = publicGetKlines || fapiPublicGetKlines || dapiPublicGetKlines\n        //     [\n        //         1591478520000, // open time\n        //         \"0.02501300\",  // open\n        //         \"0.02501800\",  // high\n        //         \"0.02500000\",  // low\n        //         \"0.02500000\",  // close\n        //         \"22.19000000\", // volume\n        //         1591478579999, // close time\n        //         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n        //         40,            // number of trades\n        //         \"10.92900000\", // taker buy base asset volume\n        //         \"0.27336462\",  // taker buy quote asset volume\n        //         \"0\"            // ignore\n        //     ]\n        //\n        //  when api method = fapiPublicGetMarkPriceKlines || fapiPublicGetIndexPriceKlines\n        //     [\n        //         [\n        //         1591256460000,          // Open time\n        //         \"9653.29201333\",        // Open\n        //         \"9654.56401333\",        // High\n        //         \"9653.07367333\",        // Low\n        //         \"9653.07367333\",        // Close (or latest price)\n        //         \"0\",                    // Ignore\n        //         1591256519999,          // Close time\n        //         \"0\",                    // Ignore\n        //         60,                     // Number of bisic data\n        //         \"0\",                    // Ignore\n        //         \"0\",                    // Ignore\n        //         \"0\"                     // Ignore\n        //         ]\n        //     ]\n        //\n        // options\n        //\n        //     {\n        //         \"open\": \"32.2\",\n        //         \"high\": \"32.2\",\n        //         \"low\": \"32.2\",\n        //         \"close\": \"32.2\",\n        //         \"volume\": \"0\",\n        //         \"interval\": \"5m\",\n        //         \"tradeCount\": 0,\n        //         \"takerVolume\": \"0\",\n        //         \"takerAmount\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"openTime\": 1677096900000,\n        //         \"closeTime\": 1677097200000\n        //     }\n        //\n        const inverse = this.safeBool (market, 'inverse');\n        const volumeIndex = inverse ? 7 : 5;\n        return [\n            this.safeInteger2 (ohlcv, 0, 'openTime'),\n            this.safeNumber2 (ohlcv, 1, 'open'),\n            this.safeNumber2 (ohlcv, 2, 'high'),\n            this.safeNumber2 (ohlcv, 3, 'low'),\n            this.safeNumber2 (ohlcv, 4, 'close'),\n            this.safeNumber2 (ohlcv, volumeIndex, 'volume'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 13132,
        "line_end": 13149,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "market['inverse'] ? undefined : amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        const timestamp = this.safeInteger2 (interest, 'timestamp', 'time');\n        const id = this.safeString (interest, 'symbol');\n        const amount = this.safeNumber2 (interest, 'sumOpenInterest', 'openInterest');\n        const value = this.safeNumber2 (interest, 'sumOpenInterestValue', 'sumOpenInterestUsd');\n        // Inverse returns the number of contracts different from the base or quote volume in this case\n        // compared with https://www.binance.com/en/futures/funding-history/quarterly/4\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id, market, undefined, 'contract'),\n            'baseVolume': market['inverse'] ? undefined : amount,  // deprecated\n            'quoteVolume': value,  // deprecated\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 13768,
        "line_end": 13812,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPrice')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPrice')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'lastPrice')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'exercisePrice')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (chain, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (chain, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-241227-80000-C\",\n         \"priceChange\": \"0\",\n         \"priceChangePercent\": \"0\",\n         \"lastPrice\": \"2750\",\n         \"lastQty\": \"0\",\n         \"open\": \"2750\",\n         \"high\": \"2750\",\n         \"low\": \"2750\",\n         \"volume\": \"0\",\n         \"amount\": \"0\",\n         \"bidPrice\": \"4880\",\n         \"askPrice\": \"0\",\n         \"openTime\": 0,\n         \"closeTime\": 0,\n         \"firstTradeId\": 0,\n         \"tradeCount\": 0,\n         \"strikePrice\": \"80000\",\n         \"exercisePrice\": \"63944.09893617\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"symbol\": \"BTC-241227-80000-C\",\n        //         \"priceChange\": \"0\",\n        //         \"priceChangePercent\": \"0\",\n        //         \"lastPrice\": \"2750\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"2750\",\n        //         \"high\": \"2750\",\n        //         \"low\": \"2750\",\n        //         \"volume\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"bidPrice\": \"4880\",\n        //         \"askPrice\": \"0\",\n        //         \"openTime\": 0,\n        //         \"closeTime\": 0,\n        //         \"firstTradeId\": 0,\n        //         \"tradeCount\": 0,\n        //         \"strikePrice\": \"80000\",\n        //         \"exercisePrice\": \"63944.09893617\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPrice'),\n            'askPrice': this.safeNumber (chain, 'askPrice'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'lastPrice'),\n            'underlyingPrice': this.safeNumber (chain, 'exercisePrice'),\n            'change': this.safeNumber (chain, 'priceChange'),\n            'percentage': this.safeNumber (chain, 'priceChangePercent'),\n            'baseVolume': this.safeNumber (chain, 'volume'),\n            'quoteVolume': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOptionPosition",
        "signature": "parseOptionPosition (position: Dict, market: Market = undefined)",
        "line_start": 10844,
        "line_end": 10900,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'markValue')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'positionCost')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPNL')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"entryPrice\": \"27.70000000\",\n         \"symbol\": \"ETH-230426-1850-C\",\n         \"side\": \"LONG\",\n         \"quantity\": \"0.50000000\",\n         \"reducibleQty\": \"0.50000000\",\n         \"markValue\": \"10.250000000\",\n         \"ror\": \"-0.2599\",\n         \"unrealizedPNL\": \"-3.600000000\",\n         \"markPrice\": \"20.5\",\n         \"strikePrice\": \"1850.00000000\",\n         \"positionCost\": \"13.85000000\",\n         \"expiryDate\": 1682496000000,\n         \"priceScale\": 1,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"quoteAsset\": \"USDT\",\n         \"time\": 1682492427106\n     }"
        ],
        "source": "parseOptionPosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"entryPrice\": \"27.70000000\",\n        //         \"symbol\": \"ETH-230426-1850-C\",\n        //         \"side\": \"LONG\",\n        //         \"quantity\": \"0.50000000\",\n        //         \"reducibleQty\": \"0.50000000\",\n        //         \"markValue\": \"10.250000000\",\n        //         \"ror\": \"-0.2599\",\n        //         \"unrealizedPNL\": \"-3.600000000\",\n        //         \"markPrice\": \"20.5\",\n        //         \"strikePrice\": \"1850.00000000\",\n        //         \"positionCost\": \"13.85000000\",\n        //         \"expiryDate\": 1682496000000,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"time\": 1682492427106\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        let quantity = this.safeString (position, 'quantity');\n        if (side !== 'long') {\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        const timestamp = this.safeInteger (position, 'time');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'notional': this.safeNumber (position, 'markValue'),\n            'collateral': this.safeNumber (position, 'positionCost'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPNL'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 5636,
        "line_end": 6236,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "fills",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"0.0\",\n         \"cummulativeQuoteQty\": \"0.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"icebergQty\": \"0.0\",\n         \"time\": 1499827319559,\n         \"updateTime\": 1499827319559,\n         \"isWorking\": true\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 16383176297,\n         \"orderListId\": -1,\n         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n         \"transactTime\": 1670891847932,\n         \"price\": \"13500.00000000\",\n         \"origQty\": \"0.00085000\",\n         \"executedQty\": \"0.00000000\",\n         \"cummulativeQuoteQty\": \"0.00000000\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"fills\": []\n     }",
          "{\n         \"orderId\": 151007482392,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"NEW\",\n         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n         \"price\": \"25000\",\n         \"avgPrice\": \"0.00000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0\",\n         \"cumQty\": \"0\",\n         \"cumQuote\": \"0\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"BUY\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"updateTime\": 1684300587845\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"1.0\",\n         \"cumQuote\": \"10.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"updateTime\": 1499827319559\n     }",
          "createOrder with { \"newOrderRespType\": \"FULL\" }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"0.0\",\n        //         \"cummulativeQuoteQty\": \"0.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"icebergQty\": \"0.0\",\n        //         \"time\": 1499827319559,\n        //         \"updateTime\": 1499827319559,\n        //         \"isWorking\": true\n        //     }\n        //\n        // spot: editOrder\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 16383176297,\n        //         \"orderListId\": -1,\n        //         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n        //         \"transactTime\": 1670891847932,\n        //         \"price\": \"13500.00000000\",\n        //         \"origQty\": \"0.00085000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"fills\": []\n        //     }\n        //\n        // swap and future: editOrder\n        //\n        //     {\n        //         \"orderId\": 151007482392,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n        //         \"price\": \"25000\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"updateTime\": 1684300587845\n        //     }\n        //\n        // futures\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"1.0\",\n        //         \"cumQuote\": \"10.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"updateTime\": 1499827319559\n        //     }\n        //\n        // createOrder with { \"newOrderRespType\": \"FULL\" }\n        //\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"orderId\": 5403233939,\n        //       \"orderListId\": -1,\n        //       \"clientOrderId\": \"x-TKT5PX2F5e669e75b6c14f69a2c43e\",\n        //       \"transactTime\": 1617151923742,\n        //       \"price\": \"0.00000000\",\n        //       \"origQty\": \"0.00050000\",\n        //       \"executedQty\": \"0.00050000\",\n        //       \"cummulativeQuoteQty\": \"29.47081500\",\n        //       \"status\": \"FILLED\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"side\": \"BUY\",\n        //       \"fills\": [\n        //         {\n        //           \"price\": \"58941.63000000\",\n        //           \"qty\": \"0.00050000\",\n        //           \"commission\": \"0.00007050\",\n        //           \"commissionAsset\": \"BNB\",\n        //           \"tradeId\": 737466631\n        //         }\n        //       ]\n        //     }\n        //\n        // delivery\n        //\n        //     {\n        //       \"orderId\": \"18742727411\",\n        //       \"symbol\": \"ETHUSD_PERP\",\n        //       \"pair\": \"ETHUSD\",\n        //       \"status\": \"FILLED\",\n        //       \"clientOrderId\": \"x-xcKtGhcu3e2d1503fdd543b3b02419\",\n        //       \"price\": \"0\",\n        //       \"avgPrice\": \"4522.14\",\n        //       \"origQty\": \"1\",\n        //       \"executedQty\": \"1\",\n        //       \"cumBase\": \"0.00221134\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"reduceOnly\": false,\n        //       \"closePosition\": false,\n        //       \"side\": \"SELL\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"stopPrice\": \"0\",\n        //       \"workingType\": \"CONTRACT_PRICE\",\n        //       \"priceProtect\": false,\n        //       \"origType\": \"MARKET\",\n        //       \"time\": \"1636061952660\",\n        //       \"updateTime\": \"1636061952660\"\n        //     }\n        //\n        // option: createOrder, fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"orderId\": 4728833085436977152,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"10.0\",\n        //         \"quantity\": \"1.00\",\n        //         \"executedQty\": \"0.00\",\n        //         \"fee\": \"0\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"reduceOnly\": false,\n        //         \"postOnly\": false,\n        //         \"createTime\": 1676083034462,\n        //         \"updateTime\": 1676083034462,\n        //         \"status\": \"ACCEPTED\",\n        //         \"avgPrice\": \"0\",\n        //         \"source\": \"API\",\n        //         \"clientOrderId\": \"\",\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"lastTrade\": {\"id\":\"69\",\"time\":\"1676084430567\",\"price\":\"24.9\",\"qty\":\"1.00\"},\n        //         \"mmp\": false\n        //     }\n        //\n        // cancelOrders/createOrders\n        //\n        //     {\n        //         \"code\": -4005,\n        //         \"msg\": \"Quantity greater than max quantity.\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin linear swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"executedQty\": \"0.000\",\n        //         \"orderId\": 258649539704,\n        //         \"goodTillDate\": 0,\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"clientOrderId\": \"x-xcKtGhcu02573c6f15e544e990057b\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0.000\",\n        //         \"updateTime\": 1707110415436,\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"35000.00\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin inverse swap and future\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"side\": \"BUY\",\n        //         \"cumBase\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"orderId\": 71275227732,\n        //         \"avgPrice\": \"0.00\",\n        //         \"origQty\": \"1\",\n        //         \"clientOrderId\": \"x-xcKtGhcuca5af3acfb5044198c5398\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0\",\n        //         \"updateTime\": 1707110994334,\n        //         \"type\": \"LIMIT\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"2000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOpenOrder: portfolio margin linear swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu27f109953d6e4dc0974006\",\n        //         \"strategyId\": 3645916,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"45000.00\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707112625879,\n        //         \"updateTime\": 1707112625879,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders: portfolio margin inverse swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuc6b86f053bb34933850739\",\n        //         \"strategyId\": 1423462,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2000\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"3000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707113098840,\n        //         \"updateTime\": 1707113098840,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin\n        //\n        //     {\n        //         \"clientOrderId\": \"x-TKT5PX2Fe9ef29d8346440f0b28b86\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"fills\": [],\n        //         \"orderId\": 24684460474,\n        //         \"origQty\": \"0.00100000\",\n        //         \"price\": \"35000.00000000\",\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"side\": \"BUY\",\n        //         \"status\": \"NEW\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"transactTime\": 1707113538870,\n        //         \"type\": \"LIMIT\"\n        //     }\n        //\n        // fetchOpenOrders, fetchOrder, fetchOrders: portfolio margin spot margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 24700763749,\n        //         \"clientOrderId\": \"x-TKT5PX2F6f724c2a4af6425f98c7b6\",\n        //         \"price\": \"35000.00000000\",\n        //         \"origQty\": \"0.00100000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.00000000\",\n        //         \"icebergQty\": \"0.00000000\",\n        //         \"time\": 1707199187679,\n        //         \"updateTime\": 1707199187679,\n        //         \"isWorking\": true,\n        //         \"accountId\": 200180970,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"preventedMatchId\": null,\n        //         \"preventedQuantity\": null\n        //     }\n        //\n        // cancelOrder: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"strategyId\": 3733211,\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyType\": \"STOP\",\n        //         \"strategyStatus\": \"CANCELED\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000.00\", // ignored with trailing orders\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"activatePrice\": null,  // only return with trailing orders\n        //         \"priceRate\": null,      // only return with trailing orders\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOrders: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyId\": 3733211,\n        //         \"strategyStatus\": \"CANCELLED\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000\",\n        //         \"orderId\": 0,\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"type\": \"LIMIT\",\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerTime\": 0,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: linear swap\n        //\n        //     {\n        //         \"orderId\": 3697213934,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcufb20c5a7761a4aa09aa156\",\n        //         \"price\": \"33000.00\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0.000\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0.00\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"goodTillDate\": 0,\n        //         \"time\": 1707892893502,\n        //         \"updateTime\": 1707892893515\n        //     }\n        //\n        // fetchOpenOrder: inverse swap\n        //\n        //     {\n        //         \"orderId\": 597368542,\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcubbde7ba93b1a4ab881eff3\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893453199,\n        //         \"updateTime\": 1707893453199\n        //     }\n        //\n        // fetchOpenOrder: linear portfolio margin\n        //\n        //     {\n        //         \"orderId\": 264895013409,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcu6278f1adbdf14f74ab432e\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893839364,\n        //         \"updateTime\": 1707893839364,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin\n        //\n        //     {\n        //         \"orderId\": 71790316950,\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcuec11030474204ab08ba2c2\",\n        //         \"price\": \"2500\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707894181694,\n        //         \"updateTime\": 1707894181694\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu2da9c765294b433994ffce\",\n        //         \"strategyId\": 1423501,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2500\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"stopPrice\": \"4000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"bookTime\": 1707894782679,\n        //         \"updateTime\": 1707894782679,\n        //         \"timeInForce\": \"GTC\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, fetchOrder, fetchOpenOrders, fetchOrders, cancelOrderWs, createOrderWs: linear swap conditional order\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"algoType\": \"CONDITIONAL\",\n        //         \"orderType\": \"STOP\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"quantity\": \"0.002\",\n        //         \"algoStatus\": \"NEW\",\n        //         \"triggerPrice\": \"100000.00\",\n        //         \"price\": \"102000.00\",\n        //         \"icebergQuantity\": null,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"closePosition\": false,\n        //         \"priceProtect\": false,\n        //         \"reduceOnly\": false,\n        //         \"createTime\": 1763458576201,\n        //         \"updateTime\": 1763458576201,\n        //         \"triggerTime\": 0,\n        //         \"goodTillDate\": 0\n        //     }\n        //\n        // cancelOrder: linear swap conditional\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"code\": \"200\",\n        //         \"msg\": \"success\"\n        //     }\n        //\n        const code = this.safeString (order, 'code');\n        if (code !== undefined) {\n            // cancelOrders/createOrders might have a partial success\n            const msg = this.safeString (order, 'msg');\n            if ((code !== '200') && !((msg === 'success') || (msg === 'The operation of cancel all open order is done.'))) {\n                return this.safeOrder ({ 'info': order, 'status': 'rejected' }, market);\n            }\n        }\n        const status = this.parseOrderStatus (this.safeStringN (order, [ 'status', 'strategyStatus', 'algoStatus' ]));\n        const marketId = this.safeString (order, 'symbol');\n        const isContract = ('positionSide' in order) || ('cumQuote' in order);\n        const marketType = isContract ? 'contract' : 'spot';\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const filled = this.safeString (order, 'executedQty', '0');\n        const timestamp = this.safeIntegerN (order, [ 'time', 'createTime', 'workingTime', 'transactTime', 'updateTime' ]); // order of the keys matters here\n        let lastTradeTimestamp = undefined;\n        if (('transactTime' in order) || ('updateTime' in order)) {\n            const timestampValue = this.safeInteger2 (order, 'updateTime', 'transactTime');\n            if (status === 'open') {\n                if (Precise.stringGt (filled, '0')) {\n                    lastTradeTimestamp = timestampValue;\n                }\n            } else if (status === 'closed') {\n                lastTradeTimestamp = timestampValue;\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger2 (order, 'transactTime', 'updateTime');\n        const average = this.safeString (order, 'avgPrice');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString2 (order, 'origQty', 'quantity');\n        // - Spot/Margin market: cummulativeQuoteQty\n        // - Futures market: cumQuote.\n        //   Note this is not the actual cost, since Binance futures uses leverage to calculate margins.\n        let cost = this.safeString2 (order, 'cummulativeQuoteQty', 'cumQuote');\n        cost = this.safeString (order, 'cumBase', cost);\n        const type = this.safeStringLower2 (order, 'type', 'orderType');\n        const side = this.safeStringLower (order, 'side');\n        const fills = this.safeList (order, 'fills', []);\n        let timeInForce = this.safeString (order, 'timeInForce');\n        if (timeInForce === 'GTX') {\n            // GTX means \"Good Till Crossing\" and is an equivalent way of saying Post Only\n            timeInForce = 'PO';\n        }\n        const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');\n        const stopPriceString = this.safeString2 (order, 'stopPrice', 'triggerPrice');\n        const triggerPrice = this.parseNumber (this.omitZero (stopPriceString));\n        const feeCost = this.safeNumber (order, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': this.safeString (order, 'quoteAsset'),\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ]),\n            'clientOrderId': this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': fills,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 5605,
        "line_end": 5622,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'ACCEPTED': 'open',\n            'TRIGGERING': 'open',\n            'FILLED': 'closed',\n            'TRIGGERED': 'closed',\n            'FINISHED': 'closed',\n            'CANCELED': 'canceled',\n            'CANCELLED': 'canceled',\n            'PENDING_CANCEL': 'canceling', // currently unused\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n            'EXPIRED_IN_MATCH': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 5624,
        "line_end": 5634,
        "comment": null,
        "mappings": [
          {
            "key": "limit_maker",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "take_profit",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "take_profit_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "trailing_stop_market",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types = {\n            'limit_maker': 'limit',\n            'stop': 'limit',\n            'stop_market': 'market',\n            'take_profit': 'limit',\n            'take_profit_market': 'market',\n            'trailing_stop_market': 'market',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parsePositionRisk",
        "signature": "parsePositionRisk (position, market: Market = undefined)",
        "line_start": 10331,
        "line_end": 10568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePositionRisk (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        //  {\n        //     symbol: \"WLDUSDT\",\n        //     positionSide: \"BOTH\",\n        //     positionAmt: \"5\",\n        //     entryPrice: \"2.3483\",\n        //     breakEvenPrice: \"2.349356735\",\n        //     markPrice: \"2.39560000\",\n        //     unRealizedProfit: \"0.23650000\",\n        //     liquidationPrice: \"0\",\n        //     isolatedMargin: \"0\",\n        //     notional: \"11.97800000\",\n        //     isolatedWallet: \"0\",\n        //     updateTime: \"1722062678998\",\n        //     initialMargin: \"2.39560000\",         // not in v2\n        //     maintMargin: \"0.07186800\",           // not in v2\n        //     positionInitialMargin: \"2.39560000\", // not in v2\n        //     openOrderInitialMargin: \"0\",         // not in v2\n        //     adl: \"2\",                            // not in v2\n        //     bidNotional: \"0\",                    // not in v2\n        //     askNotional: \"0\",                    // not in v2\n        //     marginAsset: \"USDT\",                 // not in v2\n        //     // the below fields are only in v2\n        //     leverage: \"5\",\n        //     maxNotionalValue: \"6000000\",\n        //     marginType: \"cross\",\n        //     isAutoAddMargin: \"false\",\n        //     isolated: false,\n        //     adlQuantile: \"2\",\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_PERP\",\n        //       \"positionAmt\": \"2\",\n        //       \"entryPrice\": \"37643.10000021\",\n        //       \"markPrice\": \"38103.05510455\",\n        //       \"unRealizedProfit\": \"0.00006413\",\n        //       \"liquidationPrice\": \"25119.97445760\",\n        //       \"leverage\": \"2\",\n        //       \"maxQty\": \"1500\",\n        //       \"marginType\": \"isolated\",\n        //       \"isolatedMargin\": \"0.00274471\",\n        //       \"isAutoAddMargin\": \"false\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"notionalValue\": \"0.00524892\",\n        //       \"isolatedWallet\": \"0.00268058\"\n        //     }\n        //\n        // inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"positionAmt\": \"1\",\n        //         \"entryPrice\": \"2422.400000007\",\n        //         \"markPrice\": \"2424.51267823\",\n        //         \"unRealizedProfit\": \"0.0000036\",\n        //         \"liquidationPrice\": \"293.57678898\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371941861,\n        //         \"maxQty\": \"15\",\n        //         \"notionalValue\": \"0.00412454\",\n        //         \"breakEvenPrice\": \"2423.368960034\"\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"positionAmt\": \"0.01\",\n        //         \"entryPrice\": \"44525.0\",\n        //         \"markPrice\": \"45464.1735922\",\n        //         \"unRealizedProfit\": \"9.39173592\",\n        //         \"liquidationPrice\": \"38007.16308568\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371879042,\n        //         \"maxNotionalValue\": \"500000.0\",\n        //         \"notional\": \"454.64173592\",\n        //         \"breakEvenPrice\": \"44542.81\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const isolatedMarginString = this.safeString (position, 'isolatedMargin');\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const notional = this.parseNumber (notionalStringAbs);\n        const contractsAbs = Precise.stringAbs (this.safeString (position, 'positionAmt'));\n        const contracts = this.parseNumber (contractsAbs);\n        const unrealizedPnlString = this.safeString (position, 'unRealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        const liquidationPriceString = this.omitZero (this.safeString (position, 'liquidationPrice'));\n        const liquidationPrice = this.parseNumber (liquidationPriceString);\n        let collateralString = undefined;\n        let marginMode = this.safeString (position, 'marginType');\n        if (marginMode === undefined && isolatedMarginString !== undefined) {\n            marginMode = Precise.stringEq (isolatedMarginString, '0') ? 'cross' : 'isolated';\n        }\n        let side = undefined;\n        if (Precise.stringGt (notionalString, '0')) {\n            side = 'long';\n        } else if (Precise.stringLt (notionalString, '0')) {\n            side = 'short';\n        }\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        const entryPrice = this.parseNumber (entryPriceString);\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        // as oppose to notionalValue\n        const linear = ('notional' in position);\n        if (marginMode === 'cross') {\n            // calculate collateral\n            const precision = this.safeDict (market, 'precision', {});\n            const basePrecisionValue = this.safeString (precision, 'base');\n            const quotePrecisionValue = this.safeString2 (precision, 'quote', 'price');\n            const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);\n            if (!precisionIsUndefined) {\n                if (linear) {\n                    // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    }\n                    const inner = Precise.stringMul (liquidationPriceString, onePlusMaintenanceMarginPercentageString);\n                    const leftSide = Precise.stringAdd (inner, entryPriceSignString);\n                    const quotePrecision = this.precisionFromString (this.safeString2 (precision, 'quote', 'price'));\n                    if (quotePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, contractsAbs), '1', quotePrecision);\n                    }\n                } else {\n                    // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    }\n                    const leftSide = Precise.stringMul (contractsAbs, contractSizeString);\n                    const rightSide = Precise.stringSub (Precise.stringDiv ('1', entryPriceSignString), Precise.stringDiv (onePlusMaintenanceMarginPercentageString, liquidationPriceString));\n                    const basePrecision = this.precisionFromString (this.safeString (precision, 'base'));\n                    if (basePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, rightSide), '1', basePrecision);\n                    }\n                }\n            }\n        } else {\n            collateralString = this.safeString (position, 'isolatedMargin');\n        }\n        collateralString = (collateralString === undefined) ? '0' : collateralString;\n        const collateral = this.parseNumber (collateralString);\n        const markPrice = this.parseNumber (this.omitZero (this.safeString (position, 'markPrice')));\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        let maintenanceMarginString = Precise.stringMul (maintenanceMarginPercentageString, notionalStringAbs);\n        if (maintenanceMarginString === undefined) {\n            // for a while, this new value was a backup to the existing calculations, but in future we might prioritize this\n            maintenanceMarginString = this.safeString (position, 'maintMargin');\n        }\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        let initialMarginString = undefined;\n        let initialMarginPercentageString = undefined;\n        const leverageString = this.safeString (position, 'leverage');\n        if (leverageString !== undefined) {\n            const leverage = parseInt (leverageString);\n            const rational = this.isRoundNumber (1000 % leverage);\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringAdd (initialMarginPercentageString, '1e-8');\n            }\n            const unrounded = Precise.stringMul (notionalStringAbs, initialMarginPercentageString);\n            initialMarginString = Precise.stringDiv (unrounded, '1', 8);\n        } else {\n            initialMarginString = this.safeString (position, 'initialMargin');\n            const unrounded = Precise.stringMul (initialMarginString, '1');\n            initialMarginPercentageString = Precise.stringDiv (unrounded, notionalStringAbs, 8);\n        }\n        let marginRatio = undefined;\n        let percentage = undefined;\n        if (!Precise.stringEquals (collateralString, '0')) {\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'unrealizedPnl': unrealizedPnl,\n            'leverage': this.parseNumber (leverageString),\n            'liquidationPrice': liquidationPrice,\n            'collateral': collateral,\n            'notional': notional,\n            'markPrice': markPrice,\n            'entryPrice': entryPrice,\n            'timestamp': timestamp,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'marginRatio': marginRatio,\n            'datetime': this.iso8601 (timestamp),\n            'marginMode': marginMode,\n            'marginType': marginMode, // deprecated\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 11662,
        "line_end": 11702,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH-230223-1900-P\",\n         \"strikePrice\": \"1900\",\n         \"realStrikePrice\": \"1665.5897334\",\n         \"expiryDate\": 1677139200000,\n         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n     }",
          "{\n         \"id\": \"1125899906842897036\",\n         \"currency\": \"USDT\",\n         \"symbol\": \"BTC-230728-30000-C\",\n         \"exercisePrice\": \"30000.00000000\",\n         \"markPrice\": \"29160.71284993\",\n         \"quantity\": \"1.00000000\",\n         \"amount\": \"0.00000000\",\n         \"fee\": \"0.00000000\",\n         \"createDate\": 1690531200000,\n         \"priceScale\": 0,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"positionSide\": \"LONG\",\n         \"quoteAsset\": \"USDT\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"symbol\": \"ETH-230223-1900-P\",\n        //         \"strikePrice\": \"1900\",\n        //         \"realStrikePrice\": \"1665.5897334\",\n        //         \"expiryDate\": 1677139200000,\n        //         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"id\": \"1125899906842897036\",\n        //         \"currency\": \"USDT\",\n        //         \"symbol\": \"BTC-230728-30000-C\",\n        //         \"exercisePrice\": \"30000.00000000\",\n        //         \"markPrice\": \"29160.71284993\",\n        //         \"quantity\": \"1.00000000\",\n        //         \"amount\": \"0.00000000\",\n        //         \"fee\": \"0.00000000\",\n        //         \"createDate\": 1690531200000,\n        //         \"priceScale\": 0,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"positionSide\": \"LONG\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (settlement, 'expiryDate', 'createDate');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 11704,
        "line_end": 11744,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETH-230223-1900-P\",\n             \"strikePrice\": \"1900\",\n             \"realStrikePrice\": \"1665.5897334\",\n             \"expiryDate\": 1677139200000,\n             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n         }\n     ]",
          "[\n         {\n             \"id\": \"1125899906842897036\",\n             \"currency\": \"USDT\",\n             \"symbol\": \"BTC-230728-30000-C\",\n             \"exercisePrice\": \"30000.00000000\",\n             \"markPrice\": \"29160.71284993\",\n             \"quantity\": \"1.00000000\",\n             \"amount\": \"0.00000000\",\n             \"fee\": \"0.00000000\",\n             \"createDate\": 1690531200000,\n             \"priceScale\": 0,\n             \"quantityScale\": 2,\n             \"optionSide\": \"CALL\",\n             \"positionSide\": \"LONG\",\n             \"quoteAsset\": \"USDT\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETH-230223-1900-P\",\n        //             \"strikePrice\": \"1900\",\n        //             \"realStrikePrice\": \"1665.5897334\",\n        //             \"expiryDate\": 1677139200000,\n        //             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"id\": \"1125899906842897036\",\n        //             \"currency\": \"USDT\",\n        //             \"symbol\": \"BTC-230728-30000-C\",\n        //             \"exercisePrice\": \"30000.00000000\",\n        //             \"markPrice\": \"29160.71284993\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"amount\": \"0.00000000\",\n        //             \"fee\": \"0.00000000\",\n        //             \"createDate\": 1690531200000,\n        //             \"priceScale\": 0,\n        //             \"quantityScale\": 2,\n        //             \"optionSide\": \"CALL\",\n        //             \"positionSide\": \"LONG\",\n        //             \"quoteAsset\": \"USDT\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 4068,
        "line_end": 4254,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'highPrice', 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'lowPrice', 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "wAvg",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'openPrice', 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'prevClosePrice')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"11793.63104562\", // mark price\n         \"indexPrice\": \"11781.80495970\", // index price\n         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n         \"nextFundingTime\": 1597392000000,\n         \"interestRate\": \"0.00010000\",\n         \"time\": 1597370495002\n     }",
          "{\n        \"symbol\": \"BTCUSDT\",\n        \"priceChange\": \"-188.18000000\",\n        \"priceChangePercent\": \"-0.159\",\n        \"weightedAvgPrice\": \"118356.64734074\",\n        \"lastPrice\": \"118449.03000000\",\n        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        \"openPrice\": \"118637.21000000\",\n        \"highPrice\": \"119273.36000000\",\n        \"lowPrice\": \"117427.50000000\",\n        \"volume\": \"14741.41491000\",\n        \"quoteVolume\": \"1744744445.80640740\",\n        \"openTime\": \"1753701474013\",\n        \"closeTime\": \"1753787874013\",\n        \"firstId\": \"5116031635\",\n        \"lastId\": \"5117964946\",\n        \"count\": \"1933312\"\n    }",
          "{\n        \"symbol\": \"SUSDT\",\n        \"priceChange\": \"-0.0229000\",\n        \"priceChangePercent\": \"-6.777\",\n        \"weightedAvgPrice\": \"0.3210035\",\n        \"lastPrice\": \"0.3150000\",\n        \"lastQty\": \"16\",\n        \"openPrice\": \"0.3379000\",\n        \"highPrice\": \"0.3411000\",\n        \"lowPrice\": \"0.3071000\",\n        \"volume\": \"120588225\",\n        \"quoteVolume\": \"38709237.2289000\",\n        \"openTime\": \"1753701720000\",\n        \"closeTime\": \"1753788172414\",\n        \"firstId\": \"72234973\",\n        \"lastId\": \"72423677\",\n        \"count\": \"188700\"\n    }",
          "{\n         \"baseVolume\": \"214549.95171161\",\n         \"closeTime\": \"1621965286847\",\n         \"count\": \"1283779\",\n         \"firstId\": \"152560106\",\n         \"highPrice\": \"39938.3\",\n         \"lastId\": \"153843955\",\n         \"lastPrice\": \"37993.4\",\n         \"lastQty\": \"1\",\n         \"lowPrice\": \"36457.2\",\n         \"openPrice\": \"37783.4\",\n         \"openTime\": \"1621878840000\",\n         \"pair\": \"BTCUSD\",\n         \"priceChange\": \"210.0\",\n         \"priceChangePercent\": \"0.556\",\n         \"symbol\": \"BTCUSD_PERP\",\n         \"volume\": \"81990451\",\n         \"weightedAvgPrice\": \"38215.08713747\"\n     }",
          "{\n         \"symbol\": \"ETH-230510-1825-C\",\n         \"priceChange\": \"-5.1\",\n         \"priceChangePercent\": \"-0.1854\",\n         \"lastPrice\": \"22.4\",\n         \"lastQty\": \"0\",\n         \"open\": \"27.5\",\n         \"high\": \"34.1\",\n         \"low\": \"22.4\",\n         \"volume\": \"6.83\",\n         \"amount\": \"201.44\",\n         \"bidPrice\": \"21.9\",\n         \"askPrice\": \"22.4\",\n         \"openTime\": 1683614771898,\n         \"closeTime\": 1683695017784,\n         \"firstTradeId\": 12,\n         \"tradeCount\": 22,\n         \"strikePrice\": \"1825\",\n         \"exercisePrice\": \"1845.95341176\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // markPrices\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"11793.63104562\", // mark price\n        //         \"indexPrice\": \"11781.80495970\", // index price\n        //         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n        //         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n        //         \"nextFundingTime\": 1597392000000,\n        //         \"interestRate\": \"0.00010000\",\n        //         \"time\": 1597370495002\n        //     }\n        //\n        // spot - ticker\n        //\n        //    {\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"priceChange\": \"-188.18000000\",\n        //        \"priceChangePercent\": \"-0.159\",\n        //        \"weightedAvgPrice\": \"118356.64734074\",\n        //        \"lastPrice\": \"118449.03000000\",\n        //        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        //        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        //        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        //        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        //        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        //        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        //        \"openPrice\": \"118637.21000000\",\n        //        \"highPrice\": \"119273.36000000\",\n        //        \"lowPrice\": \"117427.50000000\",\n        //        \"volume\": \"14741.41491000\",\n        //        \"quoteVolume\": \"1744744445.80640740\",\n        //        \"openTime\": \"1753701474013\",\n        //        \"closeTime\": \"1753787874013\",\n        //        \"firstId\": \"5116031635\",\n        //        \"lastId\": \"5117964946\",\n        //        \"count\": \"1933312\"\n        //    }\n        //\n        // usdm tickers\n        //\n        //    {\n        //        \"symbol\": \"SUSDT\",\n        //        \"priceChange\": \"-0.0229000\",\n        //        \"priceChangePercent\": \"-6.777\",\n        //        \"weightedAvgPrice\": \"0.3210035\",\n        //        \"lastPrice\": \"0.3150000\",\n        //        \"lastQty\": \"16\",\n        //        \"openPrice\": \"0.3379000\",\n        //        \"highPrice\": \"0.3411000\",\n        //        \"lowPrice\": \"0.3071000\",\n        //        \"volume\": \"120588225\",\n        //        \"quoteVolume\": \"38709237.2289000\",\n        //        \"openTime\": \"1753701720000\",\n        //        \"closeTime\": \"1753788172414\",\n        //        \"firstId\": \"72234973\",\n        //        \"lastId\": \"72423677\",\n        //        \"count\": \"188700\"\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //         \"baseVolume\": \"214549.95171161\",\n        //         \"closeTime\": \"1621965286847\",\n        //         \"count\": \"1283779\",\n        //         \"firstId\": \"152560106\",\n        //         \"highPrice\": \"39938.3\",\n        //         \"lastId\": \"153843955\",\n        //         \"lastPrice\": \"37993.4\",\n        //         \"lastQty\": \"1\",\n        //         \"lowPrice\": \"36457.2\",\n        //         \"openPrice\": \"37783.4\",\n        //         \"openTime\": \"1621878840000\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"priceChange\": \"210.0\",\n        //         \"priceChangePercent\": \"0.556\",\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"volume\": \"81990451\",\n        //         \"weightedAvgPrice\": \"38215.08713747\"\n        //     }\n        //\n        // eapi: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"ETH-230510-1825-C\",\n        //         \"priceChange\": \"-5.1\",\n        //         \"priceChangePercent\": \"-0.1854\",\n        //         \"lastPrice\": \"22.4\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"27.5\",\n        //         \"high\": \"34.1\",\n        //         \"low\": \"22.4\",\n        //         \"volume\": \"6.83\",\n        //         \"amount\": \"201.44\",\n        //         \"bidPrice\": \"21.9\",\n        //         \"askPrice\": \"22.4\",\n        //         \"openTime\": 1683614771898,\n        //         \"closeTime\": 1683695017784,\n        //         \"firstTradeId\": 12,\n        //         \"tradeCount\": 22,\n        //         \"strikePrice\": \"1825\",\n        //         \"exercisePrice\": \"1845.95341176\"\n        //     }\n        //\n        // spot bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"ETHBTC\",\n        //         \"bidPrice\":\"0.07466800\",\n        //         \"bidQty\":\"5.31990000\",\n        //         \"askPrice\":\"0.07466900\",\n        //         \"askQty\":\"10.93540000\"\n        //     }\n        //\n        // usdm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"bidPrice\":\"21321.90\",\n        //         \"bidQty\":\"33.592\",\n        //         \"askPrice\":\"21322.00\",\n        //         \"askQty\":\"1.427\",\n        //         \"time\":\"1673899207538\"\n        //     }\n        //\n        // coinm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD_PERP\",\n        //         \"pair\":\"BTCUSD\",\n        //         \"bidPrice\":\"21301.2\",\n        //         \"bidQty\":\"188\",\n        //         \"askPrice\":\"21301.3\",\n        //         \"askQty\":\"10302\",\n        //         \"time\":\"1673899278514\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (ticker, 'closeTime', 'time');\n        let marketType = undefined;\n        if (('time' in ticker)) {\n            marketType = 'contract';\n        }\n        if (marketType === undefined) {\n            marketType = ('bidQty' in ticker) ? 'spot' : 'contract';\n        }\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const last = this.safeString (ticker, 'lastPrice');\n        const wAvg = this.safeString (ticker, 'weightedAvgPrice');\n        const isCoinm = ('baseVolume' in ticker);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        if (isCoinm) {\n            baseVolume = this.safeString (ticker, 'baseVolume');\n            // 'volume' field in inverse markets is not quoteVolume, but traded amount (per contracts)\n            quoteVolume = Precise.stringMul (baseVolume, wAvg);\n        } else {\n            baseVolume = this.safeString (ticker, 'volume');\n            quoteVolume = this.safeString2 (ticker, 'quoteVolume', 'amount');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'highPrice', 'high'),\n            'low': this.safeString2 (ticker, 'lowPrice', 'low'),\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': wAvg,\n            'open': this.safeString2 (ticker, 'openPrice', 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'prevClosePrice'), // previous day close\n            'change': this.safeString (ticker, 'priceChange'),\n            'percentage': this.safeString (ticker, 'priceChangePercent'),\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTickersForRolling",
        "signature": "parseTickersForRolling (response, symbols)",
        "line_start": 4518,
        "line_end": 4528,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTickersForRolling (response, symbols) {\n        const results = [];\n        for (let i = 0; i < response.length; i++) {\n            const marketId = this.safeString (response[i], 'symbol');\n            const tickerMarket = this.safeMarket (marketId, undefined, undefined, 'spot');\n            const parsedTicker = this.parseTicker (response[i]);\n            parsedTicker['symbol'] = tickerMarket['symbol'];\n            results.push (parsedTicker);\n        }\n        return this.filterByArray (results, 'symbol', symbols);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 4791,
        "line_end": 5057,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ])",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'type')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'p', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (trade, 'quoteQty', 'baseQty')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"a\": 26129,         // Aggregate tradeId\n         \"p\": \"0.01633102\",  // Price\n         \"q\": \"4.70443515\",  // Quantity\n         \"f\": 27781,         // First tradeId\n         \"l\": 27781,         // Last tradeId\n         \"T\": 1498793709153, // Timestamp\n         \"m\": true,          // Was the buyer the maker?\n         \"M\": true           // Was the trade the best price match?\n     }",
          "{\n         \"a\": \"269772814\",\n         \"p\": \"25864.1\",\n         \"q\": \"3\",\n         \"f\": \"662149354\",\n         \"l\": \"662149355\",\n         \"T\": \"1694209776022\",\n         \"m\": false,\n     }",
          "{\n         \"id\": 28457,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"time\": 1499865549590,\n         \"isBuyerMaker\": true,\n         \"isBestMatch\": true\n     }",
          "{\n         \"symbol\": \"BNBBTC\",\n         \"id\": 28457,\n         \"orderId\": 100234,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"commission\": \"10.10000000\",\n         \"commissionAsset\": \"BNB\",\n         \"time\": 1499865549590,\n         \"isBuyer\": true,\n         \"isMaker\": false,\n         \"isBestMatch\": true\n     }",
          "{\n       \"accountId\": 20,\n       \"buyer\": False,\n       \"commission\": \"-0.07819010\",\n       \"commissionAsset\": \"USDT\",\n       \"counterPartyId\": 653,\n       \"id\": 698759,\n       \"maker\": False,\n       \"orderId\": 25851813,\n       \"price\": \"7819.01\",\n       \"qty\": \"0.002\",\n       \"quoteQty\": \"0.01563\",\n       \"realizedPnl\": \"-0.91539999\",\n       \"side\": \"SELL\",\n       \"symbol\": \"BTCUSDT\",\n       \"time\": 1569514978020\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        if ('isDustTrade' in trade) {\n            return this.parseDustTrade (trade, market);\n        }\n        //\n        // aggregate trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list\n        //\n        //     {\n        //         \"a\": 26129,         // Aggregate tradeId\n        //         \"p\": \"0.01633102\",  // Price\n        //         \"q\": \"4.70443515\",  // Quantity\n        //         \"f\": 27781,         // First tradeId\n        //         \"l\": 27781,         // Last tradeId\n        //         \"T\": 1498793709153, // Timestamp\n        //         \"m\": true,          // Was the buyer the maker?\n        //         \"M\": true           // Was the trade the best price match?\n        //     }\n        //\n        // REST: aggregate trades for swap & future (both linear and inverse)\n        //\n        //     {\n        //         \"a\": \"269772814\",\n        //         \"p\": \"25864.1\",\n        //         \"q\": \"3\",\n        //         \"f\": \"662149354\",\n        //         \"l\": \"662149355\",\n        //         \"T\": \"1694209776022\",\n        //         \"m\": false,\n        //     }\n        //\n        // recent public trades and old public trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#recent-trades-list\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data\n        //\n        //     {\n        //         \"id\": 28457,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyerMaker\": true,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // private trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-trade-list-user_data\n        //\n        //     {\n        //         \"symbol\": \"BNBBTC\",\n        //         \"id\": 28457,\n        //         \"orderId\": 100234,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"commission\": \"10.10000000\",\n        //         \"commissionAsset\": \"BNB\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // futures trades\n        //\n        //     {\n        //       \"accountId\": 20,\n        //       \"buyer\": False,\n        //       \"commission\": \"-0.07819010\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"counterPartyId\": 653,\n        //       \"id\": 698759,\n        //       \"maker\": False,\n        //       \"orderId\": 25851813,\n        //       \"price\": \"7819.01\",\n        //       \"qty\": \"0.002\",\n        //       \"quoteQty\": \"0.01563\",\n        //       \"realizedPnl\": \"-0.91539999\",\n        //       \"side\": \"SELL\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"time\": 1569514978020\n        //     }\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"id\": 477128891,\n        //       \"orderId\": 13809777875,\n        //       \"side\": \"SELL\",\n        //       \"price\": \"38479.55\",\n        //       \"qty\": \"0.001\",\n        //       \"realizedPnl\": \"-0.00009534\",\n        //       \"marginAsset\": \"USDT\",\n        //       \"quoteQty\": \"38.47955\",\n        //       \"commission\": \"-0.00076959\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"time\": 1612733566708,\n        //       \"positionSide\": \"BOTH\",\n        //       \"maker\": true,\n        //       \"buyer\": false\n        //     }\n        //\n        // { respType: FULL }\n        //\n        //     {\n        //       \"price\": \"4000.00000000\",\n        //       \"qty\": \"1.00000000\",\n        //       \"commission\": \"4.00000000\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"tradeId\": \"1234\",\n        //     }\n        //\n        // options: fetchMyTrades\n        //\n        //     {\n        //         \"id\": 1125899906844226012,\n        //         \"tradeId\": 73,\n        //         \"orderId\": 4638761100843040768,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"18.70000000\",\n        //         \"quantity\": \"-0.57000000\",\n        //         \"fee\": \"0.17305890\",\n        //         \"realizedProfit\": \"-3.53400000\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"LIMIT\",\n        //         \"volatility\": \"0.30000000\",\n        //         \"liquidity\": \"MAKER\",\n        //         \"time\": 1676085216845,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        // options: fetchTrades\n        //\n        //     {\n        //         \"id\": 1,\n        //         \"symbol\": \"ETH-230216-1500-C\",\n        //         \"price\": \"35.5\",\n        //         \"qty\": \"0.03\",\n        //         \"quoteQty\": \"1.065\",\n        //         \"side\": 1,\n        //         \"time\": 1676366446072\n        //     }\n        //\n        // fetchMyTrades: linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"id\": 4575108247,\n        //         \"orderId\": 261942655610,\n        //         \"side\": \"SELL\",\n        //         \"price\": \"47263.40\",\n        //         \"qty\": \"0.010\",\n        //         \"realizedPnl\": \"27.38400000\",\n        //         \"marginAsset\": \"USDT\",\n        //         \"quoteQty\": \"472.63\",\n        //         \"commission\": \"0.18905360\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707530039409,\n        //         \"buyer\": false,\n        //         \"maker\": false,\n        //         \"positionSide\": \"LONG\"\n        //     }\n        //\n        // fetchMyTrades: inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"id\": 701907838,\n        //         \"orderId\": 71548909034,\n        //         \"pair\": \"ETHUSD\",\n        //         \"side\": \"SELL\",\n        //         \"price\": \"2498.15\",\n        //         \"qty\": \"1\",\n        //         \"realizedPnl\": \"0.00012517\",\n        //         \"marginAsset\": \"ETH\",\n        //         \"baseQty\": \"0.00400296\",\n        //         \"commission\": \"0.00000160\",\n        //         \"commissionAsset\": \"ETH\",\n        //         \"time\": 1707530317519,\n        //         \"positionSide\": \"LONG\",\n        //         \"buyer\": false,\n        //         \"maker\": false\n        //     }\n        //\n        // fetchMyTrades: spot margin portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ADAUSDT\",\n        //         \"id\": 470227543,\n        //         \"orderId\": 4421170947,\n        //         \"price\": \"0.53880000\",\n        //         \"qty\": \"10.00000000\",\n        //         \"quoteQty\": \"5.38800000\",\n        //         \"commission\": \"0.00538800\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707545780522,\n        //         \"isBuyer\": false,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'T', 'time');\n        let amount = this.safeString2 (trade, 'q', 'qty');\n        amount = this.safeString (trade, 'quantity', amount);\n        const marketId = this.safeString (trade, 'symbol');\n        const isSpotTrade = ('isIsolated' in trade) || ('M' in trade) || ('orderListId' in trade) || ('isMaker' in trade);\n        const marketType = isSpotTrade ? 'spot' : 'contract';\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        let side = undefined;\n        const buyerMaker = this.safeBool2 (trade, 'm', 'isBuyerMaker');\n        let takerOrMaker = undefined;\n        if (buyerMaker !== undefined) {\n            side = buyerMaker ? 'sell' : 'buy'; // this is reversed intentionally\n        } else if ('side' in trade) {\n            side = this.safeStringLower (trade, 'side');\n        } else {\n            if ('isBuyer' in trade) {\n                side = trade['isBuyer'] ? 'buy' : 'sell'; // this is a true side\n            }\n        }\n        let fee = undefined;\n        if ('commission' in trade) {\n            fee = {\n                'cost': this.safeString (trade, 'commission'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'commissionAsset')),\n            };\n        }\n        if ('isMaker' in trade) {\n            takerOrMaker = trade['isMaker'] ? 'maker' : 'taker';\n        }\n        if ('maker' in trade) {\n            takerOrMaker = trade['maker'] ? 'maker' : 'taker';\n        }\n        if (('optionSide' in trade) || market['option']) {\n            const settle = this.safeCurrencyCode (this.safeString (trade, 'quoteAsset', 'USDT'));\n            takerOrMaker = this.safeStringLower (trade, 'liquidity');\n            if ('fee' in trade) {\n                fee = {\n                    'cost': this.safeString (trade, 'fee'),\n                    'currency': settle,\n                };\n            }\n            if ((side !== 'buy') && (side !== 'sell')) {\n                side = (side === '1') ? 'buy' : 'sell';\n            }\n            if ('optionSide' in trade) {\n                if (side !== 'buy') {\n                    amount = Precise.stringMul ('-1', amount);\n                }\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ]),\n            'order': this.safeString (trade, 'orderId'),\n            'type': this.safeStringLower (trade, 'type'),\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString2 (trade, 'p', 'price'),\n            'amount': amount,\n            'cost': this.safeString2 (trade, 'quoteQty', 'baseQty'),\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 9517,
        "line_end": 9545,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n       {\n         \"symbol\": \"BTCUSDT\",\n         \"makerCommission\": \"0.001\",\n         \"takerCommission\": \"0.001\"\n       }\n     ]",
          "{\n         \"symbol\": \"BTCUSD_PERP\",\n         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        // spot\n        //     [\n        //       {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"makerCommission\": \"0.001\",\n        //         \"takerCommission\": \"0.001\"\n        //       }\n        //     ]\n        //\n        // swap\n        //     {\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n        //         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate'),\n            'taker': this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 8648,
        "line_end": 8777,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"amount\": \"4500\",\n       \"coin\": \"USDT\",\n       \"network\": \"BSC\",\n       \"status\": 1,\n       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n       \"addressTag\": \"\",\n       \"txId\": \"Internal transfer 51376627901\",\n       \"insertTime\": 1618394381000,\n       \"transferType\": 1,\n       \"confirmTimes\": \"1/15\"\n     }",
          "{\n       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n       \"amount\": \"28.75\",\n       \"transactionFee\": \"0.25\",\n       \"coin\": \"XRP\",\n       \"status\": 6,\n       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n       \"addressTag\": \"101286922\",\n       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n       \"applyTime\": \"2021-04-15 12:09:16\",\n       \"network\": \"XRP\",\n       \"transferType\": 0\n     }",
          "{\n       \"orderNo\": \"CJW684897551397171200\",\n       \"fiatCurrency\": \"GBP\",\n       \"indicatedAmount\": \"29.99\",\n       \"amount\": \"28.49\",\n       \"totalFee\": \"1.50\",\n       \"method\": \"bank transfer\",\n       \"status\": \"Successful\",\n       \"createTime\": 1614898701000,\n       \"updateTime\": 1614898820000\n     }",
          "{\n       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n       \"fiatCurrency\": \"EUR\",\n       \"transactionType\": 0,\n       \"indicatedAmount\": \"15.00\",\n       \"amount\": \"15.00\",\n       \"totalFee\": \"0.00\",\n       \"method\": \"card\",\n       \"status\": \"Failed\",\n       \"createTime\": \"1627501026000\",\n       \"updateTime\": \"1627501027000\"\n     }",
          "{ id: \"9a67628b16ba4988ae20d329333f16bc\" }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //       \"amount\": \"4500\",\n        //       \"coin\": \"USDT\",\n        //       \"network\": \"BSC\",\n        //       \"status\": 1,\n        //       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n        //       \"addressTag\": \"\",\n        //       \"txId\": \"Internal transfer 51376627901\",\n        //       \"insertTime\": 1618394381000,\n        //       \"transferType\": 1,\n        //       \"confirmTimes\": \"1/15\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n        //       \"amount\": \"28.75\",\n        //       \"transactionFee\": \"0.25\",\n        //       \"coin\": \"XRP\",\n        //       \"status\": 6,\n        //       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n        //       \"addressTag\": \"101286922\",\n        //       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n        //       \"applyTime\": \"2021-04-15 12:09:16\",\n        //       \"network\": \"XRP\",\n        //       \"transferType\": 0\n        //     }\n        //\n        // fiat transaction\n        // withdraw\n        //     {\n        //       \"orderNo\": \"CJW684897551397171200\",\n        //       \"fiatCurrency\": \"GBP\",\n        //       \"indicatedAmount\": \"29.99\",\n        //       \"amount\": \"28.49\",\n        //       \"totalFee\": \"1.50\",\n        //       \"method\": \"bank transfer\",\n        //       \"status\": \"Successful\",\n        //       \"createTime\": 1614898701000,\n        //       \"updateTime\": 1614898820000\n        //     }\n        //\n        // deposit\n        //     {\n        //       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n        //       \"fiatCurrency\": \"EUR\",\n        //       \"transactionType\": 0,\n        //       \"indicatedAmount\": \"15.00\",\n        //       \"amount\": \"15.00\",\n        //       \"totalFee\": \"0.00\",\n        //       \"method\": \"card\",\n        //       \"status\": \"Failed\",\n        //       \"createTime\": \"1627501026000\",\n        //       \"updateTime\": \"1627501027000\"\n        //     }\n        //\n        // withdraw\n        //\n        //    { id: \"9a67628b16ba4988ae20d329333f16bc\" }\n        //\n        const id = this.safeString2 (transaction, 'id', 'orderNo');\n        const address = this.safeString (transaction, 'address');\n        let tag = this.safeString (transaction, 'addressTag'); // set but unused\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        let txid = this.safeString (transaction, 'txId');\n        if ((txid !== undefined) && (txid.indexOf ('Internal transfer ') >= 0)) {\n            txid = txid.slice (18);\n        }\n        const currencyId = this.safeString2 (transaction, 'coin', 'fiatCurrency');\n        let code = this.safeCurrencyCode (currencyId, currency);\n        let timestamp = undefined;\n        timestamp = this.safeInteger2 (transaction, 'insertTime', 'createTime');\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (transaction, 'applyTime'));\n        }\n        const updated = this.safeInteger2 (transaction, 'successTime', 'updateTime');\n        let type = this.safeString (transaction, 'type');\n        if (type === undefined) {\n            const txType = this.safeString (transaction, 'transactionType');\n            if (txType !== undefined) {\n                type = (txType === '0') ? 'deposit' : 'withdrawal';\n            }\n            const legalMoneyCurrenciesById = this.safeDict (this.options, 'legalMoneyCurrenciesById');\n            code = this.safeString (legalMoneyCurrenciesById, code, code);\n        }\n        const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber2 (transaction, 'transactionFee', 'totalFee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const internalInteger = this.safeInteger (transaction, 'transferType');\n        let internal = undefined;\n        if (internalInteger !== undefined) {\n            internal = (internalInteger !== 0) ? true : false;\n        }\n        const network = this.safeString (transaction, 'network');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': internal,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 8608,
        "line_end": 8646,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        if (type === undefined) {\n            return status;\n        }\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n                '6': 'ok',\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n                '2': 'pending', // Awaiting Approval\n                '3': 'failed', // Rejected\n                '4': 'pending', // Processing\n                '5': 'failed', // Failure\n                '6': 'ok', // Completed\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 8786,
        "line_end": 8888,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\":13526853623\n     }",
          "{\n         \"timestamp\": 1614640878000,\n         \"asset\": \"USDT\",\n         \"amount\": \"25\",\n         \"type\": \"MAIN_UMFUTURE\",\n         \"status\": \"CONFIRMED\",\n         \"tranId\": 43000126248\n     }",
          "{\n             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n             \"transactionId\": \"M_P_71505104267788288\",\n             \"transactionTime\": 1610090460133, //trade timestamp\n             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n             \"currency\": \"BNB\",\n             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n             \"fundsDetail\": [ // details\n                     {\n                         \"currency\": \"USDT\", //asset\n                         \"amount\": \"1.2\",\n                         \"walletAssetCost\":[ //details of asset cost per wallet\n                             {\"1\":\"0.6\"},\n                             {\"2\":\"0.6\"}\n                         ]\n                     },\n                     {\n                         \"currency\": \"ETH\",\n                         \"amount\": \"0.0001\",\n                         \"walletAssetCost\":[\n                             {\"1\":\"0.00005\"},\n                             {\"2\":\"0.00005\"}\n                         ]\n                     }\n                 ],\n             \"payerInfo\":{\n                     \"name\":\"Jack\", //nickname or merchant name\n                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n                     \"binanceId\":\"12345678\", //binance uid\n                     \"accountId\":\"67736251\" //binance pay id\n                 },\n             \"receiverInfo\":{\n                     \"name\":\"Alan\", //nickname or merchant name\n                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n                     \"email\":\"alan@binance.com\", //email\n                     \"binanceId\":\"34355667\", //binance uid\n                     \"accountId\":\"21326891\", //binance pay id\n                     \"countryCode\":\"1\", //International area code\n                     \"phoneNumber\":\"8057651210\",\n                     \"mobileCode\":\"US\", //country code\n                     \"extend\":[ //extension field\n                             \"institutionName\": \"\",\n                             \"cardNumber\": \"\",\n                             \"digitalWalletId\": \"\"\n                     ]\n                 }\n             }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"tranId\":13526853623\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"timestamp\": 1614640878000,\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"25\",\n        //         \"type\": \"MAIN_UMFUTURE\",\n        //         \"status\": \"CONFIRMED\",\n        //         \"tranId\": 43000126248\n        //     }\n        //\n        //     {\n        //             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n        //             \"transactionId\": \"M_P_71505104267788288\",\n        //             \"transactionTime\": 1610090460133, //trade timestamp\n        //             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n        //             \"currency\": \"BNB\",\n        //             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n        //             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n        //             \"fundsDetail\": [ // details\n        //                     {\n        //                         \"currency\": \"USDT\", //asset\n        //                         \"amount\": \"1.2\",\n        //                         \"walletAssetCost\":[ //details of asset cost per wallet\n        //                             {\"1\":\"0.6\"},\n        //                             {\"2\":\"0.6\"}\n        //                         ]\n        //                     },\n        //                     {\n        //                         \"currency\": \"ETH\",\n        //                         \"amount\": \"0.0001\",\n        //                         \"walletAssetCost\":[\n        //                             {\"1\":\"0.00005\"},\n        //                             {\"2\":\"0.00005\"}\n        //                         ]\n        //                     }\n        //                 ],\n        //             \"payerInfo\":{\n        //                     \"name\":\"Jack\", //nickname or merchant name\n        //                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"binanceId\":\"12345678\", //binance uid\n        //                     \"accountId\":\"67736251\" //binance pay id\n        //                 },\n        //             \"receiverInfo\":{\n        //                     \"name\":\"Alan\", //nickname or merchant name\n        //                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"email\":\"alan@binance.com\", //email\n        //                     \"binanceId\":\"34355667\", //binance uid\n        //                     \"accountId\":\"21326891\", //binance pay id\n        //                     \"countryCode\":\"1\", //International area code\n        //                     \"phoneNumber\":\"8057651210\",\n        //                     \"mobileCode\":\"US\", //country code\n        //                     \"extend\":[ //extension field\n        //                             \"institutionName\": \"\",\n        //                             \"cardNumber\": \"\",\n        //                             \"digitalWalletId\": \"\"\n        //                     ]\n        //                 }\n        //             }\n        const id = this.safeString2 (transfer, 'tranId', 'transactionId');\n        const currencyId = this.safeString2 (transfer, 'asset', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const amount = this.safeNumber (transfer, 'amount');\n        const type = this.safeString (transfer, 'type');\n        let fromAccount = undefined;\n        let toAccount = undefined;\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        if (type !== undefined) {\n            const parts = type.split ('_');\n            fromAccount = this.safeValue (parts, 0);\n            toAccount = this.safeValue (parts, 1);\n            fromAccount = this.safeString (accountsById, fromAccount, fromAccount);\n            toAccount = this.safeString (accountsById, toAccount, toAccount);\n        }\n        const walletType = this.safeInteger (transfer, 'walletType');\n        if (walletType !== undefined) {\n            const payer = this.safeDict (transfer, 'payerInfo', {});\n            const receiver = this.safeDict (transfer, 'receiverInfo', {});\n            fromAccount = this.safeString (payer, 'accountId');\n            toAccount = this.safeString (receiver, 'accountId');\n        }\n        const timestamp = this.safeInteger2 (transfer, 'timestamp', 'transactionTime');\n        const status = this.parseTransferStatus (this.safeString (transfer, 'status'));\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': status,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 8779,
        "line_end": 8784,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'CONFIRMED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      }
    ],
    "binanceus": [
      {
        "name": "parseAccountPosition",
        "signature": "parseAccountPosition (position, market: Market = undefined)",
        "line_start": 10081,
        "line_end": 10329,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "initialMargin",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"WLDUSDT\",\n        \"positionSide\": \"BOTH\",\n        \"positionAmt\": \"-849\",\n        \"unrealizedProfit\": \"11.17920750\",\n        \"notional\": \"-1992.46079250\",\n        \"isolatedMargin\": \"0\",\n        \"isolatedWallet\": \"0\",\n        \"initialMargin\": \"99.62303962\",\n        \"maintMargin\": \"11.95476475\",\n        \"updateTime\": \"1721995760449\"\n        \"leverage\": \"50\",                        // in v2\n        \"entryPrice\": \"2.34\",                    // in v2\n        \"positionInitialMargin\": \"118.82116614\", // in v2\n        \"openOrderInitialMargin\": \"0\",           // in v2\n        \"isolated\": false,                       // in v2\n        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        \"maxNotional\": \"25000\",                  // in v2\n        \"bidNotional\": \"0\",                      // in v2\n        \"askNotional\": \"0\"                       // in v2\n    }",
          "{\n       \"symbol\": \"BTCUSD_210625\",\n       \"initialMargin\": \"0.00024393\",\n       \"maintMargin\": \"0.00002439\",\n       \"unrealizedProfit\": \"-0.00000163\",\n       \"positionInitialMargin\": \"0.00024393\",\n       \"openOrderInitialMargin\": \"0\",\n       \"leverage\": \"10\",\n       \"isolated\": false,\n       \"positionSide\": \"BOTH\",\n       \"entryPrice\": \"41021.20000069\",\n       \"maxQty\": \"100\",\n       \"notionalValue\": \"0.00243939\",\n       \"isolatedWallet\": \"0\",\n       \"crossMargin\": \"0.314\"\n       \"crossWalletBalance\": \"34\",\n     }",
          "{\n         \"symbol\": \"CTSIUSDT\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.0\",\n         \"maxNotional\": \"25000\",\n         \"bidNotional\": \"0\",\n         \"askNotional\": \"0\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"updateTime\": 0,\n         \"notional\": \"0\",\n         \"breakEvenPrice\": \"0.0\"\n     }",
          "{\n         \"symbol\": \"TRXUSD_PERP\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.00000000\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"maxQty\": \"5000000\",\n         \"updateTime\": 0,\n         \"notionalValue\": \"0\",\n         \"breakEvenPrice\": \"0.00000000\"\n     }"
        ],
        "source": "parseAccountPosition (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        // v3 (similar for cross & isolated)\n        //\n        //    {\n        //        \"symbol\": \"WLDUSDT\",\n        //        \"positionSide\": \"BOTH\",\n        //        \"positionAmt\": \"-849\",\n        //        \"unrealizedProfit\": \"11.17920750\",\n        //        \"notional\": \"-1992.46079250\",\n        //        \"isolatedMargin\": \"0\",\n        //        \"isolatedWallet\": \"0\",\n        //        \"initialMargin\": \"99.62303962\",\n        //        \"maintMargin\": \"11.95476475\",\n        //        \"updateTime\": \"1721995760449\"\n        //        \"leverage\": \"50\",                        // in v2\n        //        \"entryPrice\": \"2.34\",                    // in v2\n        //        \"positionInitialMargin\": \"118.82116614\", // in v2\n        //        \"openOrderInitialMargin\": \"0\",           // in v2\n        //        \"isolated\": false,                       // in v2\n        //        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        //        \"maxNotional\": \"25000\",                  // in v2\n        //        \"bidNotional\": \"0\",                      // in v2\n        //        \"askNotional\": \"0\"                       // in v2\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_210625\",\n        //       \"initialMargin\": \"0.00024393\",\n        //       \"maintMargin\": \"0.00002439\",\n        //       \"unrealizedProfit\": \"-0.00000163\",\n        //       \"positionInitialMargin\": \"0.00024393\",\n        //       \"openOrderInitialMargin\": \"0\",\n        //       \"leverage\": \"10\",\n        //       \"isolated\": false,\n        //       \"positionSide\": \"BOTH\",\n        //       \"entryPrice\": \"41021.20000069\",\n        //       \"maxQty\": \"100\",\n        //       \"notionalValue\": \"0.00243939\",\n        //       \"isolatedWallet\": \"0\",\n        //       \"crossMargin\": \"0.314\"\n        //       \"crossWalletBalance\": \"34\",\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"CTSIUSDT\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.0\",\n        //         \"maxNotional\": \"25000\",\n        //         \"bidNotional\": \"0\",\n        //         \"askNotional\": \"0\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"updateTime\": 0,\n        //         \"notional\": \"0\",\n        //         \"breakEvenPrice\": \"0.0\"\n        //     }\n        //\n        // inverse portoflio margin\n        //\n        //     {\n        //         \"symbol\": \"TRXUSD_PERP\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.00000000\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"maxQty\": \"5000000\",\n        //         \"updateTime\": 0,\n        //         \"notionalValue\": \"0\",\n        //         \"breakEvenPrice\": \"0.00000000\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const leverageString = this.safeString (position, 'leverage');\n        const leverage = (leverageString !== undefined) ? parseInt (leverageString) : undefined;\n        const initialMarginString = this.safeString (position, 'initialMargin');\n        const initialMargin = this.parseNumber (initialMarginString);\n        let initialMarginPercentageString = undefined;\n        if (leverageString !== undefined) {\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            const rational = this.isRoundNumber (1000 % leverage);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringDiv (Precise.stringAdd (initialMarginPercentageString, '1e-8'), '1', 8);\n            }\n        }\n        // as oppose to notionalValue\n        const usdm = ('notional' in position);\n        const maintenanceMarginString = this.safeString (position, 'maintMargin');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        let entryPrice = this.parseNumber (entryPriceString);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        const notional = this.parseNumber (notionalStringAbs);\n        let contractsString = this.safeString (position, 'positionAmt');\n        let contractsStringAbs = Precise.stringAbs (contractsString);\n        if (contractsString === undefined) {\n            const entryNotional = Precise.stringMul (Precise.stringMul (leverageString, initialMarginString), entryPriceString);\n            const contractSizeNew = this.safeString (market, 'contractSize');\n            contractsString = Precise.stringDiv (entryNotional, contractSizeNew);\n            contractsStringAbs = Precise.stringDiv (Precise.stringAdd (contractsString, '0.5'), '1', 0);\n        }\n        const contracts = this.parseNumber (contractsStringAbs);\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        const unrealizedPnlString = this.safeString (position, 'unrealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        let isolated = this.safeBool (position, 'isolated');\n        if (isolated === undefined) {\n            const isolatedMarginRaw = this.safeString (position, 'isolatedMargin');\n            isolated = !Precise.stringEq (isolatedMarginRaw, '0');\n        }\n        let marginMode = undefined;\n        let collateralString = undefined;\n        let walletBalance = undefined;\n        if (isolated) {\n            marginMode = 'isolated';\n            walletBalance = this.safeString (position, 'isolatedWallet');\n            collateralString = Precise.stringAdd (walletBalance, unrealizedPnlString);\n        } else {\n            marginMode = 'cross';\n            walletBalance = this.safeString (position, 'crossWalletBalance');\n            collateralString = this.safeString (position, 'crossMargin');\n        }\n        const collateral = this.parseNumber (collateralString);\n        let marginRatio = undefined;\n        let side = undefined;\n        let percentage = undefined;\n        let liquidationPriceStringRaw = undefined;\n        let liquidationPrice = undefined;\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        if (Precise.stringEquals (notionalString, '0')) {\n            entryPrice = undefined;\n        } else {\n            side = Precise.stringLt (notionalString, '0') ? 'short' : 'long';\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n            if (usdm) {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (walletBalance / (contracts * (±1 + mmp))) + (±entryPrice / (±1 + mmp))\n                //\n                // mmp = maintenanceMarginPercentage\n                // where ± is negative for long and positive for short\n                // TODO: calculate liquidation price for coinm contracts\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const leftSide = Precise.stringDiv (walletBalance, Precise.stringMul (contractsStringAbs, onePlusMaintenanceMarginPercentageString));\n                const rightSide = Precise.stringDiv (entryPriceSignString, onePlusMaintenanceMarginPercentageString);\n                liquidationPriceStringRaw = Precise.stringAdd (leftSide, rightSide);\n            } else {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (contracts * contractSize(±1 - mmp)) / (±1/entryPrice * contracts * contractSize - walletBalance)\n                //\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const size = Precise.stringMul (contractsStringAbs, contractSizeString);\n                const leftSide = Precise.stringMul (size, onePlusMaintenanceMarginPercentageString);\n                const rightSide = Precise.stringSub (Precise.stringMul (Precise.stringDiv ('1', entryPriceSignString), size), walletBalance);\n                liquidationPriceStringRaw = Precise.stringDiv (leftSide, rightSide);\n            }\n            const pricePrecision = this.precisionFromString (this.safeString (market['precision'], 'price'));\n            const pricePrecisionPlusOne = pricePrecision + 1;\n            const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString ();\n            // round half up\n            const rounder = new Precise ('5e-' + pricePrecisionPlusOneString);\n            const rounderString = rounder.toString ();\n            const liquidationPriceRoundedString = Precise.stringAdd (rounderString, liquidationPriceStringRaw);\n            let truncatedLiquidationPrice = Precise.stringDiv (liquidationPriceRoundedString, '1', pricePrecision);\n            if (truncatedLiquidationPrice[0] === '-') {\n                // user cannot be liquidated\n                // since he has more collateral than the size of the position\n                truncatedLiquidationPrice = undefined;\n            }\n            liquidationPrice = this.parseNumber (truncatedLiquidationPrice);\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return {\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'initialMargin': initialMargin,\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'entryPrice': entryPrice,\n            'notional': notional,\n            'leverage': this.parseNumber (leverageString),\n            'unrealizedPnl': unrealizedPnl,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'marginRatio': marginRatio,\n            'liquidationPrice': liquidationPrice,\n            'markPrice': undefined,\n            'collateral': collateral,\n            'marginMode': marginMode,\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseAccountPositions",
        "signature": "parseAccountPositions (account, filterClosed = false)",
        "line_start": 10043,
        "line_end": 10079,
        "comment": null,
        "mappings": [
          {
            "key": "crossMargin",
            "value": "balances[code]['crossMargin']",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "balances[code]['crossWalletBalance']",
            "comment": null
          },
          {
            "key": "crossMargin",
            "value": "Precise.stringAdd (crossWalletBalance, crossUnPnl)",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "crossWalletBalance",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccountPositions (account, filterClosed = false) {\n        const positions = this.safeList (account, 'positions');\n        const assets = this.safeList (account, 'assets', []);\n        const balances: Dict = {};\n        for (let i = 0; i < assets.length; i++) {\n            const entry = assets[i];\n            const currencyId = this.safeString (entry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const crossWalletBalance = this.safeString (entry, 'crossWalletBalance');\n            const crossUnPnl = this.safeString (entry, 'crossUnPnl');\n            balances[code] = {\n                'crossMargin': Precise.stringAdd (crossWalletBalance, crossUnPnl),\n                'crossWalletBalance': crossWalletBalance,\n            };\n        }\n        const result = [];\n        for (let i = 0; i < positions.length; i++) {\n            const position = positions[i];\n            const marketId = this.safeString (position, 'symbol');\n            const market = this.safeMarket (marketId, undefined, undefined, 'contract');\n            const code = market['linear'] ? market['quote'] : market['base'];\n            const maintenanceMargin = this.safeString (position, 'maintMargin');\n            // check for maintenance margin so empty positions are not returned\n            const isPositionOpen = (maintenanceMargin !== '0') && (maintenanceMargin !== '0.00000000');\n            if (!filterClosed || isPositionOpen) {\n                // sometimes not all the codes are correctly returned...\n                if (code in balances) {\n                    const parsed = this.parseAccountPosition (this.extend (position, {\n                        'crossMargin': balances[code]['crossMargin'],\n                        'crossWalletBalance': balances[code]['crossWalletBalance'],\n                    }), market);\n                    result.push (parsed);\n                }\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 14515,
        "line_end": 14563,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "rank",
            "comment": null
          },
          {
            "key": "rating",
            "value": "this.safeStringLower (info, 'adlRisk')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlRisk\": \"LOW\",\n         \"updateTime\": 1766827800453\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlQuantile\": {\n             \"LONG\": 0,\n             \"SHORT\": 0,\n             \"BOTH\": 1\n         }\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlRisk\": \"LOW\",\n        //         \"updateTime\": 1766827800453\n        //     }\n        //\n        // fetchPositionADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlQuantile\": {\n        //             \"LONG\": 0,\n        //             \"SHORT\": 0,\n        //             \"BOTH\": 1\n        //         }\n        //     }\n        //\n        const adlQuantile = this.safeDict (info, 'adlQuantile', {});\n        const longNum = this.safeNumber (adlQuantile, 'LONG');\n        const shortNum = this.safeNumber (adlQuantile, 'SHORT');\n        const both = this.safeNumber (adlQuantile, 'BOTH');\n        let rank = undefined;\n        if (both !== undefined) {\n            rank = both;\n        } else {\n            if (longNum !== undefined && shortNum !== undefined) {\n                if (longNum > shortNum) {\n                    rank = longNum;\n                } else {\n                    rank = shortNum;\n                }\n            }\n        }\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger2 (info, 'timestamp', 'updateTime');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': rank,\n            'rating': this.safeStringLower (info, 'adlRisk'),\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBalanceCustom",
        "signature": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances",
        "line_start": 3606,
        "line_end": 3717,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances {\n        const result = {\n            'info': response,\n        };\n        let timestamp = undefined;\n        const isolated = marginMode === 'isolated';\n        const cross = (type === 'margin') || (marginMode === 'cross');\n        if (isPortfolioMargin) {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                if (type === 'linear') {\n                    account['free'] = this.safeString (entry, 'umWalletBalance');\n                    account['used'] = this.safeString (entry, 'umUnrealizedPNL');\n                } else if (type === 'inverse') {\n                    account['free'] = this.safeString (entry, 'cmWalletBalance');\n                    account['used'] = this.safeString (entry, 'cmUnrealizedPNL');\n                } else if (cross) {\n                    const borrowed = this.safeString (entry, 'crossMarginBorrowed');\n                    const interest = this.safeString (entry, 'crossMarginInterest');\n                    account['debt'] = Precise.stringAdd (borrowed, interest);\n                    account['free'] = this.safeString (entry, 'crossMarginFree');\n                    account['used'] = this.safeString (entry, 'crossMarginLocked');\n                    account['total'] = this.safeString (entry, 'crossMarginAsset');\n                } else {\n                    const usedLinear = this.safeString (entry, 'umUnrealizedPNL');\n                    const usedInverse = this.safeString (entry, 'cmUnrealizedPNL');\n                    const totalUsed = Precise.stringAdd (usedLinear, usedInverse);\n                    const totalWalletBalance = this.safeString (entry, 'totalWalletBalance');\n                    account['total'] = Precise.stringAdd (totalUsed, totalWalletBalance);\n                }\n                result[code] = account;\n            }\n        } else if (!isolated && ((type === 'spot') || cross)) {\n            timestamp = this.safeInteger (response, 'updateTime');\n            const balances = this.safeList2 (response, 'balances', 'userAssets', []);\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'free');\n                account['used'] = this.safeString (balance, 'locked');\n                if (cross) {\n                    const debt = this.safeString (balance, 'borrowed');\n                    const interest = this.safeString (balance, 'interest');\n                    account['debt'] = Precise.stringAdd (debt, interest);\n                }\n                result[code] = account;\n            }\n        } else if (isolated) {\n            const assets = this.safeList (response, 'assets');\n            for (let i = 0; i < assets.length; i++) {\n                const asset = assets[i];\n                const marketId = this.safeString (asset, 'symbol');\n                const symbol = this.safeSymbol (marketId, undefined, undefined, 'spot');\n                const base = this.safeDict (asset, 'baseAsset', {});\n                const quote = this.safeDict (asset, 'quoteAsset', {});\n                const baseCode = this.safeCurrencyCode (this.safeString (base, 'asset'));\n                const quoteCode = this.safeCurrencyCode (this.safeString (quote, 'asset'));\n                const subResult: Dict = {};\n                subResult[baseCode] = this.parseBalanceHelper (base);\n                subResult[quoteCode] = this.parseBalanceHelper (quote);\n                result[symbol] = this.safeBalance (subResult);\n            }\n        } else if (type === 'savings') {\n            const positionAmountVos = this.safeList (response, 'positionAmountVos', []);\n            for (let i = 0; i < positionAmountVos.length; i++) {\n                const entry = positionAmountVos[i];\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                const usedAndTotal = this.safeString (entry, 'amount');\n                account['total'] = usedAndTotal;\n                account['used'] = usedAndTotal;\n                result[code] = account;\n            }\n        } else if (type === 'funding') {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                account['free'] = this.safeString (entry, 'free');\n                const frozen = this.safeString (entry, 'freeze');\n                const withdrawing = this.safeString (entry, 'withdrawing');\n                const locked = this.safeString (entry, 'locked');\n                account['used'] = Precise.stringAdd (frozen, Precise.stringAdd (locked, withdrawing));\n                result[code] = account;\n            }\n        } else {\n            let balances = response;\n            if (!Array.isArray (response)) {\n                balances = this.safeList (response, 'assets', []);\n            }\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'availableBalance');\n                account['used'] = this.safeString (balance, 'initialMargin');\n                account['total'] = this.safeString2 (balance, 'marginBalance', 'balance');\n                result[code] = account;\n            }\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return isolated ? result : this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3596,
        "line_end": 3604,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString (entry, 'locked');\n        account['free'] = this.safeString (entry, 'free');\n        const interest = this.safeString (entry, 'interest');\n        const debt = this.safeString (entry, 'borrowed');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 12772,
        "line_end": 12787,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'asset'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'principal')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const symbol = this.safeString (info, 'isolatedSymbol');\n        const timestamp = this.safeInteger (info, 'interestAccuredTime');\n        const marginMode = (symbol === undefined) ? 'cross' : 'isolated';\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'asset')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'principal'),\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 12539,
        "line_end": 12558,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (info, 'dailyInterestRate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset\": \"USDT\",\n        \"timestamp\": 1638230400000,\n        \"dailyInterestRate\": \"0.0006\",\n        \"vipLevel\": 0\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"asset\": \"USDT\",\n        //        \"timestamp\": 1638230400000,\n        //        \"dailyInterestRate\": \"0.0006\",\n        //        \"vipLevel\": 0\n        //    }\n        //\n        const timestamp = this.safeInteger (info, 'timestamp');\n        const currencyId = this.safeString (info, 'asset');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber (info, 'dailyInterestRate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 14196,
        "line_end": 14284,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'targetAmount', 'toAmount')",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quoteId\":\"12415572564\",\n         \"ratio\":\"38163.7\",\n         \"inverseRatio\":\"0.0000262\",\n         \"validTimestamp\":1623319461670,\n         \"toAmount\":\"3816.37\",\n         \"fromAmount\":\"0.1\"\n     }",
          "{\n         \"orderId\":\"933256278426274426\",\n         \"createTime\":1623381330472,\n         \"orderStatus\":\"PROCESS\"\n     }",
          "{\n         \"tranId\": 118263407119,\n         \"status\": \"S\"\n     }",
          "{\n         \"tranId\": 118263615991,\n         \"type\": 244,\n         \"time\": 1664442078000,\n         \"deductedAsset\": \"BUSD\",\n         \"deductedAmount\": \"1\",\n         \"targetAsset\": \"USDC\",\n         \"targetAmount\": \"1\",\n         \"status\": \"S\",\n         \"accountType\": \"MAIN\"\n     }",
          "{\n         \"orderId\":933256278426274426,\n         \"orderStatus\":\"SUCCESS\",\n         \"fromAsset\":\"BTC\",\n         \"fromAmount\":\"0.00054414\",\n         \"toAsset\":\"USDT\",\n         \"toAmount\":\"20\",\n         \"ratio\":\"36755\",\n         \"inverseRatio\":\"0.00002721\",\n         \"createTime\":1623381330472\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"quoteId\":\"12415572564\",\n        //         \"ratio\":\"38163.7\",\n        //         \"inverseRatio\":\"0.0000262\",\n        //         \"validTimestamp\":1623319461670,\n        //         \"toAmount\":\"3816.37\",\n        //         \"fromAmount\":\"0.1\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"orderId\":\"933256278426274426\",\n        //         \"createTime\":1623381330472,\n        //         \"orderStatus\":\"PROCESS\"\n        //     }\n        //\n        // createConvertTrade BUSD\n        //\n        //     {\n        //         \"tranId\": 118263407119,\n        //         \"status\": \"S\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory BUSD\n        //\n        //     {\n        //         \"tranId\": 118263615991,\n        //         \"type\": 244,\n        //         \"time\": 1664442078000,\n        //         \"deductedAsset\": \"BUSD\",\n        //         \"deductedAmount\": \"1\",\n        //         \"targetAsset\": \"USDC\",\n        //         \"targetAmount\": \"1\",\n        //         \"status\": \"S\",\n        //         \"accountType\": \"MAIN\"\n        //     }\n        //\n        // fetchConvertTrade\n        //\n        //     {\n        //         \"orderId\":933256278426274426,\n        //         \"orderStatus\":\"SUCCESS\",\n        //         \"fromAsset\":\"BTC\",\n        //         \"fromAmount\":\"0.00054414\",\n        //         \"toAsset\":\"USDT\",\n        //         \"toAmount\":\"20\",\n        //         \"ratio\":\"36755\",\n        //         \"inverseRatio\":\"0.00002721\",\n        //         \"createTime\":1623381330472\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"quoteId\": \"f3b91c525b2644c7bc1e1cd31b6e1aa6\",\n        //         \"orderId\": 940708407462087195,\n        //         \"orderStatus\": \"SUCCESS\",\n        //         \"fromAsset\": \"USDT\",\n        //         \"fromAmount\": \"20\",\n        //         \"toAsset\": \"BNB\",\n        //         \"toAmount\": \"0.06154036\",\n        //         \"ratio\": \"0.00307702\",\n        //         \"inverseRatio\": \"324.99\",\n        //         \"createTime\": 1624248872184\n        //     }\n        //\n        const timestamp = this.safeIntegerN (conversion, [ 'time', 'validTimestamp', 'createTime' ]);\n        const fromCur = this.safeString2 (conversion, 'deductedAsset', 'fromAsset');\n        const fromCode = this.safeCurrencyCode (fromCur, fromCurrency);\n        const to = this.safeString2 (conversion, 'targetAsset', 'toAsset');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'targetAmount', 'toAmount'),\n            'price': undefined,\n            'fee': undefined,\n        } as Conversion;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress",
        "line_start": 9206,
        "line_end": 9234,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"XRP\",\n         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n         \"tag\": \"108618262\",\n         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n     }"
        ],
        "source": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"XRP\",\n        //         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n        //         \"tag\": \"108618262\",\n        //         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n        //     }\n        //\n        const url = this.safeString (response, 'url');\n        const address = this.safeString (response, 'address');\n        const currencyId = this.safeString (response, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        // deposit-address endpoint provides only network url (not network ID/CODE)\n        // so we should map the url to network (their data is inside currencies)\n        const networkCode = this.getNetworkCodeByNetworkUrl (code, url);\n        let tag = this.safeString (response, 'tag', '');\n        if (tag.length === 0) {\n            tag = undefined;\n        }\n        this.checkAddress (address);\n        return {\n            'info': response,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9409,
        "line_end": 9476,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"coin\": \"BAT\",\n        \"depositAllEnable\": true,\n        \"withdrawAllEnable\": true,\n        \"name\": \"Basic Attention Token\",\n        \"free\": \"0\",\n        \"locked\": \"0\",\n        \"freeze\": \"0\",\n        \"withdrawing\": \"0\",\n        \"ipoing\": \"0\",\n        \"ipoable\": \"0\",\n        \"storage\": \"0\",\n        \"isLegalMoney\": false,\n        \"trading\": true,\n        \"networkList\": [\n            {\n                \"network\": \"BNB\",\n                \"coin\": \"BAT\",\n                \"withdrawIntegerMultiple\": \"0.00000001\",\n                \"isDefault\": false,\n                \"depositEnable\": true,\n                \"withdrawEnable\": true,\n                \"depositDesc\": '',\n                \"withdrawDesc\": '',\n                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n                \"name\": \"BEP2\",\n                \"resetAddressStatus\": false,\n                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n                \"withdrawFee\": \"0.27\",\n                \"withdrawMin\": \"0.54\",\n                \"withdrawMax\": \"10000000000\",\n                \"minConfirm\": \"1\",\n                \"unLockConfirm\": \"0\"\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"coin\": \"BAT\",\n        //        \"depositAllEnable\": true,\n        //        \"withdrawAllEnable\": true,\n        //        \"name\": \"Basic Attention Token\",\n        //        \"free\": \"0\",\n        //        \"locked\": \"0\",\n        //        \"freeze\": \"0\",\n        //        \"withdrawing\": \"0\",\n        //        \"ipoing\": \"0\",\n        //        \"ipoable\": \"0\",\n        //        \"storage\": \"0\",\n        //        \"isLegalMoney\": false,\n        //        \"trading\": true,\n        //        \"networkList\": [\n        //            {\n        //                \"network\": \"BNB\",\n        //                \"coin\": \"BAT\",\n        //                \"withdrawIntegerMultiple\": \"0.00000001\",\n        //                \"isDefault\": false,\n        //                \"depositEnable\": true,\n        //                \"withdrawEnable\": true,\n        //                \"depositDesc\": '',\n        //                \"withdrawDesc\": '',\n        //                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n        //                \"name\": \"BEP2\",\n        //                \"resetAddressStatus\": false,\n        //                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n        //                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n        //                \"withdrawFee\": \"0.27\",\n        //                \"withdrawMin\": \"0.54\",\n        //                \"withdrawMax\": \"10000000000\",\n        //                \"minConfirm\": \"1\",\n        //                \"unLockConfirm\": \"0\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const networkList = this.safeList (fee, 'networkList', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.networkIdToCode (networkId);\n            const withdrawFee = this.safeNumber (networkEntry, 'withdrawFee');\n            const isDefault = this.safeBool (networkEntry, 'isDefault');\n            if (isDefault === true) {\n                result['withdraw'] = {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                };\n            }\n            result['networks'][networkCode] = {\n                'withdraw': {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDustTrade",
        "signature": "parseDustTrade (trade, market: Market = undefined)",
        "line_start": 8290,
        "line_end": 8360,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "currency",
            "value": "earnedCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostString)",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"fromAsset\": \"USDT\",\n       \"amount\": \"0.009669\",\n       \"transferedAmount\": \"0.00002992\",\n       \"serviceChargeAmount\": \"0.00000059\",\n       \"operateTime\": \"1628076010000\",\n       \"transId\": \"71416578712\",\n       \"isDustTrade\": true\n     }"
        ],
        "source": "parseDustTrade (trade, market: Market = undefined) {\n        //\n        //     {\n        //       \"fromAsset\": \"USDT\",\n        //       \"amount\": \"0.009669\",\n        //       \"transferedAmount\": \"0.00002992\",\n        //       \"serviceChargeAmount\": \"0.00000059\",\n        //       \"operateTime\": \"1628076010000\",\n        //       \"transId\": \"71416578712\",\n        //       \"isDustTrade\": true\n        //     }\n        //\n        const orderId = this.safeString (trade, 'transId');\n        const timestamp = this.safeInteger (trade, 'operateTime');\n        const currencyId = this.safeString (trade, 'fromAsset');\n        const tradedCurrency = this.safeCurrencyCode (currencyId);\n        const bnb = this.currency ('BNB');\n        const earnedCurrency = bnb['code'];\n        const applicantSymbol = earnedCurrency + '/' + tradedCurrency;\n        let tradedCurrencyIsQuote = false;\n        if (applicantSymbol in this.markets) {\n            tradedCurrencyIsQuote = true;\n        }\n        const feeCostString = this.safeString (trade, 'serviceChargeAmount');\n        const fee = {\n            'currency': earnedCurrency,\n            'cost': this.parseNumber (feeCostString),\n        };\n        let symbol = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        let side = undefined;\n        if (tradedCurrencyIsQuote) {\n            symbol = applicantSymbol;\n            amountString = this.safeString (trade, 'transferedAmount');\n            costString = this.safeString (trade, 'amount');\n            side = 'buy';\n        } else {\n            symbol = tradedCurrency + '/' + earnedCurrency;\n            amountString = this.safeString (trade, 'amount');\n            costString = this.safeString (trade, 'transferedAmount');\n            side = 'sell';\n        }\n        let priceString = undefined;\n        if (costString !== undefined) {\n            if (amountString) {\n                priceString = Precise.stringDiv (costString, amountString);\n            }\n        }\n        const id = undefined;\n        const amount = this.parseNumber (amountString);\n        const price = this.parseNumber (priceString);\n        const cost = this.parseNumber (costString);\n        const type = undefined;\n        const takerOrMaker = undefined;\n        return {\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'amount': amount,\n            'price': price,\n            'cost': cost,\n            'fee': fee,\n            'info': trade,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 9981,
        "line_end": 10041,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "estimatedSettlePrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"45802.81129892\",\n         \"indexPrice\": \"45745.47701915\",\n         \"estimatedSettlePrice\": \"45133.91753671\",\n         \"lastFundingRate\": \"0.00063521\",\n         \"interestRate\": \"0.00010000\",\n         \"nextFundingTime\": \"1621267200000\",\n         \"time\": \"1621252344001\"\n     }",
          "{\n         \"symbol\": \"BLZUSDT\",\n         \"adjustedFundingRateCap\": \"0.03000000\",\n         \"adjustedFundingRateFloor\": \"-0.03000000\",\n         \"fundingIntervalHours\": 4,\n         \"disclaimer\": false\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        // ensure it matches with https://www.binance.com/en/futures/funding-history/0\n        //\n        // fetchFundingRate, fetchFundingRates\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"45802.81129892\",\n        //         \"indexPrice\": \"45745.47701915\",\n        //         \"estimatedSettlePrice\": \"45133.91753671\",\n        //         \"lastFundingRate\": \"0.00063521\",\n        //         \"interestRate\": \"0.00010000\",\n        //         \"nextFundingTime\": \"1621267200000\",\n        //         \"time\": \"1621252344001\"\n        //     }\n        //\n        // fetchFundingInterval, fetchFundingIntervals\n        //\n        //     {\n        //         \"symbol\": \"BLZUSDT\",\n        //         \"adjustedFundingRateCap\": \"0.03000000\",\n        //         \"adjustedFundingRateFloor\": \"-0.03000000\",\n        //         \"fundingIntervalHours\": 4,\n        //         \"disclaimer\": false\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'time');\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        const interestRate = this.safeNumber (contract, 'interestRate');\n        const estimatedSettlePrice = this.safeNumber (contract, 'estimatedSettlePrice');\n        const fundingRate = this.safeNumber (contract, 'lastFundingRate');\n        const fundingTime = this.safeInteger (contract, 'nextFundingTime');\n        const interval = this.safeString (contract, 'fundingIntervalHours');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'estimatedSettlePrice': estimatedSettlePrice,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 9933,
        "line_end": 9949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"fundingRate\": \"0.00063521\",\n         \"fundingTime\": \"1621267200000\",\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"fundingRate\": \"0.00063521\",\n        //         \"fundingTime\": \"1621267200000\",\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap'),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 13475,
        "line_end": 13514,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidIV')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askIV')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markIV')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-231229-40000-C\",\n         \"markPrice\": \"2012\",\n         \"bidIV\": \"0.60236275\",\n         \"askIV\": \"0.62267244\",\n         \"markIV\": \"0.6125176\",\n         \"delta\": \"0.39111646\",\n         \"theta\": \"-32.13948531\",\n         \"gamma\": \"0.00004656\",\n         \"vega\": \"51.70062218\",\n         \"highPriceLimit\": \"6474\",\n         \"lowPriceLimit\": \"5\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"symbol\": \"BTC-231229-40000-C\",\n        //         \"markPrice\": \"2012\",\n        //         \"bidIV\": \"0.60236275\",\n        //         \"askIV\": \"0.62267244\",\n        //         \"markIV\": \"0.6125176\",\n        //         \"delta\": \"0.39111646\",\n        //         \"theta\": \"-32.13948531\",\n        //         \"gamma\": \"0.00004656\",\n        //         \"vega\": \"51.70062218\",\n        //         \"highPriceLimit\": \"6474\",\n        //         \"lowPriceLimit\": \"5\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidIV'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askIV'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markIV'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': this.safeNumber (greeks, 'markPrice'),\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 8890,
        "line_end": 8915,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'tranId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'income')",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"ETHUSDT\",\n       \"incomeType\": \"FUNDING_FEE\",\n       \"income\": \"0.00134317\",\n       \"asset\": \"USDT\",\n       \"time\": \"1621584000000\",\n       \"info\": \"FUNDING_FEE\",\n       \"tranId\": \"4480321991774044580\",\n       \"tradeId\": \"\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"symbol\": \"ETHUSDT\",\n        //       \"incomeType\": \"FUNDING_FEE\",\n        //       \"income\": \"0.00134317\",\n        //       \"asset\": \"USDT\",\n        //       \"time\": \"1621584000000\",\n        //       \"info\": \"FUNDING_FEE\",\n        //       \"tranId\": \"4480321991774044580\",\n        //       \"tradeId\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const currencyId = this.safeString (income, 'asset');\n        const timestamp = this.safeInteger (income, 'time');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'tranId'),\n            'amount': this.safeNumber (income, 'income'),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 12560,
        "line_end": 12596,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeString (baseInfo, 'coin')",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeString (quoteInfo, 'coin')",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"vipLevel\": 0,\n        \"symbol\": \"BTCUSDT\",\n        \"leverage\": \"10\",\n        \"data\": [\n            {\n                \"coin\": \"BTC\",\n                \"dailyInterest\": \"0.00026125\",\n                \"borrowLimit\": \"270\"\n            },\n            {\n                \"coin\": \"USDT\",\n                \"dailyInterest\": \"0.000475\",\n                \"borrowLimit\": \"2100000\"\n            }\n        ]\n    }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //    {\n        //        \"vipLevel\": 0,\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"leverage\": \"10\",\n        //        \"data\": [\n        //            {\n        //                \"coin\": \"BTC\",\n        //                \"dailyInterest\": \"0.00026125\",\n        //                \"borrowLimit\": \"270\"\n        //            },\n        //            {\n        //                \"coin\": \"USDT\",\n        //                \"dailyInterest\": \"0.000475\",\n        //                \"borrowLimit\": \"2100000\"\n        //            }\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'spot');\n        const data = this.safeList (info, 'data');\n        const baseInfo = this.safeDict (data, 0);\n        const quoteInfo = this.safeDict (data, 1);\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'base': this.safeString (baseInfo, 'coin'),\n            'baseRate': this.safeNumber (baseInfo, 'dailyInterest'),\n            'quote': this.safeString (quoteInfo, 'coin'),\n            'quoteRate': this.safeNumber (quoteInfo, 'dailyInterest'),\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 4424,
        "line_end": 4463,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumberOmitZero (entry, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"price\": \"4.00000200\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"price\": \"6000.01\",\n         \"time\": 1589437530011   // Transaction time\n     }",
          "{\n         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n         \"ps\": \"BTCUSD\", // pair\n         \"price\": \"9647.8\",\n         \"time\": 1591257246176\n     }"
        ],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"price\": \"4.00000200\"\n        //     }\n        //\n        // usdm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"price\": \"6000.01\",\n        //         \"time\": 1589437530011   // Transaction time\n        //     }\n        //\n        //\n        // coinm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n        //         \"ps\": \"BTCUSD\", // pair\n        //         \"price\": \"9647.8\",\n        //         \"time\": 1591257246176\n        //     }\n        //\n        const timestamp = this.safeInteger (entry, 'time');\n        const type = (timestamp === undefined) ? 'spot' : 'swap';\n        const marketId = this.safeString (entry, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, type);\n        return {\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'price': this.safeNumberOmitZero (entry, 'price'),\n            'side': undefined,\n            'info': entry,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 11884,
        "line_end": 11939,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (item, 'id', 'tranId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tradeId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1125899906845701870\",\n         \"asset\": \"USDT\",\n         \"amount\": \"-0.16518203\",\n         \"type\": \"FEE\",\n         \"createDate\": 167662104241\n     }",
          "{\n         \"symbol\": \"\",\n         \"incomeType\": \"TRANSFER\",\n         \"income\": \"10.00000000\",\n         \"asset\": \"USDT\",\n         \"time\": 1677645250000,\n         \"info\": \"TRANSFER\",\n         \"tranId\": 131001573082,\n         \"tradeId\": \"\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // options (eapi)\n        //\n        //     {\n        //         \"id\": \"1125899906845701870\",\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"-0.16518203\",\n        //         \"type\": \"FEE\",\n        //         \"createDate\": 167662104241\n        //     }\n        //\n        // futures (fapi, dapi, papi)\n        //\n        //     {\n        //         \"symbol\": \"\",\n        //         \"incomeType\": \"TRANSFER\",\n        //         \"income\": \"10.00000000\",\n        //         \"asset\": \"USDT\",\n        //         \"time\": 1677645250000,\n        //         \"info\": \"TRANSFER\",\n        //         \"tranId\": 131001573082,\n        //         \"tradeId\": \"\"\n        //     }\n        //\n        let amount = this.safeString2 (item, 'amount', 'income');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger2 (item, 'createDate', 'time');\n        const type = this.safeString2 (item, 'type', 'incomeType');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString2 (item, 'id', 'tranId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tradeId'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 11941,
        "line_end": 11964,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'FEE': 'fee',\n            'FUNDING_FEE': 'fee',\n            'OPTIONS_PREMIUM_FEE': 'fee',\n            'POSITION_LIMIT_INCREASE_FEE': 'fee',\n            'CONTRACT': 'trade',\n            'REALIZED_PNL': 'trade',\n            'TRANSFER': 'transfer',\n            'CROSS_COLLATERAL_TRANSFER': 'transfer',\n            'INTERNAL_TRANSFER': 'transfer',\n            'COIN_SWAP_DEPOSIT': 'deposit',\n            'COIN_SWAP_WITHDRAW': 'withdrawal',\n            'OPTIONS_SETTLE_PROFIT': 'settlement',\n            'DELIVERED_SETTELMENT': 'settlement',\n            'WELCOME_BONUS': 'cashback',\n            'CONTEST_REWARD': 'cashback',\n            'COMMISSION_REBATE': 'rebate',\n            'API_REBATE': 'rebate',\n            'REFERRAL_KICKBACK': 'referral',\n            'COMMISSION': 'commission',\n        };\n        return this.safeString (ledgerType, type, type);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 11527,
        "line_end": 11557,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const marginModeRaw = this.safeBool (leverage, 'isolated');\n        let marginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            marginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (leverage, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            marginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        const side = this.safeStringLower (leverage, 'positionSide');\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        if ((side === undefined) || (side === 'both')) {\n            longLeverage = leverageValue;\n            shortLeverage = leverageValue;\n        } else if (side === 'long') {\n            longLeverage = leverageValue;\n        } else if (side === 'short') {\n            shortLeverage = leverageValue;\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 13312,
        "line_end": 13395,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (liquidation, 'executedQty')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'avgPrice')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'side')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'cumBase')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.safeNumber (liquidation, 'cumQuote')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"avgPrice\": \"0.00388359\",\n         \"executedQty\": \"31.39000000\",\n         \"orderId\": 180015097,\n         \"price\": \"0.00388110\",\n         \"qty\": \"31.39000000\",\n         \"side\": \"SELL\",\n         \"symbol\": \"BNBBTC\",\n         \"timeInForce\": \"GTC\",\n         \"isIsolated\": true,\n         \"updatedTime\": 1558941374745\n     }",
          "{\n         \"orderId\": 6071832819,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596107620040000020\",\n         \"price\": \"10871.09\",\n         \"avgPrice\": \"10913.21000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0.002\",\n         \"cumQuote\": \"10.91321\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"origType\": \"LIMIT\",\n         \"time\": 1596107620044,\n         \"updateTime\": 1596107620087\n     }",
          "{\n         \"orderId\": 165123080,\n         \"symbol\": \"BTCUSD_200925\",\n         \"pair\": \"BTCUSD\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596542005017000006\",\n         \"price\": \"11326.9\",\n         \"avgPrice\": \"11326.9\",\n         \"origQty\": \"1\",\n         \"executedQty\": \"1\",\n         \"cumBase\": \"0.00882854\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"time\": 1596542005019,\n         \"updateTime\": 1596542005050\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // margin\n        //\n        //     {\n        //         \"avgPrice\": \"0.00388359\",\n        //         \"executedQty\": \"31.39000000\",\n        //         \"orderId\": 180015097,\n        //         \"price\": \"0.00388110\",\n        //         \"qty\": \"31.39000000\",\n        //         \"side\": \"SELL\",\n        //         \"symbol\": \"BNBBTC\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"isIsolated\": true,\n        //         \"updatedTime\": 1558941374745\n        //     }\n        //\n        // linear\n        //\n        //     {\n        //         \"orderId\": 6071832819,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596107620040000020\",\n        //         \"price\": \"10871.09\",\n        //         \"avgPrice\": \"10913.21000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0.002\",\n        //         \"cumQuote\": \"10.91321\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596107620044,\n        //         \"updateTime\": 1596107620087\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"orderId\": 165123080,\n        //         \"symbol\": \"BTCUSD_200925\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596542005017000006\",\n        //         \"price\": \"11326.9\",\n        //         \"avgPrice\": \"11326.9\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"1\",\n        //         \"cumBase\": \"0.00882854\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596542005019,\n        //         \"updateTime\": 1596542005050\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger2 (liquidation, 'updatedTime', 'updateTime');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.safeNumber (liquidation, 'executedQty'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'avgPrice'),\n            'side': this.safeStringLower (liquidation, 'side'),\n            'baseValue': this.safeNumber (liquidation, 'cumBase'),\n            'quoteValue': this.safeNumber (liquidation, 'cumQuote'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 14396,
        "line_end": 14428,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"longAccount\": \"0.4558\",\n         \"longShortRatio\": \"0.8376\",\n         \"shortAccount\": \"0.5442\",\n         \"timestamp\": 1726790400000\n     }",
          "{\n         \"longAccount\": \"0.7262\",\n         \"longShortRatio\": \"2.6523\",\n         \"shortAccount\": \"0.2738\",\n         \"pair\": \"BTCUSD\",\n         \"timestamp\": 1726790400000\n     }"
        ],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        //\n        // linear\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"longAccount\": \"0.4558\",\n        //         \"longShortRatio\": \"0.8376\",\n        //         \"shortAccount\": \"0.5442\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"longAccount\": \"0.7262\",\n        //         \"longShortRatio\": \"2.6523\",\n        //         \"shortAccount\": \"0.2738\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeIntegerOmitZero (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 12953,
        "line_end": 12981,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'tranId')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\": 108988250265,\n         \"clientTag\":\"\"\n     }",
          "{\n         \"asset\": \"USDC\",\n         \"amount\": 10,\n         \"specifyRepayAssets\": null,\n         \"updateTime\": 1727170761267,\n         \"success\": true\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"tranId\": 108988250265,\n        //         \"clientTag\":\"\"\n        //     }\n        //\n        // repayCrossMargin alternative endpoint\n        //\n        //     {\n        //         \"asset\": \"USDC\",\n        //         \"amount\": 10,\n        //         \"specifyRepayAssets\": null,\n        //         \"updateTime\": 1727170761267,\n        //         \"success\": true\n        //     }\n        //\n        const currencyId = this.safeString (info, 'asset');\n        const timestamp = this.safeInteger (info, 'updateTime');\n        return {\n            'id': this.safeInteger (info, 'tranId'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amount'),\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 13705,
        "line_end": 13722,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "reMarginMode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const marginModeRaw = this.safeBool (marginMode, 'isolated');\n        let reMarginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            reMarginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (marginMode, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            reMarginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': reMarginMode,\n        } as MarginMode;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 12323,
        "line_end": 12366,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "(rawType === 1) ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (data, 'asset')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "(success || noErrorCode) ? 'ok' : 'failed'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 200,\n         \"msg\": \"Successfully modify position margin.\",\n         \"amount\": 0.001,\n         \"type\": 1\n     }",
          "{\n        symbol: \"XRPUSDT\",\n        type: \"1\",\n        deltaType: \"TRADE\",\n        amount: \"2.57148240\",\n        asset: \"USDT\",\n        time: \"1711046271555\",\n        positionSide: \"BOTH\",\n        clientTranId: \"\"\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // add/reduce margin\n        //\n        //     {\n        //         \"code\": 200,\n        //         \"msg\": \"Successfully modify position margin.\",\n        //         \"amount\": 0.001,\n        //         \"type\": 1\n        //     }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        symbol: \"XRPUSDT\",\n        //        type: \"1\",\n        //        deltaType: \"TRADE\",\n        //        amount: \"2.57148240\",\n        //        asset: \"USDT\",\n        //        time: \"1711046271555\",\n        //        positionSide: \"BOTH\",\n        //        clientTranId: \"\"\n        //    }\n        //\n        const rawType = this.safeInteger (data, 'type');\n        const errorCode = this.safeString (data, 'code');\n        const marketId = this.safeString (data, 'symbol');\n        const timestamp = this.safeInteger (data, 'time');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const noErrorCode = errorCode === undefined;\n        const success = errorCode === '200';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': (rawType === 1) ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'code': this.safeString (data, 'asset'),\n            'total': undefined,\n            'status': (success || noErrorCode) ? 'ok' : 'failed',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 3413,
        "line_end": 3594,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "lowercaseId",
            "value": "lowercaseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "unifiedType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && isMarginTradingAllowed",
            "comment": null
          },
          {
            "key": "marginModes",
            "value": "marginModes",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "parsedStrike",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "this.safeStringLower (market, 'side')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'onboardDate')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale')))",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision')))",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (filter, 'minQty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (filter, 'maxQty')",
            "comment": null
          }
        ],
        "examples": [
          "therefore limits['price']['max'] doesn't have any meaningful value except undefined"
        ],
        "source": "parseMarket (market: Dict): Market {\n        let swap = false;\n        let future = false;\n        let option = false;\n        const underlying = this.safeString (market, 'underlying');\n        const id = this.safeString (market, 'symbol');\n        const optionParts = id.split ('-');\n        const optionBase = this.safeString (optionParts, 0);\n        const lowercaseId = this.safeStringLower (market, 'symbol');\n        const baseId = this.safeString (market, 'baseAsset', optionBase);\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const contractType = this.safeString (market, 'contractType');\n        let contract = ('contractType' in market);\n        let expiry = this.safeInteger2 (market, 'deliveryDate', 'expiryDate');\n        let settleId = this.safeString (market, 'marginAsset');\n        if ((contractType === 'PERPETUAL') || (expiry === 4133404800000)) { // some swap markets do not have contract type, eg: BTCST\n            expiry = undefined;\n            swap = true;\n        } else if (underlying !== undefined) {\n            contract = true;\n            option = true;\n            settleId = (settleId === undefined) ? 'USDT' : settleId;\n        } else if (expiry !== undefined) {\n            future = true;\n        }\n        const settle = this.safeCurrencyCode (settleId);\n        const spot = !contract;\n        const filters = this.safeList (market, 'filters', []);\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const status = this.safeString2 (market, 'status', 'contractStatus');\n        let contractSize = undefined;\n        let fees = this.fees;\n        let linear = undefined;\n        let inverse = undefined;\n        let symbol = base + '/' + quote;\n        let strike = undefined;\n        if (contract) {\n            if (swap) {\n                symbol = symbol + ':' + settle;\n            } else if (future) {\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry);\n            } else if (option) {\n                strike = this.numberToString (this.parseToNumeric (this.safeString (market, 'strikePrice')));\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry) + '-' + strike + '-' + this.safeString (optionParts, 3);\n            }\n            contractSize = this.safeNumber2 (market, 'contractSize', 'unit', this.parseNumber ('1'));\n            linear = settle === quote;\n            inverse = settle === base;\n            const feesType = linear ? 'linear' : 'inverse';\n            fees = this.safeDict (this.fees, feesType, {}) as any;\n        }\n        let active = (status === 'TRADING');\n        if (spot) {\n            const permissions = this.safeList (market, 'permissions', []);\n            for (let j = 0; j < permissions.length; j++) {\n                if (permissions[j] === 'TRD_GRP_003') {\n                    active = false;\n                    break;\n                }\n            }\n        }\n        const isMarginTradingAllowed = this.safeBool (market, 'isMarginTradingAllowed', false);\n        let marginModes = undefined;\n        if (spot) {\n            const hasCrossMargin = this.inArray (id, this.options['crossMarginPairsData']);\n            const hasIsolatedMargin = this.inArray (id, this.options['isolatedMarginPairsData']);\n            marginModes = {\n                'cross': hasCrossMargin,\n                'isolated': hasIsolatedMargin,\n            };\n        } else if (linear || inverse) {\n            marginModes = {\n                'cross': true,\n                'isolated': true,\n            };\n        }\n        let unifiedType = undefined;\n        if (spot) {\n            unifiedType = 'spot';\n        } else if (swap) {\n            unifiedType = 'swap';\n        } else if (future) {\n            unifiedType = 'future';\n        } else if (option) {\n            unifiedType = 'option';\n            active = undefined;\n        }\n        let parsedStrike = undefined;\n        if (strike !== undefined) {\n            parsedStrike = this.parseToNumeric (strike);\n        }\n        const entry = {\n            'id': id,\n            'lowercaseId': lowercaseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': unifiedType,\n            'spot': spot,\n            'margin': spot && isMarginTradingAllowed,\n            'marginModes': marginModes,\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': fees['trading']['taker'],\n            'maker': fees['trading']['maker'],\n            'contractSize': contractSize,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': parsedStrike,\n            'optionType': this.safeStringLower (market, 'side'),\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n            'created': this.safeInteger (market, 'onboardDate'), // present in inverse & linear apis\n        };\n        if ('PRICE_FILTER' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n            // PRICE_FILTER reports zero values for maxPrice\n            // since they updated filter types in November 2018\n            // https://github.com/ccxt/ccxt/issues/4286\n            // therefore limits['price']['max'] doesn't have any meaningful value except undefined\n            entry['limits']['price'] = {\n                'min': this.safeNumber (filter, 'minPrice'),\n                'max': this.safeNumber (filter, 'maxPrice'),\n            };\n            entry['precision']['price'] = this.safeNumber (filter, 'tickSize');\n        }\n        if ('LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n            entry['precision']['amount'] = this.safeNumber (filter, 'stepSize');\n            entry['limits']['amount'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if ('MARKET_LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'MARKET_LOT_SIZE', {});\n            entry['limits']['market'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if (('MIN_NOTIONAL' in filtersByType) || ('NOTIONAL' in filtersByType)) { // notional added in 12/04/23 to spot testnet\n            const filter = this.safeDict2 (filtersByType, 'MIN_NOTIONAL', 'NOTIONAL', {});\n            entry['limits']['cost']['min'] = this.safeNumber2 (filter, 'minNotional', 'notional');\n            entry['limits']['cost']['max'] = this.safeNumber (filter, 'maxNotional');\n        }\n        return entry;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 10697,
        "line_end": 10738,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "{\n        \"symbol\": \"SUSHIUSDT\",\n        \"brackets\": [\n            {\n                \"bracket\": 1,\n                \"initialLeverage\": 50,\n                \"notionalCap\": 50000,\n                \"notionalFloor\": 0,\n                \"maintMarginRatio\": 0.01,\n                \"cum\": 0.0\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\": \"SUSHIUSDT\",\n        //        \"brackets\": [\n        //            {\n        //                \"bracket\": 1,\n        //                \"initialLeverage\": 50,\n        //                \"notionalCap\": 50000,\n        //                \"notionalFloor\": 0,\n        //                \"maintMarginRatio\": 0.01,\n        //                \"cum\": 0.0\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const brackets = this.safeList (info, 'brackets', []);\n        const tiers = [];\n        for (let j = 0; j < brackets.length; j++) {\n            const bracket = brackets[j];\n            tiers.push ({\n                'tier': this.safeNumber (bracket, 'bracket'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber2 (bracket, 'notionalFloor', 'qtyFloor'),\n                'maxNotional': this.safeNumber2 (bracket, 'notionalCap', 'qtyCap'),\n                'maintenanceMarginRate': this.safeNumber (bracket, 'maintMarginRatio'),\n                'maxLeverage': this.safeNumber (bracket, 'initialLeverage'),\n                'info': bracket,\n            });\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 4595,
        "line_end": 4657,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591478520000, // open time\n         \"0.02501300\",  // open\n         \"0.02501800\",  // high\n         \"0.02500000\",  // low\n         \"0.02500000\",  // close\n         \"22.19000000\", // volume\n         1591478579999, // close time\n         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n         40,            // number of trades\n         \"10.92900000\", // taker buy base asset volume\n         \"0.27336462\",  // taker buy quote asset volume\n         \"0\"            // ignore\n     ]",
          "[\n         [\n         1591256460000,          // Open time\n         \"9653.29201333\",        // Open\n         \"9654.56401333\",        // High\n         \"9653.07367333\",        // Low\n         \"9653.07367333\",        // Close (or latest price)\n         \"0\",                    // Ignore\n         1591256519999,          // Close time\n         \"0\",                    // Ignore\n         60,                     // Number of bisic data\n         \"0\",                    // Ignore\n         \"0\",                    // Ignore\n         \"0\"                     // Ignore\n         ]\n     ]",
          "{\n         \"open\": \"32.2\",\n         \"high\": \"32.2\",\n         \"low\": \"32.2\",\n         \"close\": \"32.2\",\n         \"volume\": \"0\",\n         \"interval\": \"5m\",\n         \"tradeCount\": 0,\n         \"takerVolume\": \"0\",\n         \"takerAmount\": \"0\",\n         \"amount\": \"0\",\n         \"openTime\": 1677096900000,\n         \"closeTime\": 1677097200000\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // when api method = publicGetKlines || fapiPublicGetKlines || dapiPublicGetKlines\n        //     [\n        //         1591478520000, // open time\n        //         \"0.02501300\",  // open\n        //         \"0.02501800\",  // high\n        //         \"0.02500000\",  // low\n        //         \"0.02500000\",  // close\n        //         \"22.19000000\", // volume\n        //         1591478579999, // close time\n        //         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n        //         40,            // number of trades\n        //         \"10.92900000\", // taker buy base asset volume\n        //         \"0.27336462\",  // taker buy quote asset volume\n        //         \"0\"            // ignore\n        //     ]\n        //\n        //  when api method = fapiPublicGetMarkPriceKlines || fapiPublicGetIndexPriceKlines\n        //     [\n        //         [\n        //         1591256460000,          // Open time\n        //         \"9653.29201333\",        // Open\n        //         \"9654.56401333\",        // High\n        //         \"9653.07367333\",        // Low\n        //         \"9653.07367333\",        // Close (or latest price)\n        //         \"0\",                    // Ignore\n        //         1591256519999,          // Close time\n        //         \"0\",                    // Ignore\n        //         60,                     // Number of bisic data\n        //         \"0\",                    // Ignore\n        //         \"0\",                    // Ignore\n        //         \"0\"                     // Ignore\n        //         ]\n        //     ]\n        //\n        // options\n        //\n        //     {\n        //         \"open\": \"32.2\",\n        //         \"high\": \"32.2\",\n        //         \"low\": \"32.2\",\n        //         \"close\": \"32.2\",\n        //         \"volume\": \"0\",\n        //         \"interval\": \"5m\",\n        //         \"tradeCount\": 0,\n        //         \"takerVolume\": \"0\",\n        //         \"takerAmount\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"openTime\": 1677096900000,\n        //         \"closeTime\": 1677097200000\n        //     }\n        //\n        const inverse = this.safeBool (market, 'inverse');\n        const volumeIndex = inverse ? 7 : 5;\n        return [\n            this.safeInteger2 (ohlcv, 0, 'openTime'),\n            this.safeNumber2 (ohlcv, 1, 'open'),\n            this.safeNumber2 (ohlcv, 2, 'high'),\n            this.safeNumber2 (ohlcv, 3, 'low'),\n            this.safeNumber2 (ohlcv, 4, 'close'),\n            this.safeNumber2 (ohlcv, volumeIndex, 'volume'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 13132,
        "line_end": 13149,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "market['inverse'] ? undefined : amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        const timestamp = this.safeInteger2 (interest, 'timestamp', 'time');\n        const id = this.safeString (interest, 'symbol');\n        const amount = this.safeNumber2 (interest, 'sumOpenInterest', 'openInterest');\n        const value = this.safeNumber2 (interest, 'sumOpenInterestValue', 'sumOpenInterestUsd');\n        // Inverse returns the number of contracts different from the base or quote volume in this case\n        // compared with https://www.binance.com/en/futures/funding-history/quarterly/4\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id, market, undefined, 'contract'),\n            'baseVolume': market['inverse'] ? undefined : amount,  // deprecated\n            'quoteVolume': value,  // deprecated\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 13768,
        "line_end": 13812,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPrice')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPrice')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'lastPrice')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'exercisePrice')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (chain, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (chain, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-241227-80000-C\",\n         \"priceChange\": \"0\",\n         \"priceChangePercent\": \"0\",\n         \"lastPrice\": \"2750\",\n         \"lastQty\": \"0\",\n         \"open\": \"2750\",\n         \"high\": \"2750\",\n         \"low\": \"2750\",\n         \"volume\": \"0\",\n         \"amount\": \"0\",\n         \"bidPrice\": \"4880\",\n         \"askPrice\": \"0\",\n         \"openTime\": 0,\n         \"closeTime\": 0,\n         \"firstTradeId\": 0,\n         \"tradeCount\": 0,\n         \"strikePrice\": \"80000\",\n         \"exercisePrice\": \"63944.09893617\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"symbol\": \"BTC-241227-80000-C\",\n        //         \"priceChange\": \"0\",\n        //         \"priceChangePercent\": \"0\",\n        //         \"lastPrice\": \"2750\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"2750\",\n        //         \"high\": \"2750\",\n        //         \"low\": \"2750\",\n        //         \"volume\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"bidPrice\": \"4880\",\n        //         \"askPrice\": \"0\",\n        //         \"openTime\": 0,\n        //         \"closeTime\": 0,\n        //         \"firstTradeId\": 0,\n        //         \"tradeCount\": 0,\n        //         \"strikePrice\": \"80000\",\n        //         \"exercisePrice\": \"63944.09893617\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPrice'),\n            'askPrice': this.safeNumber (chain, 'askPrice'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'lastPrice'),\n            'underlyingPrice': this.safeNumber (chain, 'exercisePrice'),\n            'change': this.safeNumber (chain, 'priceChange'),\n            'percentage': this.safeNumber (chain, 'priceChangePercent'),\n            'baseVolume': this.safeNumber (chain, 'volume'),\n            'quoteVolume': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOptionPosition",
        "signature": "parseOptionPosition (position: Dict, market: Market = undefined)",
        "line_start": 10844,
        "line_end": 10900,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'markValue')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'positionCost')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPNL')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"entryPrice\": \"27.70000000\",\n         \"symbol\": \"ETH-230426-1850-C\",\n         \"side\": \"LONG\",\n         \"quantity\": \"0.50000000\",\n         \"reducibleQty\": \"0.50000000\",\n         \"markValue\": \"10.250000000\",\n         \"ror\": \"-0.2599\",\n         \"unrealizedPNL\": \"-3.600000000\",\n         \"markPrice\": \"20.5\",\n         \"strikePrice\": \"1850.00000000\",\n         \"positionCost\": \"13.85000000\",\n         \"expiryDate\": 1682496000000,\n         \"priceScale\": 1,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"quoteAsset\": \"USDT\",\n         \"time\": 1682492427106\n     }"
        ],
        "source": "parseOptionPosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"entryPrice\": \"27.70000000\",\n        //         \"symbol\": \"ETH-230426-1850-C\",\n        //         \"side\": \"LONG\",\n        //         \"quantity\": \"0.50000000\",\n        //         \"reducibleQty\": \"0.50000000\",\n        //         \"markValue\": \"10.250000000\",\n        //         \"ror\": \"-0.2599\",\n        //         \"unrealizedPNL\": \"-3.600000000\",\n        //         \"markPrice\": \"20.5\",\n        //         \"strikePrice\": \"1850.00000000\",\n        //         \"positionCost\": \"13.85000000\",\n        //         \"expiryDate\": 1682496000000,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"time\": 1682492427106\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        let quantity = this.safeString (position, 'quantity');\n        if (side !== 'long') {\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        const timestamp = this.safeInteger (position, 'time');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'notional': this.safeNumber (position, 'markValue'),\n            'collateral': this.safeNumber (position, 'positionCost'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPNL'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 5636,
        "line_end": 6236,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "fills",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"0.0\",\n         \"cummulativeQuoteQty\": \"0.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"icebergQty\": \"0.0\",\n         \"time\": 1499827319559,\n         \"updateTime\": 1499827319559,\n         \"isWorking\": true\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 16383176297,\n         \"orderListId\": -1,\n         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n         \"transactTime\": 1670891847932,\n         \"price\": \"13500.00000000\",\n         \"origQty\": \"0.00085000\",\n         \"executedQty\": \"0.00000000\",\n         \"cummulativeQuoteQty\": \"0.00000000\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"fills\": []\n     }",
          "{\n         \"orderId\": 151007482392,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"NEW\",\n         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n         \"price\": \"25000\",\n         \"avgPrice\": \"0.00000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0\",\n         \"cumQty\": \"0\",\n         \"cumQuote\": \"0\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"BUY\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"updateTime\": 1684300587845\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"1.0\",\n         \"cumQuote\": \"10.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"updateTime\": 1499827319559\n     }",
          "createOrder with { \"newOrderRespType\": \"FULL\" }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"0.0\",\n        //         \"cummulativeQuoteQty\": \"0.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"icebergQty\": \"0.0\",\n        //         \"time\": 1499827319559,\n        //         \"updateTime\": 1499827319559,\n        //         \"isWorking\": true\n        //     }\n        //\n        // spot: editOrder\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 16383176297,\n        //         \"orderListId\": -1,\n        //         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n        //         \"transactTime\": 1670891847932,\n        //         \"price\": \"13500.00000000\",\n        //         \"origQty\": \"0.00085000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"fills\": []\n        //     }\n        //\n        // swap and future: editOrder\n        //\n        //     {\n        //         \"orderId\": 151007482392,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n        //         \"price\": \"25000\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"updateTime\": 1684300587845\n        //     }\n        //\n        // futures\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"1.0\",\n        //         \"cumQuote\": \"10.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"updateTime\": 1499827319559\n        //     }\n        //\n        // createOrder with { \"newOrderRespType\": \"FULL\" }\n        //\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"orderId\": 5403233939,\n        //       \"orderListId\": -1,\n        //       \"clientOrderId\": \"x-TKT5PX2F5e669e75b6c14f69a2c43e\",\n        //       \"transactTime\": 1617151923742,\n        //       \"price\": \"0.00000000\",\n        //       \"origQty\": \"0.00050000\",\n        //       \"executedQty\": \"0.00050000\",\n        //       \"cummulativeQuoteQty\": \"29.47081500\",\n        //       \"status\": \"FILLED\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"side\": \"BUY\",\n        //       \"fills\": [\n        //         {\n        //           \"price\": \"58941.63000000\",\n        //           \"qty\": \"0.00050000\",\n        //           \"commission\": \"0.00007050\",\n        //           \"commissionAsset\": \"BNB\",\n        //           \"tradeId\": 737466631\n        //         }\n        //       ]\n        //     }\n        //\n        // delivery\n        //\n        //     {\n        //       \"orderId\": \"18742727411\",\n        //       \"symbol\": \"ETHUSD_PERP\",\n        //       \"pair\": \"ETHUSD\",\n        //       \"status\": \"FILLED\",\n        //       \"clientOrderId\": \"x-xcKtGhcu3e2d1503fdd543b3b02419\",\n        //       \"price\": \"0\",\n        //       \"avgPrice\": \"4522.14\",\n        //       \"origQty\": \"1\",\n        //       \"executedQty\": \"1\",\n        //       \"cumBase\": \"0.00221134\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"reduceOnly\": false,\n        //       \"closePosition\": false,\n        //       \"side\": \"SELL\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"stopPrice\": \"0\",\n        //       \"workingType\": \"CONTRACT_PRICE\",\n        //       \"priceProtect\": false,\n        //       \"origType\": \"MARKET\",\n        //       \"time\": \"1636061952660\",\n        //       \"updateTime\": \"1636061952660\"\n        //     }\n        //\n        // option: createOrder, fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"orderId\": 4728833085436977152,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"10.0\",\n        //         \"quantity\": \"1.00\",\n        //         \"executedQty\": \"0.00\",\n        //         \"fee\": \"0\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"reduceOnly\": false,\n        //         \"postOnly\": false,\n        //         \"createTime\": 1676083034462,\n        //         \"updateTime\": 1676083034462,\n        //         \"status\": \"ACCEPTED\",\n        //         \"avgPrice\": \"0\",\n        //         \"source\": \"API\",\n        //         \"clientOrderId\": \"\",\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"lastTrade\": {\"id\":\"69\",\"time\":\"1676084430567\",\"price\":\"24.9\",\"qty\":\"1.00\"},\n        //         \"mmp\": false\n        //     }\n        //\n        // cancelOrders/createOrders\n        //\n        //     {\n        //         \"code\": -4005,\n        //         \"msg\": \"Quantity greater than max quantity.\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin linear swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"executedQty\": \"0.000\",\n        //         \"orderId\": 258649539704,\n        //         \"goodTillDate\": 0,\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"clientOrderId\": \"x-xcKtGhcu02573c6f15e544e990057b\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0.000\",\n        //         \"updateTime\": 1707110415436,\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"35000.00\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin inverse swap and future\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"side\": \"BUY\",\n        //         \"cumBase\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"orderId\": 71275227732,\n        //         \"avgPrice\": \"0.00\",\n        //         \"origQty\": \"1\",\n        //         \"clientOrderId\": \"x-xcKtGhcuca5af3acfb5044198c5398\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0\",\n        //         \"updateTime\": 1707110994334,\n        //         \"type\": \"LIMIT\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"2000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOpenOrder: portfolio margin linear swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu27f109953d6e4dc0974006\",\n        //         \"strategyId\": 3645916,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"45000.00\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707112625879,\n        //         \"updateTime\": 1707112625879,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders: portfolio margin inverse swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuc6b86f053bb34933850739\",\n        //         \"strategyId\": 1423462,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2000\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"3000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707113098840,\n        //         \"updateTime\": 1707113098840,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin\n        //\n        //     {\n        //         \"clientOrderId\": \"x-TKT5PX2Fe9ef29d8346440f0b28b86\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"fills\": [],\n        //         \"orderId\": 24684460474,\n        //         \"origQty\": \"0.00100000\",\n        //         \"price\": \"35000.00000000\",\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"side\": \"BUY\",\n        //         \"status\": \"NEW\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"transactTime\": 1707113538870,\n        //         \"type\": \"LIMIT\"\n        //     }\n        //\n        // fetchOpenOrders, fetchOrder, fetchOrders: portfolio margin spot margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 24700763749,\n        //         \"clientOrderId\": \"x-TKT5PX2F6f724c2a4af6425f98c7b6\",\n        //         \"price\": \"35000.00000000\",\n        //         \"origQty\": \"0.00100000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.00000000\",\n        //         \"icebergQty\": \"0.00000000\",\n        //         \"time\": 1707199187679,\n        //         \"updateTime\": 1707199187679,\n        //         \"isWorking\": true,\n        //         \"accountId\": 200180970,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"preventedMatchId\": null,\n        //         \"preventedQuantity\": null\n        //     }\n        //\n        // cancelOrder: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"strategyId\": 3733211,\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyType\": \"STOP\",\n        //         \"strategyStatus\": \"CANCELED\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000.00\", // ignored with trailing orders\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"activatePrice\": null,  // only return with trailing orders\n        //         \"priceRate\": null,      // only return with trailing orders\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOrders: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyId\": 3733211,\n        //         \"strategyStatus\": \"CANCELLED\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000\",\n        //         \"orderId\": 0,\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"type\": \"LIMIT\",\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerTime\": 0,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: linear swap\n        //\n        //     {\n        //         \"orderId\": 3697213934,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcufb20c5a7761a4aa09aa156\",\n        //         \"price\": \"33000.00\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0.000\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0.00\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"goodTillDate\": 0,\n        //         \"time\": 1707892893502,\n        //         \"updateTime\": 1707892893515\n        //     }\n        //\n        // fetchOpenOrder: inverse swap\n        //\n        //     {\n        //         \"orderId\": 597368542,\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcubbde7ba93b1a4ab881eff3\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893453199,\n        //         \"updateTime\": 1707893453199\n        //     }\n        //\n        // fetchOpenOrder: linear portfolio margin\n        //\n        //     {\n        //         \"orderId\": 264895013409,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcu6278f1adbdf14f74ab432e\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893839364,\n        //         \"updateTime\": 1707893839364,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin\n        //\n        //     {\n        //         \"orderId\": 71790316950,\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcuec11030474204ab08ba2c2\",\n        //         \"price\": \"2500\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707894181694,\n        //         \"updateTime\": 1707894181694\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu2da9c765294b433994ffce\",\n        //         \"strategyId\": 1423501,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2500\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"stopPrice\": \"4000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"bookTime\": 1707894782679,\n        //         \"updateTime\": 1707894782679,\n        //         \"timeInForce\": \"GTC\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, fetchOrder, fetchOpenOrders, fetchOrders, cancelOrderWs, createOrderWs: linear swap conditional order\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"algoType\": \"CONDITIONAL\",\n        //         \"orderType\": \"STOP\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"quantity\": \"0.002\",\n        //         \"algoStatus\": \"NEW\",\n        //         \"triggerPrice\": \"100000.00\",\n        //         \"price\": \"102000.00\",\n        //         \"icebergQuantity\": null,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"closePosition\": false,\n        //         \"priceProtect\": false,\n        //         \"reduceOnly\": false,\n        //         \"createTime\": 1763458576201,\n        //         \"updateTime\": 1763458576201,\n        //         \"triggerTime\": 0,\n        //         \"goodTillDate\": 0\n        //     }\n        //\n        // cancelOrder: linear swap conditional\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"code\": \"200\",\n        //         \"msg\": \"success\"\n        //     }\n        //\n        const code = this.safeString (order, 'code');\n        if (code !== undefined) {\n            // cancelOrders/createOrders might have a partial success\n            const msg = this.safeString (order, 'msg');\n            if ((code !== '200') && !((msg === 'success') || (msg === 'The operation of cancel all open order is done.'))) {\n                return this.safeOrder ({ 'info': order, 'status': 'rejected' }, market);\n            }\n        }\n        const status = this.parseOrderStatus (this.safeStringN (order, [ 'status', 'strategyStatus', 'algoStatus' ]));\n        const marketId = this.safeString (order, 'symbol');\n        const isContract = ('positionSide' in order) || ('cumQuote' in order);\n        const marketType = isContract ? 'contract' : 'spot';\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const filled = this.safeString (order, 'executedQty', '0');\n        const timestamp = this.safeIntegerN (order, [ 'time', 'createTime', 'workingTime', 'transactTime', 'updateTime' ]); // order of the keys matters here\n        let lastTradeTimestamp = undefined;\n        if (('transactTime' in order) || ('updateTime' in order)) {\n            const timestampValue = this.safeInteger2 (order, 'updateTime', 'transactTime');\n            if (status === 'open') {\n                if (Precise.stringGt (filled, '0')) {\n                    lastTradeTimestamp = timestampValue;\n                }\n            } else if (status === 'closed') {\n                lastTradeTimestamp = timestampValue;\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger2 (order, 'transactTime', 'updateTime');\n        const average = this.safeString (order, 'avgPrice');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString2 (order, 'origQty', 'quantity');\n        // - Spot/Margin market: cummulativeQuoteQty\n        // - Futures market: cumQuote.\n        //   Note this is not the actual cost, since Binance futures uses leverage to calculate margins.\n        let cost = this.safeString2 (order, 'cummulativeQuoteQty', 'cumQuote');\n        cost = this.safeString (order, 'cumBase', cost);\n        const type = this.safeStringLower2 (order, 'type', 'orderType');\n        const side = this.safeStringLower (order, 'side');\n        const fills = this.safeList (order, 'fills', []);\n        let timeInForce = this.safeString (order, 'timeInForce');\n        if (timeInForce === 'GTX') {\n            // GTX means \"Good Till Crossing\" and is an equivalent way of saying Post Only\n            timeInForce = 'PO';\n        }\n        const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');\n        const stopPriceString = this.safeString2 (order, 'stopPrice', 'triggerPrice');\n        const triggerPrice = this.parseNumber (this.omitZero (stopPriceString));\n        const feeCost = this.safeNumber (order, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': this.safeString (order, 'quoteAsset'),\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ]),\n            'clientOrderId': this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': fills,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 5605,
        "line_end": 5622,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'ACCEPTED': 'open',\n            'TRIGGERING': 'open',\n            'FILLED': 'closed',\n            'TRIGGERED': 'closed',\n            'FINISHED': 'closed',\n            'CANCELED': 'canceled',\n            'CANCELLED': 'canceled',\n            'PENDING_CANCEL': 'canceling', // currently unused\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n            'EXPIRED_IN_MATCH': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 5624,
        "line_end": 5634,
        "comment": null,
        "mappings": [
          {
            "key": "limit_maker",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "take_profit",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "take_profit_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "trailing_stop_market",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types = {\n            'limit_maker': 'limit',\n            'stop': 'limit',\n            'stop_market': 'market',\n            'take_profit': 'limit',\n            'take_profit_market': 'market',\n            'trailing_stop_market': 'market',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parsePositionRisk",
        "signature": "parsePositionRisk (position, market: Market = undefined)",
        "line_start": 10331,
        "line_end": 10568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePositionRisk (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        //  {\n        //     symbol: \"WLDUSDT\",\n        //     positionSide: \"BOTH\",\n        //     positionAmt: \"5\",\n        //     entryPrice: \"2.3483\",\n        //     breakEvenPrice: \"2.349356735\",\n        //     markPrice: \"2.39560000\",\n        //     unRealizedProfit: \"0.23650000\",\n        //     liquidationPrice: \"0\",\n        //     isolatedMargin: \"0\",\n        //     notional: \"11.97800000\",\n        //     isolatedWallet: \"0\",\n        //     updateTime: \"1722062678998\",\n        //     initialMargin: \"2.39560000\",         // not in v2\n        //     maintMargin: \"0.07186800\",           // not in v2\n        //     positionInitialMargin: \"2.39560000\", // not in v2\n        //     openOrderInitialMargin: \"0\",         // not in v2\n        //     adl: \"2\",                            // not in v2\n        //     bidNotional: \"0\",                    // not in v2\n        //     askNotional: \"0\",                    // not in v2\n        //     marginAsset: \"USDT\",                 // not in v2\n        //     // the below fields are only in v2\n        //     leverage: \"5\",\n        //     maxNotionalValue: \"6000000\",\n        //     marginType: \"cross\",\n        //     isAutoAddMargin: \"false\",\n        //     isolated: false,\n        //     adlQuantile: \"2\",\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_PERP\",\n        //       \"positionAmt\": \"2\",\n        //       \"entryPrice\": \"37643.10000021\",\n        //       \"markPrice\": \"38103.05510455\",\n        //       \"unRealizedProfit\": \"0.00006413\",\n        //       \"liquidationPrice\": \"25119.97445760\",\n        //       \"leverage\": \"2\",\n        //       \"maxQty\": \"1500\",\n        //       \"marginType\": \"isolated\",\n        //       \"isolatedMargin\": \"0.00274471\",\n        //       \"isAutoAddMargin\": \"false\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"notionalValue\": \"0.00524892\",\n        //       \"isolatedWallet\": \"0.00268058\"\n        //     }\n        //\n        // inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"positionAmt\": \"1\",\n        //         \"entryPrice\": \"2422.400000007\",\n        //         \"markPrice\": \"2424.51267823\",\n        //         \"unRealizedProfit\": \"0.0000036\",\n        //         \"liquidationPrice\": \"293.57678898\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371941861,\n        //         \"maxQty\": \"15\",\n        //         \"notionalValue\": \"0.00412454\",\n        //         \"breakEvenPrice\": \"2423.368960034\"\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"positionAmt\": \"0.01\",\n        //         \"entryPrice\": \"44525.0\",\n        //         \"markPrice\": \"45464.1735922\",\n        //         \"unRealizedProfit\": \"9.39173592\",\n        //         \"liquidationPrice\": \"38007.16308568\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371879042,\n        //         \"maxNotionalValue\": \"500000.0\",\n        //         \"notional\": \"454.64173592\",\n        //         \"breakEvenPrice\": \"44542.81\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const isolatedMarginString = this.safeString (position, 'isolatedMargin');\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const notional = this.parseNumber (notionalStringAbs);\n        const contractsAbs = Precise.stringAbs (this.safeString (position, 'positionAmt'));\n        const contracts = this.parseNumber (contractsAbs);\n        const unrealizedPnlString = this.safeString (position, 'unRealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        const liquidationPriceString = this.omitZero (this.safeString (position, 'liquidationPrice'));\n        const liquidationPrice = this.parseNumber (liquidationPriceString);\n        let collateralString = undefined;\n        let marginMode = this.safeString (position, 'marginType');\n        if (marginMode === undefined && isolatedMarginString !== undefined) {\n            marginMode = Precise.stringEq (isolatedMarginString, '0') ? 'cross' : 'isolated';\n        }\n        let side = undefined;\n        if (Precise.stringGt (notionalString, '0')) {\n            side = 'long';\n        } else if (Precise.stringLt (notionalString, '0')) {\n            side = 'short';\n        }\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        const entryPrice = this.parseNumber (entryPriceString);\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        // as oppose to notionalValue\n        const linear = ('notional' in position);\n        if (marginMode === 'cross') {\n            // calculate collateral\n            const precision = this.safeDict (market, 'precision', {});\n            const basePrecisionValue = this.safeString (precision, 'base');\n            const quotePrecisionValue = this.safeString2 (precision, 'quote', 'price');\n            const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);\n            if (!precisionIsUndefined) {\n                if (linear) {\n                    // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    }\n                    const inner = Precise.stringMul (liquidationPriceString, onePlusMaintenanceMarginPercentageString);\n                    const leftSide = Precise.stringAdd (inner, entryPriceSignString);\n                    const quotePrecision = this.precisionFromString (this.safeString2 (precision, 'quote', 'price'));\n                    if (quotePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, contractsAbs), '1', quotePrecision);\n                    }\n                } else {\n                    // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    }\n                    const leftSide = Precise.stringMul (contractsAbs, contractSizeString);\n                    const rightSide = Precise.stringSub (Precise.stringDiv ('1', entryPriceSignString), Precise.stringDiv (onePlusMaintenanceMarginPercentageString, liquidationPriceString));\n                    const basePrecision = this.precisionFromString (this.safeString (precision, 'base'));\n                    if (basePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, rightSide), '1', basePrecision);\n                    }\n                }\n            }\n        } else {\n            collateralString = this.safeString (position, 'isolatedMargin');\n        }\n        collateralString = (collateralString === undefined) ? '0' : collateralString;\n        const collateral = this.parseNumber (collateralString);\n        const markPrice = this.parseNumber (this.omitZero (this.safeString (position, 'markPrice')));\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        let maintenanceMarginString = Precise.stringMul (maintenanceMarginPercentageString, notionalStringAbs);\n        if (maintenanceMarginString === undefined) {\n            // for a while, this new value was a backup to the existing calculations, but in future we might prioritize this\n            maintenanceMarginString = this.safeString (position, 'maintMargin');\n        }\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        let initialMarginString = undefined;\n        let initialMarginPercentageString = undefined;\n        const leverageString = this.safeString (position, 'leverage');\n        if (leverageString !== undefined) {\n            const leverage = parseInt (leverageString);\n            const rational = this.isRoundNumber (1000 % leverage);\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringAdd (initialMarginPercentageString, '1e-8');\n            }\n            const unrounded = Precise.stringMul (notionalStringAbs, initialMarginPercentageString);\n            initialMarginString = Precise.stringDiv (unrounded, '1', 8);\n        } else {\n            initialMarginString = this.safeString (position, 'initialMargin');\n            const unrounded = Precise.stringMul (initialMarginString, '1');\n            initialMarginPercentageString = Precise.stringDiv (unrounded, notionalStringAbs, 8);\n        }\n        let marginRatio = undefined;\n        let percentage = undefined;\n        if (!Precise.stringEquals (collateralString, '0')) {\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'unrealizedPnl': unrealizedPnl,\n            'leverage': this.parseNumber (leverageString),\n            'liquidationPrice': liquidationPrice,\n            'collateral': collateral,\n            'notional': notional,\n            'markPrice': markPrice,\n            'entryPrice': entryPrice,\n            'timestamp': timestamp,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'marginRatio': marginRatio,\n            'datetime': this.iso8601 (timestamp),\n            'marginMode': marginMode,\n            'marginType': marginMode, // deprecated\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 11662,
        "line_end": 11702,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH-230223-1900-P\",\n         \"strikePrice\": \"1900\",\n         \"realStrikePrice\": \"1665.5897334\",\n         \"expiryDate\": 1677139200000,\n         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n     }",
          "{\n         \"id\": \"1125899906842897036\",\n         \"currency\": \"USDT\",\n         \"symbol\": \"BTC-230728-30000-C\",\n         \"exercisePrice\": \"30000.00000000\",\n         \"markPrice\": \"29160.71284993\",\n         \"quantity\": \"1.00000000\",\n         \"amount\": \"0.00000000\",\n         \"fee\": \"0.00000000\",\n         \"createDate\": 1690531200000,\n         \"priceScale\": 0,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"positionSide\": \"LONG\",\n         \"quoteAsset\": \"USDT\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"symbol\": \"ETH-230223-1900-P\",\n        //         \"strikePrice\": \"1900\",\n        //         \"realStrikePrice\": \"1665.5897334\",\n        //         \"expiryDate\": 1677139200000,\n        //         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"id\": \"1125899906842897036\",\n        //         \"currency\": \"USDT\",\n        //         \"symbol\": \"BTC-230728-30000-C\",\n        //         \"exercisePrice\": \"30000.00000000\",\n        //         \"markPrice\": \"29160.71284993\",\n        //         \"quantity\": \"1.00000000\",\n        //         \"amount\": \"0.00000000\",\n        //         \"fee\": \"0.00000000\",\n        //         \"createDate\": 1690531200000,\n        //         \"priceScale\": 0,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"positionSide\": \"LONG\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (settlement, 'expiryDate', 'createDate');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 11704,
        "line_end": 11744,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETH-230223-1900-P\",\n             \"strikePrice\": \"1900\",\n             \"realStrikePrice\": \"1665.5897334\",\n             \"expiryDate\": 1677139200000,\n             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n         }\n     ]",
          "[\n         {\n             \"id\": \"1125899906842897036\",\n             \"currency\": \"USDT\",\n             \"symbol\": \"BTC-230728-30000-C\",\n             \"exercisePrice\": \"30000.00000000\",\n             \"markPrice\": \"29160.71284993\",\n             \"quantity\": \"1.00000000\",\n             \"amount\": \"0.00000000\",\n             \"fee\": \"0.00000000\",\n             \"createDate\": 1690531200000,\n             \"priceScale\": 0,\n             \"quantityScale\": 2,\n             \"optionSide\": \"CALL\",\n             \"positionSide\": \"LONG\",\n             \"quoteAsset\": \"USDT\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETH-230223-1900-P\",\n        //             \"strikePrice\": \"1900\",\n        //             \"realStrikePrice\": \"1665.5897334\",\n        //             \"expiryDate\": 1677139200000,\n        //             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"id\": \"1125899906842897036\",\n        //             \"currency\": \"USDT\",\n        //             \"symbol\": \"BTC-230728-30000-C\",\n        //             \"exercisePrice\": \"30000.00000000\",\n        //             \"markPrice\": \"29160.71284993\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"amount\": \"0.00000000\",\n        //             \"fee\": \"0.00000000\",\n        //             \"createDate\": 1690531200000,\n        //             \"priceScale\": 0,\n        //             \"quantityScale\": 2,\n        //             \"optionSide\": \"CALL\",\n        //             \"positionSide\": \"LONG\",\n        //             \"quoteAsset\": \"USDT\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 4068,
        "line_end": 4254,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'highPrice', 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'lowPrice', 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "wAvg",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'openPrice', 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'prevClosePrice')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"11793.63104562\", // mark price\n         \"indexPrice\": \"11781.80495970\", // index price\n         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n         \"nextFundingTime\": 1597392000000,\n         \"interestRate\": \"0.00010000\",\n         \"time\": 1597370495002\n     }",
          "{\n        \"symbol\": \"BTCUSDT\",\n        \"priceChange\": \"-188.18000000\",\n        \"priceChangePercent\": \"-0.159\",\n        \"weightedAvgPrice\": \"118356.64734074\",\n        \"lastPrice\": \"118449.03000000\",\n        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        \"openPrice\": \"118637.21000000\",\n        \"highPrice\": \"119273.36000000\",\n        \"lowPrice\": \"117427.50000000\",\n        \"volume\": \"14741.41491000\",\n        \"quoteVolume\": \"1744744445.80640740\",\n        \"openTime\": \"1753701474013\",\n        \"closeTime\": \"1753787874013\",\n        \"firstId\": \"5116031635\",\n        \"lastId\": \"5117964946\",\n        \"count\": \"1933312\"\n    }",
          "{\n        \"symbol\": \"SUSDT\",\n        \"priceChange\": \"-0.0229000\",\n        \"priceChangePercent\": \"-6.777\",\n        \"weightedAvgPrice\": \"0.3210035\",\n        \"lastPrice\": \"0.3150000\",\n        \"lastQty\": \"16\",\n        \"openPrice\": \"0.3379000\",\n        \"highPrice\": \"0.3411000\",\n        \"lowPrice\": \"0.3071000\",\n        \"volume\": \"120588225\",\n        \"quoteVolume\": \"38709237.2289000\",\n        \"openTime\": \"1753701720000\",\n        \"closeTime\": \"1753788172414\",\n        \"firstId\": \"72234973\",\n        \"lastId\": \"72423677\",\n        \"count\": \"188700\"\n    }",
          "{\n         \"baseVolume\": \"214549.95171161\",\n         \"closeTime\": \"1621965286847\",\n         \"count\": \"1283779\",\n         \"firstId\": \"152560106\",\n         \"highPrice\": \"39938.3\",\n         \"lastId\": \"153843955\",\n         \"lastPrice\": \"37993.4\",\n         \"lastQty\": \"1\",\n         \"lowPrice\": \"36457.2\",\n         \"openPrice\": \"37783.4\",\n         \"openTime\": \"1621878840000\",\n         \"pair\": \"BTCUSD\",\n         \"priceChange\": \"210.0\",\n         \"priceChangePercent\": \"0.556\",\n         \"symbol\": \"BTCUSD_PERP\",\n         \"volume\": \"81990451\",\n         \"weightedAvgPrice\": \"38215.08713747\"\n     }",
          "{\n         \"symbol\": \"ETH-230510-1825-C\",\n         \"priceChange\": \"-5.1\",\n         \"priceChangePercent\": \"-0.1854\",\n         \"lastPrice\": \"22.4\",\n         \"lastQty\": \"0\",\n         \"open\": \"27.5\",\n         \"high\": \"34.1\",\n         \"low\": \"22.4\",\n         \"volume\": \"6.83\",\n         \"amount\": \"201.44\",\n         \"bidPrice\": \"21.9\",\n         \"askPrice\": \"22.4\",\n         \"openTime\": 1683614771898,\n         \"closeTime\": 1683695017784,\n         \"firstTradeId\": 12,\n         \"tradeCount\": 22,\n         \"strikePrice\": \"1825\",\n         \"exercisePrice\": \"1845.95341176\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // markPrices\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"11793.63104562\", // mark price\n        //         \"indexPrice\": \"11781.80495970\", // index price\n        //         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n        //         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n        //         \"nextFundingTime\": 1597392000000,\n        //         \"interestRate\": \"0.00010000\",\n        //         \"time\": 1597370495002\n        //     }\n        //\n        // spot - ticker\n        //\n        //    {\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"priceChange\": \"-188.18000000\",\n        //        \"priceChangePercent\": \"-0.159\",\n        //        \"weightedAvgPrice\": \"118356.64734074\",\n        //        \"lastPrice\": \"118449.03000000\",\n        //        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        //        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        //        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        //        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        //        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        //        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        //        \"openPrice\": \"118637.21000000\",\n        //        \"highPrice\": \"119273.36000000\",\n        //        \"lowPrice\": \"117427.50000000\",\n        //        \"volume\": \"14741.41491000\",\n        //        \"quoteVolume\": \"1744744445.80640740\",\n        //        \"openTime\": \"1753701474013\",\n        //        \"closeTime\": \"1753787874013\",\n        //        \"firstId\": \"5116031635\",\n        //        \"lastId\": \"5117964946\",\n        //        \"count\": \"1933312\"\n        //    }\n        //\n        // usdm tickers\n        //\n        //    {\n        //        \"symbol\": \"SUSDT\",\n        //        \"priceChange\": \"-0.0229000\",\n        //        \"priceChangePercent\": \"-6.777\",\n        //        \"weightedAvgPrice\": \"0.3210035\",\n        //        \"lastPrice\": \"0.3150000\",\n        //        \"lastQty\": \"16\",\n        //        \"openPrice\": \"0.3379000\",\n        //        \"highPrice\": \"0.3411000\",\n        //        \"lowPrice\": \"0.3071000\",\n        //        \"volume\": \"120588225\",\n        //        \"quoteVolume\": \"38709237.2289000\",\n        //        \"openTime\": \"1753701720000\",\n        //        \"closeTime\": \"1753788172414\",\n        //        \"firstId\": \"72234973\",\n        //        \"lastId\": \"72423677\",\n        //        \"count\": \"188700\"\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //         \"baseVolume\": \"214549.95171161\",\n        //         \"closeTime\": \"1621965286847\",\n        //         \"count\": \"1283779\",\n        //         \"firstId\": \"152560106\",\n        //         \"highPrice\": \"39938.3\",\n        //         \"lastId\": \"153843955\",\n        //         \"lastPrice\": \"37993.4\",\n        //         \"lastQty\": \"1\",\n        //         \"lowPrice\": \"36457.2\",\n        //         \"openPrice\": \"37783.4\",\n        //         \"openTime\": \"1621878840000\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"priceChange\": \"210.0\",\n        //         \"priceChangePercent\": \"0.556\",\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"volume\": \"81990451\",\n        //         \"weightedAvgPrice\": \"38215.08713747\"\n        //     }\n        //\n        // eapi: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"ETH-230510-1825-C\",\n        //         \"priceChange\": \"-5.1\",\n        //         \"priceChangePercent\": \"-0.1854\",\n        //         \"lastPrice\": \"22.4\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"27.5\",\n        //         \"high\": \"34.1\",\n        //         \"low\": \"22.4\",\n        //         \"volume\": \"6.83\",\n        //         \"amount\": \"201.44\",\n        //         \"bidPrice\": \"21.9\",\n        //         \"askPrice\": \"22.4\",\n        //         \"openTime\": 1683614771898,\n        //         \"closeTime\": 1683695017784,\n        //         \"firstTradeId\": 12,\n        //         \"tradeCount\": 22,\n        //         \"strikePrice\": \"1825\",\n        //         \"exercisePrice\": \"1845.95341176\"\n        //     }\n        //\n        // spot bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"ETHBTC\",\n        //         \"bidPrice\":\"0.07466800\",\n        //         \"bidQty\":\"5.31990000\",\n        //         \"askPrice\":\"0.07466900\",\n        //         \"askQty\":\"10.93540000\"\n        //     }\n        //\n        // usdm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"bidPrice\":\"21321.90\",\n        //         \"bidQty\":\"33.592\",\n        //         \"askPrice\":\"21322.00\",\n        //         \"askQty\":\"1.427\",\n        //         \"time\":\"1673899207538\"\n        //     }\n        //\n        // coinm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD_PERP\",\n        //         \"pair\":\"BTCUSD\",\n        //         \"bidPrice\":\"21301.2\",\n        //         \"bidQty\":\"188\",\n        //         \"askPrice\":\"21301.3\",\n        //         \"askQty\":\"10302\",\n        //         \"time\":\"1673899278514\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (ticker, 'closeTime', 'time');\n        let marketType = undefined;\n        if (('time' in ticker)) {\n            marketType = 'contract';\n        }\n        if (marketType === undefined) {\n            marketType = ('bidQty' in ticker) ? 'spot' : 'contract';\n        }\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const last = this.safeString (ticker, 'lastPrice');\n        const wAvg = this.safeString (ticker, 'weightedAvgPrice');\n        const isCoinm = ('baseVolume' in ticker);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        if (isCoinm) {\n            baseVolume = this.safeString (ticker, 'baseVolume');\n            // 'volume' field in inverse markets is not quoteVolume, but traded amount (per contracts)\n            quoteVolume = Precise.stringMul (baseVolume, wAvg);\n        } else {\n            baseVolume = this.safeString (ticker, 'volume');\n            quoteVolume = this.safeString2 (ticker, 'quoteVolume', 'amount');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'highPrice', 'high'),\n            'low': this.safeString2 (ticker, 'lowPrice', 'low'),\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': wAvg,\n            'open': this.safeString2 (ticker, 'openPrice', 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'prevClosePrice'), // previous day close\n            'change': this.safeString (ticker, 'priceChange'),\n            'percentage': this.safeString (ticker, 'priceChangePercent'),\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTickersForRolling",
        "signature": "parseTickersForRolling (response, symbols)",
        "line_start": 4518,
        "line_end": 4528,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTickersForRolling (response, symbols) {\n        const results = [];\n        for (let i = 0; i < response.length; i++) {\n            const marketId = this.safeString (response[i], 'symbol');\n            const tickerMarket = this.safeMarket (marketId, undefined, undefined, 'spot');\n            const parsedTicker = this.parseTicker (response[i]);\n            parsedTicker['symbol'] = tickerMarket['symbol'];\n            results.push (parsedTicker);\n        }\n        return this.filterByArray (results, 'symbol', symbols);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 4791,
        "line_end": 5057,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ])",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'type')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'p', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (trade, 'quoteQty', 'baseQty')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"a\": 26129,         // Aggregate tradeId\n         \"p\": \"0.01633102\",  // Price\n         \"q\": \"4.70443515\",  // Quantity\n         \"f\": 27781,         // First tradeId\n         \"l\": 27781,         // Last tradeId\n         \"T\": 1498793709153, // Timestamp\n         \"m\": true,          // Was the buyer the maker?\n         \"M\": true           // Was the trade the best price match?\n     }",
          "{\n         \"a\": \"269772814\",\n         \"p\": \"25864.1\",\n         \"q\": \"3\",\n         \"f\": \"662149354\",\n         \"l\": \"662149355\",\n         \"T\": \"1694209776022\",\n         \"m\": false,\n     }",
          "{\n         \"id\": 28457,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"time\": 1499865549590,\n         \"isBuyerMaker\": true,\n         \"isBestMatch\": true\n     }",
          "{\n         \"symbol\": \"BNBBTC\",\n         \"id\": 28457,\n         \"orderId\": 100234,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"commission\": \"10.10000000\",\n         \"commissionAsset\": \"BNB\",\n         \"time\": 1499865549590,\n         \"isBuyer\": true,\n         \"isMaker\": false,\n         \"isBestMatch\": true\n     }",
          "{\n       \"accountId\": 20,\n       \"buyer\": False,\n       \"commission\": \"-0.07819010\",\n       \"commissionAsset\": \"USDT\",\n       \"counterPartyId\": 653,\n       \"id\": 698759,\n       \"maker\": False,\n       \"orderId\": 25851813,\n       \"price\": \"7819.01\",\n       \"qty\": \"0.002\",\n       \"quoteQty\": \"0.01563\",\n       \"realizedPnl\": \"-0.91539999\",\n       \"side\": \"SELL\",\n       \"symbol\": \"BTCUSDT\",\n       \"time\": 1569514978020\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        if ('isDustTrade' in trade) {\n            return this.parseDustTrade (trade, market);\n        }\n        //\n        // aggregate trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list\n        //\n        //     {\n        //         \"a\": 26129,         // Aggregate tradeId\n        //         \"p\": \"0.01633102\",  // Price\n        //         \"q\": \"4.70443515\",  // Quantity\n        //         \"f\": 27781,         // First tradeId\n        //         \"l\": 27781,         // Last tradeId\n        //         \"T\": 1498793709153, // Timestamp\n        //         \"m\": true,          // Was the buyer the maker?\n        //         \"M\": true           // Was the trade the best price match?\n        //     }\n        //\n        // REST: aggregate trades for swap & future (both linear and inverse)\n        //\n        //     {\n        //         \"a\": \"269772814\",\n        //         \"p\": \"25864.1\",\n        //         \"q\": \"3\",\n        //         \"f\": \"662149354\",\n        //         \"l\": \"662149355\",\n        //         \"T\": \"1694209776022\",\n        //         \"m\": false,\n        //     }\n        //\n        // recent public trades and old public trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#recent-trades-list\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data\n        //\n        //     {\n        //         \"id\": 28457,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyerMaker\": true,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // private trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-trade-list-user_data\n        //\n        //     {\n        //         \"symbol\": \"BNBBTC\",\n        //         \"id\": 28457,\n        //         \"orderId\": 100234,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"commission\": \"10.10000000\",\n        //         \"commissionAsset\": \"BNB\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // futures trades\n        //\n        //     {\n        //       \"accountId\": 20,\n        //       \"buyer\": False,\n        //       \"commission\": \"-0.07819010\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"counterPartyId\": 653,\n        //       \"id\": 698759,\n        //       \"maker\": False,\n        //       \"orderId\": 25851813,\n        //       \"price\": \"7819.01\",\n        //       \"qty\": \"0.002\",\n        //       \"quoteQty\": \"0.01563\",\n        //       \"realizedPnl\": \"-0.91539999\",\n        //       \"side\": \"SELL\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"time\": 1569514978020\n        //     }\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"id\": 477128891,\n        //       \"orderId\": 13809777875,\n        //       \"side\": \"SELL\",\n        //       \"price\": \"38479.55\",\n        //       \"qty\": \"0.001\",\n        //       \"realizedPnl\": \"-0.00009534\",\n        //       \"marginAsset\": \"USDT\",\n        //       \"quoteQty\": \"38.47955\",\n        //       \"commission\": \"-0.00076959\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"time\": 1612733566708,\n        //       \"positionSide\": \"BOTH\",\n        //       \"maker\": true,\n        //       \"buyer\": false\n        //     }\n        //\n        // { respType: FULL }\n        //\n        //     {\n        //       \"price\": \"4000.00000000\",\n        //       \"qty\": \"1.00000000\",\n        //       \"commission\": \"4.00000000\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"tradeId\": \"1234\",\n        //     }\n        //\n        // options: fetchMyTrades\n        //\n        //     {\n        //         \"id\": 1125899906844226012,\n        //         \"tradeId\": 73,\n        //         \"orderId\": 4638761100843040768,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"18.70000000\",\n        //         \"quantity\": \"-0.57000000\",\n        //         \"fee\": \"0.17305890\",\n        //         \"realizedProfit\": \"-3.53400000\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"LIMIT\",\n        //         \"volatility\": \"0.30000000\",\n        //         \"liquidity\": \"MAKER\",\n        //         \"time\": 1676085216845,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        // options: fetchTrades\n        //\n        //     {\n        //         \"id\": 1,\n        //         \"symbol\": \"ETH-230216-1500-C\",\n        //         \"price\": \"35.5\",\n        //         \"qty\": \"0.03\",\n        //         \"quoteQty\": \"1.065\",\n        //         \"side\": 1,\n        //         \"time\": 1676366446072\n        //     }\n        //\n        // fetchMyTrades: linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"id\": 4575108247,\n        //         \"orderId\": 261942655610,\n        //         \"side\": \"SELL\",\n        //         \"price\": \"47263.40\",\n        //         \"qty\": \"0.010\",\n        //         \"realizedPnl\": \"27.38400000\",\n        //         \"marginAsset\": \"USDT\",\n        //         \"quoteQty\": \"472.63\",\n        //         \"commission\": \"0.18905360\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707530039409,\n        //         \"buyer\": false,\n        //         \"maker\": false,\n        //         \"positionSide\": \"LONG\"\n        //     }\n        //\n        // fetchMyTrades: inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"id\": 701907838,\n        //         \"orderId\": 71548909034,\n        //         \"pair\": \"ETHUSD\",\n        //         \"side\": \"SELL\",\n        //         \"price\": \"2498.15\",\n        //         \"qty\": \"1\",\n        //         \"realizedPnl\": \"0.00012517\",\n        //         \"marginAsset\": \"ETH\",\n        //         \"baseQty\": \"0.00400296\",\n        //         \"commission\": \"0.00000160\",\n        //         \"commissionAsset\": \"ETH\",\n        //         \"time\": 1707530317519,\n        //         \"positionSide\": \"LONG\",\n        //         \"buyer\": false,\n        //         \"maker\": false\n        //     }\n        //\n        // fetchMyTrades: spot margin portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ADAUSDT\",\n        //         \"id\": 470227543,\n        //         \"orderId\": 4421170947,\n        //         \"price\": \"0.53880000\",\n        //         \"qty\": \"10.00000000\",\n        //         \"quoteQty\": \"5.38800000\",\n        //         \"commission\": \"0.00538800\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707545780522,\n        //         \"isBuyer\": false,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'T', 'time');\n        let amount = this.safeString2 (trade, 'q', 'qty');\n        amount = this.safeString (trade, 'quantity', amount);\n        const marketId = this.safeString (trade, 'symbol');\n        const isSpotTrade = ('isIsolated' in trade) || ('M' in trade) || ('orderListId' in trade) || ('isMaker' in trade);\n        const marketType = isSpotTrade ? 'spot' : 'contract';\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        let side = undefined;\n        const buyerMaker = this.safeBool2 (trade, 'm', 'isBuyerMaker');\n        let takerOrMaker = undefined;\n        if (buyerMaker !== undefined) {\n            side = buyerMaker ? 'sell' : 'buy'; // this is reversed intentionally\n        } else if ('side' in trade) {\n            side = this.safeStringLower (trade, 'side');\n        } else {\n            if ('isBuyer' in trade) {\n                side = trade['isBuyer'] ? 'buy' : 'sell'; // this is a true side\n            }\n        }\n        let fee = undefined;\n        if ('commission' in trade) {\n            fee = {\n                'cost': this.safeString (trade, 'commission'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'commissionAsset')),\n            };\n        }\n        if ('isMaker' in trade) {\n            takerOrMaker = trade['isMaker'] ? 'maker' : 'taker';\n        }\n        if ('maker' in trade) {\n            takerOrMaker = trade['maker'] ? 'maker' : 'taker';\n        }\n        if (('optionSide' in trade) || market['option']) {\n            const settle = this.safeCurrencyCode (this.safeString (trade, 'quoteAsset', 'USDT'));\n            takerOrMaker = this.safeStringLower (trade, 'liquidity');\n            if ('fee' in trade) {\n                fee = {\n                    'cost': this.safeString (trade, 'fee'),\n                    'currency': settle,\n                };\n            }\n            if ((side !== 'buy') && (side !== 'sell')) {\n                side = (side === '1') ? 'buy' : 'sell';\n            }\n            if ('optionSide' in trade) {\n                if (side !== 'buy') {\n                    amount = Precise.stringMul ('-1', amount);\n                }\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ]),\n            'order': this.safeString (trade, 'orderId'),\n            'type': this.safeStringLower (trade, 'type'),\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString2 (trade, 'p', 'price'),\n            'amount': amount,\n            'cost': this.safeString2 (trade, 'quoteQty', 'baseQty'),\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 9517,
        "line_end": 9545,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n       {\n         \"symbol\": \"BTCUSDT\",\n         \"makerCommission\": \"0.001\",\n         \"takerCommission\": \"0.001\"\n       }\n     ]",
          "{\n         \"symbol\": \"BTCUSD_PERP\",\n         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        // spot\n        //     [\n        //       {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"makerCommission\": \"0.001\",\n        //         \"takerCommission\": \"0.001\"\n        //       }\n        //     ]\n        //\n        // swap\n        //     {\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n        //         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate'),\n            'taker': this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 8648,
        "line_end": 8777,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"amount\": \"4500\",\n       \"coin\": \"USDT\",\n       \"network\": \"BSC\",\n       \"status\": 1,\n       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n       \"addressTag\": \"\",\n       \"txId\": \"Internal transfer 51376627901\",\n       \"insertTime\": 1618394381000,\n       \"transferType\": 1,\n       \"confirmTimes\": \"1/15\"\n     }",
          "{\n       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n       \"amount\": \"28.75\",\n       \"transactionFee\": \"0.25\",\n       \"coin\": \"XRP\",\n       \"status\": 6,\n       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n       \"addressTag\": \"101286922\",\n       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n       \"applyTime\": \"2021-04-15 12:09:16\",\n       \"network\": \"XRP\",\n       \"transferType\": 0\n     }",
          "{\n       \"orderNo\": \"CJW684897551397171200\",\n       \"fiatCurrency\": \"GBP\",\n       \"indicatedAmount\": \"29.99\",\n       \"amount\": \"28.49\",\n       \"totalFee\": \"1.50\",\n       \"method\": \"bank transfer\",\n       \"status\": \"Successful\",\n       \"createTime\": 1614898701000,\n       \"updateTime\": 1614898820000\n     }",
          "{\n       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n       \"fiatCurrency\": \"EUR\",\n       \"transactionType\": 0,\n       \"indicatedAmount\": \"15.00\",\n       \"amount\": \"15.00\",\n       \"totalFee\": \"0.00\",\n       \"method\": \"card\",\n       \"status\": \"Failed\",\n       \"createTime\": \"1627501026000\",\n       \"updateTime\": \"1627501027000\"\n     }",
          "{ id: \"9a67628b16ba4988ae20d329333f16bc\" }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //       \"amount\": \"4500\",\n        //       \"coin\": \"USDT\",\n        //       \"network\": \"BSC\",\n        //       \"status\": 1,\n        //       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n        //       \"addressTag\": \"\",\n        //       \"txId\": \"Internal transfer 51376627901\",\n        //       \"insertTime\": 1618394381000,\n        //       \"transferType\": 1,\n        //       \"confirmTimes\": \"1/15\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n        //       \"amount\": \"28.75\",\n        //       \"transactionFee\": \"0.25\",\n        //       \"coin\": \"XRP\",\n        //       \"status\": 6,\n        //       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n        //       \"addressTag\": \"101286922\",\n        //       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n        //       \"applyTime\": \"2021-04-15 12:09:16\",\n        //       \"network\": \"XRP\",\n        //       \"transferType\": 0\n        //     }\n        //\n        // fiat transaction\n        // withdraw\n        //     {\n        //       \"orderNo\": \"CJW684897551397171200\",\n        //       \"fiatCurrency\": \"GBP\",\n        //       \"indicatedAmount\": \"29.99\",\n        //       \"amount\": \"28.49\",\n        //       \"totalFee\": \"1.50\",\n        //       \"method\": \"bank transfer\",\n        //       \"status\": \"Successful\",\n        //       \"createTime\": 1614898701000,\n        //       \"updateTime\": 1614898820000\n        //     }\n        //\n        // deposit\n        //     {\n        //       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n        //       \"fiatCurrency\": \"EUR\",\n        //       \"transactionType\": 0,\n        //       \"indicatedAmount\": \"15.00\",\n        //       \"amount\": \"15.00\",\n        //       \"totalFee\": \"0.00\",\n        //       \"method\": \"card\",\n        //       \"status\": \"Failed\",\n        //       \"createTime\": \"1627501026000\",\n        //       \"updateTime\": \"1627501027000\"\n        //     }\n        //\n        // withdraw\n        //\n        //    { id: \"9a67628b16ba4988ae20d329333f16bc\" }\n        //\n        const id = this.safeString2 (transaction, 'id', 'orderNo');\n        const address = this.safeString (transaction, 'address');\n        let tag = this.safeString (transaction, 'addressTag'); // set but unused\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        let txid = this.safeString (transaction, 'txId');\n        if ((txid !== undefined) && (txid.indexOf ('Internal transfer ') >= 0)) {\n            txid = txid.slice (18);\n        }\n        const currencyId = this.safeString2 (transaction, 'coin', 'fiatCurrency');\n        let code = this.safeCurrencyCode (currencyId, currency);\n        let timestamp = undefined;\n        timestamp = this.safeInteger2 (transaction, 'insertTime', 'createTime');\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (transaction, 'applyTime'));\n        }\n        const updated = this.safeInteger2 (transaction, 'successTime', 'updateTime');\n        let type = this.safeString (transaction, 'type');\n        if (type === undefined) {\n            const txType = this.safeString (transaction, 'transactionType');\n            if (txType !== undefined) {\n                type = (txType === '0') ? 'deposit' : 'withdrawal';\n            }\n            const legalMoneyCurrenciesById = this.safeDict (this.options, 'legalMoneyCurrenciesById');\n            code = this.safeString (legalMoneyCurrenciesById, code, code);\n        }\n        const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber2 (transaction, 'transactionFee', 'totalFee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const internalInteger = this.safeInteger (transaction, 'transferType');\n        let internal = undefined;\n        if (internalInteger !== undefined) {\n            internal = (internalInteger !== 0) ? true : false;\n        }\n        const network = this.safeString (transaction, 'network');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': internal,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 8608,
        "line_end": 8646,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        if (type === undefined) {\n            return status;\n        }\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n                '6': 'ok',\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n                '2': 'pending', // Awaiting Approval\n                '3': 'failed', // Rejected\n                '4': 'pending', // Processing\n                '5': 'failed', // Failure\n                '6': 'ok', // Completed\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 8786,
        "line_end": 8888,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\":13526853623\n     }",
          "{\n         \"timestamp\": 1614640878000,\n         \"asset\": \"USDT\",\n         \"amount\": \"25\",\n         \"type\": \"MAIN_UMFUTURE\",\n         \"status\": \"CONFIRMED\",\n         \"tranId\": 43000126248\n     }",
          "{\n             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n             \"transactionId\": \"M_P_71505104267788288\",\n             \"transactionTime\": 1610090460133, //trade timestamp\n             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n             \"currency\": \"BNB\",\n             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n             \"fundsDetail\": [ // details\n                     {\n                         \"currency\": \"USDT\", //asset\n                         \"amount\": \"1.2\",\n                         \"walletAssetCost\":[ //details of asset cost per wallet\n                             {\"1\":\"0.6\"},\n                             {\"2\":\"0.6\"}\n                         ]\n                     },\n                     {\n                         \"currency\": \"ETH\",\n                         \"amount\": \"0.0001\",\n                         \"walletAssetCost\":[\n                             {\"1\":\"0.00005\"},\n                             {\"2\":\"0.00005\"}\n                         ]\n                     }\n                 ],\n             \"payerInfo\":{\n                     \"name\":\"Jack\", //nickname or merchant name\n                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n                     \"binanceId\":\"12345678\", //binance uid\n                     \"accountId\":\"67736251\" //binance pay id\n                 },\n             \"receiverInfo\":{\n                     \"name\":\"Alan\", //nickname or merchant name\n                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n                     \"email\":\"alan@binance.com\", //email\n                     \"binanceId\":\"34355667\", //binance uid\n                     \"accountId\":\"21326891\", //binance pay id\n                     \"countryCode\":\"1\", //International area code\n                     \"phoneNumber\":\"8057651210\",\n                     \"mobileCode\":\"US\", //country code\n                     \"extend\":[ //extension field\n                             \"institutionName\": \"\",\n                             \"cardNumber\": \"\",\n                             \"digitalWalletId\": \"\"\n                     ]\n                 }\n             }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"tranId\":13526853623\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"timestamp\": 1614640878000,\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"25\",\n        //         \"type\": \"MAIN_UMFUTURE\",\n        //         \"status\": \"CONFIRMED\",\n        //         \"tranId\": 43000126248\n        //     }\n        //\n        //     {\n        //             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n        //             \"transactionId\": \"M_P_71505104267788288\",\n        //             \"transactionTime\": 1610090460133, //trade timestamp\n        //             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n        //             \"currency\": \"BNB\",\n        //             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n        //             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n        //             \"fundsDetail\": [ // details\n        //                     {\n        //                         \"currency\": \"USDT\", //asset\n        //                         \"amount\": \"1.2\",\n        //                         \"walletAssetCost\":[ //details of asset cost per wallet\n        //                             {\"1\":\"0.6\"},\n        //                             {\"2\":\"0.6\"}\n        //                         ]\n        //                     },\n        //                     {\n        //                         \"currency\": \"ETH\",\n        //                         \"amount\": \"0.0001\",\n        //                         \"walletAssetCost\":[\n        //                             {\"1\":\"0.00005\"},\n        //                             {\"2\":\"0.00005\"}\n        //                         ]\n        //                     }\n        //                 ],\n        //             \"payerInfo\":{\n        //                     \"name\":\"Jack\", //nickname or merchant name\n        //                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"binanceId\":\"12345678\", //binance uid\n        //                     \"accountId\":\"67736251\" //binance pay id\n        //                 },\n        //             \"receiverInfo\":{\n        //                     \"name\":\"Alan\", //nickname or merchant name\n        //                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"email\":\"alan@binance.com\", //email\n        //                     \"binanceId\":\"34355667\", //binance uid\n        //                     \"accountId\":\"21326891\", //binance pay id\n        //                     \"countryCode\":\"1\", //International area code\n        //                     \"phoneNumber\":\"8057651210\",\n        //                     \"mobileCode\":\"US\", //country code\n        //                     \"extend\":[ //extension field\n        //                             \"institutionName\": \"\",\n        //                             \"cardNumber\": \"\",\n        //                             \"digitalWalletId\": \"\"\n        //                     ]\n        //                 }\n        //             }\n        const id = this.safeString2 (transfer, 'tranId', 'transactionId');\n        const currencyId = this.safeString2 (transfer, 'asset', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const amount = this.safeNumber (transfer, 'amount');\n        const type = this.safeString (transfer, 'type');\n        let fromAccount = undefined;\n        let toAccount = undefined;\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        if (type !== undefined) {\n            const parts = type.split ('_');\n            fromAccount = this.safeValue (parts, 0);\n            toAccount = this.safeValue (parts, 1);\n            fromAccount = this.safeString (accountsById, fromAccount, fromAccount);\n            toAccount = this.safeString (accountsById, toAccount, toAccount);\n        }\n        const walletType = this.safeInteger (transfer, 'walletType');\n        if (walletType !== undefined) {\n            const payer = this.safeDict (transfer, 'payerInfo', {});\n            const receiver = this.safeDict (transfer, 'receiverInfo', {});\n            fromAccount = this.safeString (payer, 'accountId');\n            toAccount = this.safeString (receiver, 'accountId');\n        }\n        const timestamp = this.safeInteger2 (transfer, 'timestamp', 'transactionTime');\n        const status = this.parseTransferStatus (this.safeString (transfer, 'status'));\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': status,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 8779,
        "line_end": 8784,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'CONFIRMED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      }
    ],
    "binanceusdm": [
      {
        "name": "parseAccountPosition",
        "signature": "parseAccountPosition (position, market: Market = undefined)",
        "line_start": 10081,
        "line_end": 10329,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "initialMargin",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"WLDUSDT\",\n        \"positionSide\": \"BOTH\",\n        \"positionAmt\": \"-849\",\n        \"unrealizedProfit\": \"11.17920750\",\n        \"notional\": \"-1992.46079250\",\n        \"isolatedMargin\": \"0\",\n        \"isolatedWallet\": \"0\",\n        \"initialMargin\": \"99.62303962\",\n        \"maintMargin\": \"11.95476475\",\n        \"updateTime\": \"1721995760449\"\n        \"leverage\": \"50\",                        // in v2\n        \"entryPrice\": \"2.34\",                    // in v2\n        \"positionInitialMargin\": \"118.82116614\", // in v2\n        \"openOrderInitialMargin\": \"0\",           // in v2\n        \"isolated\": false,                       // in v2\n        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        \"maxNotional\": \"25000\",                  // in v2\n        \"bidNotional\": \"0\",                      // in v2\n        \"askNotional\": \"0\"                       // in v2\n    }",
          "{\n       \"symbol\": \"BTCUSD_210625\",\n       \"initialMargin\": \"0.00024393\",\n       \"maintMargin\": \"0.00002439\",\n       \"unrealizedProfit\": \"-0.00000163\",\n       \"positionInitialMargin\": \"0.00024393\",\n       \"openOrderInitialMargin\": \"0\",\n       \"leverage\": \"10\",\n       \"isolated\": false,\n       \"positionSide\": \"BOTH\",\n       \"entryPrice\": \"41021.20000069\",\n       \"maxQty\": \"100\",\n       \"notionalValue\": \"0.00243939\",\n       \"isolatedWallet\": \"0\",\n       \"crossMargin\": \"0.314\"\n       \"crossWalletBalance\": \"34\",\n     }",
          "{\n         \"symbol\": \"CTSIUSDT\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.0\",\n         \"maxNotional\": \"25000\",\n         \"bidNotional\": \"0\",\n         \"askNotional\": \"0\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"updateTime\": 0,\n         \"notional\": \"0\",\n         \"breakEvenPrice\": \"0.0\"\n     }",
          "{\n         \"symbol\": \"TRXUSD_PERP\",\n         \"initialMargin\": \"0\",\n         \"maintMargin\": \"0\",\n         \"unrealizedProfit\": \"0.00000000\",\n         \"positionInitialMargin\": \"0\",\n         \"openOrderInitialMargin\": \"0\",\n         \"leverage\": \"20\",\n         \"entryPrice\": \"0.00000000\",\n         \"positionSide\": \"SHORT\",\n         \"positionAmt\": \"0\",\n         \"maxQty\": \"5000000\",\n         \"updateTime\": 0,\n         \"notionalValue\": \"0\",\n         \"breakEvenPrice\": \"0.00000000\"\n     }"
        ],
        "source": "parseAccountPosition (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        // v3 (similar for cross & isolated)\n        //\n        //    {\n        //        \"symbol\": \"WLDUSDT\",\n        //        \"positionSide\": \"BOTH\",\n        //        \"positionAmt\": \"-849\",\n        //        \"unrealizedProfit\": \"11.17920750\",\n        //        \"notional\": \"-1992.46079250\",\n        //        \"isolatedMargin\": \"0\",\n        //        \"isolatedWallet\": \"0\",\n        //        \"initialMargin\": \"99.62303962\",\n        //        \"maintMargin\": \"11.95476475\",\n        //        \"updateTime\": \"1721995760449\"\n        //        \"leverage\": \"50\",                        // in v2\n        //        \"entryPrice\": \"2.34\",                    // in v2\n        //        \"positionInitialMargin\": \"118.82116614\", // in v2\n        //        \"openOrderInitialMargin\": \"0\",           // in v2\n        //        \"isolated\": false,                       // in v2\n        //        \"breakEvenPrice\": \"2.3395788\",           // in v2\n        //        \"maxNotional\": \"25000\",                  // in v2\n        //        \"bidNotional\": \"0\",                      // in v2\n        //        \"askNotional\": \"0\"                       // in v2\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_210625\",\n        //       \"initialMargin\": \"0.00024393\",\n        //       \"maintMargin\": \"0.00002439\",\n        //       \"unrealizedProfit\": \"-0.00000163\",\n        //       \"positionInitialMargin\": \"0.00024393\",\n        //       \"openOrderInitialMargin\": \"0\",\n        //       \"leverage\": \"10\",\n        //       \"isolated\": false,\n        //       \"positionSide\": \"BOTH\",\n        //       \"entryPrice\": \"41021.20000069\",\n        //       \"maxQty\": \"100\",\n        //       \"notionalValue\": \"0.00243939\",\n        //       \"isolatedWallet\": \"0\",\n        //       \"crossMargin\": \"0.314\"\n        //       \"crossWalletBalance\": \"34\",\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"CTSIUSDT\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.0\",\n        //         \"maxNotional\": \"25000\",\n        //         \"bidNotional\": \"0\",\n        //         \"askNotional\": \"0\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"updateTime\": 0,\n        //         \"notional\": \"0\",\n        //         \"breakEvenPrice\": \"0.0\"\n        //     }\n        //\n        // inverse portoflio margin\n        //\n        //     {\n        //         \"symbol\": \"TRXUSD_PERP\",\n        //         \"initialMargin\": \"0\",\n        //         \"maintMargin\": \"0\",\n        //         \"unrealizedProfit\": \"0.00000000\",\n        //         \"positionInitialMargin\": \"0\",\n        //         \"openOrderInitialMargin\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"entryPrice\": \"0.00000000\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"positionAmt\": \"0\",\n        //         \"maxQty\": \"5000000\",\n        //         \"updateTime\": 0,\n        //         \"notionalValue\": \"0\",\n        //         \"breakEvenPrice\": \"0.00000000\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const leverageString = this.safeString (position, 'leverage');\n        const leverage = (leverageString !== undefined) ? parseInt (leverageString) : undefined;\n        const initialMarginString = this.safeString (position, 'initialMargin');\n        const initialMargin = this.parseNumber (initialMarginString);\n        let initialMarginPercentageString = undefined;\n        if (leverageString !== undefined) {\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            const rational = this.isRoundNumber (1000 % leverage);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringDiv (Precise.stringAdd (initialMarginPercentageString, '1e-8'), '1', 8);\n            }\n        }\n        // as oppose to notionalValue\n        const usdm = ('notional' in position);\n        const maintenanceMarginString = this.safeString (position, 'maintMargin');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        let entryPrice = this.parseNumber (entryPriceString);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        const notional = this.parseNumber (notionalStringAbs);\n        let contractsString = this.safeString (position, 'positionAmt');\n        let contractsStringAbs = Precise.stringAbs (contractsString);\n        if (contractsString === undefined) {\n            const entryNotional = Precise.stringMul (Precise.stringMul (leverageString, initialMarginString), entryPriceString);\n            const contractSizeNew = this.safeString (market, 'contractSize');\n            contractsString = Precise.stringDiv (entryNotional, contractSizeNew);\n            contractsStringAbs = Precise.stringDiv (Precise.stringAdd (contractsString, '0.5'), '1', 0);\n        }\n        const contracts = this.parseNumber (contractsStringAbs);\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        const unrealizedPnlString = this.safeString (position, 'unrealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        let isolated = this.safeBool (position, 'isolated');\n        if (isolated === undefined) {\n            const isolatedMarginRaw = this.safeString (position, 'isolatedMargin');\n            isolated = !Precise.stringEq (isolatedMarginRaw, '0');\n        }\n        let marginMode = undefined;\n        let collateralString = undefined;\n        let walletBalance = undefined;\n        if (isolated) {\n            marginMode = 'isolated';\n            walletBalance = this.safeString (position, 'isolatedWallet');\n            collateralString = Precise.stringAdd (walletBalance, unrealizedPnlString);\n        } else {\n            marginMode = 'cross';\n            walletBalance = this.safeString (position, 'crossWalletBalance');\n            collateralString = this.safeString (position, 'crossMargin');\n        }\n        const collateral = this.parseNumber (collateralString);\n        let marginRatio = undefined;\n        let side = undefined;\n        let percentage = undefined;\n        let liquidationPriceStringRaw = undefined;\n        let liquidationPrice = undefined;\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        if (Precise.stringEquals (notionalString, '0')) {\n            entryPrice = undefined;\n        } else {\n            side = Precise.stringLt (notionalString, '0') ? 'short' : 'long';\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n            if (usdm) {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (walletBalance / (contracts * (±1 + mmp))) + (±entryPrice / (±1 + mmp))\n                //\n                // mmp = maintenanceMarginPercentage\n                // where ± is negative for long and positive for short\n                // TODO: calculate liquidation price for coinm contracts\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const leftSide = Precise.stringDiv (walletBalance, Precise.stringMul (contractsStringAbs, onePlusMaintenanceMarginPercentageString));\n                const rightSide = Precise.stringDiv (entryPriceSignString, onePlusMaintenanceMarginPercentageString);\n                liquidationPriceStringRaw = Precise.stringAdd (leftSide, rightSide);\n            } else {\n                // calculate liquidation price\n                //\n                // liquidationPrice = (contracts * contractSize(±1 - mmp)) / (±1/entryPrice * contracts * contractSize - walletBalance)\n                //\n                let onePlusMaintenanceMarginPercentageString = undefined;\n                let entryPriceSignString = entryPriceString;\n                if (side === 'short') {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                } else {\n                    onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                    entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                }\n                const size = Precise.stringMul (contractsStringAbs, contractSizeString);\n                const leftSide = Precise.stringMul (size, onePlusMaintenanceMarginPercentageString);\n                const rightSide = Precise.stringSub (Precise.stringMul (Precise.stringDiv ('1', entryPriceSignString), size), walletBalance);\n                liquidationPriceStringRaw = Precise.stringDiv (leftSide, rightSide);\n            }\n            const pricePrecision = this.precisionFromString (this.safeString (market['precision'], 'price'));\n            const pricePrecisionPlusOne = pricePrecision + 1;\n            const pricePrecisionPlusOneString = pricePrecisionPlusOne.toString ();\n            // round half up\n            const rounder = new Precise ('5e-' + pricePrecisionPlusOneString);\n            const rounderString = rounder.toString ();\n            const liquidationPriceRoundedString = Precise.stringAdd (rounderString, liquidationPriceStringRaw);\n            let truncatedLiquidationPrice = Precise.stringDiv (liquidationPriceRoundedString, '1', pricePrecision);\n            if (truncatedLiquidationPrice[0] === '-') {\n                // user cannot be liquidated\n                // since he has more collateral than the size of the position\n                truncatedLiquidationPrice = undefined;\n            }\n            liquidationPrice = this.parseNumber (truncatedLiquidationPrice);\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return {\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'initialMargin': initialMargin,\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'entryPrice': entryPrice,\n            'notional': notional,\n            'leverage': this.parseNumber (leverageString),\n            'unrealizedPnl': unrealizedPnl,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'marginRatio': marginRatio,\n            'liquidationPrice': liquidationPrice,\n            'markPrice': undefined,\n            'collateral': collateral,\n            'marginMode': marginMode,\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseAccountPositions",
        "signature": "parseAccountPositions (account, filterClosed = false)",
        "line_start": 10043,
        "line_end": 10079,
        "comment": null,
        "mappings": [
          {
            "key": "crossMargin",
            "value": "balances[code]['crossMargin']",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "balances[code]['crossWalletBalance']",
            "comment": null
          },
          {
            "key": "crossMargin",
            "value": "Precise.stringAdd (crossWalletBalance, crossUnPnl)",
            "comment": null
          },
          {
            "key": "crossWalletBalance",
            "value": "crossWalletBalance",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccountPositions (account, filterClosed = false) {\n        const positions = this.safeList (account, 'positions');\n        const assets = this.safeList (account, 'assets', []);\n        const balances: Dict = {};\n        for (let i = 0; i < assets.length; i++) {\n            const entry = assets[i];\n            const currencyId = this.safeString (entry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const crossWalletBalance = this.safeString (entry, 'crossWalletBalance');\n            const crossUnPnl = this.safeString (entry, 'crossUnPnl');\n            balances[code] = {\n                'crossMargin': Precise.stringAdd (crossWalletBalance, crossUnPnl),\n                'crossWalletBalance': crossWalletBalance,\n            };\n        }\n        const result = [];\n        for (let i = 0; i < positions.length; i++) {\n            const position = positions[i];\n            const marketId = this.safeString (position, 'symbol');\n            const market = this.safeMarket (marketId, undefined, undefined, 'contract');\n            const code = market['linear'] ? market['quote'] : market['base'];\n            const maintenanceMargin = this.safeString (position, 'maintMargin');\n            // check for maintenance margin so empty positions are not returned\n            const isPositionOpen = (maintenanceMargin !== '0') && (maintenanceMargin !== '0.00000000');\n            if (!filterClosed || isPositionOpen) {\n                // sometimes not all the codes are correctly returned...\n                if (code in balances) {\n                    const parsed = this.parseAccountPosition (this.extend (position, {\n                        'crossMargin': balances[code]['crossMargin'],\n                        'crossWalletBalance': balances[code]['crossWalletBalance'],\n                    }), market);\n                    result.push (parsed);\n                }\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 14515,
        "line_end": 14563,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "rank",
            "comment": null
          },
          {
            "key": "rating",
            "value": "this.safeStringLower (info, 'adlRisk')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlRisk\": \"LOW\",\n         \"updateTime\": 1766827800453\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"adlQuantile\": {\n             \"LONG\": 0,\n             \"SHORT\": 0,\n             \"BOTH\": 1\n         }\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlRisk\": \"LOW\",\n        //         \"updateTime\": 1766827800453\n        //     }\n        //\n        // fetchPositionADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"adlQuantile\": {\n        //             \"LONG\": 0,\n        //             \"SHORT\": 0,\n        //             \"BOTH\": 1\n        //         }\n        //     }\n        //\n        const adlQuantile = this.safeDict (info, 'adlQuantile', {});\n        const longNum = this.safeNumber (adlQuantile, 'LONG');\n        const shortNum = this.safeNumber (adlQuantile, 'SHORT');\n        const both = this.safeNumber (adlQuantile, 'BOTH');\n        let rank = undefined;\n        if (both !== undefined) {\n            rank = both;\n        } else {\n            if (longNum !== undefined && shortNum !== undefined) {\n                if (longNum > shortNum) {\n                    rank = longNum;\n                } else {\n                    rank = shortNum;\n                }\n            }\n        }\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger2 (info, 'timestamp', 'updateTime');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': rank,\n            'rating': this.safeStringLower (info, 'adlRisk'),\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBalanceCustom",
        "signature": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances",
        "line_start": 3606,
        "line_end": 3717,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalanceCustom (response, type = undefined, marginMode = undefined, isPortfolioMargin = false): Balances {\n        const result = {\n            'info': response,\n        };\n        let timestamp = undefined;\n        const isolated = marginMode === 'isolated';\n        const cross = (type === 'margin') || (marginMode === 'cross');\n        if (isPortfolioMargin) {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                if (type === 'linear') {\n                    account['free'] = this.safeString (entry, 'umWalletBalance');\n                    account['used'] = this.safeString (entry, 'umUnrealizedPNL');\n                } else if (type === 'inverse') {\n                    account['free'] = this.safeString (entry, 'cmWalletBalance');\n                    account['used'] = this.safeString (entry, 'cmUnrealizedPNL');\n                } else if (cross) {\n                    const borrowed = this.safeString (entry, 'crossMarginBorrowed');\n                    const interest = this.safeString (entry, 'crossMarginInterest');\n                    account['debt'] = Precise.stringAdd (borrowed, interest);\n                    account['free'] = this.safeString (entry, 'crossMarginFree');\n                    account['used'] = this.safeString (entry, 'crossMarginLocked');\n                    account['total'] = this.safeString (entry, 'crossMarginAsset');\n                } else {\n                    const usedLinear = this.safeString (entry, 'umUnrealizedPNL');\n                    const usedInverse = this.safeString (entry, 'cmUnrealizedPNL');\n                    const totalUsed = Precise.stringAdd (usedLinear, usedInverse);\n                    const totalWalletBalance = this.safeString (entry, 'totalWalletBalance');\n                    account['total'] = Precise.stringAdd (totalUsed, totalWalletBalance);\n                }\n                result[code] = account;\n            }\n        } else if (!isolated && ((type === 'spot') || cross)) {\n            timestamp = this.safeInteger (response, 'updateTime');\n            const balances = this.safeList2 (response, 'balances', 'userAssets', []);\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'free');\n                account['used'] = this.safeString (balance, 'locked');\n                if (cross) {\n                    const debt = this.safeString (balance, 'borrowed');\n                    const interest = this.safeString (balance, 'interest');\n                    account['debt'] = Precise.stringAdd (debt, interest);\n                }\n                result[code] = account;\n            }\n        } else if (isolated) {\n            const assets = this.safeList (response, 'assets');\n            for (let i = 0; i < assets.length; i++) {\n                const asset = assets[i];\n                const marketId = this.safeString (asset, 'symbol');\n                const symbol = this.safeSymbol (marketId, undefined, undefined, 'spot');\n                const base = this.safeDict (asset, 'baseAsset', {});\n                const quote = this.safeDict (asset, 'quoteAsset', {});\n                const baseCode = this.safeCurrencyCode (this.safeString (base, 'asset'));\n                const quoteCode = this.safeCurrencyCode (this.safeString (quote, 'asset'));\n                const subResult: Dict = {};\n                subResult[baseCode] = this.parseBalanceHelper (base);\n                subResult[quoteCode] = this.parseBalanceHelper (quote);\n                result[symbol] = this.safeBalance (subResult);\n            }\n        } else if (type === 'savings') {\n            const positionAmountVos = this.safeList (response, 'positionAmountVos', []);\n            for (let i = 0; i < positionAmountVos.length; i++) {\n                const entry = positionAmountVos[i];\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                const usedAndTotal = this.safeString (entry, 'amount');\n                account['total'] = usedAndTotal;\n                account['used'] = usedAndTotal;\n                result[code] = account;\n            }\n        } else if (type === 'funding') {\n            for (let i = 0; i < response.length; i++) {\n                const entry = response[i];\n                const account = this.account ();\n                const currencyId = this.safeString (entry, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                account['free'] = this.safeString (entry, 'free');\n                const frozen = this.safeString (entry, 'freeze');\n                const withdrawing = this.safeString (entry, 'withdrawing');\n                const locked = this.safeString (entry, 'locked');\n                account['used'] = Precise.stringAdd (frozen, Precise.stringAdd (locked, withdrawing));\n                result[code] = account;\n            }\n        } else {\n            let balances = response;\n            if (!Array.isArray (response)) {\n                balances = this.safeList (response, 'assets', []);\n            }\n            for (let i = 0; i < balances.length; i++) {\n                const balance = balances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'availableBalance');\n                account['used'] = this.safeString (balance, 'initialMargin');\n                account['total'] = this.safeString2 (balance, 'marginBalance', 'balance');\n                result[code] = account;\n            }\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return isolated ? result : this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3596,
        "line_end": 3604,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString (entry, 'locked');\n        account['free'] = this.safeString (entry, 'free');\n        const interest = this.safeString (entry, 'interest');\n        const debt = this.safeString (entry, 'borrowed');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 12772,
        "line_end": 12787,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'asset'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'principal')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const symbol = this.safeString (info, 'isolatedSymbol');\n        const timestamp = this.safeInteger (info, 'interestAccuredTime');\n        const marginMode = (symbol === undefined) ? 'cross' : 'isolated';\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'asset')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'principal'),\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 12539,
        "line_end": 12558,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (info, 'dailyInterestRate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset\": \"USDT\",\n        \"timestamp\": 1638230400000,\n        \"dailyInterestRate\": \"0.0006\",\n        \"vipLevel\": 0\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"asset\": \"USDT\",\n        //        \"timestamp\": 1638230400000,\n        //        \"dailyInterestRate\": \"0.0006\",\n        //        \"vipLevel\": 0\n        //    }\n        //\n        const timestamp = this.safeInteger (info, 'timestamp');\n        const currencyId = this.safeString (info, 'asset');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber (info, 'dailyInterestRate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 14196,
        "line_end": 14284,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'targetAmount', 'toAmount')",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quoteId\":\"12415572564\",\n         \"ratio\":\"38163.7\",\n         \"inverseRatio\":\"0.0000262\",\n         \"validTimestamp\":1623319461670,\n         \"toAmount\":\"3816.37\",\n         \"fromAmount\":\"0.1\"\n     }",
          "{\n         \"orderId\":\"933256278426274426\",\n         \"createTime\":1623381330472,\n         \"orderStatus\":\"PROCESS\"\n     }",
          "{\n         \"tranId\": 118263407119,\n         \"status\": \"S\"\n     }",
          "{\n         \"tranId\": 118263615991,\n         \"type\": 244,\n         \"time\": 1664442078000,\n         \"deductedAsset\": \"BUSD\",\n         \"deductedAmount\": \"1\",\n         \"targetAsset\": \"USDC\",\n         \"targetAmount\": \"1\",\n         \"status\": \"S\",\n         \"accountType\": \"MAIN\"\n     }",
          "{\n         \"orderId\":933256278426274426,\n         \"orderStatus\":\"SUCCESS\",\n         \"fromAsset\":\"BTC\",\n         \"fromAmount\":\"0.00054414\",\n         \"toAsset\":\"USDT\",\n         \"toAmount\":\"20\",\n         \"ratio\":\"36755\",\n         \"inverseRatio\":\"0.00002721\",\n         \"createTime\":1623381330472\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"quoteId\":\"12415572564\",\n        //         \"ratio\":\"38163.7\",\n        //         \"inverseRatio\":\"0.0000262\",\n        //         \"validTimestamp\":1623319461670,\n        //         \"toAmount\":\"3816.37\",\n        //         \"fromAmount\":\"0.1\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"orderId\":\"933256278426274426\",\n        //         \"createTime\":1623381330472,\n        //         \"orderStatus\":\"PROCESS\"\n        //     }\n        //\n        // createConvertTrade BUSD\n        //\n        //     {\n        //         \"tranId\": 118263407119,\n        //         \"status\": \"S\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory BUSD\n        //\n        //     {\n        //         \"tranId\": 118263615991,\n        //         \"type\": 244,\n        //         \"time\": 1664442078000,\n        //         \"deductedAsset\": \"BUSD\",\n        //         \"deductedAmount\": \"1\",\n        //         \"targetAsset\": \"USDC\",\n        //         \"targetAmount\": \"1\",\n        //         \"status\": \"S\",\n        //         \"accountType\": \"MAIN\"\n        //     }\n        //\n        // fetchConvertTrade\n        //\n        //     {\n        //         \"orderId\":933256278426274426,\n        //         \"orderStatus\":\"SUCCESS\",\n        //         \"fromAsset\":\"BTC\",\n        //         \"fromAmount\":\"0.00054414\",\n        //         \"toAsset\":\"USDT\",\n        //         \"toAmount\":\"20\",\n        //         \"ratio\":\"36755\",\n        //         \"inverseRatio\":\"0.00002721\",\n        //         \"createTime\":1623381330472\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"quoteId\": \"f3b91c525b2644c7bc1e1cd31b6e1aa6\",\n        //         \"orderId\": 940708407462087195,\n        //         \"orderStatus\": \"SUCCESS\",\n        //         \"fromAsset\": \"USDT\",\n        //         \"fromAmount\": \"20\",\n        //         \"toAsset\": \"BNB\",\n        //         \"toAmount\": \"0.06154036\",\n        //         \"ratio\": \"0.00307702\",\n        //         \"inverseRatio\": \"324.99\",\n        //         \"createTime\": 1624248872184\n        //     }\n        //\n        const timestamp = this.safeIntegerN (conversion, [ 'time', 'validTimestamp', 'createTime' ]);\n        const fromCur = this.safeString2 (conversion, 'deductedAsset', 'fromAsset');\n        const fromCode = this.safeCurrencyCode (fromCur, fromCurrency);\n        const to = this.safeString2 (conversion, 'targetAsset', 'toAsset');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'tranId', 'orderId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'deductedAmount', 'fromAmount'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'targetAmount', 'toAmount'),\n            'price': undefined,\n            'fee': undefined,\n        } as Conversion;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress",
        "line_start": 9206,
        "line_end": 9234,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"XRP\",\n         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n         \"tag\": \"108618262\",\n         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n     }"
        ],
        "source": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"XRP\",\n        //         \"address\": \"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\",\n        //         \"tag\": \"108618262\",\n        //         \"url\": \"https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh\"\n        //     }\n        //\n        const url = this.safeString (response, 'url');\n        const address = this.safeString (response, 'address');\n        const currencyId = this.safeString (response, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        // deposit-address endpoint provides only network url (not network ID/CODE)\n        // so we should map the url to network (their data is inside currencies)\n        const networkCode = this.getNetworkCodeByNetworkUrl (code, url);\n        let tag = this.safeString (response, 'tag', '');\n        if (tag.length === 0) {\n            tag = undefined;\n        }\n        this.checkAddress (address);\n        return {\n            'info': response,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9409,
        "line_end": 9476,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"coin\": \"BAT\",\n        \"depositAllEnable\": true,\n        \"withdrawAllEnable\": true,\n        \"name\": \"Basic Attention Token\",\n        \"free\": \"0\",\n        \"locked\": \"0\",\n        \"freeze\": \"0\",\n        \"withdrawing\": \"0\",\n        \"ipoing\": \"0\",\n        \"ipoable\": \"0\",\n        \"storage\": \"0\",\n        \"isLegalMoney\": false,\n        \"trading\": true,\n        \"networkList\": [\n            {\n                \"network\": \"BNB\",\n                \"coin\": \"BAT\",\n                \"withdrawIntegerMultiple\": \"0.00000001\",\n                \"isDefault\": false,\n                \"depositEnable\": true,\n                \"withdrawEnable\": true,\n                \"depositDesc\": '',\n                \"withdrawDesc\": '',\n                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n                \"name\": \"BEP2\",\n                \"resetAddressStatus\": false,\n                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n                \"withdrawFee\": \"0.27\",\n                \"withdrawMin\": \"0.54\",\n                \"withdrawMax\": \"10000000000\",\n                \"minConfirm\": \"1\",\n                \"unLockConfirm\": \"0\"\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"coin\": \"BAT\",\n        //        \"depositAllEnable\": true,\n        //        \"withdrawAllEnable\": true,\n        //        \"name\": \"Basic Attention Token\",\n        //        \"free\": \"0\",\n        //        \"locked\": \"0\",\n        //        \"freeze\": \"0\",\n        //        \"withdrawing\": \"0\",\n        //        \"ipoing\": \"0\",\n        //        \"ipoable\": \"0\",\n        //        \"storage\": \"0\",\n        //        \"isLegalMoney\": false,\n        //        \"trading\": true,\n        //        \"networkList\": [\n        //            {\n        //                \"network\": \"BNB\",\n        //                \"coin\": \"BAT\",\n        //                \"withdrawIntegerMultiple\": \"0.00000001\",\n        //                \"isDefault\": false,\n        //                \"depositEnable\": true,\n        //                \"withdrawEnable\": true,\n        //                \"depositDesc\": '',\n        //                \"withdrawDesc\": '',\n        //                \"specialTips\": \"The name of this asset is Basic Attention Token (BAT). Both a MEMO and an Address are required to successfully deposit your BEP2 tokens to Binance.\",\n        //                \"name\": \"BEP2\",\n        //                \"resetAddressStatus\": false,\n        //                \"addressRegex\": \"^(bnb1)[0-9a-z]{38}$\",\n        //                \"memoRegex\": \"^[0-9A-Za-z\\\\-_]{1,120}$\",\n        //                \"withdrawFee\": \"0.27\",\n        //                \"withdrawMin\": \"0.54\",\n        //                \"withdrawMax\": \"10000000000\",\n        //                \"minConfirm\": \"1\",\n        //                \"unLockConfirm\": \"0\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const networkList = this.safeList (fee, 'networkList', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.networkIdToCode (networkId);\n            const withdrawFee = this.safeNumber (networkEntry, 'withdrawFee');\n            const isDefault = this.safeBool (networkEntry, 'isDefault');\n            if (isDefault === true) {\n                result['withdraw'] = {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                };\n            }\n            result['networks'][networkCode] = {\n                'withdraw': {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseDustTrade",
        "signature": "parseDustTrade (trade, market: Market = undefined)",
        "line_start": 8290,
        "line_end": 8360,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "currency",
            "value": "earnedCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostString)",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"fromAsset\": \"USDT\",\n       \"amount\": \"0.009669\",\n       \"transferedAmount\": \"0.00002992\",\n       \"serviceChargeAmount\": \"0.00000059\",\n       \"operateTime\": \"1628076010000\",\n       \"transId\": \"71416578712\",\n       \"isDustTrade\": true\n     }"
        ],
        "source": "parseDustTrade (trade, market: Market = undefined) {\n        //\n        //     {\n        //       \"fromAsset\": \"USDT\",\n        //       \"amount\": \"0.009669\",\n        //       \"transferedAmount\": \"0.00002992\",\n        //       \"serviceChargeAmount\": \"0.00000059\",\n        //       \"operateTime\": \"1628076010000\",\n        //       \"transId\": \"71416578712\",\n        //       \"isDustTrade\": true\n        //     }\n        //\n        const orderId = this.safeString (trade, 'transId');\n        const timestamp = this.safeInteger (trade, 'operateTime');\n        const currencyId = this.safeString (trade, 'fromAsset');\n        const tradedCurrency = this.safeCurrencyCode (currencyId);\n        const bnb = this.currency ('BNB');\n        const earnedCurrency = bnb['code'];\n        const applicantSymbol = earnedCurrency + '/' + tradedCurrency;\n        let tradedCurrencyIsQuote = false;\n        if (applicantSymbol in this.markets) {\n            tradedCurrencyIsQuote = true;\n        }\n        const feeCostString = this.safeString (trade, 'serviceChargeAmount');\n        const fee = {\n            'currency': earnedCurrency,\n            'cost': this.parseNumber (feeCostString),\n        };\n        let symbol = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        let side = undefined;\n        if (tradedCurrencyIsQuote) {\n            symbol = applicantSymbol;\n            amountString = this.safeString (trade, 'transferedAmount');\n            costString = this.safeString (trade, 'amount');\n            side = 'buy';\n        } else {\n            symbol = tradedCurrency + '/' + earnedCurrency;\n            amountString = this.safeString (trade, 'amount');\n            costString = this.safeString (trade, 'transferedAmount');\n            side = 'sell';\n        }\n        let priceString = undefined;\n        if (costString !== undefined) {\n            if (amountString) {\n                priceString = Precise.stringDiv (costString, amountString);\n            }\n        }\n        const id = undefined;\n        const amount = this.parseNumber (amountString);\n        const price = this.parseNumber (priceString);\n        const cost = this.parseNumber (costString);\n        const type = undefined;\n        const takerOrMaker = undefined;\n        return {\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'amount': amount,\n            'price': price,\n            'cost': cost,\n            'fee': fee,\n            'info': trade,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 9981,
        "line_end": 10041,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "estimatedSettlePrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"45802.81129892\",\n         \"indexPrice\": \"45745.47701915\",\n         \"estimatedSettlePrice\": \"45133.91753671\",\n         \"lastFundingRate\": \"0.00063521\",\n         \"interestRate\": \"0.00010000\",\n         \"nextFundingTime\": \"1621267200000\",\n         \"time\": \"1621252344001\"\n     }",
          "{\n         \"symbol\": \"BLZUSDT\",\n         \"adjustedFundingRateCap\": \"0.03000000\",\n         \"adjustedFundingRateFloor\": \"-0.03000000\",\n         \"fundingIntervalHours\": 4,\n         \"disclaimer\": false\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        // ensure it matches with https://www.binance.com/en/futures/funding-history/0\n        //\n        // fetchFundingRate, fetchFundingRates\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"45802.81129892\",\n        //         \"indexPrice\": \"45745.47701915\",\n        //         \"estimatedSettlePrice\": \"45133.91753671\",\n        //         \"lastFundingRate\": \"0.00063521\",\n        //         \"interestRate\": \"0.00010000\",\n        //         \"nextFundingTime\": \"1621267200000\",\n        //         \"time\": \"1621252344001\"\n        //     }\n        //\n        // fetchFundingInterval, fetchFundingIntervals\n        //\n        //     {\n        //         \"symbol\": \"BLZUSDT\",\n        //         \"adjustedFundingRateCap\": \"0.03000000\",\n        //         \"adjustedFundingRateFloor\": \"-0.03000000\",\n        //         \"fundingIntervalHours\": 4,\n        //         \"disclaimer\": false\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'time');\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        const interestRate = this.safeNumber (contract, 'interestRate');\n        const estimatedSettlePrice = this.safeNumber (contract, 'estimatedSettlePrice');\n        const fundingRate = this.safeNumber (contract, 'lastFundingRate');\n        const fundingTime = this.safeInteger (contract, 'nextFundingTime');\n        const interval = this.safeString (contract, 'fundingIntervalHours');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'estimatedSettlePrice': estimatedSettlePrice,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 9933,
        "line_end": 9949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"fundingRate\": \"0.00063521\",\n         \"fundingTime\": \"1621267200000\",\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"fundingRate\": \"0.00063521\",\n        //         \"fundingTime\": \"1621267200000\",\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (this.safeString (contract, 'symbol'), undefined, undefined, 'swap'),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 13475,
        "line_end": 13514,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidIV')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askIV')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markIV')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-231229-40000-C\",\n         \"markPrice\": \"2012\",\n         \"bidIV\": \"0.60236275\",\n         \"askIV\": \"0.62267244\",\n         \"markIV\": \"0.6125176\",\n         \"delta\": \"0.39111646\",\n         \"theta\": \"-32.13948531\",\n         \"gamma\": \"0.00004656\",\n         \"vega\": \"51.70062218\",\n         \"highPriceLimit\": \"6474\",\n         \"lowPriceLimit\": \"5\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"symbol\": \"BTC-231229-40000-C\",\n        //         \"markPrice\": \"2012\",\n        //         \"bidIV\": \"0.60236275\",\n        //         \"askIV\": \"0.62267244\",\n        //         \"markIV\": \"0.6125176\",\n        //         \"delta\": \"0.39111646\",\n        //         \"theta\": \"-32.13948531\",\n        //         \"gamma\": \"0.00004656\",\n        //         \"vega\": \"51.70062218\",\n        //         \"highPriceLimit\": \"6474\",\n        //         \"lowPriceLimit\": \"5\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidIV'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askIV'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markIV'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': this.safeNumber (greeks, 'markPrice'),\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 8890,
        "line_end": 8915,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'tranId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'income')",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"ETHUSDT\",\n       \"incomeType\": \"FUNDING_FEE\",\n       \"income\": \"0.00134317\",\n       \"asset\": \"USDT\",\n       \"time\": \"1621584000000\",\n       \"info\": \"FUNDING_FEE\",\n       \"tranId\": \"4480321991774044580\",\n       \"tradeId\": \"\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"symbol\": \"ETHUSDT\",\n        //       \"incomeType\": \"FUNDING_FEE\",\n        //       \"income\": \"0.00134317\",\n        //       \"asset\": \"USDT\",\n        //       \"time\": \"1621584000000\",\n        //       \"info\": \"FUNDING_FEE\",\n        //       \"tranId\": \"4480321991774044580\",\n        //       \"tradeId\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const currencyId = this.safeString (income, 'asset');\n        const timestamp = this.safeInteger (income, 'time');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'tranId'),\n            'amount': this.safeNumber (income, 'income'),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 12560,
        "line_end": 12596,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeString (baseInfo, 'coin')",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeString (quoteInfo, 'coin')",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteInfo, 'dailyInterest')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"vipLevel\": 0,\n        \"symbol\": \"BTCUSDT\",\n        \"leverage\": \"10\",\n        \"data\": [\n            {\n                \"coin\": \"BTC\",\n                \"dailyInterest\": \"0.00026125\",\n                \"borrowLimit\": \"270\"\n            },\n            {\n                \"coin\": \"USDT\",\n                \"dailyInterest\": \"0.000475\",\n                \"borrowLimit\": \"2100000\"\n            }\n        ]\n    }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //    {\n        //        \"vipLevel\": 0,\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"leverage\": \"10\",\n        //        \"data\": [\n        //            {\n        //                \"coin\": \"BTC\",\n        //                \"dailyInterest\": \"0.00026125\",\n        //                \"borrowLimit\": \"270\"\n        //            },\n        //            {\n        //                \"coin\": \"USDT\",\n        //                \"dailyInterest\": \"0.000475\",\n        //                \"borrowLimit\": \"2100000\"\n        //            }\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'spot');\n        const data = this.safeList (info, 'data');\n        const baseInfo = this.safeDict (data, 0);\n        const quoteInfo = this.safeDict (data, 1);\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'base': this.safeString (baseInfo, 'coin'),\n            'baseRate': this.safeNumber (baseInfo, 'dailyInterest'),\n            'quote': this.safeString (quoteInfo, 'coin'),\n            'quoteRate': this.safeNumber (quoteInfo, 'dailyInterest'),\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 4424,
        "line_end": 4463,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumberOmitZero (entry, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"price\": \"4.00000200\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"price\": \"6000.01\",\n         \"time\": 1589437530011   // Transaction time\n     }",
          "{\n         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n         \"ps\": \"BTCUSD\", // pair\n         \"price\": \"9647.8\",\n         \"time\": 1591257246176\n     }"
        ],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"price\": \"4.00000200\"\n        //     }\n        //\n        // usdm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"price\": \"6000.01\",\n        //         \"time\": 1589437530011   // Transaction time\n        //     }\n        //\n        //\n        // coinm (swap/future)\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD_200626\", // symbol (\"BTCUSD_200626\", \"BTCUSD_PERP\", etc..)\n        //         \"ps\": \"BTCUSD\", // pair\n        //         \"price\": \"9647.8\",\n        //         \"time\": 1591257246176\n        //     }\n        //\n        const timestamp = this.safeInteger (entry, 'time');\n        const type = (timestamp === undefined) ? 'spot' : 'swap';\n        const marketId = this.safeString (entry, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, type);\n        return {\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'price': this.safeNumberOmitZero (entry, 'price'),\n            'side': undefined,\n            'info': entry,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 11884,
        "line_end": 11939,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (item, 'id', 'tranId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tradeId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1125899906845701870\",\n         \"asset\": \"USDT\",\n         \"amount\": \"-0.16518203\",\n         \"type\": \"FEE\",\n         \"createDate\": 167662104241\n     }",
          "{\n         \"symbol\": \"\",\n         \"incomeType\": \"TRANSFER\",\n         \"income\": \"10.00000000\",\n         \"asset\": \"USDT\",\n         \"time\": 1677645250000,\n         \"info\": \"TRANSFER\",\n         \"tranId\": 131001573082,\n         \"tradeId\": \"\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // options (eapi)\n        //\n        //     {\n        //         \"id\": \"1125899906845701870\",\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"-0.16518203\",\n        //         \"type\": \"FEE\",\n        //         \"createDate\": 167662104241\n        //     }\n        //\n        // futures (fapi, dapi, papi)\n        //\n        //     {\n        //         \"symbol\": \"\",\n        //         \"incomeType\": \"TRANSFER\",\n        //         \"income\": \"10.00000000\",\n        //         \"asset\": \"USDT\",\n        //         \"time\": 1677645250000,\n        //         \"info\": \"TRANSFER\",\n        //         \"tranId\": 131001573082,\n        //         \"tradeId\": \"\"\n        //     }\n        //\n        let amount = this.safeString2 (item, 'amount', 'income');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger2 (item, 'createDate', 'time');\n        const type = this.safeString2 (item, 'type', 'incomeType');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString2 (item, 'id', 'tranId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tradeId'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 11941,
        "line_end": 11964,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'FEE': 'fee',\n            'FUNDING_FEE': 'fee',\n            'OPTIONS_PREMIUM_FEE': 'fee',\n            'POSITION_LIMIT_INCREASE_FEE': 'fee',\n            'CONTRACT': 'trade',\n            'REALIZED_PNL': 'trade',\n            'TRANSFER': 'transfer',\n            'CROSS_COLLATERAL_TRANSFER': 'transfer',\n            'INTERNAL_TRANSFER': 'transfer',\n            'COIN_SWAP_DEPOSIT': 'deposit',\n            'COIN_SWAP_WITHDRAW': 'withdrawal',\n            'OPTIONS_SETTLE_PROFIT': 'settlement',\n            'DELIVERED_SETTELMENT': 'settlement',\n            'WELCOME_BONUS': 'cashback',\n            'CONTEST_REWARD': 'cashback',\n            'COMMISSION_REBATE': 'rebate',\n            'API_REBATE': 'rebate',\n            'REFERRAL_KICKBACK': 'referral',\n            'COMMISSION': 'commission',\n        };\n        return this.safeString (ledgerType, type, type);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 11527,
        "line_end": 11557,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const marginModeRaw = this.safeBool (leverage, 'isolated');\n        let marginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            marginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (leverage, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            marginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        const side = this.safeStringLower (leverage, 'positionSide');\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        if ((side === undefined) || (side === 'both')) {\n            longLeverage = leverageValue;\n            shortLeverage = leverageValue;\n        } else if (side === 'long') {\n            longLeverage = leverageValue;\n        } else if (side === 'short') {\n            shortLeverage = leverageValue;\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 13312,
        "line_end": 13395,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (liquidation, 'executedQty')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'avgPrice')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'side')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'cumBase')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.safeNumber (liquidation, 'cumQuote')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"avgPrice\": \"0.00388359\",\n         \"executedQty\": \"31.39000000\",\n         \"orderId\": 180015097,\n         \"price\": \"0.00388110\",\n         \"qty\": \"31.39000000\",\n         \"side\": \"SELL\",\n         \"symbol\": \"BNBBTC\",\n         \"timeInForce\": \"GTC\",\n         \"isIsolated\": true,\n         \"updatedTime\": 1558941374745\n     }",
          "{\n         \"orderId\": 6071832819,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596107620040000020\",\n         \"price\": \"10871.09\",\n         \"avgPrice\": \"10913.21000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0.002\",\n         \"cumQuote\": \"10.91321\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"origType\": \"LIMIT\",\n         \"time\": 1596107620044,\n         \"updateTime\": 1596107620087\n     }",
          "{\n         \"orderId\": 165123080,\n         \"symbol\": \"BTCUSD_200925\",\n         \"pair\": \"BTCUSD\",\n         \"status\": \"FILLED\",\n         \"clientOrderId\": \"autoclose-1596542005017000006\",\n         \"price\": \"11326.9\",\n         \"avgPrice\": \"11326.9\",\n         \"origQty\": \"1\",\n         \"executedQty\": \"1\",\n         \"cumBase\": \"0.00882854\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"SELL\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"time\": 1596542005019,\n         \"updateTime\": 1596542005050\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // margin\n        //\n        //     {\n        //         \"avgPrice\": \"0.00388359\",\n        //         \"executedQty\": \"31.39000000\",\n        //         \"orderId\": 180015097,\n        //         \"price\": \"0.00388110\",\n        //         \"qty\": \"31.39000000\",\n        //         \"side\": \"SELL\",\n        //         \"symbol\": \"BNBBTC\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"isIsolated\": true,\n        //         \"updatedTime\": 1558941374745\n        //     }\n        //\n        // linear\n        //\n        //     {\n        //         \"orderId\": 6071832819,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596107620040000020\",\n        //         \"price\": \"10871.09\",\n        //         \"avgPrice\": \"10913.21000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0.002\",\n        //         \"cumQuote\": \"10.91321\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596107620044,\n        //         \"updateTime\": 1596107620087\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"orderId\": 165123080,\n        //         \"symbol\": \"BTCUSD_200925\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"FILLED\",\n        //         \"clientOrderId\": \"autoclose-1596542005017000006\",\n        //         \"price\": \"11326.9\",\n        //         \"avgPrice\": \"11326.9\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"1\",\n        //         \"cumBase\": \"0.00882854\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"SELL\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1596542005019,\n        //         \"updateTime\": 1596542005050\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger2 (liquidation, 'updatedTime', 'updateTime');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.safeNumber (liquidation, 'executedQty'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'avgPrice'),\n            'side': this.safeStringLower (liquidation, 'side'),\n            'baseValue': this.safeNumber (liquidation, 'cumBase'),\n            'quoteValue': this.safeNumber (liquidation, 'cumQuote'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 14396,
        "line_end": 14428,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"longAccount\": \"0.4558\",\n         \"longShortRatio\": \"0.8376\",\n         \"shortAccount\": \"0.5442\",\n         \"timestamp\": 1726790400000\n     }",
          "{\n         \"longAccount\": \"0.7262\",\n         \"longShortRatio\": \"2.6523\",\n         \"shortAccount\": \"0.2738\",\n         \"pair\": \"BTCUSD\",\n         \"timestamp\": 1726790400000\n     }"
        ],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        //\n        // linear\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"longAccount\": \"0.4558\",\n        //         \"longShortRatio\": \"0.8376\",\n        //         \"shortAccount\": \"0.5442\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        // inverse\n        //\n        //     {\n        //         \"longAccount\": \"0.7262\",\n        //         \"longShortRatio\": \"2.6523\",\n        //         \"shortAccount\": \"0.2738\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"timestamp\": 1726790400000\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeIntegerOmitZero (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 12953,
        "line_end": 12981,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'tranId')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\": 108988250265,\n         \"clientTag\":\"\"\n     }",
          "{\n         \"asset\": \"USDC\",\n         \"amount\": 10,\n         \"specifyRepayAssets\": null,\n         \"updateTime\": 1727170761267,\n         \"success\": true\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"tranId\": 108988250265,\n        //         \"clientTag\":\"\"\n        //     }\n        //\n        // repayCrossMargin alternative endpoint\n        //\n        //     {\n        //         \"asset\": \"USDC\",\n        //         \"amount\": 10,\n        //         \"specifyRepayAssets\": null,\n        //         \"updateTime\": 1727170761267,\n        //         \"success\": true\n        //     }\n        //\n        const currencyId = this.safeString (info, 'asset');\n        const timestamp = this.safeInteger (info, 'updateTime');\n        return {\n            'id': this.safeInteger (info, 'tranId'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amount'),\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 13705,
        "line_end": 13722,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "reMarginMode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const marginModeRaw = this.safeBool (marginMode, 'isolated');\n        let reMarginMode = undefined;\n        if (marginModeRaw !== undefined) {\n            reMarginMode = marginModeRaw ? 'isolated' : 'cross';\n        }\n        const marginTypeRaw = this.safeStringLower (marginMode, 'marginType');\n        if (marginTypeRaw !== undefined) {\n            reMarginMode = (marginTypeRaw === 'crossed') ? 'cross' : 'isolated';\n        }\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': reMarginMode,\n        } as MarginMode;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 12323,
        "line_end": 12366,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "(rawType === 1) ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (data, 'asset')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "(success || noErrorCode) ? 'ok' : 'failed'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 200,\n         \"msg\": \"Successfully modify position margin.\",\n         \"amount\": 0.001,\n         \"type\": 1\n     }",
          "{\n        symbol: \"XRPUSDT\",\n        type: \"1\",\n        deltaType: \"TRADE\",\n        amount: \"2.57148240\",\n        asset: \"USDT\",\n        time: \"1711046271555\",\n        positionSide: \"BOTH\",\n        clientTranId: \"\"\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // add/reduce margin\n        //\n        //     {\n        //         \"code\": 200,\n        //         \"msg\": \"Successfully modify position margin.\",\n        //         \"amount\": 0.001,\n        //         \"type\": 1\n        //     }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        symbol: \"XRPUSDT\",\n        //        type: \"1\",\n        //        deltaType: \"TRADE\",\n        //        amount: \"2.57148240\",\n        //        asset: \"USDT\",\n        //        time: \"1711046271555\",\n        //        positionSide: \"BOTH\",\n        //        clientTranId: \"\"\n        //    }\n        //\n        const rawType = this.safeInteger (data, 'type');\n        const errorCode = this.safeString (data, 'code');\n        const marketId = this.safeString (data, 'symbol');\n        const timestamp = this.safeInteger (data, 'time');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const noErrorCode = errorCode === undefined;\n        const success = errorCode === '200';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': (rawType === 1) ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'code': this.safeString (data, 'asset'),\n            'total': undefined,\n            'status': (success || noErrorCode) ? 'ok' : 'failed',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 3413,
        "line_end": 3594,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "lowercaseId",
            "value": "lowercaseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "unifiedType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && isMarginTradingAllowed",
            "comment": null
          },
          {
            "key": "marginModes",
            "value": "marginModes",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "parsedStrike",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "this.safeStringLower (market, 'side')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'onboardDate')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale')))",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision')))",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (filter, 'minQty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (filter, 'maxQty')",
            "comment": null
          }
        ],
        "examples": [
          "therefore limits['price']['max'] doesn't have any meaningful value except undefined"
        ],
        "source": "parseMarket (market: Dict): Market {\n        let swap = false;\n        let future = false;\n        let option = false;\n        const underlying = this.safeString (market, 'underlying');\n        const id = this.safeString (market, 'symbol');\n        const optionParts = id.split ('-');\n        const optionBase = this.safeString (optionParts, 0);\n        const lowercaseId = this.safeStringLower (market, 'symbol');\n        const baseId = this.safeString (market, 'baseAsset', optionBase);\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const contractType = this.safeString (market, 'contractType');\n        let contract = ('contractType' in market);\n        let expiry = this.safeInteger2 (market, 'deliveryDate', 'expiryDate');\n        let settleId = this.safeString (market, 'marginAsset');\n        if ((contractType === 'PERPETUAL') || (expiry === 4133404800000)) { // some swap markets do not have contract type, eg: BTCST\n            expiry = undefined;\n            swap = true;\n        } else if (underlying !== undefined) {\n            contract = true;\n            option = true;\n            settleId = (settleId === undefined) ? 'USDT' : settleId;\n        } else if (expiry !== undefined) {\n            future = true;\n        }\n        const settle = this.safeCurrencyCode (settleId);\n        const spot = !contract;\n        const filters = this.safeList (market, 'filters', []);\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const status = this.safeString2 (market, 'status', 'contractStatus');\n        let contractSize = undefined;\n        let fees = this.fees;\n        let linear = undefined;\n        let inverse = undefined;\n        let symbol = base + '/' + quote;\n        let strike = undefined;\n        if (contract) {\n            if (swap) {\n                symbol = symbol + ':' + settle;\n            } else if (future) {\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry);\n            } else if (option) {\n                strike = this.numberToString (this.parseToNumeric (this.safeString (market, 'strikePrice')));\n                symbol = symbol + ':' + settle + '-' + this.yymmdd (expiry) + '-' + strike + '-' + this.safeString (optionParts, 3);\n            }\n            contractSize = this.safeNumber2 (market, 'contractSize', 'unit', this.parseNumber ('1'));\n            linear = settle === quote;\n            inverse = settle === base;\n            const feesType = linear ? 'linear' : 'inverse';\n            fees = this.safeDict (this.fees, feesType, {}) as any;\n        }\n        let active = (status === 'TRADING');\n        if (spot) {\n            const permissions = this.safeList (market, 'permissions', []);\n            for (let j = 0; j < permissions.length; j++) {\n                if (permissions[j] === 'TRD_GRP_003') {\n                    active = false;\n                    break;\n                }\n            }\n        }\n        const isMarginTradingAllowed = this.safeBool (market, 'isMarginTradingAllowed', false);\n        let marginModes = undefined;\n        if (spot) {\n            const hasCrossMargin = this.inArray (id, this.options['crossMarginPairsData']);\n            const hasIsolatedMargin = this.inArray (id, this.options['isolatedMarginPairsData']);\n            marginModes = {\n                'cross': hasCrossMargin,\n                'isolated': hasIsolatedMargin,\n            };\n        } else if (linear || inverse) {\n            marginModes = {\n                'cross': true,\n                'isolated': true,\n            };\n        }\n        let unifiedType = undefined;\n        if (spot) {\n            unifiedType = 'spot';\n        } else if (swap) {\n            unifiedType = 'swap';\n        } else if (future) {\n            unifiedType = 'future';\n        } else if (option) {\n            unifiedType = 'option';\n            active = undefined;\n        }\n        let parsedStrike = undefined;\n        if (strike !== undefined) {\n            parsedStrike = this.parseToNumeric (strike);\n        }\n        const entry = {\n            'id': id,\n            'lowercaseId': lowercaseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': unifiedType,\n            'spot': spot,\n            'margin': spot && isMarginTradingAllowed,\n            'marginModes': marginModes,\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': fees['trading']['taker'],\n            'maker': fees['trading']['maker'],\n            'contractSize': contractSize,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': parsedStrike,\n            'optionType': this.safeStringLower (market, 'side'),\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'quantityPrecision', 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString2 (market, 'pricePrecision', 'priceScale'))),\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseAssetPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minQty'),\n                    'max': this.safeNumber (market, 'maxQty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n            'created': this.safeInteger (market, 'onboardDate'), // present in inverse & linear apis\n        };\n        if ('PRICE_FILTER' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n            // PRICE_FILTER reports zero values for maxPrice\n            // since they updated filter types in November 2018\n            // https://github.com/ccxt/ccxt/issues/4286\n            // therefore limits['price']['max'] doesn't have any meaningful value except undefined\n            entry['limits']['price'] = {\n                'min': this.safeNumber (filter, 'minPrice'),\n                'max': this.safeNumber (filter, 'maxPrice'),\n            };\n            entry['precision']['price'] = this.safeNumber (filter, 'tickSize');\n        }\n        if ('LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n            entry['precision']['amount'] = this.safeNumber (filter, 'stepSize');\n            entry['limits']['amount'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if ('MARKET_LOT_SIZE' in filtersByType) {\n            const filter = this.safeDict (filtersByType, 'MARKET_LOT_SIZE', {});\n            entry['limits']['market'] = {\n                'min': this.safeNumber (filter, 'minQty'),\n                'max': this.safeNumber (filter, 'maxQty'),\n            };\n        }\n        if (('MIN_NOTIONAL' in filtersByType) || ('NOTIONAL' in filtersByType)) { // notional added in 12/04/23 to spot testnet\n            const filter = this.safeDict2 (filtersByType, 'MIN_NOTIONAL', 'NOTIONAL', {});\n            entry['limits']['cost']['min'] = this.safeNumber2 (filter, 'minNotional', 'notional');\n            entry['limits']['cost']['max'] = this.safeNumber (filter, 'maxNotional');\n        }\n        return entry;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 10697,
        "line_end": 10738,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "{\n        \"symbol\": \"SUSHIUSDT\",\n        \"brackets\": [\n            {\n                \"bracket\": 1,\n                \"initialLeverage\": 50,\n                \"notionalCap\": 50000,\n                \"notionalFloor\": 0,\n                \"maintMarginRatio\": 0.01,\n                \"cum\": 0.0\n            },\n            ...\n        ]\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\": \"SUSHIUSDT\",\n        //        \"brackets\": [\n        //            {\n        //                \"bracket\": 1,\n        //                \"initialLeverage\": 50,\n        //                \"notionalCap\": 50000,\n        //                \"notionalFloor\": 0,\n        //                \"maintMarginRatio\": 0.01,\n        //                \"cum\": 0.0\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const brackets = this.safeList (info, 'brackets', []);\n        const tiers = [];\n        for (let j = 0; j < brackets.length; j++) {\n            const bracket = brackets[j];\n            tiers.push ({\n                'tier': this.safeNumber (bracket, 'bracket'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber2 (bracket, 'notionalFloor', 'qtyFloor'),\n                'maxNotional': this.safeNumber2 (bracket, 'notionalCap', 'qtyCap'),\n                'maintenanceMarginRate': this.safeNumber (bracket, 'maintMarginRatio'),\n                'maxLeverage': this.safeNumber (bracket, 'initialLeverage'),\n                'info': bracket,\n            });\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 4595,
        "line_end": 4657,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591478520000, // open time\n         \"0.02501300\",  // open\n         \"0.02501800\",  // high\n         \"0.02500000\",  // low\n         \"0.02500000\",  // close\n         \"22.19000000\", // volume\n         1591478579999, // close time\n         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n         40,            // number of trades\n         \"10.92900000\", // taker buy base asset volume\n         \"0.27336462\",  // taker buy quote asset volume\n         \"0\"            // ignore\n     ]",
          "[\n         [\n         1591256460000,          // Open time\n         \"9653.29201333\",        // Open\n         \"9654.56401333\",        // High\n         \"9653.07367333\",        // Low\n         \"9653.07367333\",        // Close (or latest price)\n         \"0\",                    // Ignore\n         1591256519999,          // Close time\n         \"0\",                    // Ignore\n         60,                     // Number of bisic data\n         \"0\",                    // Ignore\n         \"0\",                    // Ignore\n         \"0\"                     // Ignore\n         ]\n     ]",
          "{\n         \"open\": \"32.2\",\n         \"high\": \"32.2\",\n         \"low\": \"32.2\",\n         \"close\": \"32.2\",\n         \"volume\": \"0\",\n         \"interval\": \"5m\",\n         \"tradeCount\": 0,\n         \"takerVolume\": \"0\",\n         \"takerAmount\": \"0\",\n         \"amount\": \"0\",\n         \"openTime\": 1677096900000,\n         \"closeTime\": 1677097200000\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // when api method = publicGetKlines || fapiPublicGetKlines || dapiPublicGetKlines\n        //     [\n        //         1591478520000, // open time\n        //         \"0.02501300\",  // open\n        //         \"0.02501800\",  // high\n        //         \"0.02500000\",  // low\n        //         \"0.02500000\",  // close\n        //         \"22.19000000\", // volume\n        //         1591478579999, // close time\n        //         \"0.55490906\",  // quote asset volume, base asset volume for dapi\n        //         40,            // number of trades\n        //         \"10.92900000\", // taker buy base asset volume\n        //         \"0.27336462\",  // taker buy quote asset volume\n        //         \"0\"            // ignore\n        //     ]\n        //\n        //  when api method = fapiPublicGetMarkPriceKlines || fapiPublicGetIndexPriceKlines\n        //     [\n        //         [\n        //         1591256460000,          // Open time\n        //         \"9653.29201333\",        // Open\n        //         \"9654.56401333\",        // High\n        //         \"9653.07367333\",        // Low\n        //         \"9653.07367333\",        // Close (or latest price)\n        //         \"0\",                    // Ignore\n        //         1591256519999,          // Close time\n        //         \"0\",                    // Ignore\n        //         60,                     // Number of bisic data\n        //         \"0\",                    // Ignore\n        //         \"0\",                    // Ignore\n        //         \"0\"                     // Ignore\n        //         ]\n        //     ]\n        //\n        // options\n        //\n        //     {\n        //         \"open\": \"32.2\",\n        //         \"high\": \"32.2\",\n        //         \"low\": \"32.2\",\n        //         \"close\": \"32.2\",\n        //         \"volume\": \"0\",\n        //         \"interval\": \"5m\",\n        //         \"tradeCount\": 0,\n        //         \"takerVolume\": \"0\",\n        //         \"takerAmount\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"openTime\": 1677096900000,\n        //         \"closeTime\": 1677097200000\n        //     }\n        //\n        const inverse = this.safeBool (market, 'inverse');\n        const volumeIndex = inverse ? 7 : 5;\n        return [\n            this.safeInteger2 (ohlcv, 0, 'openTime'),\n            this.safeNumber2 (ohlcv, 1, 'open'),\n            this.safeNumber2 (ohlcv, 2, 'high'),\n            this.safeNumber2 (ohlcv, 3, 'low'),\n            this.safeNumber2 (ohlcv, 4, 'close'),\n            this.safeNumber2 (ohlcv, volumeIndex, 'volume'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 13132,
        "line_end": 13149,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "market['inverse'] ? undefined : amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        const timestamp = this.safeInteger2 (interest, 'timestamp', 'time');\n        const id = this.safeString (interest, 'symbol');\n        const amount = this.safeNumber2 (interest, 'sumOpenInterest', 'openInterest');\n        const value = this.safeNumber2 (interest, 'sumOpenInterestValue', 'sumOpenInterestUsd');\n        // Inverse returns the number of contracts different from the base or quote volume in this case\n        // compared with https://www.binance.com/en/futures/funding-history/quarterly/4\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id, market, undefined, 'contract'),\n            'baseVolume': market['inverse'] ? undefined : amount,  // deprecated\n            'quoteVolume': value,  // deprecated\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 13768,
        "line_end": 13812,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPrice')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPrice')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'lastPrice')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'exercisePrice')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (chain, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (chain, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-241227-80000-C\",\n         \"priceChange\": \"0\",\n         \"priceChangePercent\": \"0\",\n         \"lastPrice\": \"2750\",\n         \"lastQty\": \"0\",\n         \"open\": \"2750\",\n         \"high\": \"2750\",\n         \"low\": \"2750\",\n         \"volume\": \"0\",\n         \"amount\": \"0\",\n         \"bidPrice\": \"4880\",\n         \"askPrice\": \"0\",\n         \"openTime\": 0,\n         \"closeTime\": 0,\n         \"firstTradeId\": 0,\n         \"tradeCount\": 0,\n         \"strikePrice\": \"80000\",\n         \"exercisePrice\": \"63944.09893617\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"symbol\": \"BTC-241227-80000-C\",\n        //         \"priceChange\": \"0\",\n        //         \"priceChangePercent\": \"0\",\n        //         \"lastPrice\": \"2750\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"2750\",\n        //         \"high\": \"2750\",\n        //         \"low\": \"2750\",\n        //         \"volume\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"bidPrice\": \"4880\",\n        //         \"askPrice\": \"0\",\n        //         \"openTime\": 0,\n        //         \"closeTime\": 0,\n        //         \"firstTradeId\": 0,\n        //         \"tradeCount\": 0,\n        //         \"strikePrice\": \"80000\",\n        //         \"exercisePrice\": \"63944.09893617\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPrice'),\n            'askPrice': this.safeNumber (chain, 'askPrice'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'lastPrice'),\n            'underlyingPrice': this.safeNumber (chain, 'exercisePrice'),\n            'change': this.safeNumber (chain, 'priceChange'),\n            'percentage': this.safeNumber (chain, 'priceChangePercent'),\n            'baseVolume': this.safeNumber (chain, 'volume'),\n            'quoteVolume': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOptionPosition",
        "signature": "parseOptionPosition (position: Dict, market: Market = undefined)",
        "line_start": 10844,
        "line_end": 10900,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'markValue')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'positionCost')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPNL')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"entryPrice\": \"27.70000000\",\n         \"symbol\": \"ETH-230426-1850-C\",\n         \"side\": \"LONG\",\n         \"quantity\": \"0.50000000\",\n         \"reducibleQty\": \"0.50000000\",\n         \"markValue\": \"10.250000000\",\n         \"ror\": \"-0.2599\",\n         \"unrealizedPNL\": \"-3.600000000\",\n         \"markPrice\": \"20.5\",\n         \"strikePrice\": \"1850.00000000\",\n         \"positionCost\": \"13.85000000\",\n         \"expiryDate\": 1682496000000,\n         \"priceScale\": 1,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"quoteAsset\": \"USDT\",\n         \"time\": 1682492427106\n     }"
        ],
        "source": "parseOptionPosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"entryPrice\": \"27.70000000\",\n        //         \"symbol\": \"ETH-230426-1850-C\",\n        //         \"side\": \"LONG\",\n        //         \"quantity\": \"0.50000000\",\n        //         \"reducibleQty\": \"0.50000000\",\n        //         \"markValue\": \"10.250000000\",\n        //         \"ror\": \"-0.2599\",\n        //         \"unrealizedPNL\": \"-3.600000000\",\n        //         \"markPrice\": \"20.5\",\n        //         \"strikePrice\": \"1850.00000000\",\n        //         \"positionCost\": \"13.85000000\",\n        //         \"expiryDate\": 1682496000000,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"time\": 1682492427106\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        let quantity = this.safeString (position, 'quantity');\n        if (side !== 'long') {\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        const timestamp = this.safeInteger (position, 'time');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'notional': this.safeNumber (position, 'markValue'),\n            'collateral': this.safeNumber (position, 'positionCost'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPNL'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 5636,
        "line_end": 6236,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "fills",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"0.0\",\n         \"cummulativeQuoteQty\": \"0.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"icebergQty\": \"0.0\",\n         \"time\": 1499827319559,\n         \"updateTime\": 1499827319559,\n         \"isWorking\": true\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 16383176297,\n         \"orderListId\": -1,\n         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n         \"transactTime\": 1670891847932,\n         \"price\": \"13500.00000000\",\n         \"origQty\": \"0.00085000\",\n         \"executedQty\": \"0.00000000\",\n         \"cummulativeQuoteQty\": \"0.00000000\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"fills\": []\n     }",
          "{\n         \"orderId\": 151007482392,\n         \"symbol\": \"BTCUSDT\",\n         \"status\": \"NEW\",\n         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n         \"price\": \"25000\",\n         \"avgPrice\": \"0.00000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0\",\n         \"cumQty\": \"0\",\n         \"cumQuote\": \"0\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"side\": \"BUY\",\n         \"positionSide\": \"BOTH\",\n         \"stopPrice\": \"0\",\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"priceProtect\": false,\n         \"origType\": \"LIMIT\",\n         \"updateTime\": 1684300587845\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"1.0\",\n         \"cumQuote\": \"10.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"updateTime\": 1499827319559\n     }",
          "createOrder with { \"newOrderRespType\": \"FULL\" }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"0.0\",\n        //         \"cummulativeQuoteQty\": \"0.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"icebergQty\": \"0.0\",\n        //         \"time\": 1499827319559,\n        //         \"updateTime\": 1499827319559,\n        //         \"isWorking\": true\n        //     }\n        //\n        // spot: editOrder\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 16383176297,\n        //         \"orderListId\": -1,\n        //         \"clientOrderId\": \"x-TKT5PX2F22ecb58eb9074fb1be018c\",\n        //         \"transactTime\": 1670891847932,\n        //         \"price\": \"13500.00000000\",\n        //         \"origQty\": \"0.00085000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"fills\": []\n        //     }\n        //\n        // swap and future: editOrder\n        //\n        //     {\n        //         \"orderId\": 151007482392,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"web_pCCGp9AIHjziKLlpGpXI\",\n        //         \"price\": \"25000\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"updateTime\": 1684300587845\n        //     }\n        //\n        // futures\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"1.0\",\n        //         \"cumQuote\": \"10.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"updateTime\": 1499827319559\n        //     }\n        //\n        // createOrder with { \"newOrderRespType\": \"FULL\" }\n        //\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"orderId\": 5403233939,\n        //       \"orderListId\": -1,\n        //       \"clientOrderId\": \"x-TKT5PX2F5e669e75b6c14f69a2c43e\",\n        //       \"transactTime\": 1617151923742,\n        //       \"price\": \"0.00000000\",\n        //       \"origQty\": \"0.00050000\",\n        //       \"executedQty\": \"0.00050000\",\n        //       \"cummulativeQuoteQty\": \"29.47081500\",\n        //       \"status\": \"FILLED\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"side\": \"BUY\",\n        //       \"fills\": [\n        //         {\n        //           \"price\": \"58941.63000000\",\n        //           \"qty\": \"0.00050000\",\n        //           \"commission\": \"0.00007050\",\n        //           \"commissionAsset\": \"BNB\",\n        //           \"tradeId\": 737466631\n        //         }\n        //       ]\n        //     }\n        //\n        // delivery\n        //\n        //     {\n        //       \"orderId\": \"18742727411\",\n        //       \"symbol\": \"ETHUSD_PERP\",\n        //       \"pair\": \"ETHUSD\",\n        //       \"status\": \"FILLED\",\n        //       \"clientOrderId\": \"x-xcKtGhcu3e2d1503fdd543b3b02419\",\n        //       \"price\": \"0\",\n        //       \"avgPrice\": \"4522.14\",\n        //       \"origQty\": \"1\",\n        //       \"executedQty\": \"1\",\n        //       \"cumBase\": \"0.00221134\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"reduceOnly\": false,\n        //       \"closePosition\": false,\n        //       \"side\": \"SELL\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"stopPrice\": \"0\",\n        //       \"workingType\": \"CONTRACT_PRICE\",\n        //       \"priceProtect\": false,\n        //       \"origType\": \"MARKET\",\n        //       \"time\": \"1636061952660\",\n        //       \"updateTime\": \"1636061952660\"\n        //     }\n        //\n        // option: createOrder, fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"orderId\": 4728833085436977152,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"10.0\",\n        //         \"quantity\": \"1.00\",\n        //         \"executedQty\": \"0.00\",\n        //         \"fee\": \"0\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"reduceOnly\": false,\n        //         \"postOnly\": false,\n        //         \"createTime\": 1676083034462,\n        //         \"updateTime\": 1676083034462,\n        //         \"status\": \"ACCEPTED\",\n        //         \"avgPrice\": \"0\",\n        //         \"source\": \"API\",\n        //         \"clientOrderId\": \"\",\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"lastTrade\": {\"id\":\"69\",\"time\":\"1676084430567\",\"price\":\"24.9\",\"qty\":\"1.00\"},\n        //         \"mmp\": false\n        //     }\n        //\n        // cancelOrders/createOrders\n        //\n        //     {\n        //         \"code\": -4005,\n        //         \"msg\": \"Quantity greater than max quantity.\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin linear swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"executedQty\": \"0.000\",\n        //         \"orderId\": 258649539704,\n        //         \"goodTillDate\": 0,\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"clientOrderId\": \"x-xcKtGhcu02573c6f15e544e990057b\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0.000\",\n        //         \"updateTime\": 1707110415436,\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"35000.00\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin inverse swap and future\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"side\": \"BUY\",\n        //         \"cumBase\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"orderId\": 71275227732,\n        //         \"avgPrice\": \"0.00\",\n        //         \"origQty\": \"1\",\n        //         \"clientOrderId\": \"x-xcKtGhcuca5af3acfb5044198c5398\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"cumQty\": \"0\",\n        //         \"updateTime\": 1707110994334,\n        //         \"type\": \"LIMIT\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"reduceOnly\": false,\n        //         \"price\": \"2000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"NEW\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOpenOrder: portfolio margin linear swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu27f109953d6e4dc0974006\",\n        //         \"strategyId\": 3645916,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"45000.00\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707112625879,\n        //         \"updateTime\": 1707112625879,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders: portfolio margin inverse swap and future conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuc6b86f053bb34933850739\",\n        //         \"strategyId\": 1423462,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2000\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"3000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"bookTime\": 1707113098840,\n        //         \"updateTime\": 1707113098840,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin\n        //\n        //     {\n        //         \"clientOrderId\": \"x-TKT5PX2Fe9ef29d8346440f0b28b86\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"fills\": [],\n        //         \"orderId\": 24684460474,\n        //         \"origQty\": \"0.00100000\",\n        //         \"price\": \"35000.00000000\",\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"side\": \"BUY\",\n        //         \"status\": \"NEW\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"transactTime\": 1707113538870,\n        //         \"type\": \"LIMIT\"\n        //     }\n        //\n        // fetchOpenOrders, fetchOrder, fetchOrders: portfolio margin spot margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": 24700763749,\n        //         \"clientOrderId\": \"x-TKT5PX2F6f724c2a4af6425f98c7b6\",\n        //         \"price\": \"35000.00000000\",\n        //         \"origQty\": \"0.00100000\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"cummulativeQuoteQty\": \"0.00000000\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.00000000\",\n        //         \"icebergQty\": \"0.00000000\",\n        //         \"time\": 1707199187679,\n        //         \"updateTime\": 1707199187679,\n        //         \"isWorking\": true,\n        //         \"accountId\": 200180970,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"preventedMatchId\": null,\n        //         \"preventedQuantity\": null\n        //     }\n        //\n        // cancelOrder: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"strategyId\": 3733211,\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyType\": \"STOP\",\n        //         \"strategyStatus\": \"CANCELED\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000.00\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000.00\", // ignored with trailing orders\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"activatePrice\": null,  // only return with trailing orders\n        //         \"priceRate\": null,      // only return with trailing orders\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOrders: portfolio margin linear and inverse swap conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcuaf166172ed504cd1bc0396\",\n        //         \"strategyId\": 3733211,\n        //         \"strategyStatus\": \"CANCELLED\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"0.010\",\n        //         \"price\": \"35000\",\n        //         \"orderId\": 0,\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"50000\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"type\": \"LIMIT\",\n        //         \"bookTime\": 1707270098774,\n        //         \"updateTime\": 1707270119261,\n        //         \"timeInForce\": \"GTC\",\n        //         \"triggerTime\": 0,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: linear swap\n        //\n        //     {\n        //         \"orderId\": 3697213934,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcufb20c5a7761a4aa09aa156\",\n        //         \"price\": \"33000.00\",\n        //         \"avgPrice\": \"0.00000\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0.000\",\n        //         \"cumQuote\": \"0.00000\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0.00\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"selfTradePreventionMode\": \"NONE\",\n        //         \"goodTillDate\": 0,\n        //         \"time\": 1707892893502,\n        //         \"updateTime\": 1707892893515\n        //     }\n        //\n        // fetchOpenOrder: inverse swap\n        //\n        //     {\n        //         \"orderId\": 597368542,\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcubbde7ba93b1a4ab881eff3\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"stopPrice\": \"0\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false,\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893453199,\n        //         \"updateTime\": 1707893453199\n        //     }\n        //\n        // fetchOpenOrder: linear portfolio margin\n        //\n        //     {\n        //         \"orderId\": 264895013409,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcu6278f1adbdf14f74ab432e\",\n        //         \"price\": \"35000\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"0.010\",\n        //         \"executedQty\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707893839364,\n        //         \"updateTime\": 1707893839364,\n        //         \"goodTillDate\": 0,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin\n        //\n        //     {\n        //         \"orderId\": 71790316950,\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"pair\": \"ETHUSD\",\n        //         \"status\": \"NEW\",\n        //         \"clientOrderId\": \"x-xcKtGhcuec11030474204ab08ba2c2\",\n        //         \"price\": \"2500\",\n        //         \"avgPrice\": \"0\",\n        //         \"origQty\": \"1\",\n        //         \"executedQty\": \"0\",\n        //         \"cumBase\": \"0\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origType\": \"LIMIT\",\n        //         \"time\": 1707894181694,\n        //         \"updateTime\": 1707894181694\n        //     }\n        //\n        // fetchOpenOrder: inverse portfolio margin conditional\n        //\n        //     {\n        //         \"newClientStrategyId\": \"x-xcKtGhcu2da9c765294b433994ffce\",\n        //         \"strategyId\": 1423501,\n        //         \"strategyStatus\": \"NEW\",\n        //         \"strategyType\": \"STOP\",\n        //         \"origQty\": \"1\",\n        //         \"price\": \"2500\",\n        //         \"reduceOnly\": false,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"stopPrice\": \"4000\",\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"bookTime\": 1707894782679,\n        //         \"updateTime\": 1707894782679,\n        //         \"timeInForce\": \"GTC\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceProtect\": false\n        //     }\n        //\n        // createOrder, fetchOrder, fetchOpenOrders, fetchOrders, cancelOrderWs, createOrderWs: linear swap conditional order\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"algoType\": \"CONDITIONAL\",\n        //         \"orderType\": \"STOP\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"quantity\": \"0.002\",\n        //         \"algoStatus\": \"NEW\",\n        //         \"triggerPrice\": \"100000.00\",\n        //         \"price\": \"102000.00\",\n        //         \"icebergQuantity\": null,\n        //         \"selfTradePreventionMode\": \"EXPIRE_MAKER\",\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"priceMatch\": \"NONE\",\n        //         \"closePosition\": false,\n        //         \"priceProtect\": false,\n        //         \"reduceOnly\": false,\n        //         \"createTime\": 1763458576201,\n        //         \"updateTime\": 1763458576201,\n        //         \"triggerTime\": 0,\n        //         \"goodTillDate\": 0\n        //     }\n        //\n        // cancelOrder: linear swap conditional\n        //\n        //     {\n        //         \"algoId\": 3358,\n        //         \"clientAlgoId\": \"yT58zmV3DSzMBQxc5tAJXU\",\n        //         \"code\": \"200\",\n        //         \"msg\": \"success\"\n        //     }\n        //\n        const code = this.safeString (order, 'code');\n        if (code !== undefined) {\n            // cancelOrders/createOrders might have a partial success\n            const msg = this.safeString (order, 'msg');\n            if ((code !== '200') && !((msg === 'success') || (msg === 'The operation of cancel all open order is done.'))) {\n                return this.safeOrder ({ 'info': order, 'status': 'rejected' }, market);\n            }\n        }\n        const status = this.parseOrderStatus (this.safeStringN (order, [ 'status', 'strategyStatus', 'algoStatus' ]));\n        const marketId = this.safeString (order, 'symbol');\n        const isContract = ('positionSide' in order) || ('cumQuote' in order);\n        const marketType = isContract ? 'contract' : 'spot';\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const filled = this.safeString (order, 'executedQty', '0');\n        const timestamp = this.safeIntegerN (order, [ 'time', 'createTime', 'workingTime', 'transactTime', 'updateTime' ]); // order of the keys matters here\n        let lastTradeTimestamp = undefined;\n        if (('transactTime' in order) || ('updateTime' in order)) {\n            const timestampValue = this.safeInteger2 (order, 'updateTime', 'transactTime');\n            if (status === 'open') {\n                if (Precise.stringGt (filled, '0')) {\n                    lastTradeTimestamp = timestampValue;\n                }\n            } else if (status === 'closed') {\n                lastTradeTimestamp = timestampValue;\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger2 (order, 'transactTime', 'updateTime');\n        const average = this.safeString (order, 'avgPrice');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString2 (order, 'origQty', 'quantity');\n        // - Spot/Margin market: cummulativeQuoteQty\n        // - Futures market: cumQuote.\n        //   Note this is not the actual cost, since Binance futures uses leverage to calculate margins.\n        let cost = this.safeString2 (order, 'cummulativeQuoteQty', 'cumQuote');\n        cost = this.safeString (order, 'cumBase', cost);\n        const type = this.safeStringLower2 (order, 'type', 'orderType');\n        const side = this.safeStringLower (order, 'side');\n        const fills = this.safeList (order, 'fills', []);\n        let timeInForce = this.safeString (order, 'timeInForce');\n        if (timeInForce === 'GTX') {\n            // GTX means \"Good Till Crossing\" and is an equivalent way of saying Post Only\n            timeInForce = 'PO';\n        }\n        const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');\n        const stopPriceString = this.safeString2 (order, 'stopPrice', 'triggerPrice');\n        const triggerPrice = this.parseNumber (this.omitZero (stopPriceString));\n        const feeCost = this.safeNumber (order, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': this.safeString (order, 'quoteAsset'),\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeStringN (order, [ 'strategyId', 'orderId', 'algoId' ]),\n            'clientOrderId': this.safeStringN (order, [ 'clientOrderId', 'newClientStrategyId', 'clientAlgoId' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': fills,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 5605,
        "line_end": 5622,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'ACCEPTED': 'open',\n            'TRIGGERING': 'open',\n            'FILLED': 'closed',\n            'TRIGGERED': 'closed',\n            'FINISHED': 'closed',\n            'CANCELED': 'canceled',\n            'CANCELLED': 'canceled',\n            'PENDING_CANCEL': 'canceling', // currently unused\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n            'EXPIRED_IN_MATCH': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 5624,
        "line_end": 5634,
        "comment": null,
        "mappings": [
          {
            "key": "limit_maker",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "stop_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "take_profit",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "take_profit_market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "trailing_stop_market",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types = {\n            'limit_maker': 'limit',\n            'stop': 'limit',\n            'stop_market': 'market',\n            'take_profit': 'limit',\n            'take_profit_market': 'market',\n            'trailing_stop_market': 'market',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parsePositionRisk",
        "signature": "parsePositionRisk (position, market: Market = undefined)",
        "line_start": 10331,
        "line_end": 10568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePositionRisk (position, market: Market = undefined) {\n        //\n        // usdm\n        //\n        //  {\n        //     symbol: \"WLDUSDT\",\n        //     positionSide: \"BOTH\",\n        //     positionAmt: \"5\",\n        //     entryPrice: \"2.3483\",\n        //     breakEvenPrice: \"2.349356735\",\n        //     markPrice: \"2.39560000\",\n        //     unRealizedProfit: \"0.23650000\",\n        //     liquidationPrice: \"0\",\n        //     isolatedMargin: \"0\",\n        //     notional: \"11.97800000\",\n        //     isolatedWallet: \"0\",\n        //     updateTime: \"1722062678998\",\n        //     initialMargin: \"2.39560000\",         // not in v2\n        //     maintMargin: \"0.07186800\",           // not in v2\n        //     positionInitialMargin: \"2.39560000\", // not in v2\n        //     openOrderInitialMargin: \"0\",         // not in v2\n        //     adl: \"2\",                            // not in v2\n        //     bidNotional: \"0\",                    // not in v2\n        //     askNotional: \"0\",                    // not in v2\n        //     marginAsset: \"USDT\",                 // not in v2\n        //     // the below fields are only in v2\n        //     leverage: \"5\",\n        //     maxNotionalValue: \"6000000\",\n        //     marginType: \"cross\",\n        //     isAutoAddMargin: \"false\",\n        //     isolated: false,\n        //     adlQuantile: \"2\",\n        //\n        // coinm\n        //\n        //     {\n        //       \"symbol\": \"BTCUSD_PERP\",\n        //       \"positionAmt\": \"2\",\n        //       \"entryPrice\": \"37643.10000021\",\n        //       \"markPrice\": \"38103.05510455\",\n        //       \"unRealizedProfit\": \"0.00006413\",\n        //       \"liquidationPrice\": \"25119.97445760\",\n        //       \"leverage\": \"2\",\n        //       \"maxQty\": \"1500\",\n        //       \"marginType\": \"isolated\",\n        //       \"isolatedMargin\": \"0.00274471\",\n        //       \"isAutoAddMargin\": \"false\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"notionalValue\": \"0.00524892\",\n        //       \"isolatedWallet\": \"0.00268058\"\n        //     }\n        //\n        // inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"positionAmt\": \"1\",\n        //         \"entryPrice\": \"2422.400000007\",\n        //         \"markPrice\": \"2424.51267823\",\n        //         \"unRealizedProfit\": \"0.0000036\",\n        //         \"liquidationPrice\": \"293.57678898\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371941861,\n        //         \"maxQty\": \"15\",\n        //         \"notionalValue\": \"0.00412454\",\n        //         \"breakEvenPrice\": \"2423.368960034\"\n        //     }\n        //\n        // linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"positionAmt\": \"0.01\",\n        //         \"entryPrice\": \"44525.0\",\n        //         \"markPrice\": \"45464.1735922\",\n        //         \"unRealizedProfit\": \"9.39173592\",\n        //         \"liquidationPrice\": \"38007.16308568\",\n        //         \"leverage\": \"100\",\n        //         \"positionSide\": \"LONG\",\n        //         \"updateTime\": 1707371879042,\n        //         \"maxNotionalValue\": \"500000.0\",\n        //         \"notional\": \"454.64173592\",\n        //         \"breakEvenPrice\": \"44542.81\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeString (market, 'symbol');\n        const isolatedMarginString = this.safeString (position, 'isolatedMargin');\n        const leverageBrackets = this.safeDict (this.options, 'leverageBrackets', {});\n        const leverageBracket = this.safeList (leverageBrackets, symbol, []);\n        const notionalString = this.safeString2 (position, 'notional', 'notionalValue');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        let maintenanceMarginPercentageString = undefined;\n        for (let i = 0; i < leverageBracket.length; i++) {\n            const bracket = leverageBracket[i];\n            if (Precise.stringLt (notionalStringAbs, bracket[0])) {\n                break;\n            }\n            maintenanceMarginPercentageString = bracket[1];\n        }\n        const notional = this.parseNumber (notionalStringAbs);\n        const contractsAbs = Precise.stringAbs (this.safeString (position, 'positionAmt'));\n        const contracts = this.parseNumber (contractsAbs);\n        const unrealizedPnlString = this.safeString (position, 'unRealizedProfit');\n        const unrealizedPnl = this.parseNumber (unrealizedPnlString);\n        const liquidationPriceString = this.omitZero (this.safeString (position, 'liquidationPrice'));\n        const liquidationPrice = this.parseNumber (liquidationPriceString);\n        let collateralString = undefined;\n        let marginMode = this.safeString (position, 'marginType');\n        if (marginMode === undefined && isolatedMarginString !== undefined) {\n            marginMode = Precise.stringEq (isolatedMarginString, '0') ? 'cross' : 'isolated';\n        }\n        let side = undefined;\n        if (Precise.stringGt (notionalString, '0')) {\n            side = 'long';\n        } else if (Precise.stringLt (notionalString, '0')) {\n            side = 'short';\n        }\n        const entryPriceString = this.safeString (position, 'entryPrice');\n        const entryPrice = this.parseNumber (entryPriceString);\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        // as oppose to notionalValue\n        const linear = ('notional' in position);\n        if (marginMode === 'cross') {\n            // calculate collateral\n            const precision = this.safeDict (market, 'precision', {});\n            const basePrecisionValue = this.safeString (precision, 'base');\n            const quotePrecisionValue = this.safeString2 (precision, 'quote', 'price');\n            const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);\n            if (!precisionIsUndefined) {\n                if (linear) {\n                    // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringAdd ('-1', maintenanceMarginPercentageString);\n                    }\n                    const inner = Precise.stringMul (liquidationPriceString, onePlusMaintenanceMarginPercentageString);\n                    const leftSide = Precise.stringAdd (inner, entryPriceSignString);\n                    const quotePrecision = this.precisionFromString (this.safeString2 (precision, 'quote', 'price'));\n                    if (quotePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, contractsAbs), '1', quotePrecision);\n                    }\n                } else {\n                    // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)\n                    let onePlusMaintenanceMarginPercentageString = undefined;\n                    let entryPriceSignString = entryPriceString;\n                    if (side === 'short') {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('1', maintenanceMarginPercentageString);\n                    } else {\n                        onePlusMaintenanceMarginPercentageString = Precise.stringSub ('-1', maintenanceMarginPercentageString);\n                        entryPriceSignString = Precise.stringMul ('-1', entryPriceSignString);\n                    }\n                    const leftSide = Precise.stringMul (contractsAbs, contractSizeString);\n                    const rightSide = Precise.stringSub (Precise.stringDiv ('1', entryPriceSignString), Precise.stringDiv (onePlusMaintenanceMarginPercentageString, liquidationPriceString));\n                    const basePrecision = this.precisionFromString (this.safeString (precision, 'base'));\n                    if (basePrecision !== undefined) {\n                        collateralString = Precise.stringDiv (Precise.stringMul (leftSide, rightSide), '1', basePrecision);\n                    }\n                }\n            }\n        } else {\n            collateralString = this.safeString (position, 'isolatedMargin');\n        }\n        collateralString = (collateralString === undefined) ? '0' : collateralString;\n        const collateral = this.parseNumber (collateralString);\n        const markPrice = this.parseNumber (this.omitZero (this.safeString (position, 'markPrice')));\n        let timestamp = this.safeInteger (position, 'updateTime');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        const maintenanceMarginPercentage = this.parseNumber (maintenanceMarginPercentageString);\n        let maintenanceMarginString = Precise.stringMul (maintenanceMarginPercentageString, notionalStringAbs);\n        if (maintenanceMarginString === undefined) {\n            // for a while, this new value was a backup to the existing calculations, but in future we might prioritize this\n            maintenanceMarginString = this.safeString (position, 'maintMargin');\n        }\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        let initialMarginString = undefined;\n        let initialMarginPercentageString = undefined;\n        const leverageString = this.safeString (position, 'leverage');\n        if (leverageString !== undefined) {\n            const leverage = parseInt (leverageString);\n            const rational = this.isRoundNumber (1000 % leverage);\n            initialMarginPercentageString = Precise.stringDiv ('1', leverageString, 8);\n            if (!rational) {\n                initialMarginPercentageString = Precise.stringAdd (initialMarginPercentageString, '1e-8');\n            }\n            const unrounded = Precise.stringMul (notionalStringAbs, initialMarginPercentageString);\n            initialMarginString = Precise.stringDiv (unrounded, '1', 8);\n        } else {\n            initialMarginString = this.safeString (position, 'initialMargin');\n            const unrounded = Precise.stringMul (initialMarginString, '1');\n            initialMarginPercentageString = Precise.stringDiv (unrounded, notionalStringAbs, 8);\n        }\n        let marginRatio = undefined;\n        let percentage = undefined;\n        if (!Precise.stringEquals (collateralString, '0')) {\n            marginRatio = this.parseNumber (Precise.stringDiv (Precise.stringAdd (Precise.stringDiv (maintenanceMarginString, collateralString), '5e-5'), '1', 4));\n            percentage = this.parseNumber (Precise.stringMul (Precise.stringDiv (unrealizedPnlString, initialMarginString, 4), '100'));\n        }\n        const positionSide = this.safeString (position, 'positionSide');\n        const hedged = positionSide !== 'BOTH';\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'unrealizedPnl': unrealizedPnl,\n            'leverage': this.parseNumber (leverageString),\n            'liquidationPrice': liquidationPrice,\n            'collateral': collateral,\n            'notional': notional,\n            'markPrice': markPrice,\n            'entryPrice': entryPrice,\n            'timestamp': timestamp,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'marginRatio': marginRatio,\n            'datetime': this.iso8601 (timestamp),\n            'marginMode': marginMode,\n            'marginType': marginMode, // deprecated\n            'side': side,\n            'hedged': hedged,\n            'percentage': percentage,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 11662,
        "line_end": 11702,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH-230223-1900-P\",\n         \"strikePrice\": \"1900\",\n         \"realStrikePrice\": \"1665.5897334\",\n         \"expiryDate\": 1677139200000,\n         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n     }",
          "{\n         \"id\": \"1125899906842897036\",\n         \"currency\": \"USDT\",\n         \"symbol\": \"BTC-230728-30000-C\",\n         \"exercisePrice\": \"30000.00000000\",\n         \"markPrice\": \"29160.71284993\",\n         \"quantity\": \"1.00000000\",\n         \"amount\": \"0.00000000\",\n         \"fee\": \"0.00000000\",\n         \"createDate\": 1690531200000,\n         \"priceScale\": 0,\n         \"quantityScale\": 2,\n         \"optionSide\": \"CALL\",\n         \"positionSide\": \"LONG\",\n         \"quoteAsset\": \"USDT\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"symbol\": \"ETH-230223-1900-P\",\n        //         \"strikePrice\": \"1900\",\n        //         \"realStrikePrice\": \"1665.5897334\",\n        //         \"expiryDate\": 1677139200000,\n        //         \"strikeResult\": \"REALISTIC_VALUE_STRICKEN\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"id\": \"1125899906842897036\",\n        //         \"currency\": \"USDT\",\n        //         \"symbol\": \"BTC-230728-30000-C\",\n        //         \"exercisePrice\": \"30000.00000000\",\n        //         \"markPrice\": \"29160.71284993\",\n        //         \"quantity\": \"1.00000000\",\n        //         \"amount\": \"0.00000000\",\n        //         \"fee\": \"0.00000000\",\n        //         \"createDate\": 1690531200000,\n        //         \"priceScale\": 0,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"positionSide\": \"LONG\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (settlement, 'expiryDate', 'createDate');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber2 (settlement, 'realStrikePrice', 'exercisePrice'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 11704,
        "line_end": 11744,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETH-230223-1900-P\",\n             \"strikePrice\": \"1900\",\n             \"realStrikePrice\": \"1665.5897334\",\n             \"expiryDate\": 1677139200000,\n             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n         }\n     ]",
          "[\n         {\n             \"id\": \"1125899906842897036\",\n             \"currency\": \"USDT\",\n             \"symbol\": \"BTC-230728-30000-C\",\n             \"exercisePrice\": \"30000.00000000\",\n             \"markPrice\": \"29160.71284993\",\n             \"quantity\": \"1.00000000\",\n             \"amount\": \"0.00000000\",\n             \"fee\": \"0.00000000\",\n             \"createDate\": 1690531200000,\n             \"priceScale\": 0,\n             \"quantityScale\": 2,\n             \"optionSide\": \"CALL\",\n             \"positionSide\": \"LONG\",\n             \"quoteAsset\": \"USDT\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETH-230223-1900-P\",\n        //             \"strikePrice\": \"1900\",\n        //             \"realStrikePrice\": \"1665.5897334\",\n        //             \"expiryDate\": 1677139200000,\n        //             \"strikeResult\": \"EXTRINSIC_VALUE_EXPIRED\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"id\": \"1125899906842897036\",\n        //             \"currency\": \"USDT\",\n        //             \"symbol\": \"BTC-230728-30000-C\",\n        //             \"exercisePrice\": \"30000.00000000\",\n        //             \"markPrice\": \"29160.71284993\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"amount\": \"0.00000000\",\n        //             \"fee\": \"0.00000000\",\n        //             \"createDate\": 1690531200000,\n        //             \"priceScale\": 0,\n        //             \"quantityScale\": 2,\n        //             \"optionSide\": \"CALL\",\n        //             \"positionSide\": \"LONG\",\n        //             \"quoteAsset\": \"USDT\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 4068,
        "line_end": 4254,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'highPrice', 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'lowPrice', 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "wAvg",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'openPrice', 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'prevClosePrice')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"markPrice\": \"11793.63104562\", // mark price\n         \"indexPrice\": \"11781.80495970\", // index price\n         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n         \"nextFundingTime\": 1597392000000,\n         \"interestRate\": \"0.00010000\",\n         \"time\": 1597370495002\n     }",
          "{\n        \"symbol\": \"BTCUSDT\",\n        \"priceChange\": \"-188.18000000\",\n        \"priceChangePercent\": \"-0.159\",\n        \"weightedAvgPrice\": \"118356.64734074\",\n        \"lastPrice\": \"118449.03000000\",\n        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        \"openPrice\": \"118637.21000000\",\n        \"highPrice\": \"119273.36000000\",\n        \"lowPrice\": \"117427.50000000\",\n        \"volume\": \"14741.41491000\",\n        \"quoteVolume\": \"1744744445.80640740\",\n        \"openTime\": \"1753701474013\",\n        \"closeTime\": \"1753787874013\",\n        \"firstId\": \"5116031635\",\n        \"lastId\": \"5117964946\",\n        \"count\": \"1933312\"\n    }",
          "{\n        \"symbol\": \"SUSDT\",\n        \"priceChange\": \"-0.0229000\",\n        \"priceChangePercent\": \"-6.777\",\n        \"weightedAvgPrice\": \"0.3210035\",\n        \"lastPrice\": \"0.3150000\",\n        \"lastQty\": \"16\",\n        \"openPrice\": \"0.3379000\",\n        \"highPrice\": \"0.3411000\",\n        \"lowPrice\": \"0.3071000\",\n        \"volume\": \"120588225\",\n        \"quoteVolume\": \"38709237.2289000\",\n        \"openTime\": \"1753701720000\",\n        \"closeTime\": \"1753788172414\",\n        \"firstId\": \"72234973\",\n        \"lastId\": \"72423677\",\n        \"count\": \"188700\"\n    }",
          "{\n         \"baseVolume\": \"214549.95171161\",\n         \"closeTime\": \"1621965286847\",\n         \"count\": \"1283779\",\n         \"firstId\": \"152560106\",\n         \"highPrice\": \"39938.3\",\n         \"lastId\": \"153843955\",\n         \"lastPrice\": \"37993.4\",\n         \"lastQty\": \"1\",\n         \"lowPrice\": \"36457.2\",\n         \"openPrice\": \"37783.4\",\n         \"openTime\": \"1621878840000\",\n         \"pair\": \"BTCUSD\",\n         \"priceChange\": \"210.0\",\n         \"priceChangePercent\": \"0.556\",\n         \"symbol\": \"BTCUSD_PERP\",\n         \"volume\": \"81990451\",\n         \"weightedAvgPrice\": \"38215.08713747\"\n     }",
          "{\n         \"symbol\": \"ETH-230510-1825-C\",\n         \"priceChange\": \"-5.1\",\n         \"priceChangePercent\": \"-0.1854\",\n         \"lastPrice\": \"22.4\",\n         \"lastQty\": \"0\",\n         \"open\": \"27.5\",\n         \"high\": \"34.1\",\n         \"low\": \"22.4\",\n         \"volume\": \"6.83\",\n         \"amount\": \"201.44\",\n         \"bidPrice\": \"21.9\",\n         \"askPrice\": \"22.4\",\n         \"openTime\": 1683614771898,\n         \"closeTime\": 1683695017784,\n         \"firstTradeId\": 12,\n         \"tradeCount\": 22,\n         \"strikePrice\": \"1825\",\n         \"exercisePrice\": \"1845.95341176\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // markPrices\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"markPrice\": \"11793.63104562\", // mark price\n        //         \"indexPrice\": \"11781.80495970\", // index price\n        //         \"estimatedSettlePrice\": \"11781.16138815\", // Estimated Settle Price, only useful in the last hour before the settlement starts\n        //         \"lastFundingRate\": \"0.00038246\",  // This is the lastest estimated funding rate\n        //         \"nextFundingTime\": 1597392000000,\n        //         \"interestRate\": \"0.00010000\",\n        //         \"time\": 1597370495002\n        //     }\n        //\n        // spot - ticker\n        //\n        //    {\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"priceChange\": \"-188.18000000\",\n        //        \"priceChangePercent\": \"-0.159\",\n        //        \"weightedAvgPrice\": \"118356.64734074\",\n        //        \"lastPrice\": \"118449.03000000\",\n        //        \"prevClosePrice\": \"118637.22000000\",    // field absent in rolling ticker\n        //        \"lastQty\": \"0.00731000\",                // field absent in rolling ticker\n        //        \"bidPrice\": \"118449.02000000\",          // field absent in rolling ticker\n        //        \"bidQty\": \"7.15931000\",                 // field absent in rolling ticker\n        //        \"askPrice\": \"118449.03000000\",          // field absent in rolling ticker\n        //        \"askQty\": \"0.09592000\",                 // field absent in rolling ticker\n        //        \"openPrice\": \"118637.21000000\",\n        //        \"highPrice\": \"119273.36000000\",\n        //        \"lowPrice\": \"117427.50000000\",\n        //        \"volume\": \"14741.41491000\",\n        //        \"quoteVolume\": \"1744744445.80640740\",\n        //        \"openTime\": \"1753701474013\",\n        //        \"closeTime\": \"1753787874013\",\n        //        \"firstId\": \"5116031635\",\n        //        \"lastId\": \"5117964946\",\n        //        \"count\": \"1933312\"\n        //    }\n        //\n        // usdm tickers\n        //\n        //    {\n        //        \"symbol\": \"SUSDT\",\n        //        \"priceChange\": \"-0.0229000\",\n        //        \"priceChangePercent\": \"-6.777\",\n        //        \"weightedAvgPrice\": \"0.3210035\",\n        //        \"lastPrice\": \"0.3150000\",\n        //        \"lastQty\": \"16\",\n        //        \"openPrice\": \"0.3379000\",\n        //        \"highPrice\": \"0.3411000\",\n        //        \"lowPrice\": \"0.3071000\",\n        //        \"volume\": \"120588225\",\n        //        \"quoteVolume\": \"38709237.2289000\",\n        //        \"openTime\": \"1753701720000\",\n        //        \"closeTime\": \"1753788172414\",\n        //        \"firstId\": \"72234973\",\n        //        \"lastId\": \"72423677\",\n        //        \"count\": \"188700\"\n        //    }\n        //\n        // coinm\n        //\n        //     {\n        //         \"baseVolume\": \"214549.95171161\",\n        //         \"closeTime\": \"1621965286847\",\n        //         \"count\": \"1283779\",\n        //         \"firstId\": \"152560106\",\n        //         \"highPrice\": \"39938.3\",\n        //         \"lastId\": \"153843955\",\n        //         \"lastPrice\": \"37993.4\",\n        //         \"lastQty\": \"1\",\n        //         \"lowPrice\": \"36457.2\",\n        //         \"openPrice\": \"37783.4\",\n        //         \"openTime\": \"1621878840000\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"priceChange\": \"210.0\",\n        //         \"priceChangePercent\": \"0.556\",\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"volume\": \"81990451\",\n        //         \"weightedAvgPrice\": \"38215.08713747\"\n        //     }\n        //\n        // eapi: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"ETH-230510-1825-C\",\n        //         \"priceChange\": \"-5.1\",\n        //         \"priceChangePercent\": \"-0.1854\",\n        //         \"lastPrice\": \"22.4\",\n        //         \"lastQty\": \"0\",\n        //         \"open\": \"27.5\",\n        //         \"high\": \"34.1\",\n        //         \"low\": \"22.4\",\n        //         \"volume\": \"6.83\",\n        //         \"amount\": \"201.44\",\n        //         \"bidPrice\": \"21.9\",\n        //         \"askPrice\": \"22.4\",\n        //         \"openTime\": 1683614771898,\n        //         \"closeTime\": 1683695017784,\n        //         \"firstTradeId\": 12,\n        //         \"tradeCount\": 22,\n        //         \"strikePrice\": \"1825\",\n        //         \"exercisePrice\": \"1845.95341176\"\n        //     }\n        //\n        // spot bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"ETHBTC\",\n        //         \"bidPrice\":\"0.07466800\",\n        //         \"bidQty\":\"5.31990000\",\n        //         \"askPrice\":\"0.07466900\",\n        //         \"askQty\":\"10.93540000\"\n        //     }\n        //\n        // usdm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"bidPrice\":\"21321.90\",\n        //         \"bidQty\":\"33.592\",\n        //         \"askPrice\":\"21322.00\",\n        //         \"askQty\":\"1.427\",\n        //         \"time\":\"1673899207538\"\n        //     }\n        //\n        // coinm bidsAsks\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD_PERP\",\n        //         \"pair\":\"BTCUSD\",\n        //         \"bidPrice\":\"21301.2\",\n        //         \"bidQty\":\"188\",\n        //         \"askPrice\":\"21301.3\",\n        //         \"askQty\":\"10302\",\n        //         \"time\":\"1673899278514\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (ticker, 'closeTime', 'time');\n        let marketType = undefined;\n        if (('time' in ticker)) {\n            marketType = 'contract';\n        }\n        if (marketType === undefined) {\n            marketType = ('bidQty' in ticker) ? 'spot' : 'contract';\n        }\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const last = this.safeString (ticker, 'lastPrice');\n        const wAvg = this.safeString (ticker, 'weightedAvgPrice');\n        const isCoinm = ('baseVolume' in ticker);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        if (isCoinm) {\n            baseVolume = this.safeString (ticker, 'baseVolume');\n            // 'volume' field in inverse markets is not quoteVolume, but traded amount (per contracts)\n            quoteVolume = Precise.stringMul (baseVolume, wAvg);\n        } else {\n            baseVolume = this.safeString (ticker, 'volume');\n            quoteVolume = this.safeString2 (ticker, 'quoteVolume', 'amount');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'highPrice', 'high'),\n            'low': this.safeString2 (ticker, 'lowPrice', 'low'),\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': wAvg,\n            'open': this.safeString2 (ticker, 'openPrice', 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'prevClosePrice'), // previous day close\n            'change': this.safeString (ticker, 'priceChange'),\n            'percentage': this.safeString (ticker, 'priceChangePercent'),\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTickersForRolling",
        "signature": "parseTickersForRolling (response, symbols)",
        "line_start": 4518,
        "line_end": 4528,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTickersForRolling (response, symbols) {\n        const results = [];\n        for (let i = 0; i < response.length; i++) {\n            const marketId = this.safeString (response[i], 'symbol');\n            const tickerMarket = this.safeMarket (marketId, undefined, undefined, 'spot');\n            const parsedTicker = this.parseTicker (response[i]);\n            parsedTicker['symbol'] = tickerMarket['symbol'];\n            results.push (parsedTicker);\n        }\n        return this.filterByArray (results, 'symbol', symbols);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 4791,
        "line_end": 5057,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ])",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'type')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'p', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (trade, 'quoteQty', 'baseQty')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"a\": 26129,         // Aggregate tradeId\n         \"p\": \"0.01633102\",  // Price\n         \"q\": \"4.70443515\",  // Quantity\n         \"f\": 27781,         // First tradeId\n         \"l\": 27781,         // Last tradeId\n         \"T\": 1498793709153, // Timestamp\n         \"m\": true,          // Was the buyer the maker?\n         \"M\": true           // Was the trade the best price match?\n     }",
          "{\n         \"a\": \"269772814\",\n         \"p\": \"25864.1\",\n         \"q\": \"3\",\n         \"f\": \"662149354\",\n         \"l\": \"662149355\",\n         \"T\": \"1694209776022\",\n         \"m\": false,\n     }",
          "{\n         \"id\": 28457,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"time\": 1499865549590,\n         \"isBuyerMaker\": true,\n         \"isBestMatch\": true\n     }",
          "{\n         \"symbol\": \"BNBBTC\",\n         \"id\": 28457,\n         \"orderId\": 100234,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"commission\": \"10.10000000\",\n         \"commissionAsset\": \"BNB\",\n         \"time\": 1499865549590,\n         \"isBuyer\": true,\n         \"isMaker\": false,\n         \"isBestMatch\": true\n     }",
          "{\n       \"accountId\": 20,\n       \"buyer\": False,\n       \"commission\": \"-0.07819010\",\n       \"commissionAsset\": \"USDT\",\n       \"counterPartyId\": 653,\n       \"id\": 698759,\n       \"maker\": False,\n       \"orderId\": 25851813,\n       \"price\": \"7819.01\",\n       \"qty\": \"0.002\",\n       \"quoteQty\": \"0.01563\",\n       \"realizedPnl\": \"-0.91539999\",\n       \"side\": \"SELL\",\n       \"symbol\": \"BTCUSDT\",\n       \"time\": 1569514978020\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        if ('isDustTrade' in trade) {\n            return this.parseDustTrade (trade, market);\n        }\n        //\n        // aggregate trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list\n        //\n        //     {\n        //         \"a\": 26129,         // Aggregate tradeId\n        //         \"p\": \"0.01633102\",  // Price\n        //         \"q\": \"4.70443515\",  // Quantity\n        //         \"f\": 27781,         // First tradeId\n        //         \"l\": 27781,         // Last tradeId\n        //         \"T\": 1498793709153, // Timestamp\n        //         \"m\": true,          // Was the buyer the maker?\n        //         \"M\": true           // Was the trade the best price match?\n        //     }\n        //\n        // REST: aggregate trades for swap & future (both linear and inverse)\n        //\n        //     {\n        //         \"a\": \"269772814\",\n        //         \"p\": \"25864.1\",\n        //         \"q\": \"3\",\n        //         \"f\": \"662149354\",\n        //         \"l\": \"662149355\",\n        //         \"T\": \"1694209776022\",\n        //         \"m\": false,\n        //     }\n        //\n        // recent public trades and old public trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#recent-trades-list\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data\n        //\n        //     {\n        //         \"id\": 28457,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyerMaker\": true,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // private trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-trade-list-user_data\n        //\n        //     {\n        //         \"symbol\": \"BNBBTC\",\n        //         \"id\": 28457,\n        //         \"orderId\": 100234,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"commission\": \"10.10000000\",\n        //         \"commissionAsset\": \"BNB\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // futures trades\n        //\n        //     {\n        //       \"accountId\": 20,\n        //       \"buyer\": False,\n        //       \"commission\": \"-0.07819010\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"counterPartyId\": 653,\n        //       \"id\": 698759,\n        //       \"maker\": False,\n        //       \"orderId\": 25851813,\n        //       \"price\": \"7819.01\",\n        //       \"qty\": \"0.002\",\n        //       \"quoteQty\": \"0.01563\",\n        //       \"realizedPnl\": \"-0.91539999\",\n        //       \"side\": \"SELL\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"time\": 1569514978020\n        //     }\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"id\": 477128891,\n        //       \"orderId\": 13809777875,\n        //       \"side\": \"SELL\",\n        //       \"price\": \"38479.55\",\n        //       \"qty\": \"0.001\",\n        //       \"realizedPnl\": \"-0.00009534\",\n        //       \"marginAsset\": \"USDT\",\n        //       \"quoteQty\": \"38.47955\",\n        //       \"commission\": \"-0.00076959\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"time\": 1612733566708,\n        //       \"positionSide\": \"BOTH\",\n        //       \"maker\": true,\n        //       \"buyer\": false\n        //     }\n        //\n        // { respType: FULL }\n        //\n        //     {\n        //       \"price\": \"4000.00000000\",\n        //       \"qty\": \"1.00000000\",\n        //       \"commission\": \"4.00000000\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"tradeId\": \"1234\",\n        //     }\n        //\n        // options: fetchMyTrades\n        //\n        //     {\n        //         \"id\": 1125899906844226012,\n        //         \"tradeId\": 73,\n        //         \"orderId\": 4638761100843040768,\n        //         \"symbol\": \"ETH-230211-1500-C\",\n        //         \"price\": \"18.70000000\",\n        //         \"quantity\": \"-0.57000000\",\n        //         \"fee\": \"0.17305890\",\n        //         \"realizedProfit\": \"-3.53400000\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"LIMIT\",\n        //         \"volatility\": \"0.30000000\",\n        //         \"liquidity\": \"MAKER\",\n        //         \"time\": 1676085216845,\n        //         \"priceScale\": 1,\n        //         \"quantityScale\": 2,\n        //         \"optionSide\": \"CALL\",\n        //         \"quoteAsset\": \"USDT\"\n        //     }\n        //\n        // options: fetchTrades\n        //\n        //     {\n        //         \"id\": 1,\n        //         \"symbol\": \"ETH-230216-1500-C\",\n        //         \"price\": \"35.5\",\n        //         \"qty\": \"0.03\",\n        //         \"quoteQty\": \"1.065\",\n        //         \"side\": 1,\n        //         \"time\": 1676366446072\n        //     }\n        //\n        // fetchMyTrades: linear portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"id\": 4575108247,\n        //         \"orderId\": 261942655610,\n        //         \"side\": \"SELL\",\n        //         \"price\": \"47263.40\",\n        //         \"qty\": \"0.010\",\n        //         \"realizedPnl\": \"27.38400000\",\n        //         \"marginAsset\": \"USDT\",\n        //         \"quoteQty\": \"472.63\",\n        //         \"commission\": \"0.18905360\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707530039409,\n        //         \"buyer\": false,\n        //         \"maker\": false,\n        //         \"positionSide\": \"LONG\"\n        //     }\n        //\n        // fetchMyTrades: inverse portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSD_PERP\",\n        //         \"id\": 701907838,\n        //         \"orderId\": 71548909034,\n        //         \"pair\": \"ETHUSD\",\n        //         \"side\": \"SELL\",\n        //         \"price\": \"2498.15\",\n        //         \"qty\": \"1\",\n        //         \"realizedPnl\": \"0.00012517\",\n        //         \"marginAsset\": \"ETH\",\n        //         \"baseQty\": \"0.00400296\",\n        //         \"commission\": \"0.00000160\",\n        //         \"commissionAsset\": \"ETH\",\n        //         \"time\": 1707530317519,\n        //         \"positionSide\": \"LONG\",\n        //         \"buyer\": false,\n        //         \"maker\": false\n        //     }\n        //\n        // fetchMyTrades: spot margin portfolio margin\n        //\n        //     {\n        //         \"symbol\": \"ADAUSDT\",\n        //         \"id\": 470227543,\n        //         \"orderId\": 4421170947,\n        //         \"price\": \"0.53880000\",\n        //         \"qty\": \"10.00000000\",\n        //         \"quoteQty\": \"5.38800000\",\n        //         \"commission\": \"0.00538800\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1707545780522,\n        //         \"isBuyer\": false,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'T', 'time');\n        let amount = this.safeString2 (trade, 'q', 'qty');\n        amount = this.safeString (trade, 'quantity', amount);\n        const marketId = this.safeString (trade, 'symbol');\n        const isSpotTrade = ('isIsolated' in trade) || ('M' in trade) || ('orderListId' in trade) || ('isMaker' in trade);\n        const marketType = isSpotTrade ? 'spot' : 'contract';\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        let side = undefined;\n        const buyerMaker = this.safeBool2 (trade, 'm', 'isBuyerMaker');\n        let takerOrMaker = undefined;\n        if (buyerMaker !== undefined) {\n            side = buyerMaker ? 'sell' : 'buy'; // this is reversed intentionally\n        } else if ('side' in trade) {\n            side = this.safeStringLower (trade, 'side');\n        } else {\n            if ('isBuyer' in trade) {\n                side = trade['isBuyer'] ? 'buy' : 'sell'; // this is a true side\n            }\n        }\n        let fee = undefined;\n        if ('commission' in trade) {\n            fee = {\n                'cost': this.safeString (trade, 'commission'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'commissionAsset')),\n            };\n        }\n        if ('isMaker' in trade) {\n            takerOrMaker = trade['isMaker'] ? 'maker' : 'taker';\n        }\n        if ('maker' in trade) {\n            takerOrMaker = trade['maker'] ? 'maker' : 'taker';\n        }\n        if (('optionSide' in trade) || market['option']) {\n            const settle = this.safeCurrencyCode (this.safeString (trade, 'quoteAsset', 'USDT'));\n            takerOrMaker = this.safeStringLower (trade, 'liquidity');\n            if ('fee' in trade) {\n                fee = {\n                    'cost': this.safeString (trade, 'fee'),\n                    'currency': settle,\n                };\n            }\n            if ((side !== 'buy') && (side !== 'sell')) {\n                side = (side === '1') ? 'buy' : 'sell';\n            }\n            if ('optionSide' in trade) {\n                if (side !== 'buy') {\n                    amount = Precise.stringMul ('-1', amount);\n                }\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': this.safeStringN (trade, [ 't', 'a', 'tradeId', 'id' ]),\n            'order': this.safeString (trade, 'orderId'),\n            'type': this.safeStringLower (trade, 'type'),\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString2 (trade, 'p', 'price'),\n            'amount': amount,\n            'cost': this.safeString2 (trade, 'quoteQty', 'baseQty'),\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 9517,
        "line_end": 9545,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n       {\n         \"symbol\": \"BTCUSDT\",\n         \"makerCommission\": \"0.001\",\n         \"takerCommission\": \"0.001\"\n       }\n     ]",
          "{\n         \"symbol\": \"BTCUSD_PERP\",\n         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        // spot\n        //     [\n        //       {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"makerCommission\": \"0.001\",\n        //         \"takerCommission\": \"0.001\"\n        //       }\n        //     ]\n        //\n        // swap\n        //     {\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"makerCommissionRate\": \"0.00015\",  // 0.015%\n        //         \"takerCommissionRate\": \"0.00040\"   // 0.040%\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber2 (fee, 'makerCommission', 'makerCommissionRate'),\n            'taker': this.safeNumber2 (fee, 'takerCommission', 'takerCommissionRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 8648,
        "line_end": 8777,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"amount\": \"4500\",\n       \"coin\": \"USDT\",\n       \"network\": \"BSC\",\n       \"status\": 1,\n       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n       \"addressTag\": \"\",\n       \"txId\": \"Internal transfer 51376627901\",\n       \"insertTime\": 1618394381000,\n       \"transferType\": 1,\n       \"confirmTimes\": \"1/15\"\n     }",
          "{\n       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n       \"amount\": \"28.75\",\n       \"transactionFee\": \"0.25\",\n       \"coin\": \"XRP\",\n       \"status\": 6,\n       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n       \"addressTag\": \"101286922\",\n       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n       \"applyTime\": \"2021-04-15 12:09:16\",\n       \"network\": \"XRP\",\n       \"transferType\": 0\n     }",
          "{\n       \"orderNo\": \"CJW684897551397171200\",\n       \"fiatCurrency\": \"GBP\",\n       \"indicatedAmount\": \"29.99\",\n       \"amount\": \"28.49\",\n       \"totalFee\": \"1.50\",\n       \"method\": \"bank transfer\",\n       \"status\": \"Successful\",\n       \"createTime\": 1614898701000,\n       \"updateTime\": 1614898820000\n     }",
          "{\n       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n       \"fiatCurrency\": \"EUR\",\n       \"transactionType\": 0,\n       \"indicatedAmount\": \"15.00\",\n       \"amount\": \"15.00\",\n       \"totalFee\": \"0.00\",\n       \"method\": \"card\",\n       \"status\": \"Failed\",\n       \"createTime\": \"1627501026000\",\n       \"updateTime\": \"1627501027000\"\n     }",
          "{ id: \"9a67628b16ba4988ae20d329333f16bc\" }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //       \"amount\": \"4500\",\n        //       \"coin\": \"USDT\",\n        //       \"network\": \"BSC\",\n        //       \"status\": 1,\n        //       \"address\": \"0xc9c923c87347ca0f3451d6d308ce84f691b9f501\",\n        //       \"addressTag\": \"\",\n        //       \"txId\": \"Internal transfer 51376627901\",\n        //       \"insertTime\": 1618394381000,\n        //       \"transferType\": 1,\n        //       \"confirmTimes\": \"1/15\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //       \"id\": \"69e53ad305124b96b43668ceab158a18\",\n        //       \"amount\": \"28.75\",\n        //       \"transactionFee\": \"0.25\",\n        //       \"coin\": \"XRP\",\n        //       \"status\": 6,\n        //       \"address\": \"r3T75fuLjX51mmfb5Sk1kMNuhBgBPJsjza\",\n        //       \"addressTag\": \"101286922\",\n        //       \"txId\": \"19A5B24ED0B697E4F0E9CD09FCB007170A605BC93C9280B9E6379C5E6EF0F65A\",\n        //       \"applyTime\": \"2021-04-15 12:09:16\",\n        //       \"network\": \"XRP\",\n        //       \"transferType\": 0\n        //     }\n        //\n        // fiat transaction\n        // withdraw\n        //     {\n        //       \"orderNo\": \"CJW684897551397171200\",\n        //       \"fiatCurrency\": \"GBP\",\n        //       \"indicatedAmount\": \"29.99\",\n        //       \"amount\": \"28.49\",\n        //       \"totalFee\": \"1.50\",\n        //       \"method\": \"bank transfer\",\n        //       \"status\": \"Successful\",\n        //       \"createTime\": 1614898701000,\n        //       \"updateTime\": 1614898820000\n        //     }\n        //\n        // deposit\n        //     {\n        //       \"orderNo\": \"25ced37075c1470ba8939d0df2316e23\",\n        //       \"fiatCurrency\": \"EUR\",\n        //       \"transactionType\": 0,\n        //       \"indicatedAmount\": \"15.00\",\n        //       \"amount\": \"15.00\",\n        //       \"totalFee\": \"0.00\",\n        //       \"method\": \"card\",\n        //       \"status\": \"Failed\",\n        //       \"createTime\": \"1627501026000\",\n        //       \"updateTime\": \"1627501027000\"\n        //     }\n        //\n        // withdraw\n        //\n        //    { id: \"9a67628b16ba4988ae20d329333f16bc\" }\n        //\n        const id = this.safeString2 (transaction, 'id', 'orderNo');\n        const address = this.safeString (transaction, 'address');\n        let tag = this.safeString (transaction, 'addressTag'); // set but unused\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        let txid = this.safeString (transaction, 'txId');\n        if ((txid !== undefined) && (txid.indexOf ('Internal transfer ') >= 0)) {\n            txid = txid.slice (18);\n        }\n        const currencyId = this.safeString2 (transaction, 'coin', 'fiatCurrency');\n        let code = this.safeCurrencyCode (currencyId, currency);\n        let timestamp = undefined;\n        timestamp = this.safeInteger2 (transaction, 'insertTime', 'createTime');\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (transaction, 'applyTime'));\n        }\n        const updated = this.safeInteger2 (transaction, 'successTime', 'updateTime');\n        let type = this.safeString (transaction, 'type');\n        if (type === undefined) {\n            const txType = this.safeString (transaction, 'transactionType');\n            if (txType !== undefined) {\n                type = (txType === '0') ? 'deposit' : 'withdrawal';\n            }\n            const legalMoneyCurrenciesById = this.safeDict (this.options, 'legalMoneyCurrenciesById');\n            code = this.safeString (legalMoneyCurrenciesById, code, code);\n        }\n        const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber2 (transaction, 'transactionFee', 'totalFee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const internalInteger = this.safeInteger (transaction, 'transferType');\n        let internal = undefined;\n        if (internalInteger !== undefined) {\n            internal = (internalInteger !== 0) ? true : false;\n        }\n        const network = this.safeString (transaction, 'network');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': internal,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 8608,
        "line_end": 8646,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        if (type === undefined) {\n            return status;\n        }\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n                '6': 'ok',\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n                '2': 'pending', // Awaiting Approval\n                '3': 'failed', // Rejected\n                '4': 'pending', // Processing\n                '5': 'failed', // Failure\n                '6': 'ok', // Completed\n                // Fiat\n                // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped\n                'Processing': 'pending',\n                'Failed': 'failed',\n                'Successful': 'ok',\n                'Refunding': 'canceled',\n                'Refunded': 'canceled',\n                'Refund Failed': 'failed',\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 8786,
        "line_end": 8888,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tranId\":13526853623\n     }",
          "{\n         \"timestamp\": 1614640878000,\n         \"asset\": \"USDT\",\n         \"amount\": \"25\",\n         \"type\": \"MAIN_UMFUTURE\",\n         \"status\": \"CONFIRMED\",\n         \"tranId\": 43000126248\n     }",
          "{\n             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n             \"transactionId\": \"M_P_71505104267788288\",\n             \"transactionTime\": 1610090460133, //trade timestamp\n             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n             \"currency\": \"BNB\",\n             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n             \"fundsDetail\": [ // details\n                     {\n                         \"currency\": \"USDT\", //asset\n                         \"amount\": \"1.2\",\n                         \"walletAssetCost\":[ //details of asset cost per wallet\n                             {\"1\":\"0.6\"},\n                             {\"2\":\"0.6\"}\n                         ]\n                     },\n                     {\n                         \"currency\": \"ETH\",\n                         \"amount\": \"0.0001\",\n                         \"walletAssetCost\":[\n                             {\"1\":\"0.00005\"},\n                             {\"2\":\"0.00005\"}\n                         ]\n                     }\n                 ],\n             \"payerInfo\":{\n                     \"name\":\"Jack\", //nickname or merchant name\n                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n                     \"binanceId\":\"12345678\", //binance uid\n                     \"accountId\":\"67736251\" //binance pay id\n                 },\n             \"receiverInfo\":{\n                     \"name\":\"Alan\", //nickname or merchant name\n                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n                     \"email\":\"alan@binance.com\", //email\n                     \"binanceId\":\"34355667\", //binance uid\n                     \"accountId\":\"21326891\", //binance pay id\n                     \"countryCode\":\"1\", //International area code\n                     \"phoneNumber\":\"8057651210\",\n                     \"mobileCode\":\"US\", //country code\n                     \"extend\":[ //extension field\n                             \"institutionName\": \"\",\n                             \"cardNumber\": \"\",\n                             \"digitalWalletId\": \"\"\n                     ]\n                 }\n             }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"tranId\":13526853623\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"timestamp\": 1614640878000,\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"25\",\n        //         \"type\": \"MAIN_UMFUTURE\",\n        //         \"status\": \"CONFIRMED\",\n        //         \"tranId\": 43000126248\n        //     }\n        //\n        //     {\n        //             \"orderType\": \"C2C\", // Enum：PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE（Send cash)\n        //             \"transactionId\": \"M_P_71505104267788288\",\n        //             \"transactionTime\": 1610090460133, //trade timestamp\n        //             \"amount\": \"23.72469206\", //order amount(up to 8 decimal places), positive is income, negative is expenditure\n        //             \"currency\": \"BNB\",\n        //             \"walletType\": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet\n        //             \"walletTypes\": [1,2], //array format，there are multiple values when using combination payment\n        //             \"fundsDetail\": [ // details\n        //                     {\n        //                         \"currency\": \"USDT\", //asset\n        //                         \"amount\": \"1.2\",\n        //                         \"walletAssetCost\":[ //details of asset cost per wallet\n        //                             {\"1\":\"0.6\"},\n        //                             {\"2\":\"0.6\"}\n        //                         ]\n        //                     },\n        //                     {\n        //                         \"currency\": \"ETH\",\n        //                         \"amount\": \"0.0001\",\n        //                         \"walletAssetCost\":[\n        //                             {\"1\":\"0.00005\"},\n        //                             {\"2\":\"0.00005\"}\n        //                         ]\n        //                     }\n        //                 ],\n        //             \"payerInfo\":{\n        //                     \"name\":\"Jack\", //nickname or merchant name\n        //                     \"type\":\"USER\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"binanceId\":\"12345678\", //binance uid\n        //                     \"accountId\":\"67736251\" //binance pay id\n        //                 },\n        //             \"receiverInfo\":{\n        //                     \"name\":\"Alan\", //nickname or merchant name\n        //                     \"type\":\"MERCHANT\", //account type，USER for personal，MERCHANT for merchant\n        //                     \"email\":\"alan@binance.com\", //email\n        //                     \"binanceId\":\"34355667\", //binance uid\n        //                     \"accountId\":\"21326891\", //binance pay id\n        //                     \"countryCode\":\"1\", //International area code\n        //                     \"phoneNumber\":\"8057651210\",\n        //                     \"mobileCode\":\"US\", //country code\n        //                     \"extend\":[ //extension field\n        //                             \"institutionName\": \"\",\n        //                             \"cardNumber\": \"\",\n        //                             \"digitalWalletId\": \"\"\n        //                     ]\n        //                 }\n        //             }\n        const id = this.safeString2 (transfer, 'tranId', 'transactionId');\n        const currencyId = this.safeString2 (transfer, 'asset', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const amount = this.safeNumber (transfer, 'amount');\n        const type = this.safeString (transfer, 'type');\n        let fromAccount = undefined;\n        let toAccount = undefined;\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        if (type !== undefined) {\n            const parts = type.split ('_');\n            fromAccount = this.safeValue (parts, 0);\n            toAccount = this.safeValue (parts, 1);\n            fromAccount = this.safeString (accountsById, fromAccount, fromAccount);\n            toAccount = this.safeString (accountsById, toAccount, toAccount);\n        }\n        const walletType = this.safeInteger (transfer, 'walletType');\n        if (walletType !== undefined) {\n            const payer = this.safeDict (transfer, 'payerInfo', {});\n            const receiver = this.safeDict (transfer, 'receiverInfo', {});\n            fromAccount = this.safeString (payer, 'accountId');\n            toAccount = this.safeString (receiver, 'accountId');\n        }\n        const timestamp = this.safeInteger2 (transfer, 'timestamp', 'transactionTime');\n        const status = this.parseTransferStatus (this.safeString (transfer, 'status'));\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': status,\n        };\n    }",
        "inherited": true,
        "inherited_from": "binance"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 8779,
        "line_end": 8784,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'CONFIRMED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "binance"
      }
    ],
    "bingx": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2487,
        "line_end": 2598,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"code\": 0,\n         \"timestamp\": 1721192833454,\n         \"data\": [\n             {\n                 \"asset\": \"USDT\",\n                 \"balance\": \"4.72644300000000000000\",\n                 \"crossWalletBalance\": \"4.72644300000000000000\",\n                 \"crossUnPnl\": \"0\",\n                 \"availableBalance\": \"4.72644300000000000000\",\n                 \"maxWithdrawAmount\": \"4.72644300000000000000\",\n                 \"marginAvailable\": false,\n                 \"updateTime\": 1721192833443\n             },\n         ]\n     }",
          "{\n         \"code\": 0,\n         \"msg\": \"\",\n         \"debugMsg\": \"\",\n         \"data\": {\n             \"balances\": [\n                 {\n                     \"asset\": \"USDT\",\n                     \"free\": \"45.733046995800514\",\n                     \"locked\": \"0\"\n                 },\n             ]\n         }\n     }",
          "{\n         \"code\": 0,\n         \"msg\": \"\",\n         \"timestamp\": 1721191833813,\n         \"data\": [\n             {\n                 \"asset\": \"SOL\",\n                 \"balance\": \"0.35707951\",\n                 \"equity\": \"0.35791051\",\n                 \"unrealizedProfit\": \"0.00083099\",\n                 \"availableMargin\": \"0.35160653\",\n                 \"usedMargin\": \"0.00630397\",\n                 \"freezedMargin\": \"0\",\n                 \"shortUid\": \"12851936\"\n             }\n         ]\n     }",
          "{\n         \"code\": 0,\n         \"msg\": \"\",\n         \"data\": [\n             {\n                 \"userId\": \"116***295\",\n                 \"asset\": \"USDT\",\n                 \"balance\": \"194.8212\",\n                 \"equity\": \"196.7431\",\n                 \"unrealizedProfit\": \"1.9219\",\n                 \"realisedProfit\": \"-109.2504\",\n                 \"availableMargin\": \"193.7609\",\n                 \"usedMargin\": \"1.0602\",\n                 \"freezedMargin\": \"0.0000\",\n                 \"shortUid\": \"12851936\"\n             }\n         ]\n     }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // standard\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"timestamp\": 1721192833454,\n        //         \"data\": [\n        //             {\n        //                 \"asset\": \"USDT\",\n        //                 \"balance\": \"4.72644300000000000000\",\n        //                 \"crossWalletBalance\": \"4.72644300000000000000\",\n        //                 \"crossUnPnl\": \"0\",\n        //                 \"availableBalance\": \"4.72644300000000000000\",\n        //                 \"maxWithdrawAmount\": \"4.72644300000000000000\",\n        //                 \"marginAvailable\": false,\n        //                 \"updateTime\": 1721192833443\n        //             },\n        //         ]\n        //     }\n        //\n        // spot\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"msg\": \"\",\n        //         \"debugMsg\": \"\",\n        //         \"data\": {\n        //             \"balances\": [\n        //                 {\n        //                     \"asset\": \"USDT\",\n        //                     \"free\": \"45.733046995800514\",\n        //                     \"locked\": \"0\"\n        //                 },\n        //             ]\n        //         }\n        //     }\n        //\n        // inverse swap\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"msg\": \"\",\n        //         \"timestamp\": 1721191833813,\n        //         \"data\": [\n        //             {\n        //                 \"asset\": \"SOL\",\n        //                 \"balance\": \"0.35707951\",\n        //                 \"equity\": \"0.35791051\",\n        //                 \"unrealizedProfit\": \"0.00083099\",\n        //                 \"availableMargin\": \"0.35160653\",\n        //                 \"usedMargin\": \"0.00630397\",\n        //                 \"freezedMargin\": \"0\",\n        //                 \"shortUid\": \"12851936\"\n        //             }\n        //         ]\n        //     }\n        //\n        // linear swap\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"msg\": \"\",\n        //         \"data\": [\n        //             {\n        //                 \"userId\": \"116***295\",\n        //                 \"asset\": \"USDT\",\n        //                 \"balance\": \"194.8212\",\n        //                 \"equity\": \"196.7431\",\n        //                 \"unrealizedProfit\": \"1.9219\",\n        //                 \"realisedProfit\": \"-109.2504\",\n        //                 \"availableMargin\": \"193.7609\",\n        //                 \"usedMargin\": \"1.0602\",\n        //                 \"freezedMargin\": \"0.0000\",\n        //                 \"shortUid\": \"12851936\"\n        //             }\n        //         ]\n        //     }\n        //\n        const result: Dict = { 'info': response };\n        const contractBalances = this.safeList (response, 'data');\n        const firstContractBalances = this.safeDict (contractBalances, 0);\n        const isContract = firstContractBalances !== undefined;\n        const spotData = this.safeDict (response, 'data', {});\n        const spotBalances = this.safeList2 (spotData, 'balances', 'assets', []);\n        if (isContract) {\n            for (let i = 0; i < contractBalances.length; i++) {\n                const balance = contractBalances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                if (currencyId === undefined) { // linear v3 returns empty asset\n                    break;\n                }\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString2 (balance, 'availableMargin', 'availableBalance');\n                account['used'] = this.safeString (balance, 'usedMargin');\n                account['total'] = this.safeString (balance, 'maxWithdrawAmount');\n                result[code] = account;\n            }\n        } else {\n            for (let i = 0; i < spotBalances.length; i++) {\n                const balance = spotBalances[i];\n                const currencyId = this.safeString (balance, 'asset');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'free');\n                account['used'] = this.safeString (balance, 'locked');\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 5300,
        "line_end": 5325,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"coinId\":\"4\",\n     \"coin\":\"USDT\",\n     \"network\":\"OMNI\",\n     \"address\":\"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN\",\n     \"addressWithPrefix\":\"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN\"\n }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        // {\n        //     \"coinId\":\"4\",\n        //     \"coin\":\"USDT\",\n        //     \"network\":\"OMNI\",\n        //     \"address\":\"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN\",\n        //     \"addressWithPrefix\":\"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN\"\n        // }\n        //\n        const tag = this.safeString (depositAddress, 'tag');\n        const currencyId = this.safeString (depositAddress, 'coin');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = currency['code'];\n        const address = this.safeString (depositAddress, 'addressWithPrefix');\n        const networkdId = this.safeString (depositAddress, 'network');\n        const networkCode = this.networkIdToCode (networkdId, code);\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 5958,
        "line_end": 5992,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        // currencie structure\n        //\n        const networks = this.safeDict (fee, 'networks', {});\n        const networkCodes = Object.keys (networks);\n        const networksLength = networkCodes.length;\n        const result: Dict = {\n            'info': networks,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        if (networksLength !== 0) {\n            for (let i = 0; i < networksLength; i++) {\n                const networkCode = networkCodes[i];\n                const network = networks[networkCode];\n                result['networks'][networkCode] = {\n                    'deposit': { 'fee': undefined, 'percentage': undefined },\n                    'withdraw': { 'fee': this.safeNumber (network, 'fee'), 'percentage': false },\n                };\n                if (networksLength === 1) {\n                    result['withdraw']['fee'] = this.safeNumber (network, 'withdrawFee');\n                    result['withdraw']['percentage'] = false;\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1722,
        "line_end": 1754,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-', 'swap')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'indexPrice')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'lastFundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USDT\",\n         \"markPrice\": \"16884.5\",\n         \"indexPrice\": \"16886.9\",\n         \"lastFundingRate\": \"0.0001\",\n         \"nextFundingTime\": 1672041600000\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"markPrice\": \"16884.5\",\n        //         \"indexPrice\": \"16886.9\",\n        //         \"lastFundingRate\": \"0.0001\",\n        //         \"nextFundingTime\": 1672041600000\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const nextFundingTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market, '-', 'swap'),\n            'markPrice': this.safeNumber (contract, 'markPrice'),\n            'indexPrice': this.safeNumber (contract, 'indexPrice'),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'lastFundingRate'),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 1813,
        "line_end": 1829,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (contract, 'symbol'), market, '-', 'swap')",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USDT\",\n         \"fundingRate\": \"0.0001\",\n         \"fundingTime\": 1585684800000\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"fundingRate\": \"0.0001\",\n        //         \"fundingTime\": 1585684800000\n        //     }\n        //\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (this.safeString (contract, 'symbol'), market, '-', 'swap'),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 1890,
        "line_end": 1914,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'tranId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'income')",
            "comment": null
          },
          {
            "key": "type",
            "value": "'funding'",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"LDO-USDT\",\n     \"incomeType\": \"FUNDING_FEE\",\n     \"income\": \"-0.0292\",\n     \"asset\": \"USDT\",\n     \"info\": \"Funding Fee\",\n     \"time\": 1702713615000,\n     \"tranId\": \"170***6*2_3*9_20***97\",\n     \"tradeId\": \"170***6*2_3*9_20***97\"\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        // {\n        //     \"symbol\": \"LDO-USDT\",\n        //     \"incomeType\": \"FUNDING_FEE\",\n        //     \"income\": \"-0.0292\",\n        //     \"asset\": \"USDT\",\n        //     \"info\": \"Funding Fee\",\n        //     \"time\": 1702713615000,\n        //     \"tranId\": \"170***6*2_3*9_20***97\",\n        //     \"tradeId\": \"170***6*2_3*9_20***97\"\n        // }\n        const marketId = this.safeString (income, 'symbol');\n        const currencyId = this.safeString (income, 'asset');\n        const timestamp = this.safeInteger (income, 'time');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'tranId'),\n            'amount': this.safeNumber (income, 'income'),\n            'type': 'funding',\n        };\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 5715,
        "line_end": 5752,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "this.safeInteger (leverage, 'longLeverage')",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "this.safeInteger (leverage, 'shortLeverage')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"longLeverage\": 5,\n         \"shortLeverage\": 5,\n         \"maxLongLeverage\": 125,\n         \"maxShortLeverage\": 125,\n         \"availableLongVol\": \"0.0000\",\n         \"availableShortVol\": \"0.0000\",\n         \"availableLongVal\": \"0.0\",\n         \"availableShortVal\": \"0.0\",\n         \"maxPositionLongVal\": \"0.0\",\n         \"maxPositionShortVal\": \"0.0\"\n     }",
          "{\n         \"symbol\": \"SOL-USD\",\n         \"longLeverage\": 5,\n         \"shortLeverage\": 5,\n         \"maxLongLeverage\": 50,\n         \"maxShortLeverage\": 50,\n         \"availableLongVol\": \"4000000\",\n         \"availableShortVol\": \"4000000\"\n     }"
        ],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        //\n        // linear swap\n        //\n        //     {\n        //         \"longLeverage\": 5,\n        //         \"shortLeverage\": 5,\n        //         \"maxLongLeverage\": 125,\n        //         \"maxShortLeverage\": 125,\n        //         \"availableLongVol\": \"0.0000\",\n        //         \"availableShortVol\": \"0.0000\",\n        //         \"availableLongVal\": \"0.0\",\n        //         \"availableShortVal\": \"0.0\",\n        //         \"maxPositionLongVal\": \"0.0\",\n        //         \"maxPositionShortVal\": \"0.0\"\n        //     }\n        //\n        // inverse swap\n        //\n        //     {\n        //         \"symbol\": \"SOL-USD\",\n        //         \"longLeverage\": 5,\n        //         \"shortLeverage\": 5,\n        //         \"maxLongLeverage\": 50,\n        //         \"maxShortLeverage\": 50,\n        //         \"availableLongVol\": \"4000000\",\n        //         \"availableShortVol\": \"4000000\"\n        //     }\n        //\n        const marketId = this.safeString (leverage, 'symbol');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': undefined,\n            'longLeverage': this.safeInteger (leverage, 'longLeverage'),\n            'shortLeverage': this.safeInteger (leverage, 'shortLeverage'),\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 6197,
        "line_end": 6237,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contractsString)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSizeString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (priceString)",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.parseNumber (baseValueString)",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (quoteValueString)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": \"int64\",\n         \"symbol\": \"string\",\n         \"side\": \"string\",\n         \"type\": \"string\",\n         \"positionSide\": \"string\",\n         \"cumQuote\": \"string\",\n         \"status\": \"string\",\n         \"stopPrice\": \"string\",\n         \"price\": \"string\",\n         \"origQty\": \"string\",\n         \"avgPrice\": \"string\",\n         \"executedQty\": \"string\",\n         \"orderId\": \"int64\",\n         \"profit\": \"string\",\n         \"commission\": \"string\",\n         \"workingType\": \"string\",\n         \"updateTime\": \"int64\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"time\": \"int64\",\n        //         \"symbol\": \"string\",\n        //         \"side\": \"string\",\n        //         \"type\": \"string\",\n        //         \"positionSide\": \"string\",\n        //         \"cumQuote\": \"string\",\n        //         \"status\": \"string\",\n        //         \"stopPrice\": \"string\",\n        //         \"price\": \"string\",\n        //         \"origQty\": \"string\",\n        //         \"avgPrice\": \"string\",\n        //         \"executedQty\": \"string\",\n        //         \"orderId\": \"int64\",\n        //         \"profit\": \"string\",\n        //         \"commission\": \"string\",\n        //         \"workingType\": \"string\",\n        //         \"updateTime\": \"int64\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger (liquidation, 'time');\n        const contractsString = this.safeString (liquidation, 'executedQty');\n        const contractSizeString = this.safeString (market, 'contractSize');\n        const priceString = this.safeString (liquidation, 'avgPrice');\n        const baseValueString = Precise.stringMul (contractsString, contractSizeString);\n        const quoteValueString = Precise.stringMul (baseValueString, priceString);\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.parseNumber (contractsString),\n            'contractSize': this.parseNumber (contractSizeString),\n            'price': this.parseNumber (priceString),\n            'baseValue': this.parseNumber (baseValueString),\n            'quoteValue': this.parseNumber (quoteValueString),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 6621,
        "line_end": 6630,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-', 'swap')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginType",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        let marginType = this.safeStringLower (marginMode, 'marginType');\n        marginType = (marginType === 'crossed') ? 'cross' : marginType;\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (marketId, market, '-', 'swap'),\n            'marginMode': marginType,\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 5631,
        "line_end": 5653,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "type",
            "value": "(type === '1') ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "total",
            "value": "this.safeNumber (data, 'margin')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (market, 'settle')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"code\": 0,\n        \"msg\": \"\",\n        \"amount\": 1,\n        \"type\": 1\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //    {\n        //        \"code\": 0,\n        //        \"msg\": \"\",\n        //        \"amount\": 1,\n        //        \"type\": 1\n        //    }\n        //\n        const type = this.safeString (data, 'type');\n        return {\n            'info': data,\n            'symbol': this.safeString (market, 'symbol'),\n            'type': (type === '1') ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'total': this.safeNumber (data, 'margin'),\n            'code': this.safeString (market, 'settle'),\n            'status': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1021,
        "line_end": 1124,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "currency",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "isActive",
            "comment": null
          },
          {
            "key": "contract",
            "value": "swap",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isInverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "feeSide",
            "value": "this.safeString (fees, 'feeSide')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': quantityPrecision,\n                'price': pricePrecision,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': minTickSize,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumberN (market, [ 'minNotional', 'tradeMinUSDT', 'minTradeValue' ]),\n                    'max': this.safeNumber (market, 'maxNotional'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "timeOnline",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "quantityPrecision",
            "comment": null
          },
          {
            "key": "price",
            "value": "pricePrecision",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        const symbolParts = id.split ('-');\n        const baseId = symbolParts[0];\n        const quoteId = symbolParts[1];\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let currency = this.safeString (market, 'currency');\n        let checkIsInverse = false;\n        let checkIsLinear = true;\n        const minTickSize = this.safeNumber (market, 'minTickSize');\n        if (minTickSize !== undefined) {\n            // inverse swap market\n            currency = baseId;\n            checkIsInverse = true;\n            checkIsLinear = false;\n        }\n        const settle = this.safeCurrencyCode (currency);\n        let pricePrecision = this.safeNumber (market, 'tickSize');\n        if (pricePrecision === undefined) {\n            pricePrecision = this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision')));\n        }\n        let quantityPrecision = this.safeNumber (market, 'stepSize');\n        if (quantityPrecision === undefined) {\n            quantityPrecision = this.parseNumber (this.parsePrecision (this.safeString (market, 'quantityPrecision')));\n        }\n        const type = (settle !== undefined) ? 'swap' : 'spot';\n        const spot = type === 'spot';\n        const swap = type === 'swap';\n        let symbol = base + '/' + quote;\n        if (settle !== undefined) {\n            symbol += ':' + settle;\n        }\n        const fees = this.safeDict (this.fees, type, {});\n        const contractSize = (swap) ? this.parseNumber ('1') : undefined;\n        let isActive = false;\n        if ((this.safeString (market, 'apiStateOpen') === 'true') && (this.safeString (market, 'apiStateClose') === 'true')) {\n            isActive = true; // swap active\n        } else if (this.safeBool (market, 'apiStateSell') && this.safeBool (market, 'apiStateBuy') && (this.safeString (market, 'status') === '1')) {\n            isActive = true; // spot active\n        }\n        const isInverse = (spot) ? undefined : checkIsInverse;\n        const isLinear = (spot) ? undefined : checkIsLinear;\n        let minAmount = undefined;\n        if (!spot) {\n            minAmount = this.safeNumber2 (market, 'minQty', 'tradeMinQuantity');\n        }\n        let timeOnline = this.safeInteger (market, 'timeOnline');\n        if (timeOnline === 0) {\n            timeOnline = undefined;\n        }\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': currency,\n            'type': type,\n            'spot': spot,\n            'margin': false,\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': isActive,\n            'contract': swap,\n            'linear': isLinear,\n            'inverse': isInverse,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'feeSide': this.safeString (fees, 'feeSide'),\n            'contractSize': contractSize,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': quantityPrecision,\n                'price': pricePrecision,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': minTickSize,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumberN (market, [ 'minNotional', 'tradeMinUSDT', 'minTradeValue' ]),\n                    'max': this.safeNumber (market, 'maxNotional'),\n                },\n            },\n            'created': timeOnline,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 6799,
        "line_end": 6831,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeNumber (tierParts, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (market, 'settle')",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (tier, 'minPositionVal')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'maxPositionVal')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintMarginRatio')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"tier\": \"Tier 1\",\n             \"symbol\": \"ETH-USDT\",\n             \"minPositionVal\": \"0\",\n             \"maxPositionVal\": \"900000\",\n             \"maintMarginRatio\": \"0.003300\",\n             \"maintAmount\": \"0.000000\"\n         }\n     ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //     [\n        //         {\n        //             \"tier\": \"Tier 1\",\n        //             \"symbol\": \"ETH-USDT\",\n        //             \"minPositionVal\": \"0\",\n        //             \"maxPositionVal\": \"900000\",\n        //             \"maintMarginRatio\": \"0.003300\",\n        //             \"maintAmount\": \"0.000000\"\n        //         }\n        //     ]\n        //\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const tier = this.safeDict (info, i);\n            const tierString = this.safeString (tier, 'tier');\n            const tierParts = tierString.split (' ');\n            const marketId = this.safeString (tier, 'symbol');\n            market = this.safeMarket (marketId, market, undefined, 'swap');\n            tiers.push ({\n                'tier': this.safeNumber (tierParts, 1),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': this.safeString (market, 'settle'),\n                'minNotional': this.safeNumber (tier, 'minPositionVal'),\n                'maxNotional': this.safeNumber (tier, 'maxPositionVal'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintMarginRatio'),\n                'maxLeverage': undefined,\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1249,
        "line_end": 1301,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"open\": \"19394.4\",\n        \"close\": \"19379.0\",\n        \"high\": \"19394.4\",\n        \"low\": \"19368.3\",\n        \"volume\": \"167.44\",\n        \"time\": 1666584000000\n    }",
          "{\n        \"open\": \"42191.7\",\n        \"close\": \"42189.5\",\n        \"high\": \"42196.5\",\n        \"low\": \"42189.5\",\n        \"volume\": \"0.00\",\n        \"openTime\": 1706508840000,\n        \"closeTime\": 1706508840000\n    }",
          "[\n        1691402580000,\n        29093.61,\n        29093.93,\n        29087.73,\n        29093.24,\n        0.59,\n        1691402639999,\n        17221.07\n    ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //    {\n        //        \"open\": \"19394.4\",\n        //        \"close\": \"19379.0\",\n        //        \"high\": \"19394.4\",\n        //        \"low\": \"19368.3\",\n        //        \"volume\": \"167.44\",\n        //        \"time\": 1666584000000\n        //    }\n        //\n        // fetchMarkOHLCV\n        //\n        //    {\n        //        \"open\": \"42191.7\",\n        //        \"close\": \"42189.5\",\n        //        \"high\": \"42196.5\",\n        //        \"low\": \"42189.5\",\n        //        \"volume\": \"0.00\",\n        //        \"openTime\": 1706508840000,\n        //        \"closeTime\": 1706508840000\n        //    }\n        // spot\n        //    [\n        //        1691402580000,\n        //        29093.61,\n        //        29093.93,\n        //        29087.73,\n        //        29093.24,\n        //        0.59,\n        //        1691402639999,\n        //        17221.07\n        //    ]\n        //\n        if (Array.isArray (ohlcv)) {\n            return [\n                this.safeInteger (ohlcv, 0),\n                this.safeNumber (ohlcv, 1),\n                this.safeNumber (ohlcv, 2),\n                this.safeNumber (ohlcv, 3),\n                this.safeNumber (ohlcv, 4),\n                this.safeNumber (ohlcv, 5),\n            ];\n        }\n        return [\n            this.safeInteger2 (ohlcv, 'time', 'closeTime'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 1976,
        "line_end": 2008,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openInterest",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"openInterest\": \"3289641547.10\",\n         \"symbol\": \"BTC-USDT\",\n         \"time\": 1672026617364\n     }",
          "{\n         \"symbol\": \"BTC-USD\",\n         \"openInterest\": \"749.1160\",\n         \"timestamp\": 1720310400000\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // linear swap\n        //\n        //     {\n        //         \"openInterest\": \"3289641547.10\",\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"time\": 1672026617364\n        //     }\n        //\n        // inverse swap\n        //\n        //     {\n        //         \"symbol\": \"BTC-USD\",\n        //         \"openInterest\": \"749.1160\",\n        //         \"timestamp\": 1720310400000\n        //     }\n        //\n        const timestamp = this.safeInteger2 (interest, 'time', 'timestamp');\n        const id = this.safeString (interest, 'symbol');\n        const symbol = this.safeSymbol (id, market, '-', 'swap');\n        const openInterest = this.safeNumber (interest, 'openInterest');\n        return this.safeOpenInterest ({\n            'symbol': symbol,\n            'baseVolume': undefined,\n            'quoteVolume': undefined,  // deprecated\n            'openInterestAmount': undefined,\n            'openInterestValue': openInterest,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3500,
        "line_end": 3878,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'orderId', 'i', 'mainOrderId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (order, [ 'clientOrderID', 'clientOrderId', 'origClientOrderId', 'c' ])",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-', marketType)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'updateTime')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (rawType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parseOrderSide (side)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (order, 'price', 'p')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString2 (order, 'avgPrice', 'ap')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'cummulativeQuoteQty')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeStringN (order, [ 'origQty', 'q', 'quantity', 'totalAmount' ])",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString2 (order, 'executedQty', 'z')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (statusId)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCurrencyCode,\n                'cost': Precise.stringAbs (feeCost),\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool2 (order, 'reduceOnly', 'ro')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          },
          {
            "key": "cost",
            "value": "Precise.stringAbs (feeCost)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"XRP-USDT\",\n        \"orderId\": 1514090846268424192,\n        \"transactTime\": 1649822362855,\n        \"price\": \"0.5\",\n        \"origQty\": \"10\",\n        \"executedQty\": \"0\",\n        \"cummulativeQuoteQty\": \"0\",\n        \"status\": \"PENDING\",\n        \"type\": \"LIMIT\",\n        \"side\": \"BUY\"\n    }",
          "{\n        \"symbol\": \"ETH-USDT\",\n        \"orderId\": \"1660602123001266176\",\n        \"price\": \"1700\",\n        \"origQty\": \"0.003\",\n        \"executedQty\": \"0\",\n        \"cummulativeQuoteQty\": \"0\",\n        \"status\": \"PENDING\",\n        \"type\": \"LIMIT\",\n        \"side\": \"BUY\",\n        \"time\": \"1684753373276\",\n        \"updateTime\": \"1684753373276\",\n        \"origQuoteOrderQty\": \"0\",\n        \"fee\": \"0\",\n        \"feeAsset\": \"ETH\"\n    }",
          "{\n       \"symbol\": \"XRP-USDT\",\n       \"orderId\": 1514073325788200960,\n       \"price\": \"0.5\",\n       \"StopPrice\": \"0\",\n       \"origQty\": \"20\",\n       \"executedQty\": \"10\",\n       \"cummulativeQuoteQty\": \"5\",\n       \"status\": \"PENDING\",\n       \"type\": \"LIMIT\",\n       \"side\": \"BUY\",\n       \"time\": 1649818185647,\n       \"updateTime\": 1649818185647,\n       \"origQuoteOrderQty\": \"0\"\n       \"fee\": \"-0.01\"\n   }",
          "{\n      \"symbol\": \"BTC-USDT\",\n      \"orderId\": 1590973236294713344,\n      \"side\": \"BUY\",\n      \"positionSide\": \"LONG\",\n      \"type\": \"LIMIT\"\n    }",
          "{\n         \"orderId\": 1809841379603398656,\n         \"symbol\": \"SOL-USD\",\n         \"positionSide\": \"LONG\",\n         \"side\": \"BUY\",\n         \"type\": \"LIMIT\",\n         \"price\": 100,\n         \"quantity\": 1,\n         \"stopPrice\": 0,\n         \"workingType\": \"\",\n         \"timeInForce\": \"\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        // createOrder, createOrders, cancelOrder\n        //\n        //    {\n        //        \"symbol\": \"XRP-USDT\",\n        //        \"orderId\": 1514090846268424192,\n        //        \"transactTime\": 1649822362855,\n        //        \"price\": \"0.5\",\n        //        \"origQty\": \"10\",\n        //        \"executedQty\": \"0\",\n        //        \"cummulativeQuoteQty\": \"0\",\n        //        \"status\": \"PENDING\",\n        //        \"type\": \"LIMIT\",\n        //        \"side\": \"BUY\"\n        //    }\n        //\n        // fetchOrder\n        //\n        //    {\n        //        \"symbol\": \"ETH-USDT\",\n        //        \"orderId\": \"1660602123001266176\",\n        //        \"price\": \"1700\",\n        //        \"origQty\": \"0.003\",\n        //        \"executedQty\": \"0\",\n        //        \"cummulativeQuoteQty\": \"0\",\n        //        \"status\": \"PENDING\",\n        //        \"type\": \"LIMIT\",\n        //        \"side\": \"BUY\",\n        //        \"time\": \"1684753373276\",\n        //        \"updateTime\": \"1684753373276\",\n        //        \"origQuoteOrderQty\": \"0\",\n        //        \"fee\": \"0\",\n        //        \"feeAsset\": \"ETH\"\n        //    }\n        //\n        // fetchOpenOrders, fetchClosedOrders\n        //\n        //   {\n        //       \"symbol\": \"XRP-USDT\",\n        //       \"orderId\": 1514073325788200960,\n        //       \"price\": \"0.5\",\n        //       \"StopPrice\": \"0\",\n        //       \"origQty\": \"20\",\n        //       \"executedQty\": \"10\",\n        //       \"cummulativeQuoteQty\": \"5\",\n        //       \"status\": \"PENDING\",\n        //       \"type\": \"LIMIT\",\n        //       \"side\": \"BUY\",\n        //       \"time\": 1649818185647,\n        //       \"updateTime\": 1649818185647,\n        //       \"origQuoteOrderQty\": \"0\"\n        //       \"fee\": \"-0.01\"\n        //   }\n        //\n        //\n        // linear swap\n        // createOrder, createOrders\n        //\n        //    {\n        //      \"symbol\": \"BTC-USDT\",\n        //      \"orderId\": 1590973236294713344,\n        //      \"side\": \"BUY\",\n        //      \"positionSide\": \"LONG\",\n        //      \"type\": \"LIMIT\"\n        //    }\n        //\n        // inverse swap createOrder\n        //\n        //     {\n        //         \"orderId\": 1809841379603398656,\n        //         \"symbol\": \"SOL-USD\",\n        //         \"positionSide\": \"LONG\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"price\": 100,\n        //         \"quantity\": 1,\n        //         \"stopPrice\": 0,\n        //         \"workingType\": \"\",\n        //         \"timeInForce\": \"\"\n        //     }\n        //\n        // fetchOrder, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"orderId\": 1709036527545438208,\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"type\": \"TRIGGER_LIMIT\",\n        //         \"origQty\": \"0.0010\",\n        //         \"price\": \"22000.0\",\n        //         \"executedQty\": \"0.0000\",\n        //         \"avgPrice\": \"0.0\",\n        //         \"cumQuote\": \"\",\n        //         \"stopPrice\": \"23000.0\",\n        //         \"profit\": \"\",\n        //         \"commission\": \"\",\n        //         \"status\": \"NEW\",\n        //         \"time\": 1696301035187,\n        //         \"updateTime\": 1696301035187,\n        //         \"clientOrderId\": \"\",\n        //         \"leverage\": \"\",\n        //         \"takeProfit\": \"\",\n        //         \"stopLoss\": \"\",\n        //         \"advanceAttr\": 0,\n        //         \"positionID\": 0,\n        //         \"takeProfitEntrustPrice\": 0,\n        //         \"stopLossEntrustPrice\": 0,\n        //         \"orderType\": \"\",\n        //         \"workingType\": \"MARK_PRICE\"\n        //     }\n        // with tp and sl\n        //    {\n        //        orderId: 1741440894764281900,\n        //        symbol: 'LTC-USDT',\n        //        positionSide: 'LONG',\n        //        side: 'BUY',\n        //        type: 'MARKET',\n        //        price: 0,\n        //        quantity: 1,\n        //        stopPrice: 0,\n        //        workingType: 'MARK_PRICE',\n        //        clientOrderID: '',\n        //        timeInForce: 'GTC',\n        //        priceRate: 0,\n        //        stopLoss: '{\"stopPrice\":50,\"workingType\":\"MARK_PRICE\",\"type\":\"STOP_MARKET\",\"quantity\":1}',\n        //        takeProfit: '{\"stopPrice\":150,\"workingType\":\"MARK_PRICE\",\"type\":\"TAKE_PROFIT_MARKET\",\"quantity\":1}',\n        //        reduceOnly: false\n        //    }\n        //\n        // editOrder (swap)\n        //\n        //    {\n        //        cancelResult: 'true',\n        //        cancelMsg: '',\n        //        cancelResponse: {\n        //            cancelClientOrderId: '',\n        //            cancelOrderId: '1755336244265705472',\n        //            symbol: 'SOL-USDT',\n        //            orderId: '1755336244265705472',\n        //            side: 'SELL',\n        //            positionSide: 'SHORT',\n        //            type: 'LIMIT',\n        //            origQty: '1',\n        //            price: '100.000',\n        //            executedQty: '0',\n        //            avgPrice: '0.000',\n        //            cumQuote: '0',\n        //            stopPrice: '',\n        //            profit: '0.0000',\n        //            commission: '0.000000',\n        //            status: 'PENDING',\n        //            time: '1707339747860',\n        //            updateTime: '1707339747860',\n        //            clientOrderId: '',\n        //            leverage: '20X',\n        //            workingType: 'MARK_PRICE',\n        //            onlyOnePosition: false,\n        //            reduceOnly: false\n        //        },\n        //        replaceResult: 'true',\n        //        replaceMsg: '',\n        //        newOrderResponse: {\n        //            orderId: '1755338440612995072',\n        //            symbol: 'SOL-USDT',\n        //            positionSide: 'SHORT',\n        //            side: 'SELL',\n        //            type: 'LIMIT',\n        //            price: '99',\n        //            quantity: '2',\n        //            stopPrice: '0',\n        //            workingType: 'MARK_PRICE',\n        //            clientOrderID: '',\n        //            timeInForce: 'GTC',\n        //            priceRate: '0',\n        //            stopLoss: '',\n        //            takeProfit: '',\n        //            reduceOnly: false\n        //        }\n        //    }\n        //\n        // editOrder (spot)\n        //\n        //    {\n        //        cancelResult: { code: '0', msg: '', result: true },\n        //        openResult: { code: '0', msg: '', result: true },\n        //        orderOpenResponse: {\n        //            symbol: 'SOL-USDT',\n        //            orderId: '1755334007697866752',\n        //            transactTime: '1707339214620',\n        //            price: '99',\n        //            stopPrice: '0',\n        //            origQty: '0.2',\n        //            executedQty: '0',\n        //            cummulativeQuoteQty: '0',\n        //            status: 'PENDING',\n        //            type: 'LIMIT',\n        //            side: 'SELL',\n        //            clientOrderID: ''\n        //        },\n        //        orderCancelResponse: {\n        //            symbol: 'SOL-USDT',\n        //            orderId: '1755117055251480576',\n        //            price: '100',\n        //            stopPrice: '0',\n        //            origQty: '0.2',\n        //            executedQty: '0',\n        //            cummulativeQuoteQty: '0',\n        //            status: 'CANCELED',\n        //            type: 'LIMIT',\n        //            side: 'SELL'\n        //        }\n        //    }\n        //\n        // stop loss order\n        //\n        //    {\n        //        \"symbol\": \"ETH-USDT\",\n        //        \"orderId\": \"1792461744476422144\",\n        //        \"price\": \"2775.65\",\n        //        \"StopPrice\": \"2778.42\",\n        //        \"origQty\": \"0.032359\",\n        //        \"executedQty\": \"0\",\n        //        \"cummulativeQuoteQty\": \"0\",\n        //        \"status\": \"NEW\",\n        //        \"type\": \"TAKE_STOP_LIMIT\",\n        //        \"side\": \"SELL\",\n        //        \"time\": \"1716191156868\",\n        //        \"updateTime\": \"1716191156868\",\n        //        \"origQuoteOrderQty\": \"0\",\n        //        \"fee\": \"0\",\n        //        \"feeAsset\": \"USDT\",\n        //        \"clientOrderID\": \"\"\n        //    }\n        //\n        // inverse swap cancelAllOrders, cancelOrder, fetchOrder, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n        //\n        //     {\n        //         \"symbol\": \"SOL-USD\",\n        //         \"orderId\": \"1809845251327672320\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"type\": \"LIMIT\",\n        //         \"quantity\": 1,\n        //         \"origQty\": \"0\",\n        //         \"price\": \"90\",\n        //         \"executedQty\": \"0\",\n        //         \"avgPrice\": \"0\",\n        //         \"cumQuote\": \"0\",\n        //         \"stopPrice\": \"\",\n        //         \"profit\": \"0.0000\",\n        //         \"commission\": \"0.000000\",\n        //         \"status\": \"CANCELLED\",\n        //         \"time\": 1720335707872,\n        //         \"updateTime\": 1720335707912,\n        //         \"clientOrderId\": \"\",\n        //         \"leverage\": \"\",\n        //         \"takeProfit\": {\n        //             \"type\": \"\",\n        //             \"quantity\": 0,\n        //             \"stopPrice\": 0,\n        //             \"price\": 0,\n        //             \"workingType\": \"\",\n        //             \"stopGuaranteed\": \"\"\n        //         },\n        //         \"stopLoss\": {\n        //             \"type\": \"\",\n        //             \"quantity\": 0,\n        //             \"stopPrice\": 0,\n        //             \"price\": 0,\n        //             \"workingType\": \"\",\n        //             \"stopGuaranteed\": \"\"\n        //         },\n        //         \"advanceAttr\": 0,\n        //         \"positionID\": 0,\n        //         \"takeProfitEntrustPrice\": 0,\n        //         \"stopLossEntrustPrice\": 0,\n        //         \"orderType\": \"\",\n        //         \"workingType\": \"\"\n        //     }\n        //\n        const info = order;\n        const newOrder = this.safeDict2 (order, 'newOrderResponse', 'orderOpenResponse');\n        if (newOrder !== undefined) {\n            order = newOrder;\n        }\n        const positionSide = this.safeString2 (order, 'positionSide', 'ps');\n        const marketType = (positionSide === undefined) ? 'spot' : 'swap';\n        const marketId = this.safeString2 (order, 'symbol', 's');\n        if (market === undefined) {\n            market = this.safeMarket (marketId, undefined, undefined, marketType);\n        }\n        const side = this.safeStringLower2 (order, 'side', 'S');\n        const timestamp = this.safeIntegerN (order, [ 'time', 'transactTime', 'E', 'createdTime' ]);\n        const lastTradeTimestamp = this.safeInteger2 (order, 'updateTime', 'T');\n        const statusId = this.safeStringUpperN (order, [ 'status', 'X', 'orderStatus' ]);\n        let feeCurrencyCode = this.safeString2 (order, 'feeAsset', 'N');\n        const feeCost = this.safeStringN (order, [ 'fee', 'commission', 'n' ]);\n        if ((feeCurrencyCode === undefined)) {\n            if (market['spot']) {\n                if (side === 'buy') {\n                    feeCurrencyCode = market['base'];\n                } else {\n                    feeCurrencyCode = market['quote'];\n                }\n            } else {\n                feeCurrencyCode = market['quote'];\n            }\n        }\n        let stopLoss = this.safeValue (order, 'stopLoss');\n        let stopLossPrice = undefined;\n        if ((stopLoss !== undefined) && (stopLoss !== '')) {\n            stopLossPrice = this.omitZero (this.safeString (stopLoss, 'stopLoss'));\n        }\n        if ((stopLoss !== undefined) && (typeof stopLoss !== 'number') && (stopLoss !== '')) {\n            //  stopLoss: '{\"stopPrice\":50,\"workingType\":\"MARK_PRICE\",\"type\":\"STOP_MARKET\",\"quantity\":1}',\n            if (typeof stopLoss === 'string') {\n                stopLoss = this.parseJson (stopLoss);\n            }\n            stopLossPrice = this.omitZero (this.safeString (stopLoss, 'stopPrice'));\n        }\n        let takeProfit = this.safeValue (order, 'takeProfit');\n        let takeProfitPrice = undefined;\n        if (takeProfit !== undefined && (takeProfit !== '')) {\n            takeProfitPrice = this.omitZero (this.safeString (takeProfit, 'takeProfit'));\n        }\n        if ((takeProfit !== undefined) && (typeof takeProfit !== 'number') && (takeProfit !== '')) {\n            //  takeProfit: '{\"stopPrice\":150,\"workingType\":\"MARK_PRICE\",\"type\":\"TAKE_PROFIT_MARKET\",\"quantity\":1}',\n            if (typeof takeProfit === 'string') {\n                takeProfit = this.parseJson (takeProfit);\n            }\n            takeProfitPrice = this.omitZero (this.safeString (takeProfit, 'stopPrice'));\n        }\n        const rawType = this.safeStringLower2 (order, 'type', 'o');\n        const stopPrice = this.omitZero (this.safeString2 (order, 'StopPrice', 'stopPrice'));\n        let triggerPrice = stopPrice;\n        if (stopPrice !== undefined) {\n            if ((rawType.indexOf ('stop') > -1) && (stopLossPrice === undefined)) {\n                stopLossPrice = stopPrice;\n                triggerPrice = undefined;\n            }\n            if ((rawType.indexOf ('take') > -1) && (takeProfitPrice === undefined)) {\n                takeProfitPrice = stopPrice;\n                triggerPrice = undefined;\n            }\n        }\n        return this.safeOrder ({\n            'info': info,\n            'id': this.safeStringN (order, [ 'orderId', 'i', 'mainOrderId' ]),\n            'clientOrderId': this.safeStringN (order, [ 'clientOrderID', 'clientOrderId', 'origClientOrderId', 'c' ]),\n            'symbol': this.safeSymbol (marketId, market, '-', marketType),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': this.safeInteger (order, 'updateTime'),\n            'type': this.parseOrderType (rawType),\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': undefined,\n            'side': this.parseOrderSide (side),\n            'price': this.safeString2 (order, 'price', 'p'),\n            'triggerPrice': triggerPrice,\n            'stopLossPrice': stopLossPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'average': this.safeString2 (order, 'avgPrice', 'ap'),\n            'cost': this.safeString (order, 'cummulativeQuoteQty'),\n            'amount': this.safeStringN (order, [ 'origQty', 'q', 'quantity', 'totalAmount' ]),\n            'filled': this.safeString2 (order, 'executedQty', 'z'),\n            'remaining': undefined,\n            'status': this.parseOrderStatus (statusId),\n            'fee': {\n                'currency': feeCurrencyCode,\n                'cost': Precise.stringAbs (feeCost),\n            },\n            'trades': undefined,\n            'reduceOnly': this.safeBool2 (order, 'reduceOnly', 'ro'),\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (side)",
        "line_start": 3476,
        "line_end": 3486,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSide (side) {\n        const sides: Dict = {\n            'BUY': 'buy',\n            'SELL': 'sell',\n            'SHORT': 'sell',\n            'LONG': 'buy',\n            'ask': 'sell',\n            'bid': 'buy',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3880,
        "line_end": 3892,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PENDING': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'RUNNING': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'CANCELLED': 'canceled',\n            'FAILED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 3488,
        "line_end": 3498,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'trigger_market': 'market',\n            'trigger_limit': 'limit',\n            'stop_limit': 'limit',\n            'stop_market': 'market',\n            'take_profit_market': 'market',\n            'stop': 'limit',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseParams",
        "signature": "parseParams (params)",
        "line_start": 6073,
        "line_end": 6094,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseParams (params) {\n        // const sortedParams = this.keysort (params);\n        const rawKeys = Object.keys (params);\n        const keys = this.sort (rawKeys);\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const value = params[key];\n            if (Array.isArray (value)) {\n                let arrStr = '[';\n                for (let j = 0; j < value.length; j++) {\n                    const arrayElement = value[j];\n                    if (j > 0) {\n                        arrStr += ',';\n                    }\n                    arrStr += arrayElement.toString ();\n                }\n                arrStr += ']';\n                params[key] = arrStr;\n            }\n        }\n        return params;\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2850,
        "line_end": 2971,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'positionId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-', 'swap')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'positionValue')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber2 (position, 'avgPrice', 'entryPrice')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedProfit')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realisedProfit')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'positionAmt')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (position, 'positionSide')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'updateTime')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'initialMargin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"SOL-USD\",\n         \"positionId\": \"1813080351385337856\",\n         \"positionSide\": \"LONG\",\n         \"isolated\": false,\n         \"positionAmt\": \"1\",\n         \"availableAmt\": \"1\",\n         \"unrealizedProfit\": \"-0.00009074\",\n         \"initialMargin\": \"0.00630398\",\n         \"liquidationPrice\": 23.968303426677032,\n         \"avgPrice\": \"158.63\",\n         \"leverage\": 10,\n         \"markPrice\": \"158.402\",\n         \"riskRate\": \"0.00123783\",\n         \"maxMarginReduction\": \"0\",\n         \"updateTime\": 1721107015848\n     }",
          "{\n         \"positionId\": \"1792480725958881280\",\n         \"symbol\": \"LTC-USDT\",\n         \"currency\": \"USDT\",\n         \"positionAmt\": \"0.1\",\n         \"availableAmt\": \"0.1\",\n         \"positionSide\": \"LONG\",\n         \"isolated\": false,\n         \"avgPrice\": \"83.53\",\n         \"initialMargin\": \"1.3922\",\n         \"margin\": \"0.3528\",\n         \"leverage\": 6,\n         \"unrealizedProfit\": \"-1.0393\",\n         \"realisedProfit\": \"-0.2119\",\n         \"liquidationPrice\": 0,\n         \"pnlRatio\": \"-0.7465\",\n         \"maxMarginReduction\": \"0.0000\",\n         \"riskRate\": \"0.0008\",\n         \"markPrice\": \"73.14\",\n         \"positionValue\": \"7.3136\",\n         \"onlyOnePosition\": true,\n         \"updateTime\": 1721088016688\n     }",
          "{\n         \"currentPrice\": \"82.91\",\n         \"symbol\": \"LTC/USDT\",\n         \"initialMargin\": \"5.00000000000000000000\",\n         \"unrealizedProfit\": \"-0.26464500\",\n         \"leverage\": \"20.000000000\",\n         \"isolated\": true,\n         \"entryPrice\": \"83.13\",\n         \"positionSide\": \"LONG\",\n         \"positionAmt\": \"1.20365912\",\n     }",
          "{\n         \"positionId\": \"1861675561156571136\",\n         \"symbol\": \"LTC-USDT\",\n         \"isolated\": false,\n         \"positionSide\": \"LONG\",\n         \"openTime\": 1732693017000,\n         \"updateTime\": 1733310292000,\n         \"avgPrice\": \"95.18\",\n         \"avgClosePrice\": \"129.48\",\n         \"realisedProfit\": \"102.89\",\n         \"netProfit\": \"99.63\",\n         \"positionAmt\": \"30.0\",\n         \"closePositionAmt\": \"30.0\",\n         \"leverage\": 6,\n         \"closeAllPositions\": true,\n         \"positionCommission\": \"-0.33699650000000003\",\n         \"totalFunding\": \"-2.921461693902908\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // inverse swap\n        //\n        //     {\n        //         \"symbol\": \"SOL-USD\",\n        //         \"positionId\": \"1813080351385337856\",\n        //         \"positionSide\": \"LONG\",\n        //         \"isolated\": false,\n        //         \"positionAmt\": \"1\",\n        //         \"availableAmt\": \"1\",\n        //         \"unrealizedProfit\": \"-0.00009074\",\n        //         \"initialMargin\": \"0.00630398\",\n        //         \"liquidationPrice\": 23.968303426677032,\n        //         \"avgPrice\": \"158.63\",\n        //         \"leverage\": 10,\n        //         \"markPrice\": \"158.402\",\n        //         \"riskRate\": \"0.00123783\",\n        //         \"maxMarginReduction\": \"0\",\n        //         \"updateTime\": 1721107015848\n        //     }\n        //\n        // linear swap\n        //\n        //     {\n        //         \"positionId\": \"1792480725958881280\",\n        //         \"symbol\": \"LTC-USDT\",\n        //         \"currency\": \"USDT\",\n        //         \"positionAmt\": \"0.1\",\n        //         \"availableAmt\": \"0.1\",\n        //         \"positionSide\": \"LONG\",\n        //         \"isolated\": false,\n        //         \"avgPrice\": \"83.53\",\n        //         \"initialMargin\": \"1.3922\",\n        //         \"margin\": \"0.3528\",\n        //         \"leverage\": 6,\n        //         \"unrealizedProfit\": \"-1.0393\",\n        //         \"realisedProfit\": \"-0.2119\",\n        //         \"liquidationPrice\": 0,\n        //         \"pnlRatio\": \"-0.7465\",\n        //         \"maxMarginReduction\": \"0.0000\",\n        //         \"riskRate\": \"0.0008\",\n        //         \"markPrice\": \"73.14\",\n        //         \"positionValue\": \"7.3136\",\n        //         \"onlyOnePosition\": true,\n        //         \"updateTime\": 1721088016688\n        //     }\n        //\n        // standard position\n        //\n        //     {\n        //         \"currentPrice\": \"82.91\",\n        //         \"symbol\": \"LTC/USDT\",\n        //         \"initialMargin\": \"5.00000000000000000000\",\n        //         \"unrealizedProfit\": \"-0.26464500\",\n        //         \"leverage\": \"20.000000000\",\n        //         \"isolated\": true,\n        //         \"entryPrice\": \"83.13\",\n        //         \"positionSide\": \"LONG\",\n        //         \"positionAmt\": \"1.20365912\",\n        //     }\n        //\n        // linear swap fetchPositionHistory\n        //\n        //     {\n        //         \"positionId\": \"1861675561156571136\",\n        //         \"symbol\": \"LTC-USDT\",\n        //         \"isolated\": false,\n        //         \"positionSide\": \"LONG\",\n        //         \"openTime\": 1732693017000,\n        //         \"updateTime\": 1733310292000,\n        //         \"avgPrice\": \"95.18\",\n        //         \"avgClosePrice\": \"129.48\",\n        //         \"realisedProfit\": \"102.89\",\n        //         \"netProfit\": \"99.63\",\n        //         \"positionAmt\": \"30.0\",\n        //         \"closePositionAmt\": \"30.0\",\n        //         \"leverage\": 6,\n        //         \"closeAllPositions\": true,\n        //         \"positionCommission\": \"-0.33699650000000003\",\n        //         \"totalFunding\": \"-2.921461693902908\"\n        //     }\n        //\n        let marketId = this.safeString (position, 'symbol', '');\n        marketId = marketId.replace ('/', '-'); // standard return different format\n        const isolated = this.safeBool (position, 'isolated');\n        let marginMode = undefined;\n        if (isolated !== undefined) {\n            marginMode = isolated ? 'isolated' : 'cross';\n        }\n        const timestamp = this.safeInteger (position, 'openTime');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'positionId'),\n            'symbol': this.safeSymbol (marketId, market, '-', 'swap'),\n            'notional': this.safeNumber (position, 'positionValue'),\n            'marginMode': marginMode,\n            'liquidationPrice': undefined,\n            'entryPrice': this.safeNumber2 (position, 'avgPrice', 'entryPrice'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedProfit'),\n            'realizedPnl': this.safeNumber (position, 'realisedProfit'),\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'positionAmt'),\n            'contractSize': undefined,\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'lastPrice': undefined,\n            'side': this.safeStringLower (position, 'positionSide'),\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'updateTime'),\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': undefined,\n            'initialMargin': this.safeNumber (position, 'initialMargin'),\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber (position, 'leverage'),\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2262,
        "line_end": 2363,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "ts",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"string\",\n     \"lastFundingRate\": \"string\",\n     \"markPrice\": \"string\",\n     \"indexPrice\": \"string\",\n     \"nextFundingTime\": \"int64\"\n }",
          "{\n        \"symbol\": \"BTC-USDT\",\n        \"openPrice\": \"26032.08\",\n        \"highPrice\": \"26178.86\",\n        \"lowPrice\": \"25968.18\",\n        \"lastPrice\": \"26113.60\",\n        \"volume\": \"1161.79\",\n        \"quoteVolume\": \"30288466.44\",\n        \"openTime\": \"1693081020762\",\n        \"closeTime\": \"1693167420762\",\n  added 2023-11-10:\n        \"bidPrice\": 16726.0,\n        \"bidQty\": 0.05,\n        \"askPrice\": 16726.0,\n        \"askQty\": 0.05,\n    }",
          "{\n        \"symbol\": \"BTC-USDT\",\n        \"priceChange\": \"52.5\",\n        \"priceChangePercent\": \"0.31%\", // they started to add the percent sign in value\n        \"lastPrice\": \"16880.5\",\n        \"lastQty\": \"2.2238\",          // only present in swap!\n        \"highPrice\": \"16897.5\",\n        \"lowPrice\": \"16726.0\",\n        \"volume\": \"245870.1692\",\n        \"quoteVolume\": \"4151395117.73\",\n        \"openPrice\": \"16832.0\",\n        \"openTime\": 1672026667803,\n        \"closeTime\": 1672026648425,\n  added 2023-11-10:\n        \"bidPrice\": 16726.0,\n        \"bidQty\": 0.05,\n        \"askPrice\": 16726.0,\n        \"askQty\": 0.05,\n    }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // mark price\n        // {\n        //     \"symbol\": \"string\",\n        //     \"lastFundingRate\": \"string\",\n        //     \"markPrice\": \"string\",\n        //     \"indexPrice\": \"string\",\n        //     \"nextFundingTime\": \"int64\"\n        // }\n        //\n        // spot\n        //    {\n        //        \"symbol\": \"BTC-USDT\",\n        //        \"openPrice\": \"26032.08\",\n        //        \"highPrice\": \"26178.86\",\n        //        \"lowPrice\": \"25968.18\",\n        //        \"lastPrice\": \"26113.60\",\n        //        \"volume\": \"1161.79\",\n        //        \"quoteVolume\": \"30288466.44\",\n        //        \"openTime\": \"1693081020762\",\n        //        \"closeTime\": \"1693167420762\",\n        //  added 2023-11-10:\n        //        \"bidPrice\": 16726.0,\n        //        \"bidQty\": 0.05,\n        //        \"askPrice\": 16726.0,\n        //        \"askQty\": 0.05,\n        //    }\n        // swap\n        //\n        //    {\n        //        \"symbol\": \"BTC-USDT\",\n        //        \"priceChange\": \"52.5\",\n        //        \"priceChangePercent\": \"0.31%\", // they started to add the percent sign in value\n        //        \"lastPrice\": \"16880.5\",\n        //        \"lastQty\": \"2.2238\",          // only present in swap!\n        //        \"highPrice\": \"16897.5\",\n        //        \"lowPrice\": \"16726.0\",\n        //        \"volume\": \"245870.1692\",\n        //        \"quoteVolume\": \"4151395117.73\",\n        //        \"openPrice\": \"16832.0\",\n        //        \"openTime\": 1672026667803,\n        //        \"closeTime\": 1672026648425,\n        //  added 2023-11-10:\n        //        \"bidPrice\": 16726.0,\n        //        \"bidQty\": 0.05,\n        //        \"askPrice\": 16726.0,\n        //        \"askQty\": 0.05,\n        //    }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        const lastQty = this.safeString (ticker, 'lastQty');\n        // in spot markets, lastQty is not present\n        // it's (bad, but) the only way we can check the tickers origin\n        const type = (lastQty === undefined) ? 'spot' : 'swap';\n        market = this.safeMarket (marketId, market, undefined, type);\n        const symbol = market['symbol'];\n        const open = this.safeString (ticker, 'openPrice');\n        const high = this.safeString (ticker, 'highPrice');\n        const low = this.safeString (ticker, 'lowPrice');\n        const close = this.safeString (ticker, 'lastPrice');\n        const quoteVolume = this.safeString (ticker, 'quoteVolume');\n        const baseVolume = this.safeString (ticker, 'volume');\n        let percentage = this.safeString (ticker, 'priceChangePercent');\n        if (percentage !== undefined) {\n            percentage = percentage.replace ('%', '');\n        }\n        const change = this.safeString (ticker, 'priceChange');\n        let ts = this.safeInteger (ticker, 'closeTime');\n        if (ts === 0) {\n            ts = undefined;\n        }\n        const datetime = this.iso8601 (ts);\n        const bid = this.safeString (ticker, 'bidPrice');\n        const bidVolume = this.safeString (ticker, 'bidQty');\n        const ask = this.safeString (ticker, 'askPrice');\n        const askVolume = this.safeString (ticker, 'askQty');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': ts,\n            'datetime': datetime,\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': undefined,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1369,
        "line_end": 1536,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 'id', 't' ])",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "time",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (time)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString2 (trade, 'orderId', 'i')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'o')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parseOrderSide (side)",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takeOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeStringN (trade, [ 'price', 'p', 'tradePrice' ])",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.parseNumber (Precise.stringAbs (this.safeString2 (trade, 'commission', 'n'))),\n                'currency': currencyCode,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (Precise.stringAbs (this.safeString2 (trade, 'commission', 'n')))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\": 43148253,\n        \"price\": 25714.71,\n        \"qty\": 1.674571,\n        \"time\": 1655085975589,\n        \"buyerMaker\": false\n    }",
          "{\n         \"symbol\": \"LTC-USDT\",\n         \"id\": 36237072,\n         \"orderId\": 1674069326895775744,\n         \"price\": \"85.891\",\n         \"qty\": \"0.0582\",\n         \"quoteQty\": \"4.9988562000000005\",\n         \"commission\": -0.00005820000000000001,\n         \"commissionAsset\": \"LTC\",\n         \"time\": 1687964205000,\n         \"isBuyer\": true,\n         \"isMaker\": false\n     }",
          "{\n        \"time\": 1672025549368,\n        \"isBuyerMaker\": true,\n        \"price\": \"16885.0\",\n        \"qty\": \"3.3002\",\n        \"quoteQty\": \"55723.87\"\n    }",
          "{\n        \"volume\": \"0.1\",\n        \"price\": \"106.75\",\n        \"amount\": \"10.6750\",\n        \"commission\": \"-0.0053\",\n        \"currency\": \"USDT\",\n        \"orderId\": \"1676213270274379776\",\n        \"liquidatedPrice\": \"0.00\",\n        \"liquidatedMarginRatio\": \"0.00\",\n        \"filledTime\": \"2023-07-04T20:56:01.000+0800\"\n    }",
          "{\n        \"E\": 1690214529432,\n        \"T\": 1690214529386,\n        \"e\": \"trade\",\n        \"m\": true,\n        \"p\": \"29110.19\",\n        \"q\": \"0.1868\",\n        \"s\": \"BTC-USDT\",\n        \"t\": \"57903921\"\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // spot fetchTrades\n        //\n        //    {\n        //        \"id\": 43148253,\n        //        \"price\": 25714.71,\n        //        \"qty\": 1.674571,\n        //        \"time\": 1655085975589,\n        //        \"buyerMaker\": false\n        //    }\n        //\n        // spot fetchMyTrades\n        //\n        //     {\n        //         \"symbol\": \"LTC-USDT\",\n        //         \"id\": 36237072,\n        //         \"orderId\": 1674069326895775744,\n        //         \"price\": \"85.891\",\n        //         \"qty\": \"0.0582\",\n        //         \"quoteQty\": \"4.9988562000000005\",\n        //         \"commission\": -0.00005820000000000001,\n        //         \"commissionAsset\": \"LTC\",\n        //         \"time\": 1687964205000,\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false\n        //     }\n        //\n        // swap fetchTrades\n        //\n        //    {\n        //        \"time\": 1672025549368,\n        //        \"isBuyerMaker\": true,\n        //        \"price\": \"16885.0\",\n        //        \"qty\": \"3.3002\",\n        //        \"quoteQty\": \"55723.87\"\n        //    }\n        //\n        // swap fetchMyTrades\n        //\n        //    {\n        //        \"volume\": \"0.1\",\n        //        \"price\": \"106.75\",\n        //        \"amount\": \"10.6750\",\n        //        \"commission\": \"-0.0053\",\n        //        \"currency\": \"USDT\",\n        //        \"orderId\": \"1676213270274379776\",\n        //        \"liquidatedPrice\": \"0.00\",\n        //        \"liquidatedMarginRatio\": \"0.00\",\n        //        \"filledTime\": \"2023-07-04T20:56:01.000+0800\"\n        //    }\n        //\n        // ws spot\n        //\n        //    {\n        //        \"E\": 1690214529432,\n        //        \"T\": 1690214529386,\n        //        \"e\": \"trade\",\n        //        \"m\": true,\n        //        \"p\": \"29110.19\",\n        //        \"q\": \"0.1868\",\n        //        \"s\": \"BTC-USDT\",\n        //        \"t\": \"57903921\"\n        //    }\n        //\n        // ws linear swap\n        //\n        //    {\n        //        \"q\": \"0.0421\",\n        //        \"p\": \"29023.5\",\n        //        \"T\": 1690221401344,\n        //        \"m\": false,\n        //        \"s\": \"BTC-USDT\"\n        //    }\n        //\n        // ws inverse swap\n        //\n        //     {\n        //         \"e\": \"trade\",\n        //         \"E\": 1722920589665,\n        //         \"s\": \"BTC-USD\",\n        //         \"t\": \"39125001\",\n        //         \"p\": \"55360.0\",\n        //         \"q\": \"1\",\n        //         \"T\": 1722920589582,\n        //         \"m\": false\n        //     }\n        //\n        // inverse swap fetchMyTrades\n        //\n        //     {\n        //         \"orderId\": \"1817441228670648320\",\n        //         \"symbol\": \"SOL-USD\",\n        //         \"type\": \"MARKET\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"tradeId\": \"97244554\",\n        //         \"volume\": \"2\",\n        //         \"tradePrice\": \"182.652\",\n        //         \"amount\": \"20.00000000\",\n        //         \"realizedPnl\": \"0.00000000\",\n        //         \"commission\": \"-0.00005475\",\n        //         \"currency\": \"SOL\",\n        //         \"buyer\": true,\n        //         \"maker\": false,\n        //         \"tradeTime\": 1722146730000\n        //     }\n        //\n        let time = this.safeIntegerN (trade, [ 'time', 'filledTm', 'T', 'tradeTime' ]);\n        const datetimeId = this.safeString (trade, 'filledTm');\n        if (datetimeId !== undefined) {\n            time = this.parse8601 (datetimeId);\n        }\n        if (time === 0) {\n            time = undefined;\n        }\n        const cost = this.safeString (trade, 'quoteQty');\n        // const type = (cost === undefined) ? 'spot' : 'swap'; this is not reliable\n        const currencyId = this.safeStringN (trade, [ 'currency', 'N', 'commissionAsset' ]);\n        const currencyCode = this.safeCurrencyCode (currencyId);\n        const m = this.safeBool (trade, 'm');\n        const marketId = this.safeString2 (trade, 's', 'symbol');\n        const isBuyerMaker = this.safeBoolN (trade, [ 'buyerMaker', 'isBuyerMaker', 'maker' ]);\n        let takeOrMaker = undefined;\n        if ((isBuyerMaker !== undefined) || (m !== undefined)) {\n            takeOrMaker = (isBuyerMaker || m) ? 'maker' : 'taker';\n        }\n        let side = this.safeStringLower2 (trade, 'side', 'S');\n        if (side === undefined) {\n            if ((isBuyerMaker !== undefined) || (m !== undefined)) {\n                side = (isBuyerMaker || m) ? 'sell' : 'buy';\n                takeOrMaker = 'taker';\n            }\n        }\n        const isBuyer = this.safeBool (trade, 'isBuyer');\n        if (isBuyer !== undefined) {\n            side = isBuyer ? 'buy' : 'sell';\n        }\n        const isMaker = this.safeBool (trade, 'isMaker');\n        if (isMaker !== undefined) {\n            takeOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        let amount = this.safeStringN (trade, [ 'qty', 'amount', 'q' ]);\n        if ((market !== undefined) && market['swap'] && ('volume' in trade)) {\n            // private trade returns num of contracts instead of base currency (as the order-related methods do)\n            const contractSize = this.safeString (market['info'], 'tradeMinQuantity');\n            const volume = this.safeString (trade, 'volume');\n            amount = Precise.stringMul (volume, contractSize);\n        }\n        return this.safeTrade ({\n            'id': this.safeStringN (trade, [ 'id', 't' ]),\n            'info': trade,\n            'timestamp': time,\n            'datetime': this.iso8601 (time),\n            'symbol': this.safeSymbol (marketId, market, '-'),\n            'order': this.safeString2 (trade, 'orderId', 'i'),\n            'type': this.safeStringLower (trade, 'o'),\n            'side': this.parseOrderSide (side),\n            'takerOrMaker': takeOrMaker,\n            'price': this.safeStringN (trade, [ 'price', 'p', 'tradePrice' ]),\n            'amount': amount,\n            'cost': cost,\n            'fee': {\n                'cost': this.parseNumber (Precise.stringAbs (this.safeString2 (trade, 'commission', 'n'))),\n                'currency': currencyCode,\n            },\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 6701,
        "line_end": 6717,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'makerCommissionRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'takerCommissionRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "false",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"takerCommissionRate\": 0.001,\n         \"makerCommissionRate\": 0.001\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"takerCommissionRate\": 0.001,\n        //         \"makerCommissionRate\": 0.001\n        //     }\n        //\n        const symbol = (market !== undefined) ? market['symbol'] : undefined;\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'makerCommissionRate'),\n            'taker': this.safeNumber (fee, 'takerCommissionRate'),\n            'percentage': false,\n            'tierBased': false,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 5423,
        "line_end": 5518,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (network)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'info')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'transactionFee'),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (transaction, 'transactionFee')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amount\":\"0.00999800\",\n        \"coin\":\"PAXG\",\n        \"network\":\"ETH\",\n        \"status\":1,\n        \"address\":\"0x788cabe9236ce061e5a892e1a59395a81fc8d62c\",\n        \"addressTag\":\"\",\n        \"txId\":\"0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3\",\n        \"insertTime\":1599621997000,\n        \"transferType\":0,\n        \"unlockConfirm\":\"12/12\", // confirm times for unlocking\n        \"confirmTimes\":\"12/12\"\n    }",
          "{\n        \"address\": \"0x94df8b352de7f46f64b01d3666bf6e936e44ce60\",\n        \"amount\": \"8.91000000\",\n        \"applyTime\": \"2019-10-12 11:12:02\",\n        \"coin\": \"USDT\",\n        \"id\": \"b6ae22b3aa844210a7041aee7589627c\",\n        \"withdrawOrderId\": \"WITHDRAWtest123\",\n        \"network\": \"ETH\",\n        \"transferType\": 0\n        \"status\": 6,\n        \"transactionFee\": \"0.004\",\n        \"confirmNo\":3,\n        \"info\": \"The address is not valid. Please confirm with the recipient\",\n        \"txId\": \"0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268\"\n    }",
          "{\n         \"code\":0,\n         \"timestamp\":1705274263621,\n         \"data\":{\n             \"id\":\"1264246141278773252\"\n         }\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //    {\n        //        \"amount\":\"0.00999800\",\n        //        \"coin\":\"PAXG\",\n        //        \"network\":\"ETH\",\n        //        \"status\":1,\n        //        \"address\":\"0x788cabe9236ce061e5a892e1a59395a81fc8d62c\",\n        //        \"addressTag\":\"\",\n        //        \"txId\":\"0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3\",\n        //        \"insertTime\":1599621997000,\n        //        \"transferType\":0,\n        //        \"unlockConfirm\":\"12/12\", // confirm times for unlocking\n        //        \"confirmTimes\":\"12/12\"\n        //    }\n        //\n        // fetchWithdrawals\n        //\n        //    {\n        //        \"address\": \"0x94df8b352de7f46f64b01d3666bf6e936e44ce60\",\n        //        \"amount\": \"8.91000000\",\n        //        \"applyTime\": \"2019-10-12 11:12:02\",\n        //        \"coin\": \"USDT\",\n        //        \"id\": \"b6ae22b3aa844210a7041aee7589627c\",\n        //        \"withdrawOrderId\": \"WITHDRAWtest123\",\n        //        \"network\": \"ETH\",\n        //        \"transferType\": 0\n        //        \"status\": 6,\n        //        \"transactionFee\": \"0.004\",\n        //        \"confirmNo\":3,\n        //        \"info\": \"The address is not valid. Please confirm with the recipient\",\n        //        \"txId\": \"0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268\"\n        //    }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"code\":0,\n        //         \"timestamp\":1705274263621,\n        //         \"data\":{\n        //             \"id\":\"1264246141278773252\"\n        //         }\n        //     }\n        //\n        // parse withdraw-type output first...\n        //\n        const data = this.safeValue (transaction, 'data');\n        const dataId = (data === undefined) ? undefined : this.safeString (data, 'id');\n        const id = this.safeString (transaction, 'id', dataId);\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'addressTag');\n        let timestamp = this.safeInteger2 (transaction, 'insertTime', 'timestamp');\n        let datetime = this.iso8601 (timestamp);\n        if (timestamp === undefined) {\n            datetime = this.safeString (transaction, 'applyTime');\n            timestamp = this.parse8601 (datetime);\n        }\n        const network = this.safeString (transaction, 'network');\n        const currencyId = this.safeString (transaction, 'coin');\n        let code = this.safeCurrencyCode (currencyId, currency);\n        if ((code !== undefined) && (code !== network) && code.indexOf (network) >= 0) {\n            if (network !== undefined) {\n                code = code.replace (network, '');\n            }\n        }\n        const rawType = this.safeString (transaction, 'transferType');\n        const type = (rawType === '0') ? 'deposit' : 'withdrawal';\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': this.safeString (transaction, 'txId'),\n            'type': type,\n            'currency': code,\n            'network': this.networkIdToCode (network),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': tag,\n            'tagFrom': tag,\n            'tagTo': undefined,\n            'updated': undefined,\n            'comment': this.safeString (transaction, 'info'),\n            'fee': {\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'transactionFee'),\n                'rate': undefined,\n            },\n            'internal': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: string)",
        "line_start": 5520,
        "line_end": 5538,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: string) {\n        const statuses: Dict = {\n            '0': 'pending',\n            '1': 'ok',\n            '10': 'pending',\n            '20': 'rejected',\n            '30': 'ok',\n            '40': 'rejected',\n            '50': 'ok',\n            '60': 'pending',\n            '70': 'rejected',\n            '2': 'pending',\n            '3': 'rejected',\n            '4': 'pending',\n            '5': 'rejected',\n            '6': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 5196,
        "line_end": 5218,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "tranId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        const tranId = this.safeString (transfer, 'transferId');\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        const currencyId = this.safeString (transfer, 'asset');\n        const currencyCode = this.safeCurrencyCode (currencyId, currency);\n        const status = this.safeString (transfer, 'status');\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        const fromId = this.safeString (transfer, 'fromAccount');\n        const toId = this.safeString (transfer, 'toAccount');\n        const fromAccount = this.safeString (accountsById, fromId, fromId);\n        const toAccount = this.safeString (accountsById, toId, toId);\n        return {\n            'info': transfer,\n            'id': tranId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': currencyCode,\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): string",
        "line_start": 5220,
        "line_end": 5225,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): string {\n        const statuses: Dict = {\n            'CONFIRMED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bit2c": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 287,
        "line_end": 306,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const codes = Object.keys (this.currencies);\n        for (let i = 0; i < codes.length; i++) {\n            const code = codes[i];\n            const account = this.account ();\n            const currency = this.currency (code);\n            const uppercase = currency['id'].toUpperCase ();\n            if (uppercase in response) {\n                account['free'] = this.safeString (response, 'AVAILABLE_' + uppercase);\n                account['total'] = this.safeString (response, uppercase);\n            }\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 963,
        "line_end": 980,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"0xf14b94518d74aff2b1a6d3429471bcfcd3881d42\",\n         \"hasTx\": False\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"0xf14b94518d74aff2b1a6d3429471bcfcd3881d42\",\n        //         \"hasTx\": False\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        const code = this.safeCurrencyCode (undefined, currency);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': undefined,\n            'address': address,\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 639,
        "line_end": 751,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"OrderResponse\": {\"pair\": \"BtcNis\", \"HasError\": False, \"Error\": \"\", \"Message\": \"\"},\n          \"NewOrder\": {\n              \"created\": 1505531577,\n              \"type\": 0,\n              \"order_type\": 0,\n              \"status_type\": 0,\n              \"amount\": 0.01,\n              \"price\": 10000,\n              \"stop\": 0,\n              \"id\": 9244416,\n              \"initialAmount\": None,\n          },\n      }",
          "{\n          \"pair\": \"BtcNis\",\n          \"status\": \"Completed\",\n          \"created\": 1535555837,\n          \"type\": 0,\n          \"order_type\": 0,\n          \"amount\": 0.00000000,\n          \"price\": 120000.00000000,\n          \"stop\": 0,\n          \"id\": 10555173,\n          \"initialAmount\": 2.00000000\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //      createOrder\n        //      {\n        //          \"OrderResponse\": {\"pair\": \"BtcNis\", \"HasError\": False, \"Error\": \"\", \"Message\": \"\"},\n        //          \"NewOrder\": {\n        //              \"created\": 1505531577,\n        //              \"type\": 0,\n        //              \"order_type\": 0,\n        //              \"status_type\": 0,\n        //              \"amount\": 0.01,\n        //              \"price\": 10000,\n        //              \"stop\": 0,\n        //              \"id\": 9244416,\n        //              \"initialAmount\": None,\n        //          },\n        //      }\n        //      fetchOrder, fetchOpenOrders\n        //      {\n        //          \"pair\": \"BtcNis\",\n        //          \"status\": \"Completed\",\n        //          \"created\": 1535555837,\n        //          \"type\": 0,\n        //          \"order_type\": 0,\n        //          \"amount\": 0.00000000,\n        //          \"price\": 120000.00000000,\n        //          \"stop\": 0,\n        //          \"id\": 10555173,\n        //          \"initialAmount\": 2.00000000\n        //      }\n        //\n        let orderUnified = undefined;\n        let isNewOrder = false;\n        if ('NewOrder' in order) {\n            orderUnified = order['NewOrder'];\n            isNewOrder = true;\n        } else {\n            orderUnified = order;\n        }\n        const id = this.safeString (orderUnified, 'id');\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeIntegerProduct (orderUnified, 'created', 1000);\n        // status field vary between responses\n        // bit2c status type:\n        // 0 = New\n        // 1 = Open\n        // 5 = Completed\n        let status: string;\n        if (isNewOrder) {\n            const tempStatus = this.safeInteger (orderUnified, 'status_type');\n            if (tempStatus === 0 || tempStatus === 1) {\n                status = 'open';\n            } else if (tempStatus === 5) {\n                status = 'closed';\n            }\n        } else {\n            const tempStatus = this.safeString (orderUnified, 'status');\n            if (tempStatus === 'New' || tempStatus === 'Open') {\n                status = 'open';\n            } else if (tempStatus === 'Completed') {\n                status = 'closed';\n            }\n        }\n        // bit2c order type:\n        // 0 = LMT,  1 = MKT\n        let type = this.safeString (orderUnified, 'order_type');\n        if (type === '0') {\n            type = 'limit';\n        } else if (type === '1') {\n            type = 'market';\n        }\n        // bit2c side:\n        // 0 = buy, 1 = sell\n        let side = this.safeString (orderUnified, 'type');\n        if (side === '0') {\n            side = 'buy';\n        } else if (side === '1') {\n            side = 'sell';\n        }\n        const price = this.safeString (orderUnified, 'price');\n        let amount = undefined;\n        let remaining = undefined;\n        if (isNewOrder) {\n            amount = this.safeString (orderUnified, 'amount');  // NOTE:'initialAmount' is currently not set on new order\n            remaining = this.safeString (orderUnified, 'amount');\n        } else {\n            amount = this.safeString (orderUnified, 'initialAmount');\n            remaining = this.safeString (orderUnified, 'amount');\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': remaining,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 384,
        "line_end": 411,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'h')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'l')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "averagePrice",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const symbol = this.safeSymbol (undefined, market);\n        const averagePrice = this.safeString (ticker, 'av');\n        const baseVolume = this.safeString (ticker, 'a');\n        const last = this.safeString (ticker, 'll');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': undefined,\n            'low': undefined,\n            'bid': this.safeString (ticker, 'h'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'l'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': averagePrice,\n            'baseVolume': baseVolume,\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 831,
        "line_end": 929,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "makerOrTaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"date\":1651785980,\n         \"price\":127975.68,\n         \"amount\":0.3750321,\n         \"isBid\":true,\n         \"tid\":1261018\n     }",
          "{\n         \"ticks\":1574767951,\n         \"created\":\"26/11/19 13:32\",\n         \"action\":1,\n         \"price\":\"1,000\",\n         \"pair\":\"EthNis\",\n         \"reference\":\"EthNis|10867390|10867377\",\n         \"fee\":\"0.5\",\n         \"feeAmount\":\"0.08\",\n         \"feeCoin\":\"₪\",\n         \"firstAmount\":\"-0.015\",\n         \"firstAmountBalance\":\"9\",\n         \"secondAmount\":\"14.93\",\n         \"secondAmountBalance\":\"130,233.28\",\n         \"firstCoin\":\"ETH\",\n         \"secondCoin\":\"₪\"\n         \"isMaker\": True,\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"date\":1651785980,\n        //         \"price\":127975.68,\n        //         \"amount\":0.3750321,\n        //         \"isBid\":true,\n        //         \"tid\":1261018\n        //     }\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"ticks\":1574767951,\n        //         \"created\":\"26/11/19 13:32\",\n        //         \"action\":1,\n        //         \"price\":\"1,000\",\n        //         \"pair\":\"EthNis\",\n        //         \"reference\":\"EthNis|10867390|10867377\",\n        //         \"fee\":\"0.5\",\n        //         \"feeAmount\":\"0.08\",\n        //         \"feeCoin\":\"₪\",\n        //         \"firstAmount\":\"-0.015\",\n        //         \"firstAmountBalance\":\"9\",\n        //         \"secondAmount\":\"14.93\",\n        //         \"secondAmountBalance\":\"130,233.28\",\n        //         \"firstCoin\":\"ETH\",\n        //         \"secondCoin\":\"₪\"\n        //         \"isMaker\": True,\n        //     }\n        //\n        let timestamp: Int;\n        let id: Str;\n        let price = undefined;\n        let amount = undefined;\n        let orderId = undefined;\n        let fee = undefined;\n        let side: string;\n        let makerOrTaker = undefined;\n        const reference = this.safeString (trade, 'reference');\n        if (reference !== undefined) {\n            id = reference;\n            timestamp = this.safeTimestamp (trade, 'ticks');\n            price = this.safeString (trade, 'price');\n            price = this.removeCommaFromValue (price);\n            amount = this.safeString (trade, 'firstAmount');\n            const reference_parts = reference.split ('|'); // reference contains 'pair|orderId_by_taker|orderId_by_maker'\n            const marketId = this.safeString (trade, 'pair');\n            market = this.safeMarket (marketId, market);\n            market = this.safeMarket (reference_parts[0], market);\n            const isMaker = this.safeValue (trade, 'isMaker');\n            makerOrTaker = isMaker ? 'maker' : 'taker';\n            orderId = isMaker ? reference_parts[2] : reference_parts[1];\n            const action = this.safeInteger (trade, 'action');\n            if (action === 0) {\n                side = 'buy';\n            } else {\n                side = 'sell';\n            }\n            const feeCost = this.safeString (trade, 'feeAmount');\n            if (feeCost !== undefined) {\n                fee = {\n                    'cost': feeCost,\n                    'currency': 'NIS',\n                };\n            }\n        } else {\n            timestamp = this.safeTimestamp (trade, 'date');\n            id = this.safeString (trade, 'tid');\n            price = this.safeString (trade, 'price');\n            amount = this.safeString (trade, 'amount');\n            side = this.safeValue (trade, 'isBid');\n            if (side !== undefined) {\n                if (side) {\n                    side = 'buy';\n                } else {\n                    side = 'sell';\n                }\n            }\n        }\n        market = this.safeMarket (undefined, market);\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': makerOrTaker,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      }
    ],
    "bitbank": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 642,
        "line_end": 661,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const data = this.safeValue (response, 'data', {});\n        const assets = this.safeValue (data, 'assets', []);\n        for (let i = 0; i < assets.length; i++) {\n            const balance = assets[i];\n            const currencyId = this.safeString (balance, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'free_amount');\n            account['used'] = this.safeString (balance, 'locked_amount');\n            account['total'] = this.safeString (balance, 'onhand_amount');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (entry): Market",
        "line_start": 311,
        "line_end": 368,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeValue (entry, 'is_enabled')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (entry, 'taker_fee_rate_quote')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (entry, 'maker_fee_rate_quote')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (entry, 'amount_digits'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (entry, 'price_digits'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (entry, 'unit_amount'),\n                    'max': this.safeNumber (entry, 'limit_max_amount'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (entry, 'amount_digits')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (entry, 'price_digits')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (entry, 'unit_amount'),\n                    'max': this.safeNumber (entry, 'limit_max_amount'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (entry): Market {\n        const id = this.safeString (entry, 'name');\n        const baseId = this.safeString (entry, 'base_asset');\n        const quoteId = this.safeString (entry, 'quote_asset');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': this.safeValue (entry, 'is_enabled'),\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (entry, 'taker_fee_rate_quote'),\n            'maker': this.safeNumber (entry, 'maker_fee_rate_quote'),\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (entry, 'amount_digits'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (entry, 'price_digits'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (entry, 'unit_amount'),\n                    'max': this.safeNumber (entry, 'limit_max_amount'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': entry,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 568,
        "line_end": 587,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"0.02501786\",\n         \"0.02501786\",\n         \"0.02501786\",\n         \"0.02501786\",\n         \"0.0000\",\n         1591488000000\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"0.02501786\",\n        //         \"0.02501786\",\n        //         \"0.02501786\",\n        //         \"0.02501786\",\n        //         \"0.0000\",\n        //         1591488000000\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 5),\n            this.safeNumber (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 721,
        "line_end": 757,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        const id = this.safeString (order, 'order_id');\n        const marketId = this.safeString (order, 'pair');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (order, 'ordered_at');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'start_amount');\n        const filled = this.safeString (order, 'executed_amount');\n        const remaining = this.safeString (order, 'remaining_amount');\n        const average = this.safeString (order, 'average_price');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const type = this.safeStringLower (order, 'type');\n        const side = this.safeStringLower (order, 'side');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'trades': undefined,\n            'fee': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 710,
        "line_end": 719,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'UNFILLED': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FULLY_FILLED': 'closed',\n            'CANCELED_UNFILLED': 'canceled',\n            'CANCELED_PARTIALLY_FILLED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 370,
        "line_end": 396,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'vol')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'vol'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 440,
        "line_end": 484,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"transaction_id\": \"1143247037\",\n        \"side\": \"buy\",\n        \"price\": \"3836025\",\n        \"amount\": \"0.0005\",\n        \"executed_at\": \"1694249441593\"\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //    {\n        //        \"transaction_id\": \"1143247037\",\n        //        \"side\": \"buy\",\n        //        \"price\": \"3836025\",\n        //        \"amount\": \"0.0005\",\n        //        \"executed_at\": \"1694249441593\"\n        //    }\n        //\n        const timestamp = this.safeInteger (trade, 'executed_at');\n        market = this.safeMarket (undefined, market);\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const id = this.safeString2 (trade, 'transaction_id', 'trade_id');\n        const takerOrMaker = this.safeString (trade, 'maker_taker');\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee_amount_quote');\n        if (feeCostString !== undefined) {\n            fee = {\n                'currency': market['quote'],\n                'cost': feeCostString,\n            };\n        }\n        const orderId = this.safeString (trade, 'order_id');\n        const type = this.safeString (trade, 'type');\n        const side = this.safeString (trade, 'side');\n        return this.safeTrade ({\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': id,\n            'order': orderId,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1013,
        "line_end": 1054,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "txid",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"uuid\": \"string\",\n         \"asset\": \"btc\",\n         \"amount\": 0,\n         \"account_uuid\": \"string\",\n         \"fee\": 0,\n         \"status\": \"DONE\",\n         \"label\": \"string\",\n         \"txid\": \"string\",\n         \"address\": \"string\",\n         \"requested_at\": 0\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"uuid\": \"string\",\n        //         \"asset\": \"btc\",\n        //         \"amount\": 0,\n        //         \"account_uuid\": \"string\",\n        //         \"fee\": 0,\n        //         \"status\": \"DONE\",\n        //         \"label\": \"string\",\n        //         \"txid\": \"string\",\n        //         \"address\": \"string\",\n        //         \"requested_at\": 0\n        //     }\n        //\n        const txid = this.safeString (transaction, 'txid');\n        currency = this.safeCurrency (undefined, currency);\n        return {\n            'id': txid,\n            'txid': txid,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'amount': undefined,\n            'type': undefined,\n            'currency': currency['code'],\n            'status': undefined,\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'info': transaction,\n        } as Transaction;\n    }"
      }
    ],
    "bitbns": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 503,
        "line_end": 530,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const timestamp = undefined;\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const data = this.safeDict (response, 'data', {});\n        const keys = Object.keys (data);\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const parts = key.split ('availableorder');\n            const numParts = parts.length;\n            if (numParts > 1) {\n                let currencyId = this.safeString (parts, 1);\n                // note that \"Money\" stands for INR - the only fiat in bitbns\n                const account = this.account ();\n                account['free'] = this.safeString (data, key);\n                account['used'] = this.safeString (data, 'inorder' + currencyId);\n                if (currencyId === 'Money') {\n                    currencyId = 'INR';\n                }\n                const code = this.safeCurrencyCode (currencyId);\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 578,
        "line_end": 654,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'rate')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'btc')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': undefined,\n                'currency': undefined,\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"data\": \"Successfully placed bid to purchase currency\",\n         \"status\": 1,\n         \"error\": null,\n         \"id\": 5424475,\n         \"code\": 200\n     }",
          "{\n        \"entry_id\": 5424475,\n        \"btc\": 0.01,\n        \"rate\": 2000,\n        \"time\": \"2021-04-25T17:05:42.000Z\",\n        \"type\": 0,\n        \"status\": 0\n        \"t_rate\": 0.45,                       // only stop orders\n        \"trail\": 0                            // only stop orders\n    }",
          "{\n        \"data\": \"Successfully cancelled the order\",\n        \"status\": 1,\n        \"error\": null,\n        \"code\": 200\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"data\": \"Successfully placed bid to purchase currency\",\n        //         \"status\": 1,\n        //         \"error\": null,\n        //         \"id\": 5424475,\n        //         \"code\": 200\n        //     }\n        //\n        // fetchOpenOrders, fetchOrder\n        //\n        //    {\n        //        \"entry_id\": 5424475,\n        //        \"btc\": 0.01,\n        //        \"rate\": 2000,\n        //        \"time\": \"2021-04-25T17:05:42.000Z\",\n        //        \"type\": 0,\n        //        \"status\": 0\n        //        \"t_rate\": 0.45,                       // only stop orders\n        //        \"trail\": 0                            // only stop orders\n        //    }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"data\": \"Successfully cancelled the order\",\n        //        \"status\": 1,\n        //        \"error\": null,\n        //        \"code\": 200\n        //    }\n        //\n        const id = this.safeString2 (order, 'id', 'entry_id');\n        const datetime = this.safeString (order, 'time');\n        const triggerPrice = this.safeString (order, 't_rate');\n        let side = this.safeString (order, 'type');\n        if (side === '0') {\n            side = 'buy';\n        } else if (side === '1') {\n            side = 'sell';\n        }\n        const data = this.safeString (order, 'data');\n        let status = this.safeString (order, 'status');\n        if (data === 'Successfully cancelled the order') {\n            status = 'cancelled';\n        } else {\n            status = this.parseStatus (status);\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastTradeTimestamp': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': this.safeString (order, 'rate'),\n            'triggerPrice': triggerPrice,\n            'amount': this.safeString (order, 'btc'),\n            'cost': undefined,\n            'average': undefined,\n            'filled': undefined,\n            'remaining': undefined,\n            'status': status,\n            'fee': {\n                'cost': undefined,\n                'currency': undefined,\n                'rate': undefined,\n            },\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseStatus",
        "signature": "parseStatus (status)",
        "line_start": 562,
        "line_end": 576,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseStatus (status) {\n        const statuses: Dict = {\n            '-1': 'cancelled',\n            '0': 'open',\n            '1': 'open',\n            '2': 'done',\n            // 'PARTIALLY_FILLED': 'open',\n            // 'FILLED': 'closed',\n            // 'CANCELED': 'canceled',\n            // 'PENDING_CANCEL': 'canceling', // currently unused\n            // 'REJECTED': 'rejected',\n            // 'EXPIRED': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 398,
        "line_end": 455,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidVolume')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askVolume')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "this.safeString (ticker, 'vwap')",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'previousClose')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'percentage')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'average')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'baseVolume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quoteVolume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"BTC/INR\",\n         \"info\":{\n             \"highest_buy_bid\":4368494.31,\n             \"lowest_sell_bid\":4374835.09,\n             \"last_traded_price\":4374835.09,\n             \"yes_price\":4531016.27,\n             \"volume\":{\"max\":\"4569119.23\",\"min\":\"4254552.13\",\"volume\":62.17722344}\n         },\n         \"timestamp\":1619100020845,\n         \"datetime\":1619100020845,\n         \"high\":\"4569119.23\",\n         \"low\":\"4254552.13\",\n         \"bid\":4368494.31,\n         \"bidVolume\":\"\",\n         \"ask\":4374835.09,\n         \"askVolume\":\"\",\n         \"vwap\":\"\",\n         \"open\":4531016.27,\n         \"close\":4374835.09,\n         \"last\":4374835.09,\n         \"baseVolume\":62.17722344,\n         \"quoteVolume\":\"\",\n         \"previousClose\":\"\",\n         \"change\":-156181.1799999997,\n         \"percentage\":-3.446934874943623,\n         \"average\":4452925.68\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"symbol\":\"BTC/INR\",\n        //         \"info\":{\n        //             \"highest_buy_bid\":4368494.31,\n        //             \"lowest_sell_bid\":4374835.09,\n        //             \"last_traded_price\":4374835.09,\n        //             \"yes_price\":4531016.27,\n        //             \"volume\":{\"max\":\"4569119.23\",\"min\":\"4254552.13\",\"volume\":62.17722344}\n        //         },\n        //         \"timestamp\":1619100020845,\n        //         \"datetime\":1619100020845,\n        //         \"high\":\"4569119.23\",\n        //         \"low\":\"4254552.13\",\n        //         \"bid\":4368494.31,\n        //         \"bidVolume\":\"\",\n        //         \"ask\":4374835.09,\n        //         \"askVolume\":\"\",\n        //         \"vwap\":\"\",\n        //         \"open\":4531016.27,\n        //         \"close\":4374835.09,\n        //         \"last\":4374835.09,\n        //         \"baseVolume\":62.17722344,\n        //         \"quoteVolume\":\"\",\n        //         \"previousClose\":\"\",\n        //         \"change\":-156181.1799999997,\n        //         \"percentage\":-3.446934874943623,\n        //         \"average\":4452925.68\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': this.safeString (ticker, 'bidVolume'),\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': this.safeString (ticker, 'askVolume'),\n            'vwap': this.safeString (ticker, 'vwap'),\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'previousClose'), // previous day close\n            'change': this.safeString (ticker, 'change'),\n            'percentage': this.safeString (ticker, 'percentage'),\n            'average': this.safeString (ticker, 'average'),\n            'baseVolume': this.safeString (ticker, 'baseVolume'),\n            'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 859,
        "line_end": 938,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"type\": \"BTC Sell order executed\",\n         \"typeI\": 6,\n         \"crypto\": 5000,\n         \"amount\": 35.4,\n         \"rate\": 709800,\n         \"date\": \"2020-05-22T15:05:34.000Z\",\n         \"unit\": \"INR\",\n         \"factor\": 100000000,\n         \"fee\": 0.09,\n         \"delh_btc\": -5000,\n         \"delh_inr\": 0,\n         \"del_btc\": 0,\n         \"del_inr\": 35.4,\n         \"id\": \"2938823\"\n     }",
          "{\n         \"tradeId\":\"1909151\",\n         \"price\":\"61904.6300\",\n         \"quote_volume\":1618.05,\n         \"base_volume\":0.02607254,\n         \"timestamp\":1634548602000,\n         \"type\":\"buy\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"type\": \"BTC Sell order executed\",\n        //         \"typeI\": 6,\n        //         \"crypto\": 5000,\n        //         \"amount\": 35.4,\n        //         \"rate\": 709800,\n        //         \"date\": \"2020-05-22T15:05:34.000Z\",\n        //         \"unit\": \"INR\",\n        //         \"factor\": 100000000,\n        //         \"fee\": 0.09,\n        //         \"delh_btc\": -5000,\n        //         \"delh_inr\": 0,\n        //         \"del_btc\": 0,\n        //         \"del_inr\": 35.4,\n        //         \"id\": \"2938823\"\n        //     }\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"tradeId\":\"1909151\",\n        //         \"price\":\"61904.6300\",\n        //         \"quote_volume\":1618.05,\n        //         \"base_volume\":0.02607254,\n        //         \"timestamp\":1634548602000,\n        //         \"type\":\"buy\"\n        //     }\n        //\n        market = this.safeMarket (undefined, market);\n        const orderId = this.safeString2 (trade, 'id', 'tradeId');\n        let timestamp = this.parse8601 (this.safeString (trade, 'date'));\n        timestamp = this.safeInteger (trade, 'timestamp', timestamp);\n        const priceString = this.safeString2 (trade, 'rate', 'price');\n        let amountString = this.safeString (trade, 'amount');\n        let side = this.safeStringLower (trade, 'type');\n        if (side !== undefined) {\n            if (side.indexOf ('buy') >= 0) {\n                side = 'buy';\n            } else if (side.indexOf ('sell') >= 0) {\n                side = 'sell';\n            }\n        }\n        const factor = this.safeString (trade, 'factor');\n        let costString = undefined;\n        if (factor !== undefined) {\n            amountString = Precise.stringDiv (amountString, factor);\n        } else {\n            amountString = this.safeString (trade, 'base_volume');\n            costString = this.safeString (trade, 'quote_volume');\n        }\n        const symbol = market['symbol'];\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrencyCode = market['quote'];\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': orderId,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1136,
        "line_end": 1202,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"type\":\"USDT deposited\",\n         \"typeI\":1,\n         \"amount\":100,\n         \"date\":\"2021-04-24T14:56:04.000Z\",\n         \"unit\":\"USDT\",\n         \"factor\":100,\n         \"fee\":0,\n         \"delh_btc\":0,\n         \"delh_inr\":0,\n         \"rate\":0,\n         \"del_btc\":10000,\n         \"del_inr\":0\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"type\":\"USDT deposited\",\n        //         \"typeI\":1,\n        //         \"amount\":100,\n        //         \"date\":\"2021-04-24T14:56:04.000Z\",\n        //         \"unit\":\"USDT\",\n        //         \"factor\":100,\n        //         \"fee\":0,\n        //         \"delh_btc\":0,\n        //         \"delh_inr\":0,\n        //         \"rate\":0,\n        //         \"del_btc\":10000,\n        //         \"del_inr\":0\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     ...\n        //\n        const currencyId = this.safeString (transaction, 'unit');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.parse8601 (this.safeString2 (transaction, 'date', 'timestamp'));\n        let type = this.safeString (transaction, 'type');\n        const expTime = this.safeString (transaction, 'expTime', '');\n        let status = undefined;\n        if (type !== undefined) {\n            if (type.indexOf ('deposit') >= 0) {\n                type = 'deposit';\n                status = 'ok';\n            } else if (type.indexOf ('withdraw') >= 0 || expTime.indexOf ('withdraw') >= 0) {\n                type = 'withdrawal';\n            }\n        }\n        // const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        return {\n            'info': transaction,\n            'id': undefined,\n            'txid': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 1116,
        "line_end": 1134,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n                '2': 'pending', // Awaiting Approval\n                '3': 'failed', // Rejected\n                '4': 'pending', // Processing\n                '5': 'failed', // Failure\n                '6': 'ok', // Completed\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitfinex": [
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3290,
        "line_end": 3342,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 15)",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 3)",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 12)",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 9)",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n          \"tBTCF0:USTF0\",\n          1691165059000,\n          null,\n          29297.851276225,\n          29277.5,\n          null,\n          36950860.76010306,\n          null,\n          1691193600000,\n          0.00000527,\n          82,\n          null,\n          0.00014548,\n          null,\n          null,\n          29278.8925,\n          null,\n          null,\n          9636.07644994,\n          null,\n          null,\n          null,\n          0.0005,\n          0.0025\n       ]"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //       [\n        //          \"tBTCF0:USTF0\",\n        //          1691165059000,\n        //          null,\n        //          29297.851276225,\n        //          29277.5,\n        //          null,\n        //          36950860.76010306,\n        //          null,\n        //          1691193600000,\n        //          0.00000527,\n        //          82,\n        //          null,\n        //          0.00014548,\n        //          null,\n        //          null,\n        //          29278.8925,\n        //          null,\n        //          null,\n        //          9636.07644994,\n        //          null,\n        //          null,\n        //          null,\n        //          0.0005,\n        //          0.0025\n        //       ]\n        //\n        const marketId = this.safeString (contract, 0);\n        const timestamp = this.safeInteger (contract, 1);\n        const nextFundingTimestamp = this.safeInteger (contract, 8);\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'markPrice': this.safeNumber (contract, 15),\n            'indexPrice': this.safeNumber (contract, 3),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 12),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': this.safeNumber (contract, 9),\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 3344,
        "line_end": 3393,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 14)",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 2)",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 11)",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 8)",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n     1691165494000,\n     null,\n     29278.95838065,\n     29260.5,\n     null,\n     36950860.76010305,\n     null,\n     1691193600000,\n     0.00001449,\n     222,\n     null,\n     0.00014548,\n     null,\n     null,\n     29260.005,\n     null,\n     null,\n     9635.86484562,\n     null,\n     null,\n     null,\n     0.0005,\n     0.0025\n ]"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        // [\n        //     1691165494000,\n        //     null,\n        //     29278.95838065,\n        //     29260.5,\n        //     null,\n        //     36950860.76010305,\n        //     null,\n        //     1691193600000,\n        //     0.00001449,\n        //     222,\n        //     null,\n        //     0.00014548,\n        //     null,\n        //     null,\n        //     29260.005,\n        //     null,\n        //     null,\n        //     9635.86484562,\n        //     null,\n        //     null,\n        //     null,\n        //     0.0005,\n        //     0.0025\n        // ]\n        //\n        const timestamp = this.safeInteger (contract, 0);\n        const nextFundingTimestamp = this.safeInteger (contract, 7);\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': this.safeNumber (contract, 14),\n            'indexPrice': this.safeNumber (contract, 2),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 11),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': this.safeNumber (contract, 8),\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 3049,
        "line_end": 3097,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "id",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         [\n             2531822314, // ID: Ledger identifier\n             \"USD\", // CURRENCY: The symbol of the currency (ex. \"BTC\")\n             null, // PLACEHOLDER\n             1573521810000, // MTS: Timestamp in milliseconds\n             null, // PLACEHOLDER\n             0.01644445, // AMOUNT: Amount of funds moved\n             0, // BALANCE: New balance\n             null, // PLACEHOLDER\n             \"Settlement @ 185.79 on wallet margin\" // DESCRIPTION: Description of ledger transaction\n         ]\n     ]"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     [\n        //         [\n        //             2531822314, // ID: Ledger identifier\n        //             \"USD\", // CURRENCY: The symbol of the currency (ex. \"BTC\")\n        //             null, // PLACEHOLDER\n        //             1573521810000, // MTS: Timestamp in milliseconds\n        //             null, // PLACEHOLDER\n        //             0.01644445, // AMOUNT: Amount of funds moved\n        //             0, // BALANCE: New balance\n        //             null, // PLACEHOLDER\n        //             \"Settlement @ 185.79 on wallet margin\" // DESCRIPTION: Description of ledger transaction\n        //         ]\n        //     ]\n        //\n        const itemList = this.safeList (item, 'result', []);\n        let type = undefined;\n        const id = this.safeString (itemList, 0);\n        const currencyId = this.safeString (itemList, 1);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (itemList, 3);\n        const amount = this.safeNumber (itemList, 5);\n        const after = this.safeNumber (itemList, 6);\n        const description = this.safeString (itemList, 8);\n        if (description !== undefined) {\n            const parts = description.split (' @ ');\n            const first = this.safeStringLower (parts, 0);\n            type = this.parseLedgerEntryType (first);\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': undefined,\n            'account': undefined,\n            'referenceId': id,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'amount': amount,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': after,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type: Str)",
        "line_start": 3029,
        "line_end": 3047,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type: Str) {\n        if (type === undefined) {\n            return undefined;\n        } else if (type.indexOf ('fee') >= 0 || type.indexOf ('charged') >= 0) {\n            return 'fee';\n        } else if (type.indexOf ('rebate') >= 0) {\n            return 'rebate';\n        } else if (type.indexOf ('deposit') >= 0 || type.indexOf ('withdrawal') >= 0) {\n            return 'transaction';\n        } else if (type.indexOf ('transfer') >= 0) {\n            return 'transfer';\n        } else if (type.indexOf ('payment') >= 0) {\n            return 'payout';\n        } else if (type.indexOf ('exchange') >= 0 || type.indexOf ('position') >= 0) {\n            return 'trade';\n        } else {\n            return type;\n        }\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 3689,
        "line_end": 3729,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "entry",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contracts)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (price)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.parseNumber (baseValue)",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (Precise.stringMul (baseValue, price))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "[\n         [\n             \"pos\",\n             171085137,       // position id\n             1706395919788,   // timestamp\n             null,\n             \"tAVAXF0:USTF0\", // market id\n             -8,              // amount in contracts\n             32.868,          // base price\n             null,\n             1,\n             1,\n             null,\n             33.255           // acquired price\n         ]\n     ]"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     [\n        //         [\n        //             \"pos\",\n        //             171085137,       // position id\n        //             1706395919788,   // timestamp\n        //             null,\n        //             \"tAVAXF0:USTF0\", // market id\n        //             -8,              // amount in contracts\n        //             32.868,          // base price\n        //             null,\n        //             1,\n        //             1,\n        //             null,\n        //             33.255           // acquired price\n        //         ]\n        //     ]\n        //\n        const entry = liquidation[0];\n        const timestamp = this.safeInteger (entry, 2);\n        const marketId = this.safeString (entry, 4);\n        const contracts = Precise.stringAbs (this.safeString (entry, 5));\n        const contractSize = this.safeString (market, 'contractSize');\n        const baseValue = Precise.stringMul (contracts, contractSize);\n        const price = this.safeString (entry, 11);\n        const sideFlag = this.safeInteger (entry, 8);\n        const side = (sideFlag === 1) ? 'buy' : 'sell';\n        return this.safeLiquidation ({\n            'info': entry,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'contracts': this.parseNumber (contracts),\n            'contractSize': this.parseNumber (contractSize),\n            'price': this.parseNumber (price),\n            'side': side,\n            'baseValue': this.parseNumber (baseValue),\n            'quoteValue': this.parseNumber (Precise.stringMul (baseValue, price)),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data, market = undefined): MarginModification",
        "line_start": 3763,
        "line_end": 3787,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "marginStatus",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         [\n             1\n         ]\n     ]"
        ],
        "source": "parseMarginModification (data, market = undefined): MarginModification {\n        //\n        // setMargin\n        //\n        //     [\n        //         [\n        //             1\n        //         ]\n        //     ]\n        //\n        const marginStatusRaw = data[0];\n        const marginStatus = (marginStatusRaw === 1) ? 'ok' : 'failed';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': undefined,\n            'status': marginStatus,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1555,
        "line_end": 1574,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1457539800000,\n         0.02594,\n         0.02594,\n         0.02594,\n         0.02594,\n         0.1\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1457539800000,\n        //         0.02594,\n        //         0.02594,\n        //         0.02594,\n        //         0.02594,\n        //         0.1\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3563,
        "line_end": 3634,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber (interest, openInterestIndex)",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "[\n         \"tXRPF0:USTF0\",  // market id\n         1706256986000,   // millisecond timestamp\n         null,\n         0.512705,        // derivative mid price\n         0.512395,        // underlying spot mid price\n         null,\n         37671483.04,     // insurance fund balance\n         null,\n         1706284800000,   // timestamp of next funding\n         0.00002353,      // accrued funding for next period\n         317,             // next funding step\n         null,\n         0,               // current funding\n         null,\n         null,\n         0.5123016,       // mark price\n         null,\n         null,\n         2233562.03115,   // open interest in contracts\n         null,\n         null,\n         null,\n         0.0005,          // average spread without funding payment\n         0.0025           // funding payment cap\n     ]",
          "[\n         1706295191000,       // timestamp\n         null,\n         42152.425382,        // derivative mid price\n         42133,               // spot mid price\n         null,\n         37671589.7853521,    // insurance fund balance\n         null,\n         1706313600000,       // timestamp of next funding\n         0.00018734,          // accrued funding for next period\n         3343,                // next funding step\n         null,\n         0.00007587,          // current funding\n         null,\n         null,\n         42134.1,             // mark price\n         null,\n         null,\n         5775.20348804,       // open interest number of contracts\n         null,\n         null,\n         null,\n         0.0005,              // average spread without funding payment\n         0.0025               // funding payment cap\n     ]"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterest:\n        //\n        //     [\n        //         \"tXRPF0:USTF0\",  // market id\n        //         1706256986000,   // millisecond timestamp\n        //         null,\n        //         0.512705,        // derivative mid price\n        //         0.512395,        // underlying spot mid price\n        //         null,\n        //         37671483.04,     // insurance fund balance\n        //         null,\n        //         1706284800000,   // timestamp of next funding\n        //         0.00002353,      // accrued funding for next period\n        //         317,             // next funding step\n        //         null,\n        //         0,               // current funding\n        //         null,\n        //         null,\n        //         0.5123016,       // mark price\n        //         null,\n        //         null,\n        //         2233562.03115,   // open interest in contracts\n        //         null,\n        //         null,\n        //         null,\n        //         0.0005,          // average spread without funding payment\n        //         0.0025           // funding payment cap\n        //     ]\n        //\n        // fetchOpenInterestHistory:\n        //\n        //     [\n        //         1706295191000,       // timestamp\n        //         null,\n        //         42152.425382,        // derivative mid price\n        //         42133,               // spot mid price\n        //         null,\n        //         37671589.7853521,    // insurance fund balance\n        //         null,\n        //         1706313600000,       // timestamp of next funding\n        //         0.00018734,          // accrued funding for next period\n        //         3343,                // next funding step\n        //         null,\n        //         0.00007587,          // current funding\n        //         null,\n        //         null,\n        //         42134.1,             // mark price\n        //         null,\n        //         null,\n        //         5775.20348804,       // open interest number of contracts\n        //         null,\n        //         null,\n        //         null,\n        //         0.0005,              // average spread without funding payment\n        //         0.0025               // funding payment cap\n        //     ]\n        //\n        const interestLength = interest.length;\n        const openInterestIndex = (interestLength === 23) ? 17 : 18;\n        const timestamp = this.safeInteger (interest, 1);\n        const marketId = this.safeString (interest, 0);\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'openInterestAmount': this.safeNumber (interest, openInterestIndex),\n            'openInterestValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1621,
        "line_end": 1686,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "orderList",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        const orderList = this.safeList (order, 'result');\n        const id = this.safeString (orderList, 0);\n        const marketId = this.safeString (orderList, 3);\n        const symbol = this.safeSymbol (marketId);\n        // https://github.com/ccxt/ccxt/issues/6686\n        // const timestamp = this.safeTimestamp (orderObject, 5);\n        const timestamp = this.safeInteger (orderList, 5);\n        const remaining = Precise.stringAbs (this.safeString (orderList, 6));\n        const signedAmount = this.safeString (orderList, 7);\n        const amount = Precise.stringAbs (signedAmount);\n        const side = Precise.stringLt (signedAmount, '0') ? 'sell' : 'buy';\n        const orderType = this.safeString (orderList, 8);\n        const type = this.safeString (this.safeValue (this.options, 'exchangeTypes'), orderType);\n        const timeInForce = this.parseTimeInForce (orderType);\n        const rawFlags = this.safeString (orderList, 12);\n        const flags = this.parseOrderFlags (rawFlags);\n        let postOnly = false;\n        if (flags !== undefined) {\n            for (let i = 0; i < flags.length; i++) {\n                if (flags[i] === 'postOnly') {\n                    postOnly = true;\n                }\n            }\n        }\n        let price = this.safeString (orderList, 16);\n        let triggerPrice = undefined;\n        if ((orderType === 'EXCHANGE STOP') || (orderType === 'EXCHANGE STOP LIMIT')) {\n            price = undefined;\n            triggerPrice = this.safeString (orderList, 16);\n            if (orderType === 'EXCHANGE STOP LIMIT') {\n                price = this.safeString (orderList, 19);\n            }\n        }\n        let status = undefined;\n        const statusString = this.safeString (orderList, 13);\n        if (statusString !== undefined) {\n            const parts = statusString.split (' @ ');\n            status = this.parseOrderStatus (this.safeString (parts, 0));\n        }\n        const average = this.safeString (orderList, 17);\n        const clientOrderId = this.safeString (orderList, 2);\n        return this.safeOrder ({\n            'info': orderList,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': undefined,\n            'average': average,\n            'filled': undefined,\n            'remaining': remaining,\n            'status': status,\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderFlags",
        "signature": "parseOrderFlags (flags)",
        "line_start": 1597,
        "line_end": 1609,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderFlags (flags) {\n        // flags can be added to each other...\n        const flagValues: Dict = {\n            '1024': [ 'reduceOnly' ],\n            '4096': [ 'postOnly' ],\n            '5120': [ 'reduceOnly', 'postOnly' ],\n            // '64': 'hidden', // The hidden order option ensures an order does not appear in the order book\n            // '512': 'close', // Close position if position present.\n            // '16384': 'OCO', // The one cancels other order option allows you to place a pair of orders stipulating that if one order is executed fully or partially, then the other is automatically canceled.\n            // '524288': 'No Var Rates' // Excludes variable rate funding offers from matching against this order, if on margin\n        };\n        return this.safeValue (flagValues, flags, undefined);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1576,
        "line_end": 1595,
        "comment": null,
        "mappings": [
          {
            "key": "ACTIVE",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "PARTIALLY",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "EXECUTED",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "INSUFFICIENT",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "POSTONLY CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "RSN_DUST",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "RSN_PAUSE",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "IOC CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "FILLORKILL CANCELED",
            "value": "'canceled'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status === undefined) {\n            return status;\n        }\n        const parts = status.split (' ');\n        const state = this.safeString (parts, 0);\n        const statuses: Dict = {\n            'ACTIVE': 'open',\n            'PARTIALLY': 'open',\n            'EXECUTED': 'closed',\n            'CANCELED': 'canceled',\n            'INSUFFICIENT': 'canceled',\n            'POSTONLY CANCELED': 'canceled',\n            'RSN_DUST': 'rejected',\n            'RSN_PAUSE': 'rejected',\n            'IOC CANCELED': 'canceled',\n            'FILLORKILL CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, state, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2895,
        "line_end": 2964,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "positionList",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (positionList, 11)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (positionList, 3)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (positionList, 6)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (positionList, 7)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "Precise.stringGt (amount, '0') ? 'long' : 'short'",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (positionList, 13)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (positionList, 18)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (positionList, 17)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (Precise.stringMul (tradeAmount, tradePrice))",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (positionList, 9)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n        \"tBTCUSD\",                    // SYMBOL\n        \"ACTIVE\",                     // STATUS\n        0.0195,                       // AMOUNT\n        8565.0267019,                 // BASE_PRICE\n        0,                            // MARGIN_FUNDING\n        0,                            // MARGIN_FUNDING_TYPE\n        -0.33455568705000516,         // PL\n        -0.0003117550117425625,       // PL_PERC\n        7045.876419249083,            // PRICE_LIQ\n        3.0673001895895604,           // LEVERAGE\n        null,                         // _PLACEHOLDER\n        142355652,                    // POSITION_ID\n        1574002216000,                // MTS_CREATE\n        1574002216000,                // MTS_UPDATE\n        null,                         // _PLACEHOLDER\n        0,                            // TYPE\n        null,                         // _PLACEHOLDER\n        0,                            // COLLATERAL\n        0,                            // COLLATERAL_MIN\n        // META\n        {\n            \"reason\": \"TRADE\",\n            \"order_id\": 34271018124,\n            \"liq_stage\": null,\n            \"trade_price\": \"8565.0267019\",\n            \"trade_amount\": \"0.0195\",\n            \"order_id_oppo\": 34277498022\n        }\n    ]"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //    [\n        //        \"tBTCUSD\",                    // SYMBOL\n        //        \"ACTIVE\",                     // STATUS\n        //        0.0195,                       // AMOUNT\n        //        8565.0267019,                 // BASE_PRICE\n        //        0,                            // MARGIN_FUNDING\n        //        0,                            // MARGIN_FUNDING_TYPE\n        //        -0.33455568705000516,         // PL\n        //        -0.0003117550117425625,       // PL_PERC\n        //        7045.876419249083,            // PRICE_LIQ\n        //        3.0673001895895604,           // LEVERAGE\n        //        null,                         // _PLACEHOLDER\n        //        142355652,                    // POSITION_ID\n        //        1574002216000,                // MTS_CREATE\n        //        1574002216000,                // MTS_UPDATE\n        //        null,                         // _PLACEHOLDER\n        //        0,                            // TYPE\n        //        null,                         // _PLACEHOLDER\n        //        0,                            // COLLATERAL\n        //        0,                            // COLLATERAL_MIN\n        //        // META\n        //        {\n        //            \"reason\": \"TRADE\",\n        //            \"order_id\": 34271018124,\n        //            \"liq_stage\": null,\n        //            \"trade_price\": \"8565.0267019\",\n        //            \"trade_amount\": \"0.0195\",\n        //            \"order_id_oppo\": 34277498022\n        //        }\n        //    ]\n        //\n        const positionList = this.safeList (position, 'result');\n        const marketId = this.safeString (positionList, 0);\n        const amount = this.safeString (positionList, 2);\n        const timestamp = this.safeInteger (positionList, 12);\n        const meta = this.safeString (positionList, 19);\n        const tradePrice = this.safeString (meta, 'trade_price');\n        const tradeAmount = this.safeString (meta, 'trade_amount');\n        return this.safePosition ({\n            'info': positionList,\n            'id': this.safeString (positionList, 11),\n            'symbol': this.safeSymbol (marketId, market),\n            'notional': this.parseNumber (amount),\n            'marginMode': 'isolated',  // derivatives use isolated, margin uses cross, https://support.bitfinex.com/hc/en-us/articles/360035475374-Derivatives-Trading-on-Bitfinex\n            'liquidationPrice': this.safeNumber (positionList, 8),\n            'entryPrice': this.safeNumber (positionList, 3),\n            'unrealizedPnl': this.safeNumber (positionList, 6),\n            'percentage': this.safeNumber (positionList, 7),\n            'contracts': undefined,\n            'contractSize': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': Precise.stringGt (amount, '0') ? 'long' : 'short',\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (positionList, 13),\n            'maintenanceMargin': this.safeNumber (positionList, 18),\n            'maintenanceMarginPercentage': undefined,\n            'collateral': this.safeNumber (positionList, 17),\n            'initialMargin': this.parseNumber (Precise.stringMul (tradeAmount, tradePrice)),\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber (positionList, 9),\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1180,
        "line_end": 1287,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "volume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "[\n            SYMBOL, // this index is not present in singular-ticker\n            BID,\n            BID_SIZE,\n            ASK,\n            ASK_SIZE,\n            DAILY_CHANGE,\n            DAILY_CHANGE_RELATIVE,\n            LAST_PRICE,\n            VOLUME,\n            HIGH,\n            LOW\n    ]",
          "[\n            SYMBOL, // this index is not present in singular-ticker\n            FRR,\n            BID,\n            BID_PERIOD,\n            BID_SIZE,\n            ASK,\n            ASK_PERIOD,\n            ASK_SIZE,\n            DAILY_CHANGE,\n            DAILY_CHANGE_RELATIVE,\n            LAST_PRICE,\n            VOLUME,\n            HIGH,\n            LOW,\n            _PLACEHOLDER,\n            _PLACEHOLDER,\n            FRR_AMOUNT_AVAILABLE\n     ]"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // on trading pairs (ex. tBTCUSD)\n        //\n        //    [\n        //            SYMBOL, // this index is not present in singular-ticker\n        //            BID,\n        //            BID_SIZE,\n        //            ASK,\n        //            ASK_SIZE,\n        //            DAILY_CHANGE,\n        //            DAILY_CHANGE_RELATIVE,\n        //            LAST_PRICE,\n        //            VOLUME,\n        //            HIGH,\n        //            LOW\n        //    ]\n        //\n        //\n        // on funding currencies (ex. fUSD)\n        //\n        //    [\n        //            SYMBOL, // this index is not present in singular-ticker\n        //            FRR,\n        //            BID,\n        //            BID_PERIOD,\n        //            BID_SIZE,\n        //            ASK,\n        //            ASK_PERIOD,\n        //            ASK_SIZE,\n        //            DAILY_CHANGE,\n        //            DAILY_CHANGE_RELATIVE,\n        //            LAST_PRICE,\n        //            VOLUME,\n        //            HIGH,\n        //            LOW,\n        //            _PLACEHOLDER,\n        //            _PLACEHOLDER,\n        //            FRR_AMOUNT_AVAILABLE\n        //     ]\n        //\n        const length = ticker.length;\n        const isFetchTicker = (length === 10) || (length === 16);\n        let symbol: Str = undefined;\n        let minusIndex = 0;\n        let isFundingCurrency = false;\n        if (isFetchTicker) {\n            minusIndex = 1;\n            isFundingCurrency = (length === 16);\n        } else {\n            const marketId = this.safeString (ticker, 0);\n            market = this.safeMarket (marketId, market);\n            isFundingCurrency = (length === 17);\n        }\n        symbol = this.safeSymbol (undefined, market);\n        let last: Str = undefined;\n        let bid: Str = undefined;\n        let ask: Str = undefined;\n        let change: Str = undefined;\n        let percentage: Str = undefined;\n        let volume: Str = undefined;\n        let high: Str = undefined;\n        let low: Str = undefined;\n        if (isFundingCurrency) {\n            // per api docs, they are different array type\n            last = this.safeString (ticker, 10 - minusIndex);\n            bid = this.safeString (ticker, 2 - minusIndex);\n            ask = this.safeString (ticker, 5 - minusIndex);\n            change = this.safeString (ticker, 8 - minusIndex);\n            percentage = this.safeString (ticker, 9 - minusIndex);\n            volume = this.safeString (ticker, 11 - minusIndex);\n            high = this.safeString (ticker, 12 - minusIndex);\n            low = this.safeString (ticker, 13 - minusIndex);\n        } else {\n            // on trading pairs (ex. tBTCUSD or tHMSTR:USD)\n            last = this.safeString (ticker, 7 - minusIndex);\n            bid = this.safeString (ticker, 1 - minusIndex);\n            ask = this.safeString (ticker, 3 - minusIndex);\n            change = this.safeString (ticker, 5 - minusIndex);\n            percentage = this.safeString (ticker, 6 - minusIndex);\n            percentage = Precise.stringMul (percentage, '100');\n            volume = this.safeString (ticker, 8 - minusIndex);\n            high = this.safeString (ticker, 9 - minusIndex);\n            low = this.safeString (ticker, 10 - minusIndex);\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': undefined,\n            'ask': ask,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': volume,\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (orderType)",
        "line_start": 1611,
        "line_end": 1619,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (orderType) {\n        const orderTypes: Dict = {\n            'EXCHANGE IOC': 'IOC',\n            'EXCHANGE FOK': 'FOK',\n            'IOC': 'IOC', // Margin\n            'FOK': 'FOK', // Margin\n        };\n        return this.safeString (orderTypes, orderType, 'GTC');\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1370,
        "line_end": 1452,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "tradeList",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "[\n         ID,\n         MTS, // timestamp\n         AMOUNT,\n         PRICE\n     ]",
          "[\n         ID,\n         PAIR,\n         MTS_CREATE,\n         ORDER_ID,\n         EXEC_AMOUNT,\n         EXEC_PRICE,\n         ORDER_TYPE,\n         ORDER_PRICE,\n         MAKER,\n         FEE,\n         FEE_CURRENCY,\n         ...\n     ]"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     [\n        //         ID,\n        //         MTS, // timestamp\n        //         AMOUNT,\n        //         PRICE\n        //     ]\n        //\n        // fetchMyTrades (private)\n        //\n        //     [\n        //         ID,\n        //         PAIR,\n        //         MTS_CREATE,\n        //         ORDER_ID,\n        //         EXEC_AMOUNT,\n        //         EXEC_PRICE,\n        //         ORDER_TYPE,\n        //         ORDER_PRICE,\n        //         MAKER,\n        //         FEE,\n        //         FEE_CURRENCY,\n        //         ...\n        //     ]\n        //\n        const tradeList = this.safeList (trade, 'result', []);\n        const tradeLength = tradeList.length;\n        const isPrivate = (tradeLength > 5);\n        const id = this.safeString (tradeList, 0);\n        const amountIndex = isPrivate ? 4 : 2;\n        let side = undefined;\n        let amountString = this.safeString (tradeList, amountIndex);\n        const priceIndex = isPrivate ? 5 : 3;\n        const priceString = this.safeString (tradeList, priceIndex);\n        if (amountString[0] === '-') {\n            side = 'sell';\n            amountString = Precise.stringAbs (amountString);\n        } else {\n            side = 'buy';\n        }\n        let orderId = undefined;\n        let takerOrMaker = undefined;\n        let type = undefined;\n        let fee = undefined;\n        let symbol = this.safeSymbol (undefined, market);\n        const timestampIndex = isPrivate ? 2 : 1;\n        const timestamp = this.safeInteger (tradeList, timestampIndex);\n        if (isPrivate) {\n            const marketId = tradeList[1];\n            symbol = this.safeSymbol (marketId);\n            orderId = this.safeString (tradeList, 3);\n            const maker = this.safeInteger (tradeList, 8);\n            takerOrMaker = (maker === 1) ? 'maker' : 'taker';\n            let feeCostString = this.safeString (tradeList, 9);\n            feeCostString = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (tradeList, 10);\n            const feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrency,\n            };\n            const orderType = tradeList[6];\n            type = this.safeString (this.options['exchangeTypes'], orderType);\n        }\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'side': side,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n            'info': tradeList,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2438,
        "line_end": 2577,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "comment",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "[\n         1582271520931, // MTS Millisecond Time Stamp of the update\n         \"acc_wd-req\", // TYPE Purpose of notification \"acc_wd-req\" account withdrawal request\n         null, // MESSAGE_ID unique ID of the message\n         null, // not documented\n         [\n             0, // WITHDRAWAL_ID Unique Withdrawal ID\n             null, // PLACEHOLDER\n             \"bitcoin\", // METHOD Method of withdrawal\n             null, // PAYMENT_ID Payment ID if relevant\n             \"exchange\", // WALLET Sending wallet\n             1, // AMOUNT Amount of Withdrawal less fee\n             null, // PLACEHOLDER\n             null, // PLACEHOLDER\n             0.0004, // WITHDRAWAL_FEE Fee on withdrawal\n         ],\n         null, // CODE null or integer Work in progress\n         \"SUCCESS\", // STATUS Status of the notification, it may vary over time SUCCESS, ERROR, FAILURE\n         \"Invalid bitcoin address (abcdef)\", // TEXT Text of the notification\n     ]",
          "[\n         13293039, // ID\n         \"ETH\", // CURRENCY\n         \"ETHEREUM\", // CURRENCY_NAME\n         null,\n         null,\n         1574175052000, // MTS_STARTED\n         1574181326000, // MTS_UPDATED\n         null,\n         null,\n         \"CANCELED\", // STATUS\n         null,\n         null,\n         -0.24, // AMOUNT, negative for withdrawals\n         -0.00135, // FEES\n         null,\n         null,\n         \"0x38110e0Fc932CB2BE...........\", // DESTINATION_ADDRESS\n         null,\n         null,\n         null,\n         \"0x523ec8945500.....................................\", // TRANSACTION_ID\n         \"Purchase of 100 pizzas\", // WITHDRAW_TRANSACTION_NOTE, might also be: null\n     ]"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     [\n        //         1582271520931, // MTS Millisecond Time Stamp of the update\n        //         \"acc_wd-req\", // TYPE Purpose of notification \"acc_wd-req\" account withdrawal request\n        //         null, // MESSAGE_ID unique ID of the message\n        //         null, // not documented\n        //         [\n        //             0, // WITHDRAWAL_ID Unique Withdrawal ID\n        //             null, // PLACEHOLDER\n        //             \"bitcoin\", // METHOD Method of withdrawal\n        //             null, // PAYMENT_ID Payment ID if relevant\n        //             \"exchange\", // WALLET Sending wallet\n        //             1, // AMOUNT Amount of Withdrawal less fee\n        //             null, // PLACEHOLDER\n        //             null, // PLACEHOLDER\n        //             0.0004, // WITHDRAWAL_FEE Fee on withdrawal\n        //         ],\n        //         null, // CODE null or integer Work in progress\n        //         \"SUCCESS\", // STATUS Status of the notification, it may vary over time SUCCESS, ERROR, FAILURE\n        //         \"Invalid bitcoin address (abcdef)\", // TEXT Text of the notification\n        //     ]\n        //\n        // fetchDepositsWithdrawals\n        //\n        //     [\n        //         13293039, // ID\n        //         \"ETH\", // CURRENCY\n        //         \"ETHEREUM\", // CURRENCY_NAME\n        //         null,\n        //         null,\n        //         1574175052000, // MTS_STARTED\n        //         1574181326000, // MTS_UPDATED\n        //         null,\n        //         null,\n        //         \"CANCELED\", // STATUS\n        //         null,\n        //         null,\n        //         -0.24, // AMOUNT, negative for withdrawals\n        //         -0.00135, // FEES\n        //         null,\n        //         null,\n        //         \"0x38110e0Fc932CB2BE...........\", // DESTINATION_ADDRESS\n        //         null,\n        //         null,\n        //         null,\n        //         \"0x523ec8945500.....................................\", // TRANSACTION_ID\n        //         \"Purchase of 100 pizzas\", // WITHDRAW_TRANSACTION_NOTE, might also be: null\n        //     ]\n        //\n        const transactionLength = transaction.length;\n        let timestamp = undefined;\n        let updated = undefined;\n        let code = undefined;\n        let amount = undefined;\n        let id = undefined;\n        let status = undefined;\n        let tag = undefined;\n        let type = undefined;\n        let feeCost = undefined;\n        let txid = undefined;\n        let addressTo = undefined;\n        let network = undefined;\n        let comment = undefined;\n        if (transactionLength === 8) {\n            const data = this.safeValue (transaction, 4, []);\n            timestamp = this.safeInteger (transaction, 0);\n            if (currency !== undefined) {\n                code = currency['code'];\n            }\n            feeCost = this.safeString (data, 8);\n            if (feeCost !== undefined) {\n                feeCost = Precise.stringAbs (feeCost);\n            }\n            amount = this.safeNumber (data, 5);\n            id = this.safeInteger (data, 0);\n            status = 'ok';\n            if (id === 0) {\n                id = undefined;\n                status = 'failed';\n            }\n            tag = this.safeString (data, 3);\n            type = 'withdrawal';\n            const networkId = this.safeString (data, 2);\n            network = this.networkIdToCode (networkId.toUpperCase ()); // withdraw returns in lowercase\n        } else if (transactionLength === 22) {\n            id = this.safeString (transaction, 0);\n            const currencyId = this.safeString (transaction, 1);\n            code = this.safeCurrencyCode (currencyId, currency);\n            const networkId = this.safeString (transaction, 2);\n            network = this.networkIdToCode (networkId);\n            timestamp = this.safeInteger (transaction, 5);\n            updated = this.safeInteger (transaction, 6);\n            status = this.parseTransactionStatus (this.safeString (transaction, 9));\n            const signedAmount = this.safeString (transaction, 12);\n            amount = Precise.stringAbs (signedAmount);\n            if (signedAmount !== undefined) {\n                if (Precise.stringLt (signedAmount, '0')) {\n                    type = 'withdrawal';\n                } else {\n                    type = 'deposit';\n                }\n            }\n            feeCost = this.safeString (transaction, 13);\n            if (feeCost !== undefined) {\n                feeCost = Precise.stringAbs (feeCost);\n            }\n            addressTo = this.safeString (transaction, 16);\n            txid = this.safeString (transaction, 20);\n            comment = this.safeString (transaction, 21);\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'type': type,\n            'currency': code,\n            'network': network,\n            'amount': this.parseNumber (amount),\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': addressTo, // this is actually the tag for XRP transfers (the address is missing)\n            'addressFrom': undefined,\n            'addressTo': addressTo,\n            'tag': tag, // refix it properly for the tag from description\n            'tagFrom': undefined,\n            'tagTo': tag,\n            'updated': updated,\n            'comment': comment,\n            'internal': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2421,
        "line_end": 2436,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'SUCCESS': 'ok',\n            'COMPLETED': 'ok',\n            'ERROR': 'failed',\n            'FAILURE': 'failed',\n            'CANCELED': 'canceled',\n            'PENDING APPROVAL': 'pending',\n            'PENDING': 'pending',\n            'PENDING REVIEW': 'pending',\n            'PENDING CANCELLATION': 'pending',\n            'SENDING': 'pending',\n            'USER APPROVED': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1055,
        "line_end": 1097,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 7)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "info",
            "value": "result",
            "comment": null
          }
        ],
        "examples": [
          "[\n         1616451183763,\n         \"acc_tf\",\n         null,\n         null,\n         [\n             1616451183763,\n             \"exchange\",\n             \"margin\",\n             null,\n             \"UST\",\n             \"UST\",\n             null,\n             1\n         ],\n         null,\n         \"SUCCESS\",\n         \"1.0 Tether USDt transfered from Exchange to Margin\"\n     ]"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     [\n        //         1616451183763,\n        //         \"acc_tf\",\n        //         null,\n        //         null,\n        //         [\n        //             1616451183763,\n        //             \"exchange\",\n        //             \"margin\",\n        //             null,\n        //             \"UST\",\n        //             \"UST\",\n        //             null,\n        //             1\n        //         ],\n        //         null,\n        //         \"SUCCESS\",\n        //         \"1.0 Tether USDt transfered from Exchange to Margin\"\n        //     ]\n        //\n        const result = this.safeList (transfer, 'result');\n        const timestamp = this.safeInteger (result, 0);\n        const info = this.safeValue (result, 4);\n        const fromAccount = this.safeString (info, 1);\n        const toAccount = this.safeString (info, 2);\n        const currencyId = this.safeString (info, 5);\n        const status = this.safeString (result, 6);\n        return {\n            'id': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'status': this.parseTransferStatus (status),\n            'amount': this.safeNumber (info, 7),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'info': result,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 1099,
        "line_end": 1106,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'SUCCESS': 'ok',\n            'ERROR': 'failed',\n            'FAILURE': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitflyer": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 412,
        "line_end": 424,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency_code');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'amount');\n            account['free'] = this.safeString (balance, 'available');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositStatus",
        "signature": "parseDepositStatus (status)",
        "line_start": 1056,
        "line_end": 1062,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositStatus (status) {\n        const statuses: Dict = {\n            'PENDING': 'pending',\n            'COMPLETED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseExpiryDate",
        "signature": "parseExpiryDate (expiry)",
        "line_start": 228,
        "line_end": 248,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseExpiryDate (expiry) {\n        const day = expiry.slice (0, 2);\n        const monthName = expiry.slice (2, 5);\n        const year = expiry.slice (5, 9);\n        const months: Dict = {\n            'JAN': '01',\n            'FEB': '02',\n            'MAR': '03',\n            'APR': '04',\n            'MAY': '05',\n            'JUN': '06',\n            'JUL': '07',\n            'AUG': '08',\n            'SEP': '09',\n            'OCT': '10',\n            'NOV': '11',\n            'DEC': '12',\n        };\n        const month = this.safeString (months, monthName);\n        return this.parse8601 (year + '-' + month + '-' + day + 'T00:00:00Z');\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1178,
        "line_end": 1207,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'current_funding_rate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"current_funding_rate\": -0.003750000000\n        \"next_funding_rate_settledate\": \"2024-04-15T13:00:00\"\n    }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"current_funding_rate\": -0.003750000000\n        //        \"next_funding_rate_settledate\": \"2024-04-15T13:00:00\"\n        //    }\n        //\n        const nextFundingDatetime = this.safeString (contract, 'next_funding_rate_settledate');\n        const nextFundingTimestamp = this.parse8601 (nextFundingDatetime);\n        return {\n            'info': contract,\n            'symbol': this.safeString (market, 'symbol'),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': undefined,\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': this.safeNumber (contract, 'current_funding_rate'),\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 730,
        "line_end": 774,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        const timestamp = this.parse8601 (this.safeString (order, 'child_order_date'));\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'size');\n        const filled = this.safeString (order, 'executed_size');\n        const remaining = this.safeString (order, 'outstanding_size');\n        const status = this.parseOrderStatus (this.safeString (order, 'child_order_state'));\n        const type = this.safeStringLower (order, 'child_order_type');\n        const side = this.safeStringLower (order, 'side');\n        const marketId = this.safeString (order, 'product_code');\n        const symbol = this.safeSymbol (marketId, market);\n        let fee = undefined;\n        const feeCost = this.safeNumber (order, 'total_commission');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': undefined,\n                'rate': undefined,\n            };\n        }\n        const id = this.safeString (order, 'child_order_acceptance_id');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'fee': fee,\n            'average': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 719,
        "line_end": 728,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'ACTIVE': 'open',\n            'COMPLETED': 'closed',\n            'CANCELED': 'canceled',\n            'EXPIRED': 'canceled',\n            'REJECTED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 479,
        "line_end": 505,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'best_bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'best_ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume_by_product')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.parse8601 (this.safeString (ticker, 'timestamp'));\n        const last = this.safeString (ticker, 'ltp');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': undefined,\n            'low': undefined,\n            'bid': this.safeString (ticker, 'best_bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'best_ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume_by_product'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 526,
        "line_end": 589,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"id\":2278466664,\n          \"side\":\"SELL\",\n          \"price\":56810.7,\n          \"size\":0.08798,\n          \"exec_date\":\"2021-11-19T11:46:39.323\",\n          \"buy_child_order_acceptance_id\":\"JRF20211119-114209-236525\",\n          \"sell_child_order_acceptance_id\":\"JRF20211119-114639-236919\"\n      }",
          "{\n          \"id\": 37233,\n          \"side\": \"BUY\",\n          \"price\": 33470,\n          \"size\": 0.01,\n          \"exec_date\": \"2015-07-07T09:57:40.397\",\n          \"child_order_id\": \"JOR20150707-060559-021935\",\n          \"child_order_acceptance_id\": \"JRF20150707-060559-396699\"\n          \"commission\": 0,\n      },"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public) v1\n        //\n        //      {\n        //          \"id\":2278466664,\n        //          \"side\":\"SELL\",\n        //          \"price\":56810.7,\n        //          \"size\":0.08798,\n        //          \"exec_date\":\"2021-11-19T11:46:39.323\",\n        //          \"buy_child_order_acceptance_id\":\"JRF20211119-114209-236525\",\n        //          \"sell_child_order_acceptance_id\":\"JRF20211119-114639-236919\"\n        //      }\n        //\n        // fetchMyTrades\n        //\n        //      {\n        //          \"id\": 37233,\n        //          \"side\": \"BUY\",\n        //          \"price\": 33470,\n        //          \"size\": 0.01,\n        //          \"exec_date\": \"2015-07-07T09:57:40.397\",\n        //          \"child_order_id\": \"JOR20150707-060559-021935\",\n        //          \"child_order_acceptance_id\": \"JRF20150707-060559-396699\"\n        //          \"commission\": 0,\n        //      },\n        //\n        let side = this.safeStringLower (trade, 'side');\n        if (side !== undefined) {\n            if (side.length < 1) {\n                side = undefined;\n            }\n        }\n        let order = undefined;\n        if (side !== undefined) {\n            const idInner = side + '_child_order_acceptance_id';\n            if (idInner in trade) {\n                order = trade[idInner];\n            }\n        }\n        if (order === undefined) {\n            order = this.safeString (trade, 'child_order_acceptance_id');\n        }\n        const timestamp = this.parse8601 (this.safeString (trade, 'exec_date'));\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'size');\n        const id = this.safeString (trade, 'id');\n        market = this.safeMarket (undefined, market);\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': order,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1072,
        "line_end": 1151,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (Precise.stringAdd (feeCost, additionalFee))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 100,\n         \"order_id\": \"CDP20151227-024141-055555\",\n         \"currency_code\": \"BTC\",\n         \"amount\": 0.00002,\n         \"address\": \"1WriteySQufKZ2pVuM1oMhPrTtTVFq35j\",\n         \"tx_hash\": \"9f92ee65a176bb9545f7becb8706c50d07d4cee5ffca34d8be3ef11d411405ae\",\n         \"status\": \"COMPLETED\",\n         \"event_date\": \"2015-11-27T08:59:20.301\"\n     }",
          "{\n         \"id\": 500,\n         \"order_id\": \"CWD20151224-014040-077777\",\n         \"currency_code\": \"BTC\",\n         \"amount\": 0.1234,\n         \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n         \"tx_hash\": \"724c07dfd4044abcb390b0412c3e707dd5c4f373f0a52b3bd295ce32b478c60a\",\n         \"fee\": 0.0005,\n         \"additional_fee\": 0.0001,\n         \"status\": \"COMPLETED\",\n         \"event_date\": \"2015-12-24T01:40:40.397\"\n     }",
          "{\n         \"message_id\": \"69476620-5056-4003-bcbe-42658a2b041b\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": 100,\n        //         \"order_id\": \"CDP20151227-024141-055555\",\n        //         \"currency_code\": \"BTC\",\n        //         \"amount\": 0.00002,\n        //         \"address\": \"1WriteySQufKZ2pVuM1oMhPrTtTVFq35j\",\n        //         \"tx_hash\": \"9f92ee65a176bb9545f7becb8706c50d07d4cee5ffca34d8be3ef11d411405ae\",\n        //         \"status\": \"COMPLETED\",\n        //         \"event_date\": \"2015-11-27T08:59:20.301\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": 500,\n        //         \"order_id\": \"CWD20151224-014040-077777\",\n        //         \"currency_code\": \"BTC\",\n        //         \"amount\": 0.1234,\n        //         \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n        //         \"tx_hash\": \"724c07dfd4044abcb390b0412c3e707dd5c4f373f0a52b3bd295ce32b478c60a\",\n        //         \"fee\": 0.0005,\n        //         \"additional_fee\": 0.0001,\n        //         \"status\": \"COMPLETED\",\n        //         \"event_date\": \"2015-12-24T01:40:40.397\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"message_id\": \"69476620-5056-4003-bcbe-42658a2b041b\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'id', 'message_id');\n        const address = this.safeString (transaction, 'address');\n        const currencyId = this.safeString (transaction, 'currency_code');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.parse8601 (this.safeString (transaction, 'event_date'));\n        const amount = this.safeNumber (transaction, 'amount');\n        const txId = this.safeString (transaction, 'tx_hash');\n        const rawStatus = this.safeString (transaction, 'status');\n        let type = undefined;\n        let status = undefined;\n        let fee = undefined;\n        if ('fee' in transaction) {\n            type = 'withdrawal';\n            status = this.parseWithdrawalStatus (rawStatus);\n            const feeCost = this.safeString (transaction, 'fee');\n            const additionalFee = this.safeString (transaction, 'additional_fee');\n            fee = { 'currency': code, 'cost': this.parseNumber (Precise.stringAdd (feeCost, additionalFee)) };\n        } else {\n            type = 'deposit';\n            status = this.parseDepositStatus (rawStatus);\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseWithdrawalStatus",
        "signature": "parseWithdrawalStatus (status)",
        "line_start": 1064,
        "line_end": 1070,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseWithdrawalStatus (status) {\n        const statuses: Dict = {\n            'PENDING': 'pending',\n            'COMPLETED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitget": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (balance): Balances",
        "line_start": 4597,
        "line_end": 4674,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"coin\": \"USDT\",\n         \"available\": \"0.00000000\",\n         \"limitAvailable\": \"0\",\n         \"frozen\": \"0.00000000\",\n         \"locked\": \"0.00000000\",\n         \"uTime\": \"1699937566000\"\n     }",
          "{\n         \"marginCoin\": \"USDT\",\n         \"locked\": \"0\",\n         \"available\": \"0\",\n         \"crossedMaxAvailable\": \"0\",\n         \"isolatedMaxAvailable\": \"0\",\n         \"maxTransferOut\": \"0\",\n         \"accountEquity\": \"0\",\n         \"usdtEquity\": \"0.000000005166\",\n         \"btcEquity\": \"0\",\n         \"crossedRiskRate\": \"0\",\n         \"unrealizedPL\": \"0\",\n         \"coupon\": \"0\",\n         \"crossedUnrealizedPL\": null,\n         \"isolatedUnrealizedPL\": null\n     }",
          "{\n           \"coin\": \"USDT\",\n           \"totalAmount\": \"0.01\",\n           \"available\": \"0.01\",\n           \"frozen\": \"0\",\n           \"borrow\": \"0\",\n           \"interest\": \"0\",\n           \"net\": \"0.01\",\n           \"coupon\": \"0\",\n           \"cTime\": \"1759828511592\",\n           \"uTime\": \"1759828511592\"\n           // \"symbol\": \"BTCUSDT\" // only for isolated margin\n       }"
        ],
        "source": "parseBalance (balance): Balances {\n        const result: Dict = { 'info': balance };\n        //\n        // spot\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"available\": \"0.00000000\",\n        //         \"limitAvailable\": \"0\",\n        //         \"frozen\": \"0.00000000\",\n        //         \"locked\": \"0.00000000\",\n        //         \"uTime\": \"1699937566000\"\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"marginCoin\": \"USDT\",\n        //         \"locked\": \"0\",\n        //         \"available\": \"0\",\n        //         \"crossedMaxAvailable\": \"0\",\n        //         \"isolatedMaxAvailable\": \"0\",\n        //         \"maxTransferOut\": \"0\",\n        //         \"accountEquity\": \"0\",\n        //         \"usdtEquity\": \"0.000000005166\",\n        //         \"btcEquity\": \"0\",\n        //         \"crossedRiskRate\": \"0\",\n        //         \"unrealizedPL\": \"0\",\n        //         \"coupon\": \"0\",\n        //         \"crossedUnrealizedPL\": null,\n        //         \"isolatedUnrealizedPL\": null\n        //     }\n        //\n        // cross & isolated margin\n        //\n        //      {\n        //           \"coin\": \"USDT\",\n        //           \"totalAmount\": \"0.01\",\n        //           \"available\": \"0.01\",\n        //           \"frozen\": \"0\",\n        //           \"borrow\": \"0\",\n        //           \"interest\": \"0\",\n        //           \"net\": \"0.01\",\n        //           \"coupon\": \"0\",\n        //           \"cTime\": \"1759828511592\",\n        //           \"uTime\": \"1759828511592\"\n        //           // \"symbol\": \"BTCUSDT\" // only for isolated margin\n        //       }\n        //\n        for (let i = 0; i < balance.length; i++) {\n            const entry = balance[i];\n            const account = this.account ();\n            const currencyId = this.safeString2 (entry, 'marginCoin', 'coin');\n            const code = this.safeCurrencyCode (currencyId);\n            const borrow = this.safeString (entry, 'borrow');\n            if (borrow !== undefined) {\n                const interest = this.safeString (entry, 'interest');\n                account['free'] = this.safeString (entry, 'transferable');\n                account['total'] = this.safeString (entry, 'totalAmount');\n                account['debt'] = Precise.stringAdd (borrow, interest);\n            } else {\n                // Use transferable instead of available for swap and margin https://github.com/ccxt/ccxt/pull/19127\n                const spotAccountFree = this.safeString (entry, 'available');\n                const contractAccountFree = this.safeString (entry, 'maxTransferOut');\n                if (contractAccountFree !== undefined) {\n                    account['free'] = contractAccountFree;\n                    account['total'] = this.safeString (entry, 'accountEquity');\n                } else {\n                    account['free'] = spotAccountFree;\n                    const frozen = this.safeString (entry, 'frozen');\n                    const locked = this.safeString (entry, 'locked');\n                    account['used'] = Precise.stringAdd (frozen, locked);\n                }\n            }\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 10235,
        "line_end": 10279,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'interestCoin'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interestAmount')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'dailyInterestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"interestId\": \"1112125304879067137\",\n         \"interestCoin\": \"USDT\",\n         \"dailyInterestRate\": \"0.00041095\",\n         \"loanCoin\": \"USDT\",\n         \"interestAmount\": \"0.0000685\",\n         \"interstType\": \"first\",\n         \"symbol\": \"BTCUSDT\",\n         \"cTime\": \"1700877255648\",\n         \"uTime\": \"1700877255648\"\n     }",
          "{\n         \"interestId\": \"1112122013642272769\",\n         \"interestCoin\": \"USDT\",\n         \"dailyInterestRate\": \"0.00041\",\n         \"loanCoin\": \"USDT\",\n         \"interestAmount\": \"0.00006834\",\n         \"interstType\": \"first\",\n         \"cTime\": \"1700876470957\",\n         \"uTime\": \"1700876470957\"\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        // isolated\n        //\n        //     {\n        //         \"interestId\": \"1112125304879067137\",\n        //         \"interestCoin\": \"USDT\",\n        //         \"dailyInterestRate\": \"0.00041095\",\n        //         \"loanCoin\": \"USDT\",\n        //         \"interestAmount\": \"0.0000685\",\n        //         \"interstType\": \"first\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"cTime\": \"1700877255648\",\n        //         \"uTime\": \"1700877255648\"\n        //     }\n        //\n        // cross\n        //\n        //     {\n        //         \"interestId\": \"1112122013642272769\",\n        //         \"interestCoin\": \"USDT\",\n        //         \"dailyInterestRate\": \"0.00041\",\n        //         \"loanCoin\": \"USDT\",\n        //         \"interestAmount\": \"0.00006834\",\n        //         \"interstType\": \"first\",\n        //         \"cTime\": \"1700876470957\",\n        //         \"uTime\": \"1700876470957\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const marginMode = (marketId !== undefined) ? 'isolated' : 'cross';\n        const timestamp = this.safeInteger (info, 'cTime');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'interestCoin')),\n            'interest': this.safeNumber (info, 'interestAmount'),\n            'interestRate': this.safeNumber (info, 'dailyInterestRate'),\n            'amountBorrowed': undefined,\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 10086,
        "line_end": 10126,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber2 (info, 'dailyInterestRate', 'dailyInterest')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"BTC\",\n         \"leverage\": \"3\",\n         \"transferable\": true,\n         \"borrowable\": true,\n         \"dailyInterestRate\": \"0.00007\",\n         \"annualInterestRate\": \"0.02555\",\n         \"maxBorrowableAmount\": \"26\",\n         \"vipList\": [\n             {\"level\":\"0\",\"limit\":\"26\",\"dailyInterestRate\":\"0.00007\",\"annualInterestRate\":\"0.02555\",\"discountRate\":\"1\"},\n             {\"level\":\"1\",\"limit\":\"26.78\",\"dailyInterestRate\":\"0.0000679\",\"annualInterestRate\":\"0.0247835\",\"discountRate\":\"0.97\"},\n             {\"level\":\"2\",\"limit\":\"28.08\",\"dailyInterestRate\":\"0.0000644\",\"annualInterestRate\":\"0.023506\",\"discountRate\":\"0.92\"},\n             {\"level\":\"3\",\"limit\":\"30.16\",\"dailyInterestRate\":\"0.0000602\",\"annualInterestRate\":\"0.021973\",\"discountRate\":\"0.86\"},\n             {\"level\":\"4\",\"limit\":\"34.58\",\"dailyInterestRate\":\"0.0000525\",\"annualInterestRate\":\"0.0191625\",\"discountRate\":\"0.75\"},\n             {\"level\":\"5\",\"limit\":\"43.16\",\"dailyInterestRate\":\"0.000042\",\"annualInterestRate\":\"0.01533\",\"discountRate\":\"0.6\"}\n         ]\n     }",
          "{\n         \"dailyInterest\": \"0.00100008\",\n         \"annualInterest\": \"0.3650292\",\n         \"limit\": \"100\"\n     }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        // default\n        //\n        //     {\n        //         \"coin\": \"BTC\",\n        //         \"leverage\": \"3\",\n        //         \"transferable\": true,\n        //         \"borrowable\": true,\n        //         \"dailyInterestRate\": \"0.00007\",\n        //         \"annualInterestRate\": \"0.02555\",\n        //         \"maxBorrowableAmount\": \"26\",\n        //         \"vipList\": [\n        //             {\"level\":\"0\",\"limit\":\"26\",\"dailyInterestRate\":\"0.00007\",\"annualInterestRate\":\"0.02555\",\"discountRate\":\"1\"},\n        //             {\"level\":\"1\",\"limit\":\"26.78\",\"dailyInterestRate\":\"0.0000679\",\"annualInterestRate\":\"0.0247835\",\"discountRate\":\"0.97\"},\n        //             {\"level\":\"2\",\"limit\":\"28.08\",\"dailyInterestRate\":\"0.0000644\",\"annualInterestRate\":\"0.023506\",\"discountRate\":\"0.92\"},\n        //             {\"level\":\"3\",\"limit\":\"30.16\",\"dailyInterestRate\":\"0.0000602\",\"annualInterestRate\":\"0.021973\",\"discountRate\":\"0.86\"},\n        //             {\"level\":\"4\",\"limit\":\"34.58\",\"dailyInterestRate\":\"0.0000525\",\"annualInterestRate\":\"0.0191625\",\"discountRate\":\"0.75\"},\n        //             {\"level\":\"5\",\"limit\":\"43.16\",\"dailyInterestRate\":\"0.000042\",\"annualInterestRate\":\"0.01533\",\"discountRate\":\"0.6\"}\n        //         ]\n        //     }\n        //\n        // uta\n        //\n        //     {\n        //         \"dailyInterest\": \"0.00100008\",\n        //         \"annualInterest\": \"0.3650292\",\n        //         \"limit\": \"100\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'coin');\n        const timestamp = this.safeInteger (info, 'timestamp');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber2 (info, 'dailyInterestRate', 'dailyInterest'),\n            'period': 86400000, // 1-Day\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 10745,
        "line_end": 10798,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (conversion, 'id', 'traceId')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber (conversion, 'fromCoinSize')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber (conversion, 'toCoinSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (conversion, 'cnvtPrice')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (conversion, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fromCoin\": \"USDT\",\n         \"fromCoinSize\": \"5\",\n         \"cnvtPrice\": \"0.9993007892377704\",\n         \"toCoin\": \"USDC\",\n         \"toCoinSize\": \"4.99650394\",\n         \"traceId\": \"1159288930228187140\",\n         \"fee\": \"0\"\n     }",
          "{\n         \"cnvtPrice\": \"0.99940076\",\n         \"toCoin\": \"USDC\",\n         \"toCoinSize\": \"4.99700379\",\n         \"ts\": \"1712123746217\"\n     }",
          "{\n         \"id\": \"1159296505255219205\",\n         \"fromCoin\": \"USDT\",\n         \"fromCoinSize\": \"5\",\n         \"cnvtPrice\": \"0.99940076\",\n         \"toCoin\": \"USDC\",\n         \"toCoinSize\": \"4.99700379\",\n         \"ts\": \"1712123746217\",\n         \"fee\": \"0\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"fromCoin\": \"USDT\",\n        //         \"fromCoinSize\": \"5\",\n        //         \"cnvtPrice\": \"0.9993007892377704\",\n        //         \"toCoin\": \"USDC\",\n        //         \"toCoinSize\": \"4.99650394\",\n        //         \"traceId\": \"1159288930228187140\",\n        //         \"fee\": \"0\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"cnvtPrice\": \"0.99940076\",\n        //         \"toCoin\": \"USDC\",\n        //         \"toCoinSize\": \"4.99700379\",\n        //         \"ts\": \"1712123746217\"\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"id\": \"1159296505255219205\",\n        //         \"fromCoin\": \"USDT\",\n        //         \"fromCoinSize\": \"5\",\n        //         \"cnvtPrice\": \"0.99940076\",\n        //         \"toCoin\": \"USDC\",\n        //         \"toCoinSize\": \"4.99700379\",\n        //         \"ts\": \"1712123746217\",\n        //         \"fee\": \"0\"\n        //     }\n        //\n        const timestamp = this.safeInteger (conversion, 'ts');\n        const fromCoin = this.safeString (conversion, 'fromCoin');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'toCoin');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString2 (conversion, 'id', 'traceId'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber (conversion, 'fromCoinSize'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber (conversion, 'toCoinSize'),\n            'price': this.safeNumber (conversion, 'cnvtPrice'),\n            'fee': this.safeNumber (conversion, 'fee'),\n        } as Conversion;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 3127,
        "line_end": 3151,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "parsedCurrency",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'tag')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"BTC\",\n         \"address\": \"1BfZh7JESJGBUszCGeZnzxbVVvBycbJSbA\",\n         \"chain\": \"\",\n         \"tag\": null,\n         \"url\": \"https://blockchair.com/bitcoin/transaction/\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"BTC\",\n        //         \"address\": \"1BfZh7JESJGBUszCGeZnzxbVVvBycbJSbA\",\n        //         \"chain\": \"\",\n        //         \"tag\": null,\n        //         \"url\": \"https://blockchair.com/bitcoin/transaction/\"\n        //     }\n        //\n        const currencyId = this.safeString (depositAddress, 'coin');\n        const networkId = this.safeString (depositAddress, 'chain');\n        const parsedCurrency = this.safeCurrencyCode (currencyId, currency);\n        let network = undefined;\n        if (networkId !== undefined) {\n            network = this.networkIdToCode (networkId, parsedCurrency);\n        }\n        return {\n            'info': depositAddress,\n            'currency': parsedCurrency,\n            'network': network,\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': this.safeString (depositAddress, 'tag'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9438,
        "line_end": 9490,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': this.safeNumber (chain, 'withdrawFee'), 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"chains\": [\n             {\n                 \"browserUrl\": \"https://blockchair.com/bitcoin/transaction/\",\n                 \"chain\": \"BTC\",\n                 \"depositConfirm\": \"1\",\n                 \"extraWithdrawFee\": \"0\",\n                 \"minDepositAmount\": \"0.0001\",\n                 \"minWithdrawAmount\": \"0.005\",\n                 \"needTag\": \"false\",\n                 \"rechargeable\": \"true\",\n                 \"withdrawConfirm\": \"1\",\n                 \"withdrawFee\": \"0.0004\",\n                 \"withdrawable\": \"true\"\n             },\n         ],\n         \"coin\": \"BTC\",\n         \"coinId\": \"1\",\n         \"transfer\": \"true\"\"\n     }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"chains\": [\n        //             {\n        //                 \"browserUrl\": \"https://blockchair.com/bitcoin/transaction/\",\n        //                 \"chain\": \"BTC\",\n        //                 \"depositConfirm\": \"1\",\n        //                 \"extraWithdrawFee\": \"0\",\n        //                 \"minDepositAmount\": \"0.0001\",\n        //                 \"minWithdrawAmount\": \"0.005\",\n        //                 \"needTag\": \"false\",\n        //                 \"rechargeable\": \"true\",\n        //                 \"withdrawConfirm\": \"1\",\n        //                 \"withdrawFee\": \"0.0004\",\n        //                 \"withdrawable\": \"true\"\n        //             },\n        //         ],\n        //         \"coin\": \"BTC\",\n        //         \"coinId\": \"1\",\n        //         \"transfer\": \"true\"\"\n        //     }\n        //\n        const chains = this.safeValue (fee, 'chains', []);\n        const chainsLength = chains.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        for (let i = 0; i < chainsLength; i++) {\n            const chain = chains[i];\n            const networkId = this.safeString (chain, 'chain');\n            const currencyCode = this.safeString (currency, 'code');\n            const networkCode = this.networkIdToCode (networkId, currencyCode);\n            result['networks'][networkCode] = {\n                'deposit': { 'fee': undefined, 'percentage': undefined },\n                'withdraw': { 'fee': this.safeNumber (chain, 'withdrawFee'), 'percentage': false },\n            };\n            if (chainsLength === 1) {\n                result['withdraw']['fee'] = this.safeNumber (chain, 'withdrawFee');\n                result['withdraw']['percentage'] = false;\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingHistories",
        "signature": "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[]",
        "line_start": 8814,
        "line_end": 8830,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[] {\n        const result = [];\n        for (let i = 0; i < contracts.length; i++) {\n            const contract = contracts[i];\n            const business = this.safeString (contract, 'businessType');\n            if (business !== 'contract_settle_fee') {\n                continue;\n            }\n            result.push (this.parseFundingHistory (contract, market));\n        }\n        const sorted = this.sortBy (result, 'timestamp');\n        let symbol = undefined;\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        return this.filterBySymbolSinceLimit (sorted, symbol, since, limit);\n    }"
      },
      {
        "name": "parseFundingHistory",
        "signature": "parseFundingHistory (contract, market: Market = undefined)",
        "line_start": 8787,
        "line_end": 8812,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (contract, 'amount')",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (contract, 'billId')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"billId\": \"1111499428100472833\",\n         \"symbol\": \"BTCUSDT\",\n         \"amount\": \"-0.004992\",\n         \"fee\": \"0\",\n         \"feeByCoupon\": \"\",\n         \"businessType\": \"contract_settle_fee\",\n         \"coin\": \"USDT\",\n         \"cTime\": \"1700728034996\"\n     }"
        ],
        "source": "parseFundingHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"billId\": \"1111499428100472833\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"amount\": \"-0.004992\",\n        //         \"fee\": \"0\",\n        //         \"feeByCoupon\": \"\",\n        //         \"businessType\": \"contract_settle_fee\",\n        //         \"coin\": \"USDT\",\n        //         \"cTime\": \"1700728034996\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const currencyId = this.safeString (contract, 'coin');\n        const timestamp = this.safeInteger (contract, 'cTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'code': this.safeCurrencyCode (currencyId),\n            'amount': this.safeNumber (contract, 'amount'),\n            'id': this.safeString (contract, 'billId'),\n        };\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 8627,
        "line_end": 8715,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"fundingRate\": \"-0.000013\",\n         \"fundingRateInterval\": \"8\",\n         \"nextUpdate\": \"1745510400000\",\n         \"minFundingRate\": \"-0.003\",\n         \"maxFundingRate\": \"0.003\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"nextFundingTime\": \"1745424000000\",\n         \"ratePeriod\": \"8\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"nextFundingTime\": \"1727942400000\",\n         \"ratePeriod\": \"8\"\n     }",
          "{\n         \"symbol\": \"BTCUSD\",\n         \"lastPr\": \"29904.5\",\n         \"askPr\": \"29904.5\",\n         \"bidPr\": \"29903.5\",\n         \"bidSz\": \"0.5091\",\n         \"askSz\": \"2.2694\",\n         \"high24h\": \"0\",\n         \"low24h\": \"0\",\n         \"ts\": \"1695794271400\",\n         \"change24h\": \"0\",\n         \"baseVolume\": \"0\",\n         \"quoteVolume\": \"0\",\n         \"usdtVolume\": \"0\",\n         \"openUtc\": \"0\",\n         \"changeUtc24h\": \"0\",\n         \"indexPrice\": \"29132.353333\",\n         \"fundingRate\": \"-0.0007\",\n         \"holdingAmount\": \"125.6844\",\n         \"deliveryStartTime\": null,\n         \"deliveryTime\": null,\n         \"deliveryStatus\": \"delivery_normal\",\n         \"open24h\": \"0\",\n         \"markPrice\": \"12345\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        // fetchFundingRate: publicMixGetV2MixMarketCurrentFundRate, publicUtaGetV3MarketCurrentFundRate\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"fundingRate\": \"-0.000013\",\n        //         \"fundingRateInterval\": \"8\",\n        //         \"nextUpdate\": \"1745510400000\",\n        //         \"minFundingRate\": \"-0.003\",\n        //         \"maxFundingRate\": \"0.003\"\n        //     }\n        //\n        // fetchFundingRate: publicMixGetV2MixMarketFundingTime\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"nextFundingTime\": \"1745424000000\",\n        //         \"ratePeriod\": \"8\"\n        //     }\n        //\n        // fetchFundingInterval\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"nextFundingTime\": \"1727942400000\",\n        //         \"ratePeriod\": \"8\"\n        //     }\n        //\n        // fetchFundingRates\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD\",\n        //         \"lastPr\": \"29904.5\",\n        //         \"askPr\": \"29904.5\",\n        //         \"bidPr\": \"29903.5\",\n        //         \"bidSz\": \"0.5091\",\n        //         \"askSz\": \"2.2694\",\n        //         \"high24h\": \"0\",\n        //         \"low24h\": \"0\",\n        //         \"ts\": \"1695794271400\",\n        //         \"change24h\": \"0\",\n        //         \"baseVolume\": \"0\",\n        //         \"quoteVolume\": \"0\",\n        //         \"usdtVolume\": \"0\",\n        //         \"openUtc\": \"0\",\n        //         \"changeUtc24h\": \"0\",\n        //         \"indexPrice\": \"29132.353333\",\n        //         \"fundingRate\": \"-0.0007\",\n        //         \"holdingAmount\": \"125.6844\",\n        //         \"deliveryStartTime\": null,\n        //         \"deliveryTime\": null,\n        //         \"deliveryStatus\": \"delivery_normal\",\n        //         \"open24h\": \"0\",\n        //         \"markPrice\": \"12345\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'swap');\n        const fundingTimestamp = this.safeInteger2 (contract, 'nextFundingTime', 'nextUpdate');\n        const interval = this.safeString2 (contract, 'ratePeriod', 'fundingRateInterval');\n        const timestamp = this.safeInteger (contract, 'ts');\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 9961,
        "line_end": 10012,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeCurrencyCode (baseId)",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (info, 'baseDailyInterestRate')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeCurrencyCode (quoteId)",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (info, 'quoteDailyInterestRate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"leverage\": \"10\",\n         \"baseCoin\": \"BTC\",\n         \"baseTransferable\": true,\n         \"baseBorrowable\": true,\n         \"baseDailyInterestRate\": \"0.00007\",\n         \"baseAnnuallyInterestRate\": \"0.02555\",\n         \"baseMaxBorrowableAmount\": \"27\",\n         \"baseVipList\": [\n             {\"level\":\"0\",\"dailyInterestRate\":\"0.00007\",\"limit\":\"27\",\"annuallyInterestRate\":\"0.02555\",\"discountRate\":\"1\"},\n             {\"level\":\"1\",\"dailyInterestRate\":\"0.0000679\",\"limit\":\"27.81\",\"annuallyInterestRate\":\"0.0247835\",\"discountRate\":\"0.97\"},\n             {\"level\":\"2\",\"dailyInterestRate\":\"0.0000644\",\"limit\":\"29.16\",\"annuallyInterestRate\":\"0.023506\",\"discountRate\":\"0.92\"},\n             {\"level\":\"3\",\"dailyInterestRate\":\"0.0000602\",\"limit\":\"31.32\",\"annuallyInterestRate\":\"0.021973\",\"discountRate\":\"0.86\"},\n             {\"level\":\"4\",\"dailyInterestRate\":\"0.0000525\",\"limit\":\"35.91\",\"annuallyInterestRate\":\"0.0191625\",\"discountRate\":\"0.75\"},\n             {\"level\":\"5\",\"dailyInterestRate\":\"0.000042\",\"limit\":\"44.82\",\"annuallyInterestRate\":\"0.01533\",\"discountRate\":\"0.6\"}\n         ],\n         \"quoteCoin\": \"USDT\",\n         \"quoteTransferable\": true,\n         \"quoteBorrowable\": true,\n         \"quoteDailyInterestRate\": \"0.00041095\",\n         \"quoteAnnuallyInterestRate\": \"0.14999675\",\n         \"quoteMaxBorrowableAmount\": \"300000\",\n         \"quoteList\": [\n             {\"level\":\"0\",\"dailyInterestRate\":\"0.00041095\",\"limit\":\"300000\",\"annuallyInterestRate\":\"0.14999675\",\"discountRate\":\"1\"},\n             {\"level\":\"1\",\"dailyInterestRate\":\"0.00039863\",\"limit\":\"309000\",\"annuallyInterestRate\":\"0.14549995\",\"discountRate\":\"0.97\"},\n             {\"level\":\"2\",\"dailyInterestRate\":\"0.00037808\",\"limit\":\"324000\",\"annuallyInterestRate\":\"0.1379992\",\"discountRate\":\"0.92\"},\n             {\"level\":\"3\",\"dailyInterestRate\":\"0.00035342\",\"limit\":\"348000\",\"annuallyInterestRate\":\"0.1289983\",\"discountRate\":\"0.86\"},\n             {\"level\":\"4\",\"dailyInterestRate\":\"0.00030822\",\"limit\":\"399000\",\"annuallyInterestRate\":\"0.1125003\",\"discountRate\":\"0.75\"},\n             {\"level\":\"5\",\"dailyInterestRate\":\"0.00024657\",\"limit\":\"498000\",\"annuallyInterestRate\":\"0.08999805\",\"discountRate\":\"0.6\"}\n         ]\n     }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"leverage\": \"10\",\n        //         \"baseCoin\": \"BTC\",\n        //         \"baseTransferable\": true,\n        //         \"baseBorrowable\": true,\n        //         \"baseDailyInterestRate\": \"0.00007\",\n        //         \"baseAnnuallyInterestRate\": \"0.02555\",\n        //         \"baseMaxBorrowableAmount\": \"27\",\n        //         \"baseVipList\": [\n        //             {\"level\":\"0\",\"dailyInterestRate\":\"0.00007\",\"limit\":\"27\",\"annuallyInterestRate\":\"0.02555\",\"discountRate\":\"1\"},\n        //             {\"level\":\"1\",\"dailyInterestRate\":\"0.0000679\",\"limit\":\"27.81\",\"annuallyInterestRate\":\"0.0247835\",\"discountRate\":\"0.97\"},\n        //             {\"level\":\"2\",\"dailyInterestRate\":\"0.0000644\",\"limit\":\"29.16\",\"annuallyInterestRate\":\"0.023506\",\"discountRate\":\"0.92\"},\n        //             {\"level\":\"3\",\"dailyInterestRate\":\"0.0000602\",\"limit\":\"31.32\",\"annuallyInterestRate\":\"0.021973\",\"discountRate\":\"0.86\"},\n        //             {\"level\":\"4\",\"dailyInterestRate\":\"0.0000525\",\"limit\":\"35.91\",\"annuallyInterestRate\":\"0.0191625\",\"discountRate\":\"0.75\"},\n        //             {\"level\":\"5\",\"dailyInterestRate\":\"0.000042\",\"limit\":\"44.82\",\"annuallyInterestRate\":\"0.01533\",\"discountRate\":\"0.6\"}\n        //         ],\n        //         \"quoteCoin\": \"USDT\",\n        //         \"quoteTransferable\": true,\n        //         \"quoteBorrowable\": true,\n        //         \"quoteDailyInterestRate\": \"0.00041095\",\n        //         \"quoteAnnuallyInterestRate\": \"0.14999675\",\n        //         \"quoteMaxBorrowableAmount\": \"300000\",\n        //         \"quoteList\": [\n        //             {\"level\":\"0\",\"dailyInterestRate\":\"0.00041095\",\"limit\":\"300000\",\"annuallyInterestRate\":\"0.14999675\",\"discountRate\":\"1\"},\n        //             {\"level\":\"1\",\"dailyInterestRate\":\"0.00039863\",\"limit\":\"309000\",\"annuallyInterestRate\":\"0.14549995\",\"discountRate\":\"0.97\"},\n        //             {\"level\":\"2\",\"dailyInterestRate\":\"0.00037808\",\"limit\":\"324000\",\"annuallyInterestRate\":\"0.1379992\",\"discountRate\":\"0.92\"},\n        //             {\"level\":\"3\",\"dailyInterestRate\":\"0.00035342\",\"limit\":\"348000\",\"annuallyInterestRate\":\"0.1289983\",\"discountRate\":\"0.86\"},\n        //             {\"level\":\"4\",\"dailyInterestRate\":\"0.00030822\",\"limit\":\"399000\",\"annuallyInterestRate\":\"0.1125003\",\"discountRate\":\"0.75\"},\n        //             {\"level\":\"5\",\"dailyInterestRate\":\"0.00024657\",\"limit\":\"498000\",\"annuallyInterestRate\":\"0.08999805\",\"discountRate\":\"0.6\"}\n        //         ]\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        const baseId = this.safeString (info, 'baseCoin');\n        const quoteId = this.safeString (info, 'quoteCoin');\n        const timestamp = this.safeInteger (info, 'timestamp');\n        return {\n            'symbol': symbol,\n            'base': this.safeCurrencyCode (baseId),\n            'baseRate': this.safeNumber (info, 'baseDailyInterestRate'),\n            'quote': this.safeCurrencyCode (quoteId),\n            'quoteRate': this.safeNumber (info, 'quoteDailyInterestRate'),\n            'period': 86400000, // 1-Day\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 7481,
        "line_end": 7541,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'billId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerType (this.safeString (item, 'businessType'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': fee,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"billId\": \"1111506298997215233\",\n         \"coin\": \"USDT\",\n         \"groupType\": \"transfer\",\n         \"businessType\": \"transfer_out\",\n         \"size\": \"-11.64958799\",\n         \"balance\": \"0.00000000\",\n         \"fees\": \"0.00000000\",\n         \"cTime\": \"1700729673028\"\n     }",
          "{\n         \"billId\": \"1111499428100472833\",\n         \"symbol\": \"\",\n         \"amount\": \"-11.64958799\",\n         \"fee\": \"0\",\n         \"feeByCoupon\": \"\",\n         \"businessType\": \"trans_to_exchange\",\n         \"coin\": \"USDT\",\n         \"cTime\": \"1700728034996\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // spot\n        //\n        //     {\n        //         \"billId\": \"1111506298997215233\",\n        //         \"coin\": \"USDT\",\n        //         \"groupType\": \"transfer\",\n        //         \"businessType\": \"transfer_out\",\n        //         \"size\": \"-11.64958799\",\n        //         \"balance\": \"0.00000000\",\n        //         \"fees\": \"0.00000000\",\n        //         \"cTime\": \"1700729673028\"\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"billId\": \"1111499428100472833\",\n        //         \"symbol\": \"\",\n        //         \"amount\": \"-11.64958799\",\n        //         \"fee\": \"0\",\n        //         \"feeByCoupon\": \"\",\n        //         \"businessType\": \"trans_to_exchange\",\n        //         \"coin\": \"USDT\",\n        //         \"cTime\": \"1700728034996\"\n        //     }\n        //\n        const currencyId = this.safeString (item, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'cTime');\n        const after = this.safeNumber (item, 'balance');\n        const fee = this.safeNumber2 (item, 'fees', 'fee');\n        const amountRaw = this.safeString2 (item, 'size', 'amount');\n        const amount = this.parseNumber (Precise.stringAbs (amountRaw));\n        let direction = 'in';\n        if (amountRaw.indexOf ('-') >= 0) {\n            direction = 'out';\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'billId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': undefined,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': this.parseLedgerType (this.safeString (item, 'businessType')),\n            'currency': code,\n            'amount': amount,\n            'before': undefined,\n            'after': after,\n            'status': undefined,\n            'fee': {\n                'currency': code,\n                'cost': fee,\n            },\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerType",
        "signature": "parseLedgerType (type)",
        "line_start": 7543,
        "line_end": 7587,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerType (type) {\n        const types: Dict = {\n            'trans_to_cross': 'transfer',\n            'trans_from_cross': 'transfer',\n            'trans_to_exchange': 'transfer',\n            'trans_from_exchange': 'transfer',\n            'trans_to_isolated': 'transfer',\n            'trans_from_isolated': 'transfer',\n            'trans_to_contract': 'transfer',\n            'trans_from_contract': 'transfer',\n            'trans_to_otc': 'transfer',\n            'trans_from_otc': 'transfer',\n            'open_long': 'trade',\n            'close_long': 'trade',\n            'open_short': 'trade',\n            'close_short': 'trade',\n            'force_close_long': 'trade',\n            'force_close_short': 'trade',\n            'burst_long_loss_query': 'trade',\n            'burst_short_loss_query': 'trade',\n            'force_buy': 'trade',\n            'force_sell': 'trade',\n            'burst_buy': 'trade',\n            'burst_sell': 'trade',\n            'delivery_long': 'settlement',\n            'delivery_short': 'settlement',\n            'contract_settle_fee': 'fee',\n            'append_margin': 'transaction',\n            'adjust_down_lever_append_margin': 'transaction',\n            'reduce_margin': 'transaction',\n            'auto_append_margin': 'transaction',\n            'cash_gift_issue': 'cashback',\n            'cash_gift_recycle': 'cashback',\n            'bonus_issue': 'rebate',\n            'bonus_recycle': 'rebate',\n            'bonus_expired': 'rebate',\n            'transfer_in': 'transfer',\n            'transfer_out': 'transfer',\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'buy': 'trade',\n            'sell': 'trade',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 8979,
        "line_end": 8990,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "isCrossMarginMode ? 'cross' : 'isolated'",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "this.safeInteger (leverage, longLevKey)",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "this.safeInteger (leverage, shortLevKey)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const isCrossMarginMode = this.safeString (leverage, 'marginMode') === 'crossed';\n        const longLevKey = isCrossMarginMode ? 'crossedMarginLeverage' : 'isolatedLongLever';\n        const shortLevKey = isCrossMarginMode ? 'crossedMarginLeverage' : 'isolatedShortLever';\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': isCrossMarginMode ? 'cross' : 'isolated',\n            'longLeverage': this.safeInteger (leverage, longLevKey),\n            'shortLeverage': this.safeInteger (leverage, shortLevKey),\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 9848,
        "line_end": 9895,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (quoteValueString)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"liqId\": \"123\",\n         \"symbol\": \"BTCUSDT\",\n         \"liqStartTime\": \"1653453245342\",\n         \"liqEndTime\": \"16312423423432\",\n         \"liqRiskRatio\": \"1.01\",\n         \"totalAssets\": \"1242.34\",\n         \"totalDebt\": \"1100\",\n         \"liqFee\": \"1.2\",\n         \"uTime\": \"1692690126000\"\n         \"cTime\": \"1653453245342\"\n     }",
          "{\n         \"liqId\": \"123\",\n         \"liqStartTime\": \"1653453245342\",\n         \"liqEndTime\": \"16312423423432\",\n         \"liqRiskRatio\": \"1.01\",\n         \"totalAssets\": \"1242.34\",\n         \"totalDebt\": \"1100\",\n         \"LiqFee\": \"1.2\",\n         \"uTime\": \"1692690126000\"\n         \"cTime\": \"1653453245342\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // isolated\n        //\n        //     {\n        //         \"liqId\": \"123\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"liqStartTime\": \"1653453245342\",\n        //         \"liqEndTime\": \"16312423423432\",\n        //         \"liqRiskRatio\": \"1.01\",\n        //         \"totalAssets\": \"1242.34\",\n        //         \"totalDebt\": \"1100\",\n        //         \"liqFee\": \"1.2\",\n        //         \"uTime\": \"1692690126000\"\n        //         \"cTime\": \"1653453245342\"\n        //     }\n        //\n        // cross\n        //\n        //     {\n        //         \"liqId\": \"123\",\n        //         \"liqStartTime\": \"1653453245342\",\n        //         \"liqEndTime\": \"16312423423432\",\n        //         \"liqRiskRatio\": \"1.01\",\n        //         \"totalAssets\": \"1242.34\",\n        //         \"totalDebt\": \"1100\",\n        //         \"LiqFee\": \"1.2\",\n        //         \"uTime\": \"1692690126000\"\n        //         \"cTime\": \"1653453245342\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger (liquidation, 'liqEndTime');\n        const liquidationFee = this.safeString2 (liquidation, 'LiqFee', 'liqFee');\n        const totalDebt = this.safeString (liquidation, 'totalDebt');\n        const quoteValueString = Precise.stringAdd (liquidationFee, totalDebt);\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': undefined,\n            'contractSize': undefined,\n            'price': undefined,\n            'baseValue': undefined,\n            'quoteValue': this.parseNumber (quoteValueString),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 10988,
        "line_end": 10999,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber2 (info, 'longShortRatio', 'longShortAccountRatio')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeIntegerOmitZero (info, 'ts');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber2 (info, 'longShortRatio', 'longShortAccountRatio'),\n        } as LongShortRatio;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined, market: Market = undefined)",
        "line_start": 9683,
        "line_end": 9736,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (info, 'loanId', 'repayId')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber2 (info, 'borrowAmount', 'repayAmount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"loanId\": \"1112125304879067137\",\n         \"symbol\": \"BTCUSDT\",\n         \"coin\": \"USDT\",\n         \"borrowAmount\": \"4\"\n     }",
          "{\n         \"loanId\": \"1112122013642272769\",\n         \"coin\": \"USDT\",\n         \"borrowAmount\": \"4\"\n     }",
          "{\n         \"remainDebtAmount\": \"0\",\n         \"repayId\": \"1112126405439270912\",\n         \"symbol\": \"BTCUSDT\",\n         \"coin\": \"USDT\",\n         \"repayAmount\": \"8.000137\"\n     }",
          "{\n         \"remainDebtAmount\": \"0\",\n         \"repayId\": \"1112122994945830912\",\n         \"coin\": \"USDT\",\n         \"repayAmount\": \"4.00006834\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined, market: Market = undefined) {\n        //\n        // isolated: borrowMargin\n        //\n        //     {\n        //         \"loanId\": \"1112125304879067137\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"coin\": \"USDT\",\n        //         \"borrowAmount\": \"4\"\n        //     }\n        //\n        // cross: borrowMargin\n        //\n        //     {\n        //         \"loanId\": \"1112122013642272769\",\n        //         \"coin\": \"USDT\",\n        //         \"borrowAmount\": \"4\"\n        //     }\n        //\n        // isolated: repayMargin\n        //\n        //     {\n        //         \"remainDebtAmount\": \"0\",\n        //         \"repayId\": \"1112126405439270912\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"coin\": \"USDT\",\n        //         \"repayAmount\": \"8.000137\"\n        //     }\n        //\n        // cross: repayMargin\n        //\n        //     {\n        //         \"remainDebtAmount\": \"0\",\n        //         \"repayId\": \"1112122994945830912\",\n        //         \"coin\": \"USDT\",\n        //         \"repayAmount\": \"4.00006834\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'coin');\n        const marketId = this.safeString (info, 'symbol');\n        let symbol = undefined;\n        if (marketId !== undefined) {\n            symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        }\n        return {\n            'id': this.safeString2 (info, 'loanId', 'repayId'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber2 (info, 'borrowAmount', 'repayAmount'),\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 10469,
        "line_end": 10477,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginType",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        let marginType = this.safeString (marginMode, 'marginMode');\n        marginType = (marginType === 'crossed') ? 'cross' : marginType;\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': marginType,\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 8861,
        "line_end": 8886,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": \"00000\",\n         \"msg\": \"success\",\n         \"requestTime\": 1700813444618,\n         \"data\": \"\"\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //     {\n        //         \"code\": \"00000\",\n        //         \"msg\": \"success\",\n        //         \"requestTime\": 1700813444618,\n        //         \"data\": \"\"\n        //     }\n        //\n        const errorCode = this.safeString (data, 'code');\n        const status = (errorCode === '00000') ? 'ok' : 'failed';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': market['settle'],\n            'status': status,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 2727,
        "line_end": 2799,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger2 (item, 'level', 'tier')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "maxNotional",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumberN (item, [ 'keepMarginRate', 'maintainMarginRate', 'mmr' ])",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (item, 'leverage')",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"level\": \"1\",\n         \"startUnit\": \"0\",\n         \"endUnit\": \"150000\",\n         \"leverage\": \"125\",\n         \"keepMarginRate\": \"0.004\"\n     }",
          "{\n         \"tier\": \"1\",\n         \"symbol\": \"BTCUSDT\",\n         \"leverage\": \"10\",\n         \"baseCoin\": \"BTC\",\n         \"quoteCoin\": \"USDT\",\n         \"baseMaxBorrowableAmount\": \"2\",\n         \"quoteMaxBorrowableAmount\": \"24000\",\n         \"maintainMarginRate\": \"0.05\",\n         \"initRate\": \"0.1111\"\n     }",
          "{\n         \"tier\": \"1\",\n         \"leverage\": \"3\",\n         \"coin\": \"BTC\",\n         \"maxBorrowableAmount\": \"26\",\n         \"maintainMarginRate\": \"0.1\"\n     }",
          "{\n         \"tier\": \"1\",\n         \"minTierValue\": \"0\",\n         \"maxTierValue\": \"150000\",\n         \"leverage\": \"125\",\n         \"mmr\": \"0.004\"\n     }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        // swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"level\": \"1\",\n        //         \"startUnit\": \"0\",\n        //         \"endUnit\": \"150000\",\n        //         \"leverage\": \"125\",\n        //         \"keepMarginRate\": \"0.004\"\n        //     }\n        //\n        // isolated\n        //\n        //     {\n        //         \"tier\": \"1\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"leverage\": \"10\",\n        //         \"baseCoin\": \"BTC\",\n        //         \"quoteCoin\": \"USDT\",\n        //         \"baseMaxBorrowableAmount\": \"2\",\n        //         \"quoteMaxBorrowableAmount\": \"24000\",\n        //         \"maintainMarginRate\": \"0.05\",\n        //         \"initRate\": \"0.1111\"\n        //     }\n        //\n        // cross\n        //\n        //     {\n        //         \"tier\": \"1\",\n        //         \"leverage\": \"3\",\n        //         \"coin\": \"BTC\",\n        //         \"maxBorrowableAmount\": \"26\",\n        //         \"maintainMarginRate\": \"0.1\"\n        //     }\n        //\n        // uta\n        //\n        //     {\n        //         \"tier\": \"1\",\n        //         \"minTierValue\": \"0\",\n        //         \"maxTierValue\": \"150000\",\n        //         \"leverage\": \"125\",\n        //         \"mmr\": \"0.004\"\n        //     }\n        //\n        const tiers = [];\n        let minNotional = 0;\n        for (let i = 0; i < info.length; i++) {\n            const item = info[i];\n            const minimumNotional = this.safeNumber2 (item, 'startUnit', 'minTierValue');\n            if (minimumNotional !== undefined) {\n                minNotional = minimumNotional;\n            }\n            const maxNotional = this.safeNumberN (item, [ 'endUnit', 'maxBorrowableAmount', 'baseMaxBorrowableAmount', 'maxTierValue' ]);\n            const marginCurrency = this.safeString2 (item, 'coin', 'baseCoin');\n            const currencyId = (marginCurrency !== undefined) ? marginCurrency : market['base'];\n            const marketId = this.safeString (item, 'symbol');\n            tiers.push ({\n                'tier': this.safeInteger2 (item, 'level', 'tier'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': this.safeCurrencyCode (currencyId),\n                'minNotional': minNotional,\n                'maxNotional': maxNotional,\n                'maintenanceMarginRate': this.safeNumberN (item, [ 'keepMarginRate', 'maintainMarginRate', 'mmr' ]),\n                'maxLeverage': this.safeNumber (item, 'leverage'),\n                'info': item,\n            });\n            minNotional = maxNotional;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 4191,
        "line_end": 4213,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1645911960000\",\n         \"39406\",\n         \"39407\",\n         \"39374.5\",\n         \"39379\",\n         \"35.526\",\n         \"1399132.341\"\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1645911960000\",\n        //         \"39406\",\n        //         \"39407\",\n        //         \"39374.5\",\n        //         \"39379\",\n        //         \"35.526\",\n        //         \"1399132.341\"\n        //     ]\n        //\n        const inverse = this.safeBool (market, 'inverse');\n        const volumeIndex = inverse ? 6 : 5;\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, volumeIndex),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 9235,
        "line_end": 9272,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber2 (data[0], 'size', 'openInterest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"openInterestList\": [\n             {\n                 \"symbol\": \"BTCUSDT\",\n                 \"size\": \"52234.134\"\n             }\n         ],\n         \"ts\": \"1700866041023\"\n     }",
          "{\n         \"list\": [\n             {\n                 \"symbol\": \"BTCUSDT\",\n                 \"openInterest\": \"18166.3583\"\n             }\n         ],\n         \"ts\": \"1751101220993\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // default\n        //\n        //     {\n        //         \"openInterestList\": [\n        //             {\n        //                 \"symbol\": \"BTCUSDT\",\n        //                 \"size\": \"52234.134\"\n        //             }\n        //         ],\n        //         \"ts\": \"1700866041023\"\n        //     }\n        //\n        // uta\n        //\n        //     {\n        //         \"list\": [\n        //             {\n        //                 \"symbol\": \"BTCUSDT\",\n        //                 \"openInterest\": \"18166.3583\"\n        //             }\n        //         ],\n        //         \"ts\": \"1751101220993\"\n        //     }\n        //\n        const data = this.safeList2 (interest, 'openInterestList', 'list', []);\n        const timestamp = this.safeInteger (interest, 'ts');\n        const marketId = this.safeString (data[0], 'symbol');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'openInterestAmount': this.safeNumber2 (data[0], 'size', 'openInterest'),\n            'openInterestValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 4698,
        "line_end": 5040,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString2 (order, 'clientOrderId', 'clientOid')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'orderId', 'data')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "updateTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "updateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "size",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (order, 'quoteVolume', 'quoteSize')",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'triggerPrice')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeNumberN (order, [ 'presetStopSurplusPrice', 'stopSurplusTriggerPrice', 'takeProfit' ])",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeNumberN (order, [ 'presetStopLossPrice', 'stopLossTriggerPrice', 'stopLoss' ])",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (Precise.stringNeg (utaFee))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settle']",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clientOid\": \"abe95dbe-6081-4a6f-a2d3-ae49601cd479\",\n         \"orderId\": null\n     }",
          "[\n         {\n             \"orderId\": \"1111397214281175046\",\n             \"clientOid\": \"766d3fc3-7321-4406-a689-15c9987a2e75\"\n         },\n         {\n             \"orderId\": \"\",\n             \"clientOid\": \"d1b75cb3-cc15-4ede-ad4c-3937396f75ab\",\n             \"errorMsg\": \"less than the minimum amount 5 USDT\",\n             \"errorCode\": \"45110\"\n         },\n     ]",
          "{\n         \"orderId\": \"1098758604547850241\",\n         \"clientOid\": \"1098758604585598977\"\n     }",
          "{\n         \"result\": \"success\"\n     }",
          "{\n         \"userId\": \"7264631750\",\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"1111499608327360513\",\n         \"clientOid\": \"d0d4dad5-18d0-4869-a074-ec40bb47cba6\",\n         \"size\": \"0.0002000000000000\", // COST for 'buy market' order! AMOUNT in all other cases\n         \"price\": \"0\", // in fetchOrder: 0 for market order, otherwise limit price (field not present in fetchOpenOrders\n         \"orderType\": \"limit\",\n         \"side\": \"buy\",\n         \"status\": \"live\",\n         \"basePrice\": \"0\",\n         \"priceAvg\": \"25000.0000000000000000\",   // 0 if nothing filled\n         \"baseVolume\": \"0.0000000000000000\",     // 0 if nothing filled\n         \"quoteVolume\": \"0.0000000000000000\",    // 0 if nothing filled\n         \"enterPointSource\": \"WEB\",\n         \"orderSource\": \"normal\",\n         \"cTime\": \"1700728077966\",\n         \"uTime\": \"1700728077966\"\n         \"feeDetail\": \"{\\\\\"newFees\\\\\":{\\\\\"c\\\\\":0,\\\\\"d\\\\\":0,\\\\\"deduction\\\\\":false,\\\\\"r\\\\\":-0.0064699886,\\\\\"t\\\\\":-0.0064699886,\\\\\"totalDeductionFee\\\\\":0},\\\\\"USDT\\\\\":{\\\\\"deduction\\\\\":false,\\\\\"feeCoinCode\\\\\":\\\\\"USDT\\\\\",\\\\\"totalDeductionFee\\\\\":0,\\\\\"totalFee\\\\\":-0.0064699886000000}}\", // might not be present in fetchOpenOrders\n         \"triggerPrice\": null,\n         \"tpslType\": \"normal\",\n         \"quoteCoin\": \"USDT\",  // not present in fetchOpenOrders\n         \"baseCoin\": \"DOT\",    // not present in fetchOpenOrders\n         \"cancelReason\": \"\",   // not present in fetchOpenOrders\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, editOrder, closePosition\n        //\n        //     {\n        //         \"clientOid\": \"abe95dbe-6081-4a6f-a2d3-ae49601cd479\",\n        //         \"orderId\": null\n        //     }\n        //\n        // createOrders\n        //\n        //     [\n        //         {\n        //             \"orderId\": \"1111397214281175046\",\n        //             \"clientOid\": \"766d3fc3-7321-4406-a689-15c9987a2e75\"\n        //         },\n        //         {\n        //             \"orderId\": \"\",\n        //             \"clientOid\": \"d1b75cb3-cc15-4ede-ad4c-3937396f75ab\",\n        //             \"errorMsg\": \"less than the minimum amount 5 USDT\",\n        //             \"errorCode\": \"45110\"\n        //         },\n        //     ]\n        //\n        // spot, swap, future, spot margin and uta: cancelOrder, cancelOrders, cancelAllOrders\n        //\n        //     {\n        //         \"orderId\": \"1098758604547850241\",\n        //         \"clientOid\": \"1098758604585598977\"\n        //     }\n        //\n        // spot trigger: cancelOrder\n        //\n        //     {\n        //         \"result\": \"success\"\n        //     }\n        //\n        // spot: fetchOrder, fetchOpenOrders, fetchCanceledAndClosedOrders\n        //\n        //     {\n        //         \"userId\": \"7264631750\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"1111499608327360513\",\n        //         \"clientOid\": \"d0d4dad5-18d0-4869-a074-ec40bb47cba6\",\n        //         \"size\": \"0.0002000000000000\", // COST for 'buy market' order! AMOUNT in all other cases\n        //         \"price\": \"0\", // in fetchOrder: 0 for market order, otherwise limit price (field not present in fetchOpenOrders\n        //         \"orderType\": \"limit\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"live\",\n        //         \"basePrice\": \"0\",\n        //         \"priceAvg\": \"25000.0000000000000000\",   // 0 if nothing filled\n        //         \"baseVolume\": \"0.0000000000000000\",     // 0 if nothing filled\n        //         \"quoteVolume\": \"0.0000000000000000\",    // 0 if nothing filled\n        //         \"enterPointSource\": \"WEB\",\n        //         \"orderSource\": \"normal\",\n        //         \"cTime\": \"1700728077966\",\n        //         \"uTime\": \"1700728077966\"\n        //         \"feeDetail\": \"{\\\\\"newFees\\\\\":{\\\\\"c\\\\\":0,\\\\\"d\\\\\":0,\\\\\"deduction\\\\\":false,\\\\\"r\\\\\":-0.0064699886,\\\\\"t\\\\\":-0.0064699886,\\\\\"totalDeductionFee\\\\\":0},\\\\\"USDT\\\\\":{\\\\\"deduction\\\\\":false,\\\\\"feeCoinCode\\\\\":\\\\\"USDT\\\\\",\\\\\"totalDeductionFee\\\\\":0,\\\\\"totalFee\\\\\":-0.0064699886000000}}\", // might not be present in fetchOpenOrders\n        //         \"triggerPrice\": null,\n        //         \"tpslType\": \"normal\",\n        //         \"quoteCoin\": \"USDT\",  // not present in fetchOpenOrders\n        //         \"baseCoin\": \"DOT\",    // not present in fetchOpenOrders\n        //         \"cancelReason\": \"\",   // not present in fetchOpenOrders\n        //     }\n        //\n        // spot trigger: fetchOpenOrders, fetchCanceledAndClosedOrders\n        //\n        //     {\n        //         \"orderId\": \"1111503385931620352\",\n        //         \"clientOid\": \"1111503385910648832\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"size\": \"0.0002\",\n        //         \"planType\": \"AMOUNT\",\n        //         \"executePrice\": \"25000\",\n        //         \"triggerPrice\": \"26000\",\n        //         \"status\": \"live\",\n        //         \"orderType\": \"limit\",\n        //         \"side\": \"buy\",\n        //         \"triggerType\": \"fill_price\",\n        //         \"enterPointSource\": \"API\",\n        //         \"cTime\": \"1700728978617\",\n        //         \"uTime\": \"1700728978617\"\n        //     }\n        //\n        // spot margin: fetchOpenOrders, fetchCanceledAndClosedOrders\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderType\": \"limit\",\n        //         \"enterPointSource\": \"WEB\",\n        //         \"orderId\": \"1111506377509580801\",\n        //         \"clientOid\": \"2043a3b59a60445f9d9f7365bf3e960c\",\n        //         \"loanType\": \"autoLoanAndRepay\",\n        //         \"price\": \"25000\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"live\",\n        //         \"baseSize\": \"0.0002\",\n        //         \"quoteSize\": \"5\",\n        //         \"priceAvg\": \"0\",\n        //         \"size\": \"0\",\n        //         \"amount\": \"0\",\n        //         \"force\": \"gtc\",\n        //         \"cTime\": \"1700729691866\",\n        //         \"uTime\": \"1700729691866\"\n        //     }\n        //\n        // swap and future: fetchOrder, fetchOpenOrders, fetchCanceledAndClosedOrders\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"size\": \"0.001\",\n        //         \"orderId\": \"1111465253393825792\",\n        //         \"clientOid\": \"1111465253431574529\",\n        //         \"baseVolume\": \"0\",\n        //         \"fee\": \"0\",\n        //         \"price\": \"27000\",\n        //         \"priceAvg\": \"\",\n        //         \"state\": \"live\",\n        //         // \"status\": \"live\", // key for fetchOpenOrders, fetchClosedOrders\n        //         \"side\": \"buy\",\n        //         \"force\": \"gtc\",\n        //         \"totalProfits\": \"0\",\n        //         \"posSide\": \"long\",\n        //         \"marginCoin\": \"USDT\",\n        //         \"quoteVolume\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"marginMode\": \"crossed\",\n        //         \"enterPointSource\": \"API\",\n        //         \"tradeSide\": \"open\",\n        //         \"posMode\": \"hedge_mode\",\n        //         \"orderType\": \"limit\",\n        //         \"orderSource\": \"normal\",\n        //         \"presetStopSurplusPrice\": \"\",\n        //         \"presetStopLossPrice\": \"\",\n        //         \"reduceOnly\": \"NO\",\n        //         \"cTime\": \"1700719887120\",\n        //         \"uTime\": \"1700719887120\"\n        //\n        //     for swap trigger order, the additional below fields are present:\n        //\n        //         \"planType\": \"normal_plan\",\n        //         \"callbackRatio\": \"\",\n        //         \"triggerPrice\": \"24000\",\n        //         \"triggerType\": \"mark_price\",\n        //         \"planStatus\": \"live\",\n        //         \"stopSurplusTriggerPrice\": \"\",\n        //         \"stopSurplusExecutePrice\": \"\",\n        //         \"stopSurplusTriggerType\": \"fill_price\",\n        //         \"stopLossTriggerPrice\": \"\",\n        //         \"stopLossExecutePrice\": \"\",\n        //         \"stopLossTriggerType\": \"fill_price\",\n        //     }\n        //\n        // uta: fetchOrder, fetchOpenOrders, fetchCanceledAndClosedOrders\n        //\n        //     {\n        //         \"orderId\": \"1320244799629316096\",\n        //         \"clientOid\": \"1320244799633510400\",\n        //         \"category\": \"USDT-FUTURES\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderType\": \"limit\",\n        //         \"side\": \"buy\",\n        //         \"price\": \"50000\",\n        //         \"qty\": \"0.001\",\n        //         \"amount\": \"0\",\n        //         \"cumExecQty\": \"0\",\n        //         \"cumExecValue\": \"0\",\n        //         \"avgPrice\": \"0\",\n        //         \"timeInForce\": \"gtc\",\n        //         \"orderStatus\": \"live\",\n        //         \"posSide\": \"long\",\n        //         \"holdMode\": \"hedge_mode\",\n        //         \"reduceOnly\": \"NO\",\n        //         \"feeDetail\": [{\n        //             \"feeCoin\": \"\",\n        //             \"fee\": \"\"\n        //         }],\n        //         \"createdTime\": \"1750496809871\",\n        //         \"updatedTime\": \"1750496809886\",\n        //         \"cancelReason\": \"\",\n        //         \"execType\": \"normal\",\n        //         \"stpMode\": \"none\",\n        //         \"tpTriggerBy\": null,\n        //         \"slTriggerBy\": null,\n        //         \"takeProfit\": null,\n        //         \"stopLoss\": null,\n        //         \"tpOrderType\": null,\n        //         \"slOrderType\": null,\n        //         \"tpLimitPrice\": null,\n        //         \"slLimitPrice\": null\n        //     }\n        //\n        // uta trigger: fetchClosedOrders, fetchCanceledOrders\n        //\n        //     {\n        //         \"orderId\": \"1330984742276198400\",\n        //         \"clientOid\": \"1330984742276198400\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"category\": \"USDT-FUTURES\",\n        //         \"qty\": \"0.001\",\n        //         \"posSide\": \"long\",\n        //         \"tpTriggerBy\": \"market\",\n        //         \"slTriggerBy\": \"mark\",\n        //         \"takeProfit\": \"\",\n        //         \"stopLoss\": \"112000\",\n        //         \"tpOrderType\": \"market\",\n        //         \"slOrderType\": \"limit\",\n        //         \"tpLimitPrice\": \"\",\n        //         \"slLimitPrice\": \"111000\",\n        //         \"createdTime\": \"1753057411736\",\n        //         \"updatedTime\": \"1753058267412\"\n        //     }\n        //\n        const errorMessage = this.safeString (order, 'errorMsg');\n        if (errorMessage !== undefined) {\n            return this.safeOrder ({\n                'info': order,\n                'id': this.safeString (order, 'orderId'),\n                'clientOrderId': this.safeString2 (order, 'clientOrderId', 'clientOid'),\n                'status': 'rejected',\n            }, market);\n        }\n        const posSide = this.safeString (order, 'posSide');\n        const isContractOrder = (posSide !== undefined);\n        let marketType = isContractOrder ? 'contract' : 'spot';\n        if (market !== undefined) {\n            marketType = market['type'];\n        }\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const timestamp = this.safeIntegerN (order, [ 'cTime', 'ctime', 'createdTime' ]);\n        const updateTimestamp = this.safeInteger2 (order, 'uTime', 'updatedTime');\n        const rawStatus = this.safeStringN (order, [ 'status', 'state', 'orderStatus', 'planStatus' ]);\n        let fee = undefined;\n        const feeCostString = this.safeString (order, 'fee');\n        if (feeCostString !== undefined) {\n            // swap\n            fee = {\n                'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n                'currency': market['settle'],\n            };\n        }\n        const feeDetail = this.safeValue (order, 'feeDetail');\n        const uta = this.safeString (order, 'category') !== undefined;\n        if (uta) {\n            const feeResult = this.safeDict (feeDetail, 0, {});\n            const utaFee = this.safeString (feeResult, 'fee');\n            fee = {\n                'cost': this.parseNumber (Precise.stringNeg (utaFee)),\n                'currency': market['settle'],\n            };\n        } else {\n            if (feeDetail !== undefined) {\n                const parsedFeeDetail = JSON.parse (feeDetail);\n                const feeValues = Object.values (parsedFeeDetail);\n                let feeObject = undefined;\n                for (let i = 0; i < feeValues.length; i++) {\n                    const feeValue = feeValues[i];\n                    if (this.safeValue (feeValue, 'feeCoinCode') !== undefined) {\n                        feeObject = feeValue;\n                        break;\n                    }\n                }\n                fee = {\n                    'cost': this.parseNumber (Precise.stringNeg (this.safeString (feeObject, 'totalFee'))),\n                    'currency': this.safeCurrencyCode (this.safeString (feeObject, 'feeCoinCode')),\n                };\n            }\n        }\n        let postOnly = undefined;\n        let timeInForce = this.safeStringUpper2 (order, 'force', 'timeInForce');\n        if (timeInForce === 'POST_ONLY') {\n            postOnly = true;\n            timeInForce = 'PO';\n        }\n        let reduceOnly = undefined;\n        const reduceOnlyRaw = this.safeString (order, 'reduceOnly');\n        if (reduceOnlyRaw !== undefined) {\n            reduceOnly = (reduceOnlyRaw === 'NO') ? false : true;\n        }\n        let price = undefined;\n        let average = undefined;\n        const basePrice = this.safeString (order, 'basePrice');\n        if (basePrice !== undefined) {\n            // for spot fetchOpenOrders, the price is priceAvg and the filled price is basePrice\n            price = this.safeString (order, 'priceAvg');\n            average = this.safeString (order, 'basePrice');\n        } else {\n            price = this.safeStringN (order, [ 'price', 'executePrice', 'slLimitPrice', 'tpLimitPrice' ]);\n            average = this.safeString (order, 'priceAvg');\n        }\n        let size = undefined;\n        let filled = undefined;\n        const baseSize = this.safeString (order, 'baseSize');\n        if (baseSize !== undefined) {\n            // for spot margin fetchOpenOrders, the order size is baseSize and the filled amount is size\n            size = baseSize;\n            filled = this.safeString (order, 'size');\n        } else {\n            size = this.safeString2 (order, 'size', 'qty');\n            filled = this.safeString2 (order, 'baseVolume', 'cumExecQty');\n        }\n        let side = this.safeString (order, 'side');\n        const posMode = this.safeString (order, 'posMode');\n        if (posMode === 'hedge_mode' && reduceOnly) {\n            side = (side === 'buy') ? 'sell' : 'buy';\n            // on bitget hedge mode if the position is long the side is always buy, and if the position is short the side is always sell\n            // so the side of the reduceOnly order is inversed\n        }\n        const orderType = this.safeString (order, 'orderType');\n        const isBuyMarket = (side === 'buy') && (orderType === 'market');\n        if (market['spot'] && isBuyMarket) {\n            // as noted in top comment, for 'buy market' the 'size' field is COST, not AMOUNT\n            size = this.safeString (order, 'baseVolume');\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString2 (order, 'orderId', 'data'),\n            'clientOrderId': this.safeString2 (order, 'clientOrderId', 'clientOid'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': updateTimestamp,\n            'lastUpdateTimestamp': updateTimestamp,\n            'symbol': market['symbol'],\n            'type': orderType,\n            'side': side,\n            'price': price,\n            'amount': size,\n            'cost': this.safeString2 (order, 'quoteVolume', 'quoteSize'),\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': reduceOnly,\n            'triggerPrice': this.safeNumber (order, 'triggerPrice'),\n            'takeProfitPrice': this.safeNumberN (order, [ 'presetStopSurplusPrice', 'stopSurplusTriggerPrice', 'takeProfit' ]),\n            'stopLossPrice': this.safeNumberN (order, [ 'presetStopLossPrice', 'stopLossTriggerPrice', 'stopLoss' ]),\n            'status': this.parseOrderStatus (rawStatus),\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 4676,
        "line_end": 4696,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'open',\n            'init': 'open',\n            'not_trigger': 'open',\n            'partial_fill': 'open',\n            'partially_fill': 'open',\n            'partially_filled': 'open',\n            'triggered': 'closed',\n            'full_fill': 'closed',\n            'filled': 'closed',\n            'fail_trigger': 'rejected',\n            'cancel': 'canceled',\n            'cancelled': 'canceled',\n            'canceled': 'canceled',\n            'live': 'open',\n            'fail_execute': 'rejected',\n            'executed': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 8113,
        "line_end": 8335,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (position, 'orderId', 'positionId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPrice)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealizedPnl)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumberN (position, [ 'pnl', 'curRealisedPnl', 'cumRealisedPnl' ])",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.parseNumber (percentage)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSizeNumber",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPrice)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber2 (position, 'closeAvgPrice', 'closePriceAvg')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger2 (position, 'utime', 'updatedTime')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMargin)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceMarginPercentage)",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateral)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentage)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.safeNumber2 (position, 'marginRatio', 'mmr')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marginCoin\": \"USDT\",\n         \"symbol\": \"BTCUSDT\",\n         \"holdSide\": \"long\",\n         \"openDelegateSize\": \"0\",\n         \"marginSize\": \"3.73555\",\n         \"available\": \"0.002\",\n         \"locked\": \"0\",\n         \"total\": \"0.002\",\n         \"leverage\": \"20\",\n         \"achievedProfits\": \"0\",\n         \"openPriceAvg\": \"37355.5\",\n         \"marginMode\": \"crossed\",\n         \"posMode\": \"hedge_mode\",\n         \"unrealizedPL\": \"0.007\",\n         \"liquidationPrice\": \"31724.970702417\",\n         \"keepMarginRate\": \"0.004\",\n         \"markPrice\": \"37359\",\n         \"marginRatio\": \"0.029599540355\",\n         \"cTime\": \"1700807507275\"\n     }",
          "{\n         \"category\": \"USDT-FUTURES\",\n         \"symbol\": \"BTCUSDT\",\n         \"marginCoin\": \"USDT\",\n         \"holdMode\": \"hedge_mode\",\n         \"posSide\": \"long\",\n         \"marginMode\": \"crossed\",\n         \"positionBalance\": \"5.435199\",\n         \"available\": \"0.001\",\n         \"frozen\": \"0\",\n         \"total\": \"0.001\",\n         \"leverage\": \"20\",\n         \"curRealisedPnl\": \"0\",\n         \"avgPrice\": \"107410.3\",\n         \"positionStatus\": \"normal\",\n         \"unrealisedPnl\": \"0.0047\",\n         \"liquidationPrice\": \"0\",\n         \"mmr\": \"0.004\",\n         \"profitRate\": \"0.0008647337475591\",\n         \"markPrice\": \"107415.3\",\n         \"breakEvenPrice\": \"107539.2\",\n         \"totalFunding\": \"0\",\n         \"openFeeTotal\": \"-0.06444618\",\n         \"closeFeeTotal\": \"0\",\n         \"createdTime\": \"1750495670699\",\n         \"updatedTime\": \"1750929883465\"\n     }",
          "{\n         \"marginCoin\": \"USDT\",\n         \"symbol\": \"BTCUSDT\",\n         \"holdSide\": \"long\",\n         \"openDelegateSize\": \"0\",\n         \"marginSize\": \"3.73555\",\n         \"available\": \"0.002\",\n         \"locked\": \"0\",\n         \"total\": \"0.002\",\n         \"leverage\": \"20\",\n         \"achievedProfits\": \"0\",\n         \"openPriceAvg\": \"37355.5\",\n         \"marginMode\": \"crossed\",\n         \"posMode\": \"hedge_mode\",\n         \"unrealizedPL\": \"0.03\",\n         \"liquidationPrice\": \"31725.023602417\",\n         \"keepMarginRate\": \"0.004\",\n         \"markPrice\": \"37370.5\",\n         \"marginRatio\": \"0.029550120396\",\n         \"cTime\": \"1700807507275\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"marginCoin\": \"USDT\",\n         \"holdSide\": \"long\",\n         \"openAvgPrice\": \"37272.1\",\n         \"closeAvgPrice\": \"37271.4\",\n         \"marginMode\": \"crossed\",\n         \"openTotalPos\": \"0.001\",\n         \"closeTotalPos\": \"0.001\",\n         \"pnl\": \"-0.0007\",\n         \"netProfit\": \"-0.0454261\",\n         \"totalFunding\": \"0\",\n         \"openFee\": \"-0.02236326\",\n         \"closeFee\": \"-0.02236284\",\n         \"utime\": \"1700720700400\",\n         \"ctime\": \"1700720651684\"\n     }",
          "{\n         \"orderId\": \"1120923953904893955\",\n         \"clientOid\": \"1120923953904893956\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // fetchPosition\n        //\n        //     {\n        //         \"marginCoin\": \"USDT\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"holdSide\": \"long\",\n        //         \"openDelegateSize\": \"0\",\n        //         \"marginSize\": \"3.73555\",\n        //         \"available\": \"0.002\",\n        //         \"locked\": \"0\",\n        //         \"total\": \"0.002\",\n        //         \"leverage\": \"20\",\n        //         \"achievedProfits\": \"0\",\n        //         \"openPriceAvg\": \"37355.5\",\n        //         \"marginMode\": \"crossed\",\n        //         \"posMode\": \"hedge_mode\",\n        //         \"unrealizedPL\": \"0.007\",\n        //         \"liquidationPrice\": \"31724.970702417\",\n        //         \"keepMarginRate\": \"0.004\",\n        //         \"markPrice\": \"37359\",\n        //         \"marginRatio\": \"0.029599540355\",\n        //         \"cTime\": \"1700807507275\"\n        //     }\n        //\n        // uta: fetchPosition\n        //\n        //     {\n        //         \"category\": \"USDT-FUTURES\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"marginCoin\": \"USDT\",\n        //         \"holdMode\": \"hedge_mode\",\n        //         \"posSide\": \"long\",\n        //         \"marginMode\": \"crossed\",\n        //         \"positionBalance\": \"5.435199\",\n        //         \"available\": \"0.001\",\n        //         \"frozen\": \"0\",\n        //         \"total\": \"0.001\",\n        //         \"leverage\": \"20\",\n        //         \"curRealisedPnl\": \"0\",\n        //         \"avgPrice\": \"107410.3\",\n        //         \"positionStatus\": \"normal\",\n        //         \"unrealisedPnl\": \"0.0047\",\n        //         \"liquidationPrice\": \"0\",\n        //         \"mmr\": \"0.004\",\n        //         \"profitRate\": \"0.0008647337475591\",\n        //         \"markPrice\": \"107415.3\",\n        //         \"breakEvenPrice\": \"107539.2\",\n        //         \"totalFunding\": \"0\",\n        //         \"openFeeTotal\": \"-0.06444618\",\n        //         \"closeFeeTotal\": \"0\",\n        //         \"createdTime\": \"1750495670699\",\n        //         \"updatedTime\": \"1750929883465\"\n        //     }\n        //\n        // fetchPositions: privateMixGetV2MixPositionAllPosition\n        //\n        //     {\n        //         \"marginCoin\": \"USDT\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"holdSide\": \"long\",\n        //         \"openDelegateSize\": \"0\",\n        //         \"marginSize\": \"3.73555\",\n        //         \"available\": \"0.002\",\n        //         \"locked\": \"0\",\n        //         \"total\": \"0.002\",\n        //         \"leverage\": \"20\",\n        //         \"achievedProfits\": \"0\",\n        //         \"openPriceAvg\": \"37355.5\",\n        //         \"marginMode\": \"crossed\",\n        //         \"posMode\": \"hedge_mode\",\n        //         \"unrealizedPL\": \"0.03\",\n        //         \"liquidationPrice\": \"31725.023602417\",\n        //         \"keepMarginRate\": \"0.004\",\n        //         \"markPrice\": \"37370.5\",\n        //         \"marginRatio\": \"0.029550120396\",\n        //         \"cTime\": \"1700807507275\"\n        //     }\n        //\n        // fetchPositionsHistory: privateMixGetV2MixPositionHistoryPosition\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"marginCoin\": \"USDT\",\n        //         \"holdSide\": \"long\",\n        //         \"openAvgPrice\": \"37272.1\",\n        //         \"closeAvgPrice\": \"37271.4\",\n        //         \"marginMode\": \"crossed\",\n        //         \"openTotalPos\": \"0.001\",\n        //         \"closeTotalPos\": \"0.001\",\n        //         \"pnl\": \"-0.0007\",\n        //         \"netProfit\": \"-0.0454261\",\n        //         \"totalFunding\": \"0\",\n        //         \"openFee\": \"-0.02236326\",\n        //         \"closeFee\": \"-0.02236284\",\n        //         \"utime\": \"1700720700400\",\n        //         \"ctime\": \"1700720651684\"\n        //     }\n        //\n        // closeAllPositions\n        //\n        //     {\n        //         \"orderId\": \"1120923953904893955\",\n        //         \"clientOid\": \"1120923953904893956\"\n        //     }\n        //\n        // uta: fetchPositionsHistory\n        //\n        //     {\n        //         \"positionId\": \"1322441328637100049\",\n        //         \"category\": \"USDT-FUTURES\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"marginCoin\": \"USDT\",\n        //         \"holdMode\": \"hedge_mode\",\n        //         \"posSide\": \"long\",\n        //         \"marginMode\": \"crossed\",\n        //         \"openPriceAvg\": \"107003.7\",\n        //         \"closePriceAvg\": \"107005.4\",\n        //         \"openTotalPos\": \"0.0001\",\n        //         \"closeTotalPos\": \"0.0001\",\n        //         \"cumRealisedPnl\": \"0.00017\",\n        //         \"netProfit\": \"-0.01267055\",\n        //         \"totalFunding\": \"0\",\n        //         \"openFeeTotal\": \"-0.00642022\",\n        //         \"closeFeeTotal\": \"-0.00642032\",\n        //         \"createdTime\": \"1751020503195\",\n        //         \"updatedTime\": \"1751020520458\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = market['symbol'];\n        const timestamp = this.safeIntegerN (position, [ 'cTime', 'ctime', 'createdTime' ]);\n        let marginMode = this.safeString (position, 'marginMode');\n        let collateral = undefined;\n        let initialMargin = undefined;\n        const unrealizedPnl = this.safeString2 (position, 'unrealizedPL', 'unrealisedPnl');\n        const rawCollateral = this.safeString2 (position, 'marginSize', 'positionBalance');\n        if (marginMode === 'isolated') {\n            collateral = Precise.stringAdd (rawCollateral, unrealizedPnl);\n        } else if (marginMode === 'crossed') {\n            marginMode = 'cross';\n            initialMargin = rawCollateral;\n        }\n        const holdMode = this.safeString2 (position, 'posMode', 'holdMode');\n        let hedged = undefined;\n        if (holdMode === 'hedge_mode') {\n            hedged = true;\n        } else if (holdMode === 'one_way_mode') {\n            hedged = false;\n        }\n        const side = this.safeString2 (position, 'holdSide', 'posSide');\n        const leverage = this.safeString (position, 'leverage');\n        const contractSizeNumber = this.safeValue (market, 'contractSize');\n        const contractSize = this.numberToString (contractSizeNumber);\n        const baseAmount = this.safeString2 (position, 'total', 'openTotalPos');\n        const entryPrice = this.safeStringN (position, [ 'openPriceAvg', 'openAvgPrice', 'avgPrice' ]);\n        const maintenanceMarginPercentage = this.safeString (position, 'keepMarginRate');\n        const openNotional = Precise.stringMul (entryPrice, baseAmount);\n        if (initialMargin === undefined) {\n            initialMargin = Precise.stringDiv (openNotional, leverage);\n        }\n        let contracts = this.parseNumber (Precise.stringDiv (baseAmount, contractSize));\n        if (contracts === undefined) {\n            contracts = this.safeNumber (position, 'closeTotalPos');\n        }\n        const markPrice = this.safeString (position, 'markPrice');\n        const notional = Precise.stringMul (baseAmount, markPrice);\n        const initialMarginPercentage = Precise.stringDiv (initialMargin, notional);\n        let liquidationPrice = this.parseNumber (this.omitZero (this.safeString (position, 'liquidationPrice')));\n        const calcTakerFeeRate = '0.0006';\n        const calcTakerFeeMult = '0.9994';\n        if ((liquidationPrice === undefined) && (marginMode === 'isolated') && Precise.stringGt (baseAmount, '0')) {\n            let signedMargin = Precise.stringDiv (rawCollateral, baseAmount);\n            let signedMmp = maintenanceMarginPercentage;\n            if (side === 'short') {\n                signedMargin = Precise.stringNeg (signedMargin);\n                signedMmp = Precise.stringNeg (signedMmp);\n            }\n            let mmrMinusOne = Precise.stringSub ('1', signedMmp);\n            let numerator = Precise.stringSub (entryPrice, signedMargin);\n            if (side === 'long') {\n                mmrMinusOne = Precise.stringMul (mmrMinusOne, calcTakerFeeMult);\n            } else {\n                numerator = Precise.stringMul (numerator, calcTakerFeeMult);\n            }\n            liquidationPrice = this.parseNumber (Precise.stringDiv (numerator, mmrMinusOne));\n        }\n        const feeToClose = Precise.stringMul (notional, calcTakerFeeRate);\n        const maintenanceMargin = Precise.stringAdd (Precise.stringMul (maintenanceMarginPercentage, notional), feeToClose);\n        const percentage = Precise.stringMul (Precise.stringDiv (unrealizedPnl, initialMargin, 4), '100');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString2 (position, 'orderId', 'positionId'),\n            'symbol': symbol,\n            'notional': this.parseNumber (notional),\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.parseNumber (entryPrice),\n            'unrealizedPnl': this.parseNumber (unrealizedPnl),\n            'realizedPnl': this.safeNumberN (position, [ 'pnl', 'curRealisedPnl', 'cumRealisedPnl' ]),\n            'percentage': this.parseNumber (percentage),\n            'contracts': contracts,\n            'contractSize': contractSizeNumber,\n            'markPrice': this.parseNumber (markPrice),\n            'lastPrice': this.safeNumber2 (position, 'closeAvgPrice', 'closePriceAvg'),\n            'side': side,\n            'hedged': hedged,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger2 (position, 'utime', 'updatedTime'),\n            'maintenanceMargin': this.parseNumber (maintenanceMargin),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceMarginPercentage),\n            'collateral': this.parseNumber (collateral),\n            'initialMargin': this.parseNumber (initialMargin),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentage),\n            'leverage': this.parseNumber (leverage),\n            'marginRatio': this.safeNumber2 (position, 'marginRatio', 'mmr'),\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 3221,
        "line_end": 3365,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, marketType)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'high24h', 'highPrice24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'low24h', 'lowPrice24h')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'bidPr', 'bid1Price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString2 (ticker, 'bidSz', 'bid1Size')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'askPr', 'ask1Price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString2 (ticker, 'askSz', 'ask1Size')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeStringN (ticker, [ 'open', 'open24h', 'openPrice24h' ])",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'baseVolume', 'volume24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString2 (ticker, 'quoteVolume', 'turnover24h')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"BTCUSDT\",\n       \"price\": \"26242\",\n       \"indexPrice\": \"34867\",\n       \"markPrice\": \"25555\",\n       \"ts\": \"1695793390482\"\n   }",
          "{\n         \"open\": \"37202.46\",\n         \"symbol\": \"BTCUSDT\",\n         \"high24h\": \"37744.75\",\n         \"low24h\": \"36666\",\n         \"lastPr\": \"37583.69\",\n         \"quoteVolume\": \"519127705.303\",\n         \"baseVolume\": \"13907.0386\",\n         \"usdtVolume\": \"519127705.302908\",\n         \"ts\": \"1700532903261\",\n         \"bidPr\": \"37583.68\",\n         \"askPr\": \"37583.69\",\n         \"bidSz\": \"0.0007\",\n         \"askSz\": \"0.0829\",\n         \"openUtc\": \"37449.4\",\n         \"changeUtc24h\": \"0.00359\",\n         \"change24h\": \"0.00321\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"lastPr\": \"104823.8\",\n         \"askPr\": \"104823.8\",\n         \"bidPr\": \"104823.5\",\n         \"bidSz\": \"0.703\",\n         \"askSz\": \"13.894\",\n         \"high24h\": \"105289.3\",\n         \"low24h\": \"103447.9\",\n         \"ts\": \"1750332210370\",\n         \"change24h\": \"0.00471\",\n         \"baseVolume\": \"79089.5675\",\n         \"quoteVolume\": \"8274870921.80485\",\n         \"usdtVolume\": \"8274870921.80485\",\n         \"openUtc\": \"104833\",\n         \"changeUtc24h\": \"-0.00009\",\n         \"indexPrice\": \"104881.953125\",\n         \"fundingRate\": \"-0.000014\",\n         \"holdingAmount\": \"7452.6421\",\n         \"deliveryStartTime\": null,\n         \"deliveryTime\": null,\n         \"deliveryStatus\": \"\",\n         \"open24h\": \"104332.3\",\n         \"markPrice\": \"104824.2\"\n     }",
          "{\n         \"category\": \"SPOT\",\n         \"symbol\": \"BTCUSDT\",\n         \"ts\": \"1750330651972\",\n         \"lastPrice\": \"104900.2\",\n         \"openPrice24h\": \"104321.2\",\n         \"highPrice24h\": \"107956.8\",\n         \"lowPrice24h\": \"103600.1\",\n         \"ask1Price\": \"104945.8\",\n         \"bid1Price\": \"104880.6\",\n         \"bid1Size\": \"0.266534\",\n         \"ask1Size\": \"0.014001\",\n         \"price24hPcnt\": \"0.00555\",\n         \"volume24h\": \"355.941109\",\n         \"turnover24h\": \"37302936.008134\"\n     }",
          "{\n         \"category\": \"USDT-FUTURES\",\n         \"symbol\": \"BTCUSDT\",\n         \"ts\": \"1750332730472\",\n         \"lastPrice\": \"104738\",\n         \"openPrice24h\": \"104374\",\n         \"highPrice24h\": \"105289.3\",\n         \"lowPrice24h\": \"103447.9\",\n         \"ask1Price\": \"104738\",\n         \"bid1Price\": \"104737.7\",\n         \"bid1Size\": \"2.036\",\n         \"ask1Size\": \"8.094\",\n         \"price24hPcnt\": \"0.00349\",\n         \"volume24h\": \"79101.6477\",\n         \"turnover24h\": \"8276293391.45973\",\n         \"indexPrice\": \"104785.956168\",\n         \"markPrice\": \"104738\",\n         \"fundingRate\": \"-0.000007\",\n         \"openInterest\": \"7465.5938\",\n         \"deliveryStartTime\": \"\",\n         \"deliveryTime\": \"\",\n         \"deliveryStatus\": \"\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //   {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"price\": \"26242\",\n        //       \"indexPrice\": \"34867\",\n        //       \"markPrice\": \"25555\",\n        //       \"ts\": \"1695793390482\"\n        //   }\n        //\n        // spot\n        //\n        //     {\n        //         \"open\": \"37202.46\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"high24h\": \"37744.75\",\n        //         \"low24h\": \"36666\",\n        //         \"lastPr\": \"37583.69\",\n        //         \"quoteVolume\": \"519127705.303\",\n        //         \"baseVolume\": \"13907.0386\",\n        //         \"usdtVolume\": \"519127705.302908\",\n        //         \"ts\": \"1700532903261\",\n        //         \"bidPr\": \"37583.68\",\n        //         \"askPr\": \"37583.69\",\n        //         \"bidSz\": \"0.0007\",\n        //         \"askSz\": \"0.0829\",\n        //         \"openUtc\": \"37449.4\",\n        //         \"changeUtc24h\": \"0.00359\",\n        //         \"change24h\": \"0.00321\"\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"lastPr\": \"104823.8\",\n        //         \"askPr\": \"104823.8\",\n        //         \"bidPr\": \"104823.5\",\n        //         \"bidSz\": \"0.703\",\n        //         \"askSz\": \"13.894\",\n        //         \"high24h\": \"105289.3\",\n        //         \"low24h\": \"103447.9\",\n        //         \"ts\": \"1750332210370\",\n        //         \"change24h\": \"0.00471\",\n        //         \"baseVolume\": \"79089.5675\",\n        //         \"quoteVolume\": \"8274870921.80485\",\n        //         \"usdtVolume\": \"8274870921.80485\",\n        //         \"openUtc\": \"104833\",\n        //         \"changeUtc24h\": \"-0.00009\",\n        //         \"indexPrice\": \"104881.953125\",\n        //         \"fundingRate\": \"-0.000014\",\n        //         \"holdingAmount\": \"7452.6421\",\n        //         \"deliveryStartTime\": null,\n        //         \"deliveryTime\": null,\n        //         \"deliveryStatus\": \"\",\n        //         \"open24h\": \"104332.3\",\n        //         \"markPrice\": \"104824.2\"\n        //     }\n        //\n        // spot uta\n        //\n        //     {\n        //         \"category\": \"SPOT\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"ts\": \"1750330651972\",\n        //         \"lastPrice\": \"104900.2\",\n        //         \"openPrice24h\": \"104321.2\",\n        //         \"highPrice24h\": \"107956.8\",\n        //         \"lowPrice24h\": \"103600.1\",\n        //         \"ask1Price\": \"104945.8\",\n        //         \"bid1Price\": \"104880.6\",\n        //         \"bid1Size\": \"0.266534\",\n        //         \"ask1Size\": \"0.014001\",\n        //         \"price24hPcnt\": \"0.00555\",\n        //         \"volume24h\": \"355.941109\",\n        //         \"turnover24h\": \"37302936.008134\"\n        //     }\n        //\n        // swap and future uta\n        //\n        //     {\n        //         \"category\": \"USDT-FUTURES\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"ts\": \"1750332730472\",\n        //         \"lastPrice\": \"104738\",\n        //         \"openPrice24h\": \"104374\",\n        //         \"highPrice24h\": \"105289.3\",\n        //         \"lowPrice24h\": \"103447.9\",\n        //         \"ask1Price\": \"104738\",\n        //         \"bid1Price\": \"104737.7\",\n        //         \"bid1Size\": \"2.036\",\n        //         \"ask1Size\": \"8.094\",\n        //         \"price24hPcnt\": \"0.00349\",\n        //         \"volume24h\": \"79101.6477\",\n        //         \"turnover24h\": \"8276293391.45973\",\n        //         \"indexPrice\": \"104785.956168\",\n        //         \"markPrice\": \"104738\",\n        //         \"fundingRate\": \"-0.000007\",\n        //         \"openInterest\": \"7465.5938\",\n        //         \"deliveryStartTime\": \"\",\n        //         \"deliveryTime\": \"\",\n        //         \"deliveryStatus\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        const close = this.safeString2 (ticker, 'lastPr', 'lastPrice');\n        const timestamp = this.safeIntegerOmitZero (ticker, 'ts'); // exchange bitget provided 0\n        const category = this.safeString (ticker, 'category');\n        const markPrice = this.safeString (ticker, 'markPrice');\n        let marketType: string;\n        if ((markPrice !== undefined) && (category !== 'SPOT')) {\n            marketType = 'contract';\n        } else {\n            marketType = 'spot';\n        }\n        let percentage = this.safeString (ticker, 'price24hPcnt');\n        if (percentage === undefined) {\n            const change24h = this.safeString (ticker, 'change24h');\n            percentage = Precise.stringMul (change24h, '100');\n        }\n        return this.safeTicker ({\n            'symbol': this.safeSymbol (marketId, market, undefined, marketType),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'high24h', 'highPrice24h'),\n            'low': this.safeString2 (ticker, 'low24h', 'lowPrice24h'),\n            'bid': this.safeString2 (ticker, 'bidPr', 'bid1Price'),\n            'bidVolume': this.safeString2 (ticker, 'bidSz', 'bid1Size'),\n            'ask': this.safeString2 (ticker, 'askPr', 'ask1Price'),\n            'askVolume': this.safeString2 (ticker, 'askSz', 'ask1Size'),\n            'vwap': undefined,\n            'open': this.safeStringN (ticker, [ 'open', 'open24h', 'openPrice24h' ]),\n            'close': close,\n            'last': close,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'baseVolume', 'volume24h'),\n            'quoteVolume': this.safeString2 (ticker, 'quoteVolume', 'turnover24h'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'markPrice': markPrice,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 3721,
        "line_end": 3873,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'tradeId', 'execId')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (trade, 'side')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (trade, 'orderType')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeString (trade, 'tradeScope')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeStringN (trade, [ 'priceAvg', 'price', 'execPrice' ])",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeStringN (trade, [ 'baseVolume', 'size', 'execQty' ])",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeStringN (trade, [ 'quoteVolume', 'amount', 'execValue' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tradeId\": \"1075199767891652609\",\n         \"price\": \"29376.5\",\n         \"size\": \"6.035\",\n         \"side\": \"Buy\",\n         \"ts\": \"1692073521000\",\n         \"symbol\": \"BTCUSDT\"\n     }",
          "{\n         \"userId\": \"7264631750\",\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"1098394344925597696\",\n         \"tradeId\": \"1098394344974925824\",\n         \"orderType\": \"market\",\n         \"side\": \"sell\",\n         \"priceAvg\": \"28467.68\",\n         \"size\": \"0.0002\",\n         \"amount\": \"5.693536\",\n         \"feeDetail\": {\n             \"deduction\": \"no\",\n             \"feeCoin\": \"USDT\",\n             \"totalDeductionFee\": \"\",\n             \"totalFee\": \"-0.005693536\"\n         },\n         \"tradeScope\": \"taker\",\n         \"cTime\": \"1697603539699\",\n         \"uTime\": \"1697603539754\"\n     }",
          "{\n         \"orderId\": \"1099353730455318528\",\n         \"tradeId\": \"1099353730627092481\",\n         \"orderType\": \"market\",\n         \"side\": \"sell\",\n         \"priceAvg\": \"29543.7\",\n         \"size\": \"0.0001\",\n         \"amount\": \"2.95437\",\n         \"tradeScope\": \"taker\",\n         \"feeDetail\": {\n             \"deduction\": \"no\",\n             \"feeCoin\": \"USDT\",\n             \"totalDeductionFee\": \"0\",\n             \"totalFee\": \"-0.00295437\"\n         },\n         \"cTime\": \"1697832275063\",\n         \"uTime\": \"1697832275150\"\n     }",
          "{\n         \"tradeId\": \"1111468664328269825\",\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"1111468664264753162\",\n         \"price\": \"37271.4\",\n         \"baseVolume\": \"0.001\",\n         \"feeDetail\": [\n             {\n                 \"deduction\": \"no\",\n                 \"feeCoin\": \"USDT\",\n                 \"totalDeductionFee\": null,\n                 \"totalFee\": \"-0.02236284\"\n             }\n         ],\n         \"side\": \"buy\",\n         \"quoteVolume\": \"37.2714\",\n         \"profit\": \"-0.0007\",\n         \"enterPointSource\": \"web\",\n         \"tradeSide\": \"close\",\n         \"posMode\": \"hedge_mode\",\n         \"tradeScope\": \"taker\",\n         \"cTime\": \"1700720700342\"\n     }",
          "{\n         \"execId\": \"1319896716324937729\",\n         \"price\": \"105909.1\",\n         \"size\": \"6.3090\",\n         \"side\": \"sell\",\n         \"ts\": \"1750413820344\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // spot, swap and future: fetchTrades\n        //\n        //     {\n        //         \"tradeId\": \"1075199767891652609\",\n        //         \"price\": \"29376.5\",\n        //         \"size\": \"6.035\",\n        //         \"side\": \"Buy\",\n        //         \"ts\": \"1692073521000\",\n        //         \"symbol\": \"BTCUSDT\"\n        //     }\n        //\n        // spot: fetchMyTrades\n        //\n        //     {\n        //         \"userId\": \"7264631750\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"1098394344925597696\",\n        //         \"tradeId\": \"1098394344974925824\",\n        //         \"orderType\": \"market\",\n        //         \"side\": \"sell\",\n        //         \"priceAvg\": \"28467.68\",\n        //         \"size\": \"0.0002\",\n        //         \"amount\": \"5.693536\",\n        //         \"feeDetail\": {\n        //             \"deduction\": \"no\",\n        //             \"feeCoin\": \"USDT\",\n        //             \"totalDeductionFee\": \"\",\n        //             \"totalFee\": \"-0.005693536\"\n        //         },\n        //         \"tradeScope\": \"taker\",\n        //         \"cTime\": \"1697603539699\",\n        //         \"uTime\": \"1697603539754\"\n        //     }\n        //\n        // spot margin: fetchMyTrades\n        //\n        //     {\n        //         \"orderId\": \"1099353730455318528\",\n        //         \"tradeId\": \"1099353730627092481\",\n        //         \"orderType\": \"market\",\n        //         \"side\": \"sell\",\n        //         \"priceAvg\": \"29543.7\",\n        //         \"size\": \"0.0001\",\n        //         \"amount\": \"2.95437\",\n        //         \"tradeScope\": \"taker\",\n        //         \"feeDetail\": {\n        //             \"deduction\": \"no\",\n        //             \"feeCoin\": \"USDT\",\n        //             \"totalDeductionFee\": \"0\",\n        //             \"totalFee\": \"-0.00295437\"\n        //         },\n        //         \"cTime\": \"1697832275063\",\n        //         \"uTime\": \"1697832275150\"\n        //     }\n        //\n        // swap and future: fetchMyTrades\n        //\n        //     {\n        //         \"tradeId\": \"1111468664328269825\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"1111468664264753162\",\n        //         \"price\": \"37271.4\",\n        //         \"baseVolume\": \"0.001\",\n        //         \"feeDetail\": [\n        //             {\n        //                 \"deduction\": \"no\",\n        //                 \"feeCoin\": \"USDT\",\n        //                 \"totalDeductionFee\": null,\n        //                 \"totalFee\": \"-0.02236284\"\n        //             }\n        //         ],\n        //         \"side\": \"buy\",\n        //         \"quoteVolume\": \"37.2714\",\n        //         \"profit\": \"-0.0007\",\n        //         \"enterPointSource\": \"web\",\n        //         \"tradeSide\": \"close\",\n        //         \"posMode\": \"hedge_mode\",\n        //         \"tradeScope\": \"taker\",\n        //         \"cTime\": \"1700720700342\"\n        //     }\n        //\n        // uta fetchTrades\n        //\n        //     {\n        //         \"execId\": \"1319896716324937729\",\n        //         \"price\": \"105909.1\",\n        //         \"size\": \"6.3090\",\n        //         \"side\": \"sell\",\n        //         \"ts\": \"1750413820344\"\n        //     }\n        //\n        // uta fetchMyTrades\n        //\n        //     {\n        //         \"execId\": \"1322441401010528257\",\n        //         \"orderId\": \"1322441400976261120\",\n        //         \"category\": \"USDT-FUTURES\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderType\": \"market\",\n        //         \"side\": \"sell\",\n        //         \"execPrice\": \"107005.4\",\n        //         \"execQty\": \"0.0001\",\n        //         \"execValue\": \"10.7005\",\n        //         \"tradeScope\": \"taker\",\n        //         \"feeDetail\": [{\n        //             \"feeCoin\": \"USDT\",\n        //             \"fee\":\"0.00642032\"\n        //         }],\n        //         \"createdTime\": \"1751020520451\",\n        //         \"updatedTime\": \"1751020520458\",\n        //         \"execPnl\": \"0.00017\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.safeIntegerN (trade, [ 'cTime', 'ts', 'createdTime' ]);\n        let fee = undefined;\n        const feeDetail = this.safeValue (trade, 'feeDetail');\n        const posMode = this.safeString (trade, 'posMode');\n        const category = this.safeString (trade, 'category');\n        const isFeeStructure = (posMode !== undefined) || (category !== undefined);\n        const feeStructure = isFeeStructure ? feeDetail[0] : feeDetail;\n        if (feeStructure !== undefined) {\n            const currencyCode = this.safeCurrencyCode (this.safeString (feeStructure, 'feeCoin'));\n            fee = {\n                'currency': currencyCode,\n            };\n            const feeCostString = this.safeString2 (feeStructure, 'totalFee', 'fee');\n            const deduction = this.safeString (feeStructure, 'deduction') === 'yes' ? true : false;\n            if (deduction) {\n                fee['cost'] = feeCostString;\n            } else {\n                fee['cost'] = Precise.stringNeg (feeCostString);\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'tradeId', 'execId'),\n            'order': this.safeString (trade, 'orderId'),\n            'symbol': symbol,\n            'side': this.safeStringLower (trade, 'side'),\n            'type': this.safeString (trade, 'orderType'),\n            'takerOrMaker': this.safeString (trade, 'tradeScope'),\n            'price': this.safeStringN (trade, [ 'priceAvg', 'price', 'execPrice' ]),\n            'amount': this.safeStringN (trade, [ 'baseVolume', 'size', 'execQty' ]),\n            'cost': this.safeStringN (trade, [ 'quoteVolume', 'amount', 'execValue' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (data, market: Market = undefined)",
        "line_start": 4179,
        "line_end": 4189,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (data, 'makerFeeRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (data, 'takerFeeRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (data, market: Market = undefined) {\n        const marketId = this.safeString (data, 'symbol');\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (marketId, market),\n            'maker': this.safeNumber (data, 'makerFeeRate'),\n            'taker': this.safeNumber (data, 'takerFeeRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2997,
        "line_end": 3075,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'orderId')",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'tradeId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (transaction, 'fromAddress')",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'toAddress')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "this.safeString (transaction, 'toAddress')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (transaction, 'type')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'uTime')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": \"1083832260799930368\",\n         \"tradeId\": \"35bf0e588a42b25c71a9d45abe7308cabdeec6b7b423910b9bd4743d3a9a9efa\",\n         \"coin\": \"BTC\",\n         \"type\": \"deposit\",\n         \"size\": \"0.00030000\",\n         \"status\": \"success\",\n         \"toAddress\": \"1BfZh7JESJGBUszCGeZnzxbVVvBycbJSbA\",\n         \"dest\": \"on_chain\",\n         \"chain\": \"BTC\",\n         \"fromAddress\": null,\n         \"cTime\": \"1694131668281\",\n         \"uTime\": \"1694131680247\"\n     }",
          "{\n         \"orderId\": \"1083832260799930368\",\n         \"tradeId\": \"35bf0e588a42b25c71a9d45abe7308cabdeec6b7b423910b9bd4743d3a9a9efa\",\n         \"clientOid\": \"123\",\n         \"coin\": \"BTC\",\n         \"type\": \"withdraw\",\n         \"size\": \"0.00030000\",\n         \"fee\": \"-1.0000000\",\n         \"status\": \"success\",\n         \"toAddress\": \"1BfZh7JESJGBUszCGeZnzxbVVvBycbJSbA\",\n         \"dest\": \"on_chain\",\n         \"chain\": \"BTC\",\n         \"confirm\": \"100\",\n         \"fromAddress\": null,\n         \"cTime\": \"1694131668281\",\n         \"uTime\": \"1694131680247\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"orderId\": \"1083832260799930368\",\n        //         \"tradeId\": \"35bf0e588a42b25c71a9d45abe7308cabdeec6b7b423910b9bd4743d3a9a9efa\",\n        //         \"coin\": \"BTC\",\n        //         \"type\": \"deposit\",\n        //         \"size\": \"0.00030000\",\n        //         \"status\": \"success\",\n        //         \"toAddress\": \"1BfZh7JESJGBUszCGeZnzxbVVvBycbJSbA\",\n        //         \"dest\": \"on_chain\",\n        //         \"chain\": \"BTC\",\n        //         \"fromAddress\": null,\n        //         \"cTime\": \"1694131668281\",\n        //         \"uTime\": \"1694131680247\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"orderId\": \"1083832260799930368\",\n        //         \"tradeId\": \"35bf0e588a42b25c71a9d45abe7308cabdeec6b7b423910b9bd4743d3a9a9efa\",\n        //         \"clientOid\": \"123\",\n        //         \"coin\": \"BTC\",\n        //         \"type\": \"withdraw\",\n        //         \"size\": \"0.00030000\",\n        //         \"fee\": \"-1.0000000\",\n        //         \"status\": \"success\",\n        //         \"toAddress\": \"1BfZh7JESJGBUszCGeZnzxbVVvBycbJSbA\",\n        //         \"dest\": \"on_chain\",\n        //         \"chain\": \"BTC\",\n        //         \"confirm\": \"100\",\n        //         \"fromAddress\": null,\n        //         \"cTime\": \"1694131668281\",\n        //         \"uTime\": \"1694131680247\"\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger (transaction, 'cTime');\n        const networkId = this.safeString (transaction, 'chain');\n        const status = this.safeString (transaction, 'status');\n        const tag = this.safeString (transaction, 'tag');\n        const feeCostString = this.safeString (transaction, 'fee');\n        let feeCostAbsString = undefined;\n        if (feeCostString !== undefined) {\n            feeCostAbsString = Precise.stringAbs (feeCostString);\n        }\n        let fee = undefined;\n        let amountString = this.safeString (transaction, 'size');\n        if (feeCostAbsString !== undefined) {\n            fee = { 'currency': code, 'cost': this.parseNumber (feeCostAbsString) };\n            amountString = Precise.stringSub (amountString, feeCostAbsString);\n        }\n        return {\n            'id': this.safeString (transaction, 'orderId'),\n            'info': transaction,\n            'txid': this.safeString (transaction, 'tradeId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (networkId),\n            'addressFrom': this.safeString (transaction, 'fromAddress'),\n            'address': this.safeString (transaction, 'toAddress'),\n            'addressTo': this.safeString (transaction, 'toAddress'),\n            'amount': this.parseNumber (amountString),\n            'type': this.safeString (transaction, 'type'),\n            'currency': code,\n            'status': this.parseTransactionStatus (status),\n            'updated': this.safeInteger (transaction, 'uTime'),\n            'tagFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 3077,
        "line_end": 3086,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'success': 'ok',\n            'Pending': 'pending',\n            'pending_review': 'pending',\n            'pending_review_fail': 'failed',\n            'reject': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 9385,
        "line_end": 9429,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'transferId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'size')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transferId\": \"1112112916581847040\",\n         \"clientOrderId\": null,\n         \"ts\": 1700874302021\n     }",
          "{\n         \"coin\": \"USDT\",\n         \"status\": \"Successful\",\n         \"toType\": \"crossed_margin\",\n         \"toSymbol\": \"\",\n         \"fromType\": \"spot\",\n         \"fromSymbol\": \"\",\n         \"size\": \"11.64958799\",\n         \"ts\": \"1700729673028\",\n         \"clientOid\": \"1111506298504744960\",\n         \"transferId\": \"24930940\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"transferId\": \"1112112916581847040\",\n        //         \"clientOrderId\": null,\n        //         \"ts\": 1700874302021\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"status\": \"Successful\",\n        //         \"toType\": \"crossed_margin\",\n        //         \"toSymbol\": \"\",\n        //         \"fromType\": \"spot\",\n        //         \"fromSymbol\": \"\",\n        //         \"size\": \"11.64958799\",\n        //         \"ts\": \"1700729673028\",\n        //         \"clientOid\": \"1111506298504744960\",\n        //         \"transferId\": \"24930940\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transfer, 'ts');\n        const status = this.safeStringLower (transfer, 'status');\n        const currencyId = this.safeString (transfer, 'coin');\n        const fromAccountRaw = this.safeString (transfer, 'fromType');\n        const accountsById = this.safeValue (this.options, 'accountsById', {});\n        const fromAccount = this.safeString (accountsById, fromAccountRaw, fromAccountRaw);\n        const toAccountRaw = this.safeString (transfer, 'toType');\n        const toAccount = this.safeString (accountsById, toAccountRaw, toAccountRaw);\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'transferId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'size'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 9431,
        "line_end": 9436,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'successful': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseUtaBalance",
        "signature": "parseUtaBalance (balance): Balances",
        "line_start": 4570,
        "line_end": 4595,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"coin\": \"USDT\",\n         \"equity\": \"6.19300826\",\n         \"usdValue\": \"6.19299777\",\n         \"balance\": \"6.19300826\",\n         \"available\": \"6.19300826\",\n         \"debt\": \"0\",\n         \"locked\": \"0\"\n     }"
        ],
        "source": "parseUtaBalance (balance): Balances {\n        const result: Dict = { 'info': balance };\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"equity\": \"6.19300826\",\n        //         \"usdValue\": \"6.19299777\",\n        //         \"balance\": \"6.19300826\",\n        //         \"available\": \"6.19300826\",\n        //         \"debt\": \"0\",\n        //         \"locked\": \"0\"\n        //     }\n        //\n        for (let i = 0; i < balance.length; i++) {\n            const entry = balance[i];\n            const account = this.account ();\n            const currencyId = this.safeString (entry, 'coin');\n            const code = this.safeCurrencyCode (currencyId);\n            account['debt'] = this.safeString (entry, 'debt');\n            account['used'] = this.safeString (entry, 'locked');\n            account['free'] = this.safeString (entry, 'available');\n            account['total'] = this.safeString (entry, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      }
    ],
    "bithumb": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 428,
        "line_end": 443,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const balances = this.safeDict (response, 'data');\n        const codes = Object.keys (this.currencies);\n        for (let i = 0; i < codes.length; i++) {\n            const code = codes[i];\n            const account = this.account ();\n            const currency = this.currency (code);\n            const lowerCurrencyId = this.safeStringLower (currency, 'id');\n            account['total'] = this.safeString (balances, 'total_' + lowerCurrencyId);\n            account['used'] = this.safeString (balances, 'in_use_' + lowerCurrencyId);\n            account['free'] = this.safeString (balances, 'available_' + lowerCurrencyId);\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 660,
        "line_end": 679,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1576823400000, // 기준 시간\n         \"8284000\", // 시가\n         \"8286000\", // 종가\n         \"8289000\", // 고가\n         \"8276000\", // 저가\n         \"15.41503692\" // 거래량\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1576823400000, // 기준 시간\n        //         \"8284000\", // 시가\n        //         \"8286000\", // 종가\n        //         \"8289000\", // 고가\n        //         \"8276000\", // 저가\n        //         \"15.41503692\" // 거래량\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 954,
        "line_end": 1050,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transaction_date\": \"1572497603668315\",\n         \"type\": \"bid\",\n         \"order_status\": \"Completed\", // Completed, Cancel ...\n         \"order_currency\": \"BTC\",\n         \"payment_currency\": \"KRW\",\n         \"watch_price\": \"0\", // present in Cancel order\n         \"order_price\": \"8601000\",\n         \"order_qty\": \"0.007\",\n         \"cancel_date\": \"\", // filled in Cancel order\n         \"cancel_type\": \"\", // filled in Cancel order, i.e. 사용자취소\n         \"contract\": [\n             {\n                 \"transaction_date\": \"1572497603902030\",\n                 \"price\": \"8601000\",\n                 \"units\": \"0.005\",\n                 \"fee_currency\": \"KRW\",\n                 \"fee\": \"107.51\",\n                 \"total\": \"43005\"\n             },\n         ]\n     }",
          "{\n         \"order_currency\": \"BTC\",\n         \"payment_currency\": \"KRW\",\n         \"order_id\": \"C0101000007408440032\",\n         \"order_date\": \"1571728739360570\",\n         \"type\": \"bid\",\n         \"units\": \"5.0\",\n         \"units_remaining\": \"5.0\",\n         \"price\": \"501000\",\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //\n        // fetchOrder\n        //\n        //     {\n        //         \"transaction_date\": \"1572497603668315\",\n        //         \"type\": \"bid\",\n        //         \"order_status\": \"Completed\", // Completed, Cancel ...\n        //         \"order_currency\": \"BTC\",\n        //         \"payment_currency\": \"KRW\",\n        //         \"watch_price\": \"0\", // present in Cancel order\n        //         \"order_price\": \"8601000\",\n        //         \"order_qty\": \"0.007\",\n        //         \"cancel_date\": \"\", // filled in Cancel order\n        //         \"cancel_type\": \"\", // filled in Cancel order, i.e. 사용자취소\n        //         \"contract\": [\n        //             {\n        //                 \"transaction_date\": \"1572497603902030\",\n        //                 \"price\": \"8601000\",\n        //                 \"units\": \"0.005\",\n        //                 \"fee_currency\": \"KRW\",\n        //                 \"fee\": \"107.51\",\n        //                 \"total\": \"43005\"\n        //             },\n        //         ]\n        //     }\n        //\n        // fetchOpenOrders\n        //\n        //     {\n        //         \"order_currency\": \"BTC\",\n        //         \"payment_currency\": \"KRW\",\n        //         \"order_id\": \"C0101000007408440032\",\n        //         \"order_date\": \"1571728739360570\",\n        //         \"type\": \"bid\",\n        //         \"units\": \"5.0\",\n        //         \"units_remaining\": \"5.0\",\n        //         \"price\": \"501000\",\n        //     }\n        //\n        const timestamp = this.safeIntegerProduct (order, 'order_date', 0.001);\n        const sideProperty = this.safeString2 (order, 'type', 'side');\n        const side = (sideProperty === 'bid') ? 'buy' : 'sell';\n        const status = this.parseOrderStatus (this.safeString (order, 'order_status'));\n        const price = this.safeString2 (order, 'order_price', 'price');\n        let type = 'limit';\n        if (Precise.stringEquals (price, '0')) {\n            type = 'market';\n        }\n        const amount = this.fixCommaNumber (this.safeString2 (order, 'order_qty', 'units'));\n        let remaining = this.fixCommaNumber (this.safeString (order, 'units_remaining'));\n        if (remaining === undefined) {\n            if (status === 'closed') {\n                remaining = '0';\n            } else if (status !== 'canceled') {\n                remaining = amount;\n            }\n        }\n        let symbol = undefined;\n        const baseId = this.safeString (order, 'order_currency');\n        const quoteId = this.safeString (order, 'payment_currency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        if ((base !== undefined) && (quote !== undefined)) {\n            symbol = base + '/' + quote;\n        }\n        if (symbol === undefined) {\n            market = this.safeMarket (undefined, market);\n            symbol = market['symbol'];\n        }\n        const id = this.safeString (order, 'order_id');\n        const rawTrades = this.safeList (order, 'contract', []);\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'average': undefined,\n            'filled': undefined,\n            'remaining': remaining,\n            'status': status,\n            'fee': undefined,\n            'trades': rawTrades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 945,
        "line_end": 952,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Pending': 'open',\n            'Completed': 'closed',\n            'Cancel': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 508,
        "line_end": 555,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'max_price')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'min_price')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy_price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell_price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"opening_price\":\"227100\",\n         \"closing_price\":\"228400\",\n         \"min_price\":\"222300\",\n         \"max_price\":\"230000\",\n         \"units_traded\":\"82618.56075337\",\n         \"acc_trade_value\":\"18767376138.6031\",\n         \"prev_closing_price\":\"227100\",\n         \"units_traded_24H\":\"151871.13484676\",\n         \"acc_trade_value_24H\":\"34247610416.8974\",\n         \"fluctate_24H\":\"8700\",\n         \"fluctate_rate_24H\":\"3.96\",\n         \"date\":\"1587710327264\", // fetchTickers inject this\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"opening_price\":\"227100\",\n        //         \"closing_price\":\"228400\",\n        //         \"min_price\":\"222300\",\n        //         \"max_price\":\"230000\",\n        //         \"units_traded\":\"82618.56075337\",\n        //         \"acc_trade_value\":\"18767376138.6031\",\n        //         \"prev_closing_price\":\"227100\",\n        //         \"units_traded_24H\":\"151871.13484676\",\n        //         \"acc_trade_value_24H\":\"34247610416.8974\",\n        //         \"fluctate_24H\":\"8700\",\n        //         \"fluctate_rate_24H\":\"3.96\",\n        //         \"date\":\"1587710327264\", // fetchTickers inject this\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'date');\n        const symbol = this.safeSymbol (undefined, market);\n        const open = this.safeString (ticker, 'opening_price');\n        const close = this.safeString (ticker, 'closing_price');\n        const baseVolume = this.safeString (ticker, 'units_traded_24H');\n        const quoteVolume = this.safeString (ticker, 'acc_trade_value_24H');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'max_price'),\n            'low': this.safeString (ticker, 'min_price'),\n            'bid': this.safeString (ticker, 'buy_price'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell_price'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': close,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 729,
        "line_end": 805,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transaction_date\":\"2020-04-23 22:21:46\",\n         \"type\":\"ask\",\n         \"units_traded\":\"0.0125\",\n         \"price\":\"8667000\",\n         \"total\":\"108337\"\n     }",
          "{\n         \"transaction_date\": \"1572497603902030\",\n         \"price\": \"8601000\",\n         \"units\": \"0.005\",\n         \"fee_currency\": \"KRW\",\n         \"fee\": \"107.51\",\n         \"total\": \"43005\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"transaction_date\":\"2020-04-23 22:21:46\",\n        //         \"type\":\"ask\",\n        //         \"units_traded\":\"0.0125\",\n        //         \"price\":\"8667000\",\n        //         \"total\":\"108337\"\n        //     }\n        //\n        // fetchOrder (private)\n        //\n        //     {\n        //         \"transaction_date\": \"1572497603902030\",\n        //         \"price\": \"8601000\",\n        //         \"units\": \"0.005\",\n        //         \"fee_currency\": \"KRW\",\n        //         \"fee\": \"107.51\",\n        //         \"total\": \"43005\"\n        //     }\n        //\n        // a workaround for their bug in date format, hours are not 0-padded\n        let timestamp = undefined;\n        const transactionDatetime = this.safeString (trade, 'transaction_date');\n        if (transactionDatetime !== undefined) {\n            const parts = transactionDatetime.split (' ');\n            const numParts = parts.length;\n            if (numParts > 1) {\n                const transactionDate = parts[0];\n                let transactionTime = parts[1];\n                if (transactionTime.length < 8) {\n                    transactionTime = '0' + transactionTime;\n                }\n                timestamp = this.parse8601 (transactionDate + ' ' + transactionTime);\n            } else {\n                timestamp = this.safeIntegerProduct (trade, 'transaction_date', 0.001);\n            }\n        }\n        if (timestamp !== undefined) {\n            timestamp -= 9 * 3600000; // they report UTC + 9 hours, server in Korean timezone\n        }\n        const type = undefined;\n        let side = this.safeString (trade, 'type');\n        side = (side === 'ask') ? 'sell' : 'buy';\n        const id = this.safeString (trade, 'cont_no');\n        market = this.safeMarket (undefined, market);\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.fixCommaNumber (this.safeString2 (trade, 'units_traded', 'units'));\n        const costString = this.safeString (trade, 'total');\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fee_currency');\n            const feeCurrencyCode = this.commonCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': undefined,\n            'type': type,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1185,
        "line_end": 1214,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{ \"status\" : \"0000\"}"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     { \"status\" : \"0000\"}\n        //\n        currency = this.safeCurrency (undefined, currency);\n        return {\n            'id': undefined,\n            'txid': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'amount': undefined,\n            'type': undefined,\n            'currency': currency['code'],\n            'status': undefined,\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'info': transaction,\n        } as Transaction;\n    }"
      }
    ],
    "bitmart": [
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 2381,
        "line_end": 2390,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString (entry, 'frozen');\n        account['free'] = this.safeString (entry, 'available');\n        account['total'] = this.safeString (entry, 'total_asset');\n        const debt = this.safeString (entry, 'borrow_unpaid');\n        const interest = this.safeString (entry, 'interest_unpaid');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 4610,
        "line_end": 4637,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'currency'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest_amount')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'hourly_interest')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'borrow_amount')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"borrow_id\": \"1657664327844Lk5eJJugXmdHHZoe\",\n         \"symbol\": \"BTC_USDT\",\n         \"currency\": \"USDT\",\n         \"borrow_amount\": \"20.00000000\",\n         \"daily_interest\": \"0.00055000\",\n         \"hourly_interest\": \"0.00002291\",\n         \"interest_amount\": \"0.00045833\",\n         \"create_time\": 1657664329000\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        //     {\n        //         \"borrow_id\": \"1657664327844Lk5eJJugXmdHHZoe\",\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"currency\": \"USDT\",\n        //         \"borrow_amount\": \"20.00000000\",\n        //         \"daily_interest\": \"0.00055000\",\n        //         \"hourly_interest\": \"0.00002291\",\n        //         \"interest_amount\": \"0.00045833\",\n        //         \"create_time\": 1657664329000\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (info, 'create_time');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'currency')),\n            'interest': this.safeNumber (info, 'interest_amount'),\n            'interestRate': this.safeNumber (info, 'hourly_interest'),\n            'amountBorrowed': this.safeNumber (info, 'borrow_amount'),\n            'marginMode': 'isolated',\n            'timestamp': timestamp,  // borrow creation time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency = undefined): DepositAddress",
        "line_start": 3747,
        "line_end": 3788,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (network)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString2 (depositAddress, 'address_memo', 'memo')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        currency: 'ETH',\n        chain: 'Ethereum',\n        address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',\n        address_memo: ''\n    }",
          "{\n         \"currency\": \"ETH\",\n         \"network\": \"ETH\",\n         \"address\": \"0x1121\",\n         \"memo\": \"12\",\n         \"remark\": \"12\",\n         \"addressType\": 0,\n         \"verifyStatus\": 0\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency = undefined): DepositAddress {\n        //\n        // fetchDepositAddress\n        //    {\n        //        currency: 'ETH',\n        //        chain: 'Ethereum',\n        //        address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',\n        //        address_memo: ''\n        //    }\n        //\n        // fetchWithdrawAddress\n        //     {\n        //         \"currency\": \"ETH\",\n        //         \"network\": \"ETH\",\n        //         \"address\": \"0x1121\",\n        //         \"memo\": \"12\",\n        //         \"remark\": \"12\",\n        //         \"addressType\": 0,\n        //         \"verifyStatus\": 0\n        //     }\n        //\n        let currencyId = this.safeString (depositAddress, 'currency');\n        let network = this.safeString2 (depositAddress, 'chain', 'network');\n        if (currencyId.indexOf ('NFT') < 0) {\n            const parts = currencyId.split ('-');\n            currencyId = this.safeString (parts, 0);\n            const secondPart = this.safeString (parts, 1);\n            if (secondPart !== undefined) {\n                network = secondPart;\n            }\n        }\n        const address = this.safeString (depositAddress, 'address');\n        currency = this.safeCurrency (currencyId, currency);\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeString (currency, 'code'),\n            'network': this.networkIdToCode (network),\n            'address': address,\n            'tag': this.safeString2 (depositAddress, 'address_memo', 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 1370,
        "line_end": 1391,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': this.safeNumber (fee, 'withdraw_fee'),\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"today_available_withdraw_BTC\": \"100.0000\",\n        \"min_withdraw\": \"0.005\",\n        \"withdraw_precision\": \"8\",\n        \"withdraw_fee\": \"0.000500000000000000000000000000\"\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"today_available_withdraw_BTC\": \"100.0000\",\n        //        \"min_withdraw\": \"0.005\",\n        //        \"withdraw_precision\": \"8\",\n        //        \"withdraw_fee\": \"0.000500000000000000000000000000\"\n        //    }\n        //\n        return {\n            'info': fee,\n            'withdraw': {\n                'fee': this.safeNumber (fee, 'withdraw_fee'),\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n    }"
      },
      {
        "name": "parseFundingHistories",
        "signature": "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[]",
        "line_start": 5478,
        "line_end": 5486,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[] {\n        const result = [];\n        for (let i = 0; i < contracts.length; i++) {\n            const contract = contracts[i];\n            result.push (this.parseFundingHistory (contract, market));\n        }\n        const sorted = this.sortBy (result, 'timestamp');\n        return this.filterBySinceLimit (sorted, since, limit);\n    }"
      },
      {
        "name": "parseFundingHistory",
        "signature": "parseFundingHistory (contract, market: Market = undefined)",
        "line_start": 5452,
        "line_end": 5476,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (contract, 'tran_id')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (contract, 'amount')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": \"1734422402121\",\n         \"type\": \"Funding Fee\",\n         \"amount\": \"-0.00008253\",\n         \"asset\": \"USDT\",\n         \"symbol\": \"LTCUSDT\",\n         \"tran_id\": \"1734422402121\",\n         \"flow_type\": 3\n     }"
        ],
        "source": "parseFundingHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"time\": \"1734422402121\",\n        //         \"type\": \"Funding Fee\",\n        //         \"amount\": \"-0.00008253\",\n        //         \"asset\": \"USDT\",\n        //         \"symbol\": \"LTCUSDT\",\n        //         \"tran_id\": \"1734422402121\",\n        //         \"flow_type\": 3\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const currencyId = this.safeString (contract, 'asset');\n        const timestamp = this.safeInteger (contract, 'time');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (contract, 'tran_id'),\n            'amount': this.safeNumber (contract, 'amount'),\n        };\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 4826,
        "line_end": 4875,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber2 (contract, 'expected_rate', 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'nextFundingRate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "this.safeNumber (contract, 'rate_value')",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"expected_rate\": \"-0.0000238\",\n         \"rate_value\": \"0.000009601106\",\n         \"funding_time\": 1761292800000,\n         \"funding_upper_limit\": \"0.0375\",\n         \"funding_lower_limit\": \"-0.0375\",\n         \"timestamp\": 1761291544336\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"fundingRate\": \"0.0000561\",\n         \"fundingTime\": 1770978448000,\n         \"nextFundingRate\": \"-0.0000195\",\n         \"nextFundingTime\": 1770998400000,\n         \"funding_upper_limit\": \"0.0375\",\n         \"funding_lower_limit\": \"-0.0375\",\n         \"ts\": 1770978448970\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"expected_rate\": \"-0.0000238\",\n        //         \"rate_value\": \"0.000009601106\",\n        //         \"funding_time\": 1761292800000,\n        //         \"funding_upper_limit\": \"0.0375\",\n        //         \"funding_lower_limit\": \"-0.0375\",\n        //         \"timestamp\": 1761291544336\n        //     }\n        //\n        // watchFundingRates\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"fundingRate\": \"0.0000561\",\n        //         \"fundingTime\": 1770978448000,\n        //         \"nextFundingRate\": \"-0.0000195\",\n        //         \"nextFundingTime\": 1770998400000,\n        //         \"funding_upper_limit\": \"0.0375\",\n        //         \"funding_lower_limit\": \"-0.0375\",\n        //         \"ts\": 1770978448970\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const timestamp = this.safeInteger2 (contract, 'timestamp', 'ts');\n        const fundingTimestamp = this.safeInteger2 (contract, 'funding_time', 'fundingTime');\n        const nextFundingTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber2 (contract, 'expected_rate', 'fundingRate'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': this.safeNumber (contract, 'nextFundingRate'),\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': this.safeNumber (contract, 'rate_value'),\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 4259,
        "line_end": 4300,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeCurrencyCode (baseId)",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseData, 'hourly_interest')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeCurrencyCode (quoteId)",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteData, 'hourly_interest')",
            "comment": null
          },
          {
            "key": "period",
            "value": "3600000",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC_USDT\",\n         \"max_leverage\": \"5\",\n         \"symbol_enabled\": true,\n         \"base\": {\n             \"currency\": \"BTC\",\n             \"daily_interest\": \"0.00055000\",\n             \"hourly_interest\": \"0.00002291\",\n             \"max_borrow_amount\": \"2.00000000\",\n             \"min_borrow_amount\": \"0.00000001\",\n             \"borrowable_amount\": \"0.00670810\"\n         },\n         \"quote\": {\n             \"currency\": \"USDT\",\n             \"daily_interest\": \"0.00055000\",\n             \"hourly_interest\": \"0.00002291\",\n             \"max_borrow_amount\": \"50000.00000000\",\n             \"min_borrow_amount\": \"0.00000001\",\n             \"borrowable_amount\": \"135.12575038\"\n         }\n     }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"max_leverage\": \"5\",\n        //         \"symbol_enabled\": true,\n        //         \"base\": {\n        //             \"currency\": \"BTC\",\n        //             \"daily_interest\": \"0.00055000\",\n        //             \"hourly_interest\": \"0.00002291\",\n        //             \"max_borrow_amount\": \"2.00000000\",\n        //             \"min_borrow_amount\": \"0.00000001\",\n        //             \"borrowable_amount\": \"0.00670810\"\n        //         },\n        //         \"quote\": {\n        //             \"currency\": \"USDT\",\n        //             \"daily_interest\": \"0.00055000\",\n        //             \"hourly_interest\": \"0.00002291\",\n        //             \"max_borrow_amount\": \"50000.00000000\",\n        //             \"min_borrow_amount\": \"0.00000001\",\n        //             \"borrowable_amount\": \"135.12575038\"\n        //         }\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const baseData = this.safeDict (info, 'base', {});\n        const quoteData = this.safeDict (info, 'quote', {});\n        const baseId = this.safeString (baseData, 'currency');\n        const quoteId = this.safeString (quoteData, 'currency');\n        return {\n            'symbol': symbol,\n            'base': this.safeCurrencyCode (baseId),\n            'baseRate': this.safeNumber (baseData, 'hourly_interest'),\n            'quote': this.safeCurrencyCode (quoteId),\n            'quoteRate': this.safeNumber (quoteData, 'hourly_interest'),\n            'period': 3600000, // 1-Hour\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 5334,
        "line_end": 5375,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'tran_id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tradeId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": \"1734422402121\",\n         \"type\": \"Funding Fee\",\n         \"amount\": \"-0.00008253\",\n         \"asset\": \"USDT\",\n         \"symbol\": \"LTCUSDT\",\n         \"tran_id\": \"1734422402121\",\n         \"flow_type\": 3\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"time\": \"1734422402121\",\n        //         \"type\": \"Funding Fee\",\n        //         \"amount\": \"-0.00008253\",\n        //         \"asset\": \"USDT\",\n        //         \"symbol\": \"LTCUSDT\",\n        //         \"tran_id\": \"1734422402121\",\n        //         \"flow_type\": 3\n        //     }\n        //\n        let amount = this.safeString (item, 'amount');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'asset');\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'time');\n        const type = this.safeString (item, 'type');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'tran_id'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tradeId'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': currency['code'],\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 5377,
        "line_end": 5386,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'Commission Fee': 'fee',\n            'Funding Fee': 'fee',\n            'Realized PNL': 'trade',\n            'Transfer': 'transfer',\n            'Liquidation Clearance': 'settlement',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 5121,
        "line_end": 5158,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contractsString)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSizeString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (priceString)",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.parseNumber (baseValueString)",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (quoteValueString)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"231007865458273\",\n         \"client_order_id\": \"\",\n         \"price\": \"27407.9\",\n         \"size\": \"1\",\n         \"symbol\": \"BTCUSDT\",\n         \"state\": 4,\n         \"side\": 3,\n         \"type\": \"market\",\n         \"leverage\": \"10\",\n         \"open_type\": \"isolated\",\n         \"deal_avg_price\": \"27422.6\",\n         \"deal_size\": \"1\",\n         \"create_time\": 1696405864011,\n         \"update_time\": 1696405864045\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"order_id\": \"231007865458273\",\n        //         \"client_order_id\": \"\",\n        //         \"price\": \"27407.9\",\n        //         \"size\": \"1\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"state\": 4,\n        //         \"side\": 3,\n        //         \"type\": \"market\",\n        //         \"leverage\": \"10\",\n        //         \"open_type\": \"isolated\",\n        //         \"deal_avg_price\": \"27422.6\",\n        //         \"deal_size\": \"1\",\n        //         \"create_time\": 1696405864011,\n        //         \"update_time\": 1696405864045\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger (liquidation, 'update_time');\n        const contractsString = this.safeString (liquidation, 'deal_size');\n        const contractSizeString = this.safeString (market, 'contractSize');\n        const priceString = this.safeString (liquidation, 'deal_avg_price');\n        const baseValueString = Precise.stringMul (contractsString, contractSizeString);\n        const quoteValueString = Precise.stringMul (baseValueString, priceString);\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.parseNumber (contractsString),\n            'contractSize': this.parseNumber (contractSizeString),\n            'price': this.parseNumber (priceString),\n            'baseValue': this.parseNumber (baseValueString),\n            'quoteValue': this.parseNumber (quoteValueString),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 4180,
        "line_end": 4203,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (info, 'borrow_id', 'repay_id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"borrow_id\": \"629a7177a4ed4cf09869c6a4343b788c\",\n     }",
          "{\n         \"repay_id\": \"2afcc16d99bd4707818c5a355dc89bed\",\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        // borrowMargin\n        //\n        //     {\n        //         \"borrow_id\": \"629a7177a4ed4cf09869c6a4343b788c\",\n        //     }\n        //\n        // repayMargin\n        //\n        //     {\n        //         \"repay_id\": \"2afcc16d99bd4707818c5a355dc89bed\",\n        //     }\n        //\n        return {\n            'id': this.safeString2 (info, 'borrow_id', 'repay_id'),\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2027,
        "line_end": 2089,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        \"1699512060\", // timestamp\n        \"36746.49\", // open\n        \"36758.71\", // high\n        \"36736.13\", // low\n        \"36755.99\", // close\n        \"2.83965\", // base volume\n        \"104353.57\" // quote volume\n    ]",
          "{\n        \"low_price\": \"20090.3\",\n        \"high_price\": \"20095.5\",\n        \"open_price\": \"20092.6\",\n        \"close_price\": \"20091.4\",\n        \"volume\": \"8748\",\n        \"timestamp\": 1665002281\n    }",
          "[\n        1631056350, // timestamp\n        \"46532.83\", // open\n        \"46555.71\", // high\n        \"46511.41\", // low\n        \"46555.71\", // close\n        \"0.25\", // volume\n    ]",
          "{\n        \"symbol\":\"BTCUSDT\",\n        \"o\":\"146.24\",\n        \"h\":\"146.24\",\n        \"l\":\"146.24\",\n        \"c\":\"146.24\",\n        \"v\":\"146\"\n    }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // spot\n        //    [\n        //        \"1699512060\", // timestamp\n        //        \"36746.49\", // open\n        //        \"36758.71\", // high\n        //        \"36736.13\", // low\n        //        \"36755.99\", // close\n        //        \"2.83965\", // base volume\n        //        \"104353.57\" // quote volume\n        //    ]\n        //\n        // swap\n        //    {\n        //        \"low_price\": \"20090.3\",\n        //        \"high_price\": \"20095.5\",\n        //        \"open_price\": \"20092.6\",\n        //        \"close_price\": \"20091.4\",\n        //        \"volume\": \"8748\",\n        //        \"timestamp\": 1665002281\n        //    }\n        //\n        // ws\n        //    [\n        //        1631056350, // timestamp\n        //        \"46532.83\", // open\n        //        \"46555.71\", // high\n        //        \"46511.41\", // low\n        //        \"46555.71\", // close\n        //        \"0.25\", // volume\n        //    ]\n        //\n        // ws swap\n        //    {\n        //        \"symbol\":\"BTCUSDT\",\n        //        \"o\":\"146.24\",\n        //        \"h\":\"146.24\",\n        //        \"l\":\"146.24\",\n        //        \"c\":\"146.24\",\n        //        \"v\":\"146\"\n        //    }\n        //\n        if (Array.isArray (ohlcv)) {\n            return [\n                this.safeTimestamp (ohlcv, 0),\n                this.safeNumber (ohlcv, 1),\n                this.safeNumber (ohlcv, 2),\n                this.safeNumber (ohlcv, 3),\n                this.safeNumber (ohlcv, 4),\n                this.safeNumber (ohlcv, 5),\n            ];\n        } else {\n            return [\n                this.safeTimestamp2 (ohlcv, 'timestamp', 'ts'),\n                this.safeNumber2 (ohlcv, 'open_price', 'o'),\n                this.safeNumber2 (ohlcv, 'high_price', 'h'),\n                this.safeNumber2 (ohlcv, 'low_price', 'l'),\n                this.safeNumber2 (ohlcv, 'close_price', 'c'),\n                this.safeNumber2 (ohlcv, 'volume', 'v'),\n            ];\n        }\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 4675,
        "line_end": 4694,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id, market)",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber (interest, 'open_interest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "this.safeNumber (interest, 'open_interest_value')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"timestamp\": 1694657502415,\n         \"symbol\": \"BTCUSDT\",\n         \"open_interest\": \"265231.721368593081729069\",\n         \"open_interest_value\": \"7006353.83988919\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"timestamp\": 1694657502415,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"open_interest\": \"265231.721368593081729069\",\n        //         \"open_interest_value\": \"7006353.83988919\"\n        //     }\n        //\n        const timestamp = this.safeInteger (interest, 'timestamp');\n        const id = this.safeString (interest, 'symbol');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id, market),\n            'openInterestAmount': this.safeNumber (interest, 'open_interest'),\n            'openInterestValue': this.safeNumber (interest, 'open_interest_value'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2577,
        "line_end": 2704,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString2 (order, 'client_order_id', 'clientOrderId')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'update_time')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parseOrderSide (this.safeString (order, 'side'))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.omitZero (priceString)",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "trailingActivationPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.omitZero (this.safeString (order, 'size'))",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (order, 'filled_notional', 'filledNotional')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeStringN (order, [ 'price_avg', 'priceAvg', 'deal_avg_price' ])",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeStringN (order, [ 'filled_size', 'filledSize', 'deal_size' ])",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatusByType (orderType, this.safeString2 (order, 'status', 'state'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": 2707217580\n     }",
          "\"data\": {\n       \"order_id\": 231116359426639,\n       \"price\": \"market price\"\n    },",
          "{\n         \"order_id\":1736871726781,\n         \"symbol\":\"BTC_USDT\",\n         \"create_time\":1591096004000,\n         \"side\":\"sell\",\n         \"type\":\"market\", // limit, market, limit_maker, ioc\n         \"price\":\"0.00\",\n         \"price_avg\":\"0.00\",\n         \"size\":\"0.02000\",\n         \"notional\":\"0.00000000\",\n         \"filled_notional\":\"0.00000000\",\n         \"filled_size\":\"0.00000\",\n         \"status\":\"8\"\n     }",
          "{\n        \"orderId\" : \"118100034543076010\",\n        \"clientOrderId\" : \"118100034543076010\",\n        \"symbol\" : \"BTC_USDT\",\n        \"side\" : \"buy\",\n        \"orderMode\" : \"spot\",\n        \"type\" : \"limit\",\n        \"state\" : \"filled\",\n        \"price\" : \"48800.00\",\n        \"priceAvg\" : \"39999.00\",\n        \"size\" : \"0.10000\",\n        \"filledSize\" : \"0.10000\",\n        \"notional\" : \"4880.00000000\",\n        \"filledNotional\" : \"3999.90000000\",\n        \"createTime\" : 1681701557927,\n        \"updateTime\" : 1681701559408\n    }",
          "{\n         \"order_id\": \"230935812485489\",\n         \"client_order_id\": \"\",\n         \"price\": \"24000\",\n         \"size\": \"1\",\n         \"symbol\": \"BTCUSDT\",\n         \"state\": 2,\n         \"side\": 1,\n         \"type\": \"limit\",\n         \"leverage\": \"10\",\n         \"open_type\": \"isolated\",\n         \"deal_avg_price\": \"0\",\n         \"deal_size\": \"0\",\n         \"create_time\": 1695702258629,\n         \"update_time\": 1695702258642,\n         \"activation_price_type\": 0,\n         \"activation_price\": \"\",\n         \"callback_rate\": \"\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, editOrder\n        //\n        //     {\n        //         \"order_id\": 2707217580\n        //     }\n        //\n        // swap\n        //   \"data\": {\n        //       \"order_id\": 231116359426639,\n        //       \"price\": \"market price\"\n        //    },\n        //\n        // cancelOrder\n        //\n        //     \"2707217580\" // order id\n        //\n        // spot fetchOrder, fetchOrdersByStatus, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"order_id\":1736871726781,\n        //         \"symbol\":\"BTC_USDT\",\n        //         \"create_time\":1591096004000,\n        //         \"side\":\"sell\",\n        //         \"type\":\"market\", // limit, market, limit_maker, ioc\n        //         \"price\":\"0.00\",\n        //         \"price_avg\":\"0.00\",\n        //         \"size\":\"0.02000\",\n        //         \"notional\":\"0.00000000\",\n        //         \"filled_notional\":\"0.00000000\",\n        //         \"filled_size\":\"0.00000\",\n        //         \"status\":\"8\"\n        //     }\n        //\n        // spot v4\n        //    {\n        //        \"orderId\" : \"118100034543076010\",\n        //        \"clientOrderId\" : \"118100034543076010\",\n        //        \"symbol\" : \"BTC_USDT\",\n        //        \"side\" : \"buy\",\n        //        \"orderMode\" : \"spot\",\n        //        \"type\" : \"limit\",\n        //        \"state\" : \"filled\",\n        //        \"price\" : \"48800.00\",\n        //        \"priceAvg\" : \"39999.00\",\n        //        \"size\" : \"0.10000\",\n        //        \"filledSize\" : \"0.10000\",\n        //        \"notional\" : \"4880.00000000\",\n        //        \"filledNotional\" : \"3999.90000000\",\n        //        \"createTime\" : 1681701557927,\n        //        \"updateTime\" : 1681701559408\n        //    }\n        //\n        // swap: fetchOrder, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"order_id\": \"230935812485489\",\n        //         \"client_order_id\": \"\",\n        //         \"price\": \"24000\",\n        //         \"size\": \"1\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"state\": 2,\n        //         \"side\": 1,\n        //         \"type\": \"limit\",\n        //         \"leverage\": \"10\",\n        //         \"open_type\": \"isolated\",\n        //         \"deal_avg_price\": \"0\",\n        //         \"deal_size\": \"0\",\n        //         \"create_time\": 1695702258629,\n        //         \"update_time\": 1695702258642,\n        //         \"activation_price_type\": 0,\n        //         \"activation_price\": \"\",\n        //         \"callback_rate\": \"\"\n        //     }\n        //\n        let id = undefined;\n        if (typeof order === 'string') {\n            id = order;\n            order = {};\n        }\n        id = this.safeString2 (order, 'order_id', 'orderId', id);\n        const timestamp = this.safeInteger2 (order, 'create_time', 'createTime');\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        market = this.safeMarket (symbol, market);\n        const orderType = this.safeString (market, 'type', 'spot');\n        let type = this.safeString (order, 'type');\n        let timeInForce = undefined;\n        let postOnly = undefined;\n        if (type === 'limit_maker') {\n            type = 'limit';\n            postOnly = true;\n            timeInForce = 'PO';\n        }\n        if (type === 'ioc') {\n            type = 'limit';\n            timeInForce = 'IOC';\n        }\n        let priceString = this.safeString (order, 'price');\n        if (priceString === 'market price') {\n            priceString = undefined;\n        }\n        const trailingActivationPrice = this.safeNumber (order, 'activation_price');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': this.safeString2 (order, 'client_order_id', 'clientOrderId'),\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.safeInteger (order, 'update_time'),\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': this.parseOrderSide (this.safeString (order, 'side')),\n            'price': this.omitZero (priceString),\n            'triggerPrice': trailingActivationPrice,\n            'amount': this.omitZero (this.safeString (order, 'size')),\n            'cost': this.safeString2 (order, 'filled_notional', 'filledNotional'),\n            'average': this.safeStringN (order, [ 'price_avg', 'priceAvg', 'deal_avg_price' ]),\n            'filled': this.safeStringN (order, [ 'filled_size', 'filledSize', 'deal_size' ]),\n            'remaining': undefined,\n            'status': this.parseOrderStatusByType (orderType, this.safeString2 (order, 'status', 'state')),\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (side)",
        "line_start": 2706,
        "line_end": 2714,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSide (side) {\n        const sides: Dict = {\n            '1': 'buy',\n            '2': 'buy',\n            '3': 'sell',\n            '4': 'sell',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseOrderStatusByType",
        "signature": "parseOrderStatusByType (type, status)",
        "line_start": 2716,
        "line_end": 2740,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatusByType (type, status) {\n        const statusesByType: Dict = {\n            'spot': {\n                '1': 'rejected', // Order failure\n                '2': 'open', // Placing order\n                '3': 'rejected', // Order failure, Freeze failure\n                '4': 'open', // Order success, Pending for fulfilment\n                '5': 'open', // Partially filled\n                '6': 'closed', // Fully filled\n                '7': 'canceled', // Canceling\n                '8': 'canceled', // Canceled\n                'new': 'open',\n                'partially_filled': 'open',\n                'filled': 'closed',\n                'partially_canceled': 'canceled',\n            },\n            'swap': {\n                '1': 'open', // Submitting\n                '2': 'open', // Commissioned\n                '4': 'closed', // Completed\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 4990,
        "line_end": 5053,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "(side === 1) ? 'long' : 'short'",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'current_amount')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entry_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateral)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMargin)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceMarginPercentage)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealized_value')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realized_value')",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.parseNumber (marginRatio)",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"leverage\": \"10\",\n         \"timestamp\": 1696392515269,\n         \"current_fee\": \"0.0014250028\",\n         \"open_timestamp\": 1696392256998,\n         \"current_value\": \"27.4039\",\n         \"mark_price\": \"27.4039\",\n         \"position_value\": \"27.4079\",\n         \"position_cross\": \"3.75723474\",\n         \"maintenance_margin\": \"0.1370395\",\n         \"close_vol\": \"0\",\n         \"close_avg_price\": \"0\",\n         \"open_avg_price\": \"27407.9\",\n         \"entry_price\": \"27407.9\",\n         \"current_amount\": \"1\",\n         \"unrealized_value\": \"-0.004\",\n         \"realized_value\": \"-0.01644474\",\n         \"position_type\": 1\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"leverage\": \"10\",\n        //         \"timestamp\": 1696392515269,\n        //         \"current_fee\": \"0.0014250028\",\n        //         \"open_timestamp\": 1696392256998,\n        //         \"current_value\": \"27.4039\",\n        //         \"mark_price\": \"27.4039\",\n        //         \"position_value\": \"27.4079\",\n        //         \"position_cross\": \"3.75723474\",\n        //         \"maintenance_margin\": \"0.1370395\",\n        //         \"close_vol\": \"0\",\n        //         \"close_avg_price\": \"0\",\n        //         \"open_avg_price\": \"27407.9\",\n        //         \"entry_price\": \"27407.9\",\n        //         \"current_amount\": \"1\",\n        //         \"unrealized_value\": \"-0.004\",\n        //         \"realized_value\": \"-0.01644474\",\n        //         \"position_type\": 1\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (position, 'timestamp');\n        const side = this.safeInteger (position, 'position_type');\n        const maintenanceMargin = this.safeString (position, 'maintenance_margin');\n        const notional = this.safeString (position, 'current_value');\n        const collateral = this.safeString (position, 'position_cross');\n        const maintenanceMarginPercentage = Precise.stringDiv (maintenanceMargin, notional);\n        const marginRatio = Precise.stringDiv (maintenanceMargin, collateral);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'hedged': undefined,\n            'side': (side === 1) ? 'long' : 'short',\n            'contracts': this.safeNumber (position, 'current_amount'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'entryPrice': this.safeNumber (position, 'entry_price'),\n            'markPrice': this.safeNumber (position, 'mark_price'),\n            'lastPrice': undefined,\n            'notional': this.parseNumber (notional),\n            'leverage': this.safeNumber (position, 'leverage'),\n            'collateral': this.parseNumber (collateral),\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': this.parseNumber (maintenanceMargin),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceMarginPercentage),\n            'unrealizedPnl': this.safeNumber (position, 'unrealized_value'),\n            'realizedPnl': this.safeNumber (position, 'realized_value'),\n            'liquidationPrice': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n            'marginRatio': this.parseNumber (marginRatio),\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1428,
        "line_end": 1587,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'index_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         'result': [\n             \"AFIN_USDT\",     // symbol\n             \"0.001047\",      // last\n             \"11110\",         // v_24h\n             \"11.632170\",     // qv_24h\n             \"0.001048\",      // open_24h\n             \"0.001048\",      // high_24h\n             \"0.001047\",      // low_24h\n             \"-0.00095\",      // price_change_24h\n             \"0.001029\",      // bid_px\n             \"5555\",          // bid_sz\n             \"0.001041\",      // ask_px\n             \"5297\",          // ask_sz\n             \"1717122550482\"  // timestamp\n         ]\n     }",
          "{\n         \"symbol\": \"BTC_USDT\",\n         \"last\": \"68500.00\",\n         \"v_24h\": \"10491.65490\",\n         \"qv_24h\": \"717178990.42\",\n         \"open_24h\": \"68149.75\",\n         \"high_24h\": \"69499.99\",\n         \"low_24h\": \"67132.40\",\n         \"fluctuation\": \"0.00514\",\n         \"bid_px\": \"68500\",\n         \"bid_sz\": \"0.00162\",\n         \"ask_px\": \"68500.01\",\n         \"ask_sz\": \"0.01722\",\n         \"ts\": \"1717131391671\"\n     }",
          "{\n          \"symbol\":\"BTC_USDT\",\n          \"last_price\":\"146.24\",\n          \"open_24h\":\"147.17\",\n          \"high_24h\":\"147.48\",\n          \"low_24h\":\"143.88\",\n          \"base_volume_24h\":\"117387.58\", // NOT base, but quote currency!!!\n          \"s_t\": 1610936002\n      }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"product_type\": 1,\n         \"open_timestamp\": 1645977600000,\n         \"expire_timestamp\": 0,\n         \"settle_timestamp\": 0,\n         \"base_currency\": \"BTC\",\n         \"quote_currency\": \"USDT\",\n         \"last_price\": \"63547.4\",\n         \"volume_24h\": \"110938430\",\n         \"turnover_24h\": \"7004836342.6944\",\n         \"index_price\": \"63587.85404255\",\n         \"index_name\": \"BTCUSDT\",\n         \"contract_size\": \"0.001\",\n         \"min_leverage\": \"1\",\n         \"max_leverage\": \"100\",\n         \"price_precision\": \"0.1\",\n         \"vol_precision\": \"1\",\n         \"max_volume\": \"1000000\",\n         \"min_volume\": \"1\",\n         \"funding_rate\": \"0.0000801\",\n         \"expected_funding_rate\": \"-0.0000035\",\n         \"open_interest\": \"278214\",\n         \"open_interest_value\": \"17555316.9355496\",\n         \"high_24h\": \"64109.4\",\n         \"low_24h\": \"61857.6\",\n         \"change_24h\": \"0.0239264900886327\",\n         \"funding_time\": 1726819200000\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot (REST) fetchTickers\n        //\n        //     {\n        //         'result': [\n        //             \"AFIN_USDT\",     // symbol\n        //             \"0.001047\",      // last\n        //             \"11110\",         // v_24h\n        //             \"11.632170\",     // qv_24h\n        //             \"0.001048\",      // open_24h\n        //             \"0.001048\",      // high_24h\n        //             \"0.001047\",      // low_24h\n        //             \"-0.00095\",      // price_change_24h\n        //             \"0.001029\",      // bid_px\n        //             \"5555\",          // bid_sz\n        //             \"0.001041\",      // ask_px\n        //             \"5297\",          // ask_sz\n        //             \"1717122550482\"  // timestamp\n        //         ]\n        //     }\n        //\n        // spot (REST) fetchTicker\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"last\": \"68500.00\",\n        //         \"v_24h\": \"10491.65490\",\n        //         \"qv_24h\": \"717178990.42\",\n        //         \"open_24h\": \"68149.75\",\n        //         \"high_24h\": \"69499.99\",\n        //         \"low_24h\": \"67132.40\",\n        //         \"fluctuation\": \"0.00514\",\n        //         \"bid_px\": \"68500\",\n        //         \"bid_sz\": \"0.00162\",\n        //         \"ask_px\": \"68500.01\",\n        //         \"ask_sz\": \"0.01722\",\n        //         \"ts\": \"1717131391671\"\n        //     }\n        //\n        // spot (WS)\n        //\n        //      {\n        //          \"symbol\":\"BTC_USDT\",\n        //          \"last_price\":\"146.24\",\n        //          \"open_24h\":\"147.17\",\n        //          \"high_24h\":\"147.48\",\n        //          \"low_24h\":\"143.88\",\n        //          \"base_volume_24h\":\"117387.58\", // NOT base, but quote currency!!!\n        //          \"s_t\": 1610936002\n        //      }\n        //\n        // swap\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"product_type\": 1,\n        //         \"open_timestamp\": 1645977600000,\n        //         \"expire_timestamp\": 0,\n        //         \"settle_timestamp\": 0,\n        //         \"base_currency\": \"BTC\",\n        //         \"quote_currency\": \"USDT\",\n        //         \"last_price\": \"63547.4\",\n        //         \"volume_24h\": \"110938430\",\n        //         \"turnover_24h\": \"7004836342.6944\",\n        //         \"index_price\": \"63587.85404255\",\n        //         \"index_name\": \"BTCUSDT\",\n        //         \"contract_size\": \"0.001\",\n        //         \"min_leverage\": \"1\",\n        //         \"max_leverage\": \"100\",\n        //         \"price_precision\": \"0.1\",\n        //         \"vol_precision\": \"1\",\n        //         \"max_volume\": \"1000000\",\n        //         \"min_volume\": \"1\",\n        //         \"funding_rate\": \"0.0000801\",\n        //         \"expected_funding_rate\": \"-0.0000035\",\n        //         \"open_interest\": \"278214\",\n        //         \"open_interest_value\": \"17555316.9355496\",\n        //         \"high_24h\": \"64109.4\",\n        //         \"low_24h\": \"61857.6\",\n        //         \"change_24h\": \"0.0239264900886327\",\n        //         \"funding_time\": 1726819200000\n        //     }\n        //\n        const result = this.safeList (ticker, 'result', []);\n        const average = this.safeString2 (ticker, 'avg_price', 'index_price');\n        let marketId = this.safeString2 (ticker, 'symbol', 'contract_symbol');\n        let timestamp = this.safeInteger2 (ticker, 'timestamp', 'ts');\n        let last = this.safeString2 (ticker, 'last_price', 'last');\n        let percentage = this.safeString2 (ticker, 'price_change_percent_24h', 'change_24h');\n        let change = this.safeString (ticker, 'fluctuation');\n        let high = this.safeString2 (ticker, 'high_24h', 'high_price');\n        let low = this.safeString2 (ticker, 'low_24h', 'low_price');\n        let bid = this.safeString2 (ticker, 'best_bid', 'bid_px');\n        let bidVolume = this.safeString2 (ticker, 'best_bid_size', 'bid_sz');\n        let ask = this.safeString2 (ticker, 'best_ask', 'ask_px');\n        let askVolume = this.safeString2 (ticker, 'best_ask_size', 'ask_sz');\n        let open = this.safeString (ticker, 'open_24h');\n        let baseVolume = this.safeStringN (ticker, [ 'base_volume_24h', 'v_24h', 'volume_24h' ]);\n        let quoteVolume = this.safeStringLowerN (ticker, [ 'quote_volume_24h', 'qv_24h', 'turnover_24h' ]);\n        const listMarketId = this.safeString (result, 0);\n        if (listMarketId !== undefined) {\n            marketId = listMarketId;\n            timestamp = this.safeInteger (result, 12);\n            high = this.safeString (result, 5);\n            low = this.safeString (result, 6);\n            bid = this.safeString (result, 8);\n            bidVolume = this.safeString (result, 9);\n            ask = this.safeString (result, 10);\n            askVolume = this.safeString (result, 11);\n            open = this.safeString (result, 4);\n            last = this.safeString (result, 1);\n            change = this.safeString (result, 7);\n            baseVolume = this.safeString (result, 2);\n            quoteVolume = this.safeStringLower (result, 3);\n        }\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        if (timestamp === undefined) {\n            // ticker from WS has a different field (in seconds)\n            timestamp = this.safeIntegerProduct (ticker, 's_t', 1000);\n        }\n        if (percentage === undefined) {\n            percentage = Precise.stringMul (change, '100');\n        }\n        if (quoteVolume === undefined) {\n            if (baseVolume === undefined) {\n                // this is swap\n                quoteVolume = this.safeString (ticker, 'volume_24h', quoteVolume);\n            } else {\n                // this is a ticker from websockets\n                // contrary to name and documentation, base_volume_24h is actually the quote volume\n                quoteVolume = baseVolume;\n                baseVolume = undefined;\n            }\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': average,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'indexPrice': this.safeString (ticker, 'index_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1877,
        "line_end": 1981,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 'tradeId', 'trade_id', 'lastTradeID' ])",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString2 (trade, 'orderId', 'order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeStringN (trade, [ 'price', 'fillPrice', 2 ])",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeStringLower2 (trade, 'tradeRole', 'exec_type')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "[\n         \"BTC_USDT\",      // symbol\n         \"1717212457302\", // timestamp\n         \"67643.11\",      // price\n         \"0.00106\",       // size\n         \"sell\"           // side\n     ]",
          "{\n        \"tradeId\":\"182342999769370687\",\n        \"orderId\":\"183270218784142990\",\n        \"clientOrderId\":\"183270218784142990\",\n        \"symbol\":\"ADA_USDT\",\n        \"side\":\"buy\",\n        \"orderMode\":\"spot\",\n        \"type\":\"market\",\n        \"price\":\"0.245948\",\n        \"size\":\"20.71\",\n        \"notional\":\"5.09358308\",\n        \"fee\":\"0.00509358\",\n        \"feeCoinName\":\"USDT\",\n        \"tradeRole\":\"taker\",\n        \"createTime\":1695658457836,\n    }",
          "{\n        \"order_id\": \"230930336848609\",\n        \"trade_id\": \"6212604014\",\n        \"symbol\": \"BTCUSDT\",\n        \"side\": 3,\n        \"price\": \"26910.4\",\n        \"vol\": \"1\",\n        \"exec_type\": \"Taker\",\n        \"profit\": false,\n        \"create_time\": 1695961596692,\n        \"realised_profit\": \"-0.0003\",\n        \"paid_fees\": \"0.01614624\"\n    }",
          "{\n        'fee': '-0.000044502',\n        'feeCcy': 'USDT',\n        'fillPrice': '74.17',\n        'fillQty': '1',\n        'lastTradeID': 6802340762\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades spot ( amount = count * price )\n        //\n        //     [\n        //         \"BTC_USDT\",      // symbol\n        //         \"1717212457302\", // timestamp\n        //         \"67643.11\",      // price\n        //         \"0.00106\",       // size\n        //         \"sell\"           // side\n        //     ]\n        //\n        // spot: fetchMyTrades\n        //\n        //    {\n        //        \"tradeId\":\"182342999769370687\",\n        //        \"orderId\":\"183270218784142990\",\n        //        \"clientOrderId\":\"183270218784142990\",\n        //        \"symbol\":\"ADA_USDT\",\n        //        \"side\":\"buy\",\n        //        \"orderMode\":\"spot\",\n        //        \"type\":\"market\",\n        //        \"price\":\"0.245948\",\n        //        \"size\":\"20.71\",\n        //        \"notional\":\"5.09358308\",\n        //        \"fee\":\"0.00509358\",\n        //        \"feeCoinName\":\"USDT\",\n        //        \"tradeRole\":\"taker\",\n        //        \"createTime\":1695658457836,\n        //    }\n        //\n        // swap: fetchMyTrades\n        //\n        //    {\n        //        \"order_id\": \"230930336848609\",\n        //        \"trade_id\": \"6212604014\",\n        //        \"symbol\": \"BTCUSDT\",\n        //        \"side\": 3,\n        //        \"price\": \"26910.4\",\n        //        \"vol\": \"1\",\n        //        \"exec_type\": \"Taker\",\n        //        \"profit\": false,\n        //        \"create_time\": 1695961596692,\n        //        \"realised_profit\": \"-0.0003\",\n        //        \"paid_fees\": \"0.01614624\"\n        //    }\n        //\n        // ws swap\n        //\n        //    {\n        //        'fee': '-0.000044502',\n        //        'feeCcy': 'USDT',\n        //        'fillPrice': '74.17',\n        //        'fillQty': '1',\n        //        'lastTradeID': 6802340762\n        //    }\n        //\n        const timestamp = this.safeIntegerN (trade, [ 'createTime', 'create_time', 1 ]);\n        const isPublic = this.safeString (trade, 0);\n        const isPublicTrade = (isPublic !== undefined);\n        let amount = undefined;\n        let cost = undefined;\n        let type = undefined;\n        let side = undefined;\n        if (isPublicTrade) {\n            amount = this.safeString2 (trade, 'count', 3);\n            cost = this.safeString (trade, 'amount');\n            side = this.safeString2 (trade, 'type', 4);\n        } else {\n            amount = this.safeStringN (trade, [ 'size', 'vol', 'fillQty' ]);\n            cost = this.safeString (trade, 'notional');\n            type = this.safeString (trade, 'type');\n            side = this.parseOrderSide (this.safeString (trade, 'side'));\n        }\n        const marketId = this.safeString2 (trade, 'symbol', 0);\n        market = this.safeMarket (marketId, market);\n        const feeCostString = this.safeString2 (trade, 'fee', 'paid_fees');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'feeCoinName');\n            let feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            if (feeCurrencyCode === undefined) {\n                feeCurrencyCode = (side === 'buy') ? market['base'] : market['quote'];\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeStringN (trade, [ 'tradeId', 'trade_id', 'lastTradeID' ]),\n            'order': this.safeString2 (trade, 'orderId', 'order_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': type,\n            'side': side,\n            'price': this.safeStringN (trade, [ 'price', 'fillPrice', 2 ]),\n            'amount': amount,\n            'cost': cost,\n            'takerOrMaker': this.safeStringLower2 (trade, 'tradeRole', 'exec_type'),\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 2522,
        "line_end": 2540,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'maker_fee_rate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'taker_fee_rate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH_USDT\",\n         \"taker_fee_rate\": \"0.0025\",\n         \"maker_fee_rate\": \"0.0025\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\": \"ETH_USDT\",\n        //         \"taker_fee_rate\": \"0.0025\",\n        //         \"maker_fee_rate\": \"0.0025\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'maker_fee_rate'),\n            'taker': this.safeNumber (fee, 'taker_fee_rate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4019,
        "line_end": 4100,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "(timestamp !== 0) ? timestamp : undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "(timestamp !== 0) ? this.iso8601 (timestamp) : undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"withdraw_id\": \"121212\"\n     }",
          "{\n         \"withdraw_id\":\"1679952\",\n         \"deposit_id\":\"\",\n         \"operation_type\":\"withdraw\",\n         \"currency\":\"BMX\",\n         \"apply_time\":1588867374000,\n         \"arrival_amount\":\"59.000000000000\",\n         \"fee\":\"1.000000000000\",\n         \"status\":0,\n         \"address\":\"0xe57b69a8776b37860407965B73cdFFBDFe668Bb5\",\n         \"address_memo\":\"\",\n         \"tx_id\":\"\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"withdraw_id\": \"121212\"\n        //     }\n        //\n        // fetchDeposits, fetchWithdrawals, fetchWithdrawal\n        //\n        //     {\n        //         \"withdraw_id\":\"1679952\",\n        //         \"deposit_id\":\"\",\n        //         \"operation_type\":\"withdraw\",\n        //         \"currency\":\"BMX\",\n        //         \"apply_time\":1588867374000,\n        //         \"arrival_amount\":\"59.000000000000\",\n        //         \"fee\":\"1.000000000000\",\n        //         \"status\":0,\n        //         \"address\":\"0xe57b69a8776b37860407965B73cdFFBDFe668Bb5\",\n        //         \"address_memo\":\"\",\n        //         \"tx_id\":\"\"\n        //     }\n        //\n        let id = undefined;\n        const withdrawId = this.safeString (transaction, 'withdraw_id');\n        const depositId = this.safeString (transaction, 'deposit_id');\n        let type = undefined;\n        if ((withdrawId !== undefined) && (withdrawId !== '')) {\n            type = 'withdraw';\n            id = withdrawId;\n        } else if ((depositId !== undefined) && (depositId !== '')) {\n            type = 'deposit';\n            id = depositId;\n        }\n        const amount = this.safeNumber (transaction, 'arrival_amount');\n        const timestamp = this.safeInteger (transaction, 'apply_time');\n        let currencyId = this.safeString (transaction, 'currency');\n        let networkId: Str = undefined;\n        if (currencyId !== undefined) {\n            if (currencyId.indexOf ('NFT') < 0) {\n                const parts = currencyId.split ('-');\n                currencyId = this.safeString (parts, 0);\n                networkId = this.safeString (parts, 1);\n            }\n        }\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        const txid = this.safeString (transaction, 'tx_id');\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'address_memo');\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': undefined,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'internal': undefined,\n            'comment': undefined,\n            'timestamp': (timestamp !== 0) ? timestamp : undefined,\n            'datetime': (timestamp !== 0) ? this.iso8601 (timestamp) : undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 4007,
        "line_end": 4017,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            '0': 'pending', // Create\n            '1': 'pending', // Submitted, waiting for withdrawal\n            '2': 'pending', // Processing\n            '3': 'ok', // Success\n            '4': 'canceled', // Cancel\n            '5': 'failed', // Fail\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 4451,
        "line_end": 4489,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'transfer_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.parseTransferFromAccount (this.safeString (transfer, 'type'))",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.parseTransferToAccount (this.safeString (transfer, 'type'))",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'state'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transfer_id\": \"ca90d97a621e47d49774f19af6b029f5\"\n     }",
          "{\n         \"currency\": \"USDT\",\n         \"amount\": \"5\"\n     }",
          "{\n         \"transfer_id\": \"902463535961567232\",\n         \"currency\": \"USDT\",\n         \"amount\": \"5\",\n         \"type\": \"contract_to_spot\",\n         \"state\": \"FINISHED\",\n         \"timestamp\": 1695330539565\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // margin\n        //\n        //     {\n        //         \"transfer_id\": \"ca90d97a621e47d49774f19af6b029f5\"\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"5\"\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"transfer_id\": \"902463535961567232\",\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"5\",\n        //         \"type\": \"contract_to_spot\",\n        //         \"state\": \"FINISHED\",\n        //         \"timestamp\": 1695330539565\n        //     }\n        //\n        const currencyId = this.safeString (transfer, 'currency');\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        return {\n            'id': this.safeString (transfer, 'transfer_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': this.parseTransferFromAccount (this.safeString (transfer, 'type')),\n            'toAccount': this.parseTransferToAccount (this.safeString (transfer, 'type')),\n            'status': this.parseTransferStatus (this.safeString (transfer, 'state')),\n        };\n    }"
      },
      {
        "name": "parseTransferFromAccount",
        "signature": "parseTransferFromAccount (type)",
        "line_start": 4443,
        "line_end": 4449,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferFromAccount (type) {\n        const types: Dict = {\n            'contract_to_spot': 'swap',\n            'spot_to_contract': 'spot',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 4426,
        "line_end": 4433,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            '1000': 'ok',\n            'OK': 'ok',\n            'FINISHED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransferToAccount",
        "signature": "parseTransferToAccount (type)",
        "line_start": 4435,
        "line_end": 4441,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferToAccount (type) {\n        const types: Dict = {\n            'contract_to_spot': 'spot',\n            'spot_to_contract': 'swap',\n        };\n        return this.safeString (types, type, type);\n    }"
      }
    ],
    "bitmex": [
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 3276,
        "line_end": 3404,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeInteger (info, 'deleveragePercentile')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"account\": 395724,\n         \"symbol\": \"XBTUSDT\",\n         \"strategy\": \"OneWay\",\n         \"currency\": \"USDt\",\n         \"underlying\": \"XBT\",\n         \"quoteCurrency\": \"USDT\",\n         \"commission\": 0.0005,\n         \"initMarginReq\": 0.01,\n         \"maintMarginReq\": 0.005,\n         \"riskLimit\": 1000000000000,\n         \"leverage\": 100,\n         \"crossMargin\": true,\n         \"deleveragePercentile\": 1,\n         \"rebalancedPnl\": -4319,\n         \"prevRealisedPnl\": 0,\n         \"prevUnrealisedPnl\": null,\n         \"openingQty\": null,\n         \"openOrderBuyQty\": 0,\n         \"openOrderBuyCost\": 0,\n         \"openOrderBuyPremium\": 0,\n         \"openOrderSellQty\": 0,\n         \"openOrderSellCost\": 0,\n         \"openOrderSellPremium\": 0,\n         \"currentQty\": 100,\n         \"currentCost\": 8639330,\n         \"currentComm\": 0,\n         \"realisedCost\": 0,\n         \"unrealisedCost\": 8639330,\n         \"grossOpenPremium\": 0,\n         \"isOpen\": true,\n         \"markPrice\": 88636.92,\n         \"markValue\": 8863692,\n         \"riskValue\": 8863692,\n         \"homeNotional\": 0.0001,\n         \"foreignNotional\": -8.863692,\n         \"posCost\": 8639330,\n         \"posCross\": 0,\n         \"posComm\": 0,\n         \"posLoss\": 0,\n         \"posMargin\": 44061,\n         \"posMaint\": 44061,\n         \"posInit\": 0,\n         \"initMargin\": 0,\n         \"maintMargin\": 44061,\n         \"realisedPnl\": 0,\n         \"unrealisedPnl\": 224362,\n         \"unrealisedPnlPcnt\": 0.026,\n         \"unrealisedRoePcnt\": 2.597,\n         \"avgCostPrice\": 86393.3,\n         \"avgEntryPrice\": 86393.3,\n         \"breakEvenPrice\": 86436.5,\n         \"marginCallPrice\": null,\n         \"liquidationPrice\": 0,\n         \"bankruptPrice\": 0,\n         \"timestamp\": \"2025-12-31T07:55:50.505Z\",\n         \"positionReport\": {\n             \"account\": 395724,\n             \"avgCostPrice\": 86393.3,\n             \"avgEntryPrice\": 86393.3,\n             \"bankruptPrice\": 0,\n             \"breakEvenPrice\": 86436.5,\n             \"commission\": 0.0005,\n             \"crossMargin\": true,\n             \"currency\": \"USDt\",\n             \"currentComm\": 0,\n             \"currentCost\": 8639330,\n             \"currentQty\": 100,\n             \"deleveragePercentile\": 1,\n             \"foreignNotional\": -8.863692,\n             \"grossOpenPremium\": 0,\n             \"homeNotional\": 0.0001,\n             \"initMargin\": 0,\n             \"initMarginReq\": 0.01,\n             \"isOpen\": true,\n             \"leverage\": 100,\n             \"liquidationPrice\": 0,\n             \"maintMargin\": 44061,\n             \"maintMarginReq\": 0.005,\n             \"markPrice\": 88636.92,\n             \"markValue\": 8863692,\n             \"openOrderBuyCost\": 0,\n             \"openOrderBuyPremium\": 0,\n             \"openOrderBuyQty\": 0,\n             \"openOrderRealisedPnl\": 0,\n             \"openOrderSellCost\": 0,\n             \"openOrderSellPremium\": 0,\n             \"openOrderSellQty\": 0,\n             \"posComm\": 0,\n             \"posCost\": 8639330,\n             \"posCross\": 0,\n             \"posInit\": 0,\n             \"posLoss\": 0,\n             \"posMaint\": 44061,\n             \"posMargin\": 44061,\n             \"prevRealisedPnl\": 0,\n             \"quoteCurrency\": \"USDT\",\n             \"realisedCost\": 0,\n             \"realisedPnl\": 0,\n             \"rebalancedPnl\": -4319,\n             \"riskLimit\": 1000000000000,\n             \"riskValue\": 8863692,\n             \"strategy\": \"OneWay\",\n             \"symbol\": \"XBTUSDT\",\n             \"timestamp\": \"2025-12-31T07:55:50.505Z\",\n             \"underlying\": \"XBT\",\n             \"unrealisedCost\": 8639330,\n             \"unrealisedPnl\": 224362,\n             \"unrealisedPnlPcnt\": 0.026,\n             \"unrealisedRoePcnt\": 2.597\n         }\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionsADLRank\n        //\n        //     {\n        //         \"account\": 395724,\n        //         \"symbol\": \"XBTUSDT\",\n        //         \"strategy\": \"OneWay\",\n        //         \"currency\": \"USDt\",\n        //         \"underlying\": \"XBT\",\n        //         \"quoteCurrency\": \"USDT\",\n        //         \"commission\": 0.0005,\n        //         \"initMarginReq\": 0.01,\n        //         \"maintMarginReq\": 0.005,\n        //         \"riskLimit\": 1000000000000,\n        //         \"leverage\": 100,\n        //         \"crossMargin\": true,\n        //         \"deleveragePercentile\": 1,\n        //         \"rebalancedPnl\": -4319,\n        //         \"prevRealisedPnl\": 0,\n        //         \"prevUnrealisedPnl\": null,\n        //         \"openingQty\": null,\n        //         \"openOrderBuyQty\": 0,\n        //         \"openOrderBuyCost\": 0,\n        //         \"openOrderBuyPremium\": 0,\n        //         \"openOrderSellQty\": 0,\n        //         \"openOrderSellCost\": 0,\n        //         \"openOrderSellPremium\": 0,\n        //         \"currentQty\": 100,\n        //         \"currentCost\": 8639330,\n        //         \"currentComm\": 0,\n        //         \"realisedCost\": 0,\n        //         \"unrealisedCost\": 8639330,\n        //         \"grossOpenPremium\": 0,\n        //         \"isOpen\": true,\n        //         \"markPrice\": 88636.92,\n        //         \"markValue\": 8863692,\n        //         \"riskValue\": 8863692,\n        //         \"homeNotional\": 0.0001,\n        //         \"foreignNotional\": -8.863692,\n        //         \"posCost\": 8639330,\n        //         \"posCross\": 0,\n        //         \"posComm\": 0,\n        //         \"posLoss\": 0,\n        //         \"posMargin\": 44061,\n        //         \"posMaint\": 44061,\n        //         \"posInit\": 0,\n        //         \"initMargin\": 0,\n        //         \"maintMargin\": 44061,\n        //         \"realisedPnl\": 0,\n        //         \"unrealisedPnl\": 224362,\n        //         \"unrealisedPnlPcnt\": 0.026,\n        //         \"unrealisedRoePcnt\": 2.597,\n        //         \"avgCostPrice\": 86393.3,\n        //         \"avgEntryPrice\": 86393.3,\n        //         \"breakEvenPrice\": 86436.5,\n        //         \"marginCallPrice\": null,\n        //         \"liquidationPrice\": 0,\n        //         \"bankruptPrice\": 0,\n        //         \"timestamp\": \"2025-12-31T07:55:50.505Z\",\n        //         \"positionReport\": {\n        //             \"account\": 395724,\n        //             \"avgCostPrice\": 86393.3,\n        //             \"avgEntryPrice\": 86393.3,\n        //             \"bankruptPrice\": 0,\n        //             \"breakEvenPrice\": 86436.5,\n        //             \"commission\": 0.0005,\n        //             \"crossMargin\": true,\n        //             \"currency\": \"USDt\",\n        //             \"currentComm\": 0,\n        //             \"currentCost\": 8639330,\n        //             \"currentQty\": 100,\n        //             \"deleveragePercentile\": 1,\n        //             \"foreignNotional\": -8.863692,\n        //             \"grossOpenPremium\": 0,\n        //             \"homeNotional\": 0.0001,\n        //             \"initMargin\": 0,\n        //             \"initMarginReq\": 0.01,\n        //             \"isOpen\": true,\n        //             \"leverage\": 100,\n        //             \"liquidationPrice\": 0,\n        //             \"maintMargin\": 44061,\n        //             \"maintMarginReq\": 0.005,\n        //             \"markPrice\": 88636.92,\n        //             \"markValue\": 8863692,\n        //             \"openOrderBuyCost\": 0,\n        //             \"openOrderBuyPremium\": 0,\n        //             \"openOrderBuyQty\": 0,\n        //             \"openOrderRealisedPnl\": 0,\n        //             \"openOrderSellCost\": 0,\n        //             \"openOrderSellPremium\": 0,\n        //             \"openOrderSellQty\": 0,\n        //             \"posComm\": 0,\n        //             \"posCost\": 8639330,\n        //             \"posCross\": 0,\n        //             \"posInit\": 0,\n        //             \"posLoss\": 0,\n        //             \"posMaint\": 44061,\n        //             \"posMargin\": 44061,\n        //             \"prevRealisedPnl\": 0,\n        //             \"quoteCurrency\": \"USDT\",\n        //             \"realisedCost\": 0,\n        //             \"realisedPnl\": 0,\n        //             \"rebalancedPnl\": -4319,\n        //             \"riskLimit\": 1000000000000,\n        //             \"riskValue\": 8863692,\n        //             \"strategy\": \"OneWay\",\n        //             \"symbol\": \"XBTUSDT\",\n        //             \"timestamp\": \"2025-12-31T07:55:50.505Z\",\n        //             \"underlying\": \"XBT\",\n        //             \"unrealisedCost\": 8639330,\n        //             \"unrealisedPnl\": 224362,\n        //             \"unrealisedPnlPcnt\": 0.026,\n        //             \"unrealisedRoePcnt\": 2.597\n        //         }\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const datetime = this.safeString (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeInteger (info, 'deleveragePercentile'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 842,
        "line_end": 903,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"account\":1455728,\n             \"currency\":\"XBt\",\n             \"riskLimit\":1000000000000,\n             \"prevState\":\"\",\n             \"state\":\"\",\n             \"action\":\"\",\n             \"amount\":263542,\n             \"pendingCredit\":0,\n             \"pendingDebit\":0,\n             \"confirmedDebit\":0,\n             \"prevRealisedPnl\":0,\n             \"prevUnrealisedPnl\":0,\n             \"grossComm\":0,\n             \"grossOpenCost\":0,\n             \"grossOpenPremium\":0,\n             \"grossExecCost\":0,\n             \"grossMarkValue\":0,\n             \"riskValue\":0,\n             \"taxableMargin\":0,\n             \"initMargin\":0,\n             \"maintMargin\":0,\n             \"sessionMargin\":0,\n             \"targetExcessMargin\":0,\n             \"varMargin\":0,\n             \"realisedPnl\":0,\n             \"unrealisedPnl\":0,\n             \"indicativeTax\":0,\n             \"unrealisedProfit\":0,\n             \"syntheticMargin\":null,\n             \"walletBalance\":263542,\n             \"marginBalance\":263542,\n             \"marginBalancePcnt\":1,\n             \"marginLeverage\":0,\n             \"marginUsedPcnt\":0,\n             \"excessMargin\":263542,\n             \"excessMarginPcnt\":1,\n             \"availableMargin\":263542,\n             \"withdrawableMargin\":263542,\n             \"timestamp\":\"2020-08-03T12:01:01.246Z\",\n             \"grossLastValue\":0,\n             \"commission\":null\n         }\n     ]"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        //     [\n        //         {\n        //             \"account\":1455728,\n        //             \"currency\":\"XBt\",\n        //             \"riskLimit\":1000000000000,\n        //             \"prevState\":\"\",\n        //             \"state\":\"\",\n        //             \"action\":\"\",\n        //             \"amount\":263542,\n        //             \"pendingCredit\":0,\n        //             \"pendingDebit\":0,\n        //             \"confirmedDebit\":0,\n        //             \"prevRealisedPnl\":0,\n        //             \"prevUnrealisedPnl\":0,\n        //             \"grossComm\":0,\n        //             \"grossOpenCost\":0,\n        //             \"grossOpenPremium\":0,\n        //             \"grossExecCost\":0,\n        //             \"grossMarkValue\":0,\n        //             \"riskValue\":0,\n        //             \"taxableMargin\":0,\n        //             \"initMargin\":0,\n        //             \"maintMargin\":0,\n        //             \"sessionMargin\":0,\n        //             \"targetExcessMargin\":0,\n        //             \"varMargin\":0,\n        //             \"realisedPnl\":0,\n        //             \"unrealisedPnl\":0,\n        //             \"indicativeTax\":0,\n        //             \"unrealisedProfit\":0,\n        //             \"syntheticMargin\":null,\n        //             \"walletBalance\":263542,\n        //             \"marginBalance\":263542,\n        //             \"marginBalancePcnt\":1,\n        //             \"marginLeverage\":0,\n        //             \"marginUsedPcnt\":0,\n        //             \"excessMargin\":263542,\n        //             \"excessMarginPcnt\":1,\n        //             \"availableMargin\":263542,\n        //             \"withdrawableMargin\":263542,\n        //             \"timestamp\":\"2020-08-03T12:01:01.246Z\",\n        //             \"grossLastValue\":0,\n        //             \"commission\":null\n        //         }\n        //     ]\n        //\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            const free = this.safeString (balance, 'availableMargin');\n            const total = this.safeString (balance, 'marginBalance');\n            account['free'] = this.convertToRealAmount (code, free);\n            account['total'] = this.convertToRealAmount (code, total);\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2886,
        "line_end": 2948,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': withdrawalFee, 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset\": \"XBT\",\n        \"currency\": \"XBt\",\n        \"majorCurrency\": \"XBT\",\n        \"name\": \"Bitcoin\",\n        \"currencyType\": \"Crypto\",\n        \"scale\": \"8\",\n        \"enabled\": true,\n        \"isMarginCurrency\": true,\n        \"minDepositAmount\": \"10000\",\n        \"minWithdrawalAmount\": \"1000\",\n        \"maxWithdrawalAmount\": \"100000000000000\",\n        \"networks\": [\n            {\n                \"asset\": \"btc\",\n                \"tokenAddress\": '',\n                \"depositEnabled\": true,\n                \"withdrawalEnabled\": true,\n                \"withdrawalFee\": \"20000\",\n                \"minFee\": \"20000\",\n                \"maxFee\": \"10000000\"\n            }\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"asset\": \"XBT\",\n        //        \"currency\": \"XBt\",\n        //        \"majorCurrency\": \"XBT\",\n        //        \"name\": \"Bitcoin\",\n        //        \"currencyType\": \"Crypto\",\n        //        \"scale\": \"8\",\n        //        \"enabled\": true,\n        //        \"isMarginCurrency\": true,\n        //        \"minDepositAmount\": \"10000\",\n        //        \"minWithdrawalAmount\": \"1000\",\n        //        \"maxWithdrawalAmount\": \"100000000000000\",\n        //        \"networks\": [\n        //            {\n        //                \"asset\": \"btc\",\n        //                \"tokenAddress\": '',\n        //                \"depositEnabled\": true,\n        //                \"withdrawalEnabled\": true,\n        //                \"withdrawalFee\": \"20000\",\n        //                \"minFee\": \"20000\",\n        //                \"maxFee\": \"10000000\"\n        //            }\n        //        ]\n        //    }\n        //\n        const networks = this.safeValue (fee, 'networks', []);\n        const networksLength = networks.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        if (networksLength !== 0) {\n            const scale = this.safeString (fee, 'scale');\n            const precision = this.parsePrecision (scale);\n            for (let i = 0; i < networksLength; i++) {\n                const network = networks[i];\n                const networkId = this.safeString (network, 'asset');\n                const currencyCode = this.safeString (currency, 'code');\n                const networkCode = this.networkIdToCode (networkId, currencyCode);\n                const withdrawalFeeId = this.safeString (network, 'withdrawalFee');\n                const withdrawalFee = this.parseNumber (Precise.stringMul (withdrawalFeeId, precision));\n                result['networks'][networkCode] = {\n                    'deposit': { 'fee': undefined, 'percentage': undefined },\n                    'withdraw': { 'fee': withdrawalFee, 'percentage': false },\n                };\n                if (networksLength === 1) {\n                    result['withdraw']['fee'] = withdrawalFee;\n                    result['withdraw']['percentage'] = false;\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 2677,
        "line_end": 2702,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "this.safeNumber (contract, 'indicativeSettlePrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "this.parse8601 (fundingDatetime)",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "fundingDatetime",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'indicativeFundingRate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        // see response sample under \"fetchMarkets\" because same endpoint is being used here\n        const datetime = this.safeString (contract, 'timestamp');\n        const marketId = this.safeString (contract, 'symbol');\n        const fundingDatetime = this.safeString (contract, 'fundingTimestamp');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'markPrice': this.safeNumber (contract, 'markPrice'),\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': this.safeNumber (contract, 'indicativeSettlePrice'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': this.parse8601 (fundingDatetime),\n            'fundingDatetime': fundingDatetime,\n            'nextFundingRate': this.safeNumber (contract, 'indicativeFundingRate'),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (info, market: Market = undefined)",
        "line_start": 2769,
        "line_end": 2788,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (info, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"timestamp\": \"2016-05-07T12:00:00.000Z\",\n        \"symbol\": \"ETHXBT\",\n        \"fundingInterval\": \"2000-01-02T00:00:00.000Z\",\n        \"fundingRate\": 0.0010890000000000001,\n        \"fundingRateDaily\": 0.0010890000000000001\n    }"
        ],
        "source": "parseFundingRateHistory (info, market: Market = undefined) {\n        //\n        //    {\n        //        \"timestamp\": \"2016-05-07T12:00:00.000Z\",\n        //        \"symbol\": \"ETHXBT\",\n        //        \"fundingInterval\": \"2000-01-02T00:00:00.000Z\",\n        //        \"fundingRate\": 0.0010890000000000001,\n        //        \"fundingRateDaily\": 0.0010890000000000001\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const datetime = this.safeString (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market),\n            'fundingRate': this.safeNumber (info, 'fundingRate'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1237,
        "line_end": 1335,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "referenceAccount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "before",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.parseNumber (after)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transactID\": \"69573da3-7744-5467-3207-89fd6efe7a47\",\n         \"account\":  24321,\n         \"currency\": \"XBt\",\n         \"transactType\": \"Withdrawal\", // \"AffiliatePayout\", \"Transfer\", \"Deposit\", \"RealisedPNL\", ...\n         \"amount\":  -1000000,\n         \"fee\":  300000,\n         \"transactStatus\": \"Completed\", // \"Canceled\", ...\n         \"address\": \"1Ex4fkF4NhQaQdRWNoYpqiPbDBbq18Kdd9\",\n         \"tx\": \"3BMEX91ZhhKoWtsH9QRb5dNXnmnGpiEetA\",\n         \"text\": \"\",\n         \"transactTime\": \"2017-03-21T20:05:14.388Z\",\n         \"walletBalance\":  0, // balance after\n         \"marginBalance\":  null,\n         \"timestamp\": \"2017-03-22T13:09:23.514Z\"\n     }",
          "{\n         \"transactID\":\"00000000-0000-0000-0000-000000000000\",\n         \"account\":121210,\n         \"currency\":\"XBt\",\n         \"transactType\":\"UnrealisedPNL\",\n         \"amount\":-5508,\n         \"fee\":0,\n         \"transactStatus\":\"Pending\",\n         \"address\":\"XBTUSD\",\n         \"tx\":\"\",\n         \"text\":\"\",\n         \"transactTime\":null,  # ←---------------------------- null\n         \"walletBalance\":139198767,\n         \"marginBalance\":139193259,\n         \"timestamp\":null  # ←---------------------------- null\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"transactID\": \"69573da3-7744-5467-3207-89fd6efe7a47\",\n        //         \"account\":  24321,\n        //         \"currency\": \"XBt\",\n        //         \"transactType\": \"Withdrawal\", // \"AffiliatePayout\", \"Transfer\", \"Deposit\", \"RealisedPNL\", ...\n        //         \"amount\":  -1000000,\n        //         \"fee\":  300000,\n        //         \"transactStatus\": \"Completed\", // \"Canceled\", ...\n        //         \"address\": \"1Ex4fkF4NhQaQdRWNoYpqiPbDBbq18Kdd9\",\n        //         \"tx\": \"3BMEX91ZhhKoWtsH9QRb5dNXnmnGpiEetA\",\n        //         \"text\": \"\",\n        //         \"transactTime\": \"2017-03-21T20:05:14.388Z\",\n        //         \"walletBalance\":  0, // balance after\n        //         \"marginBalance\":  null,\n        //         \"timestamp\": \"2017-03-22T13:09:23.514Z\"\n        //     }\n        //\n        // ButMEX returns the unrealized pnl from the wallet history endpoint.\n        // The unrealized pnl transaction has an empty timestamp.\n        // It is not related to historical pnl it has status set to \"Pending\".\n        // Therefore it's not a part of the history at all.\n        // https://github.com/ccxt/ccxt/issues/6047\n        //\n        //     {\n        //         \"transactID\":\"00000000-0000-0000-0000-000000000000\",\n        //         \"account\":121210,\n        //         \"currency\":\"XBt\",\n        //         \"transactType\":\"UnrealisedPNL\",\n        //         \"amount\":-5508,\n        //         \"fee\":0,\n        //         \"transactStatus\":\"Pending\",\n        //         \"address\":\"XBTUSD\",\n        //         \"tx\":\"\",\n        //         \"text\":\"\",\n        //         \"transactTime\":null,  # ←---------------------------- null\n        //         \"walletBalance\":139198767,\n        //         \"marginBalance\":139193259,\n        //         \"timestamp\":null  # ←---------------------------- null\n        //     }\n        //\n        const id = this.safeString (item, 'transactID');\n        const account = this.safeString (item, 'account');\n        const referenceId = this.safeString (item, 'tx');\n        const referenceAccount = undefined;\n        const type = this.parseLedgerEntryType (this.safeString (item, 'transactType'));\n        const currencyId = this.safeString (item, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amountString = this.safeString (item, 'amount');\n        let amount = this.convertToRealAmount (code, amountString);\n        let timestamp = this.parse8601 (this.safeString (item, 'transactTime'));\n        if (timestamp === undefined) {\n            // https://github.com/ccxt/ccxt/issues/6047\n            // set the timestamp to zero, 1970 Jan 1 00:00:00\n            // for unrealized pnl and other transactions without a timestamp\n            timestamp = 0; // see comments above\n        }\n        let fee = undefined;\n        let feeCost = this.safeString (item, 'fee');\n        if (feeCost !== undefined) {\n            feeCost = this.convertToRealAmount (code, feeCost);\n            fee = {\n                'cost': this.parseNumber (feeCost),\n                'currency': code,\n            };\n        }\n        let after = this.safeString (item, 'walletBalance');\n        if (after !== undefined) {\n            after = this.convertToRealAmount (code, after);\n        }\n        const before = this.parseNumber (Precise.stringSub (this.numberToString (after), this.numberToString (amount)));\n        let direction = undefined;\n        if (Precise.stringLt (amountString, '0')) {\n            direction = 'out';\n            amount = this.convertToRealAmount (code, Precise.stringAbs (amountString));\n        } else {\n            direction = 'in';\n        }\n        const status = this.parseTransactionStatus (this.safeString (item, 'transactStatus'));\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': account,\n            'referenceId': referenceId,\n            'referenceAccount': referenceAccount,\n            'type': type,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'before': before,\n            'after': this.parseNumber (after),\n            'status': status,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1224,
        "line_end": 1235,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'Withdrawal': 'transaction',\n            'RealisedPNL': 'margin',\n            'UnrealisedPNL': 'margin',\n            'Deposit': 'transaction',\n            'Transfer': 'transfer',\n            'AffiliatePayout': 'referral',\n            'SpotTrade': 'trade',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2326,
        "line_end": 2335,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'marginMode')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "this.safeInteger (leverage, 'leverage')",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "this.safeInteger (leverage, 'leverage')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'marginMode'),\n            'longLeverage': this.safeInteger (leverage, 'leverage'),\n            'shortLeverage': this.safeInteger (leverage, 'leverage'),\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 3119,
        "line_end": 3142,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'side')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderID\": \"string\",\n         \"symbol\": \"string\",\n         \"side\": \"string\",\n         \"price\": 0,\n         \"leavesQty\": 0\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"orderID\": \"string\",\n        //         \"symbol\": \"string\",\n        //         \"side\": \"string\",\n        //         \"price\": 0,\n        //         \"leavesQty\": 0\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': undefined,\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'price'),\n            'side': this.safeStringLower (liquidation, 'side'),\n            'baseValue': undefined,\n            'quoteValue': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        });\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 712,
        "line_end": 840,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isInverse",
            "comment": null
          },
          {
            "key": "quanto",
            "value": "isQuanto",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (market, 'takerFee')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (market, 'makerFee')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "expiryDatetime",
            "comment": null
          },
          {
            "key": "strike",
            "value": "this.safeNumber (market, 'optionStrikePrice')",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'lotSize'),\n                'price': this.safeNumber (market, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': contract ? this.parseNumber ('1') : undefined,\n                    'max': contract ? maxLeverage : undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': positionIsQuote ? undefined : maxOrderQty,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'maxPrice'),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': positionIsQuote ? maxOrderQty : undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSize')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': contract ? this.parseNumber ('1') : undefined,\n                    'max': contract ? maxLeverage : undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': positionIsQuote ? undefined : maxOrderQty,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'maxPrice'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': positionIsQuote ? maxOrderQty : undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "positionIsQuote ? maxOrderQty : undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        let baseId = this.safeString (market, 'underlying');\n        let quoteId = this.safeString (market, 'quoteCurrency');\n        const settleId = this.safeString (market, 'settlCurrency');\n        const settle = this.safeCurrencyCode (settleId);\n        // 'positionCurrency' may be empty (\"\", as Bitmex currently returns for ETHUSD)\n        // so let's take the settlCurrency first and then adjust if needed\n        const typ = this.safeString (market, 'typ'); // type definitions at: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_get\n        let type = undefined;\n        let swap = false;\n        let spot = false;\n        let future = false;\n        if (typ === 'FFWCSX') {\n            type = 'swap';\n            swap = true;\n        } else if (typ === 'IFXXXP') {\n            type = 'spot';\n            spot = true;\n        } else if (typ === 'FFCCSX') {\n            type = 'future';\n            future = true;\n        } else if (typ === 'FFICSX') {\n            // prediction markets (without any volume)\n            quoteId = baseId;\n            baseId = this.safeString (market, 'rootSymbol');\n            type = 'future';\n            future = true;\n        } else if (typ === 'FFSCSX') {\n            type = 'swap';\n            swap = true;\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const contract = swap || future;\n        let contractSize = undefined;\n        let isInverse = this.safeValue (market, 'isInverse');  // this is true when BASE and SETTLE are same, i.e. BTC/XXX:BTC\n        let isQuanto = this.safeValue (market, 'isQuanto'); // this is true when BASE and SETTLE are different, i.e. AXS/XXX:BTC\n        let linear = contract ? (!isInverse && !isQuanto) : undefined;\n        const status = this.safeString (market, 'state');\n        const active = status === 'Open'; // Open, Settled, Unlisted\n        let expiry = undefined;\n        let expiryDatetime = undefined;\n        let symbol = undefined;\n        if (spot) {\n            symbol = base + '/' + quote;\n        } else if (contract) {\n            symbol = base + '/' + quote + ':' + settle;\n            if (linear) {\n                const multiplierString = this.safeString2 (market, 'underlyingToPositionMultiplier', 'underlyingToSettleMultiplier');\n                contractSize = this.parseNumber (Precise.stringDiv ('1', multiplierString));\n            } else {\n                const multiplierString = Precise.stringAbs (this.safeString (market, 'multiplier'));\n                contractSize = this.parseNumber (multiplierString);\n            }\n            expiryDatetime = this.safeString (market, 'expiry');\n            expiry = this.parse8601 (expiryDatetime);\n            if (expiry !== undefined) {\n                symbol = symbol + '-' + this.yymmdd (expiry);\n            }\n        } else {\n            // for index/exotic markets, default to id\n            symbol = id;\n        }\n        const positionId = this.safeString2 (market, 'positionCurrency', 'underlying');\n        const position = this.safeCurrencyCode (positionId);\n        const positionIsQuote = (position === quote);\n        const maxOrderQty = this.safeNumber (market, 'maxOrderQty');\n        const initMargin = this.safeString (market, 'initMargin', '1');\n        const maxLeverage = this.parseNumber (Precise.stringDiv ('1', initMargin));\n        // subtype should be undefined for spot markets\n        if (spot) {\n            isInverse = undefined;\n            isQuanto = undefined;\n            linear = undefined;\n        }\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': false,\n            'swap': swap,\n            'future': future,\n            'option': false,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': isInverse,\n            'quanto': isQuanto,\n            'taker': this.safeNumber (market, 'takerFee'),\n            'maker': this.safeNumber (market, 'makerFee'),\n            'contractSize': contractSize,\n            'expiry': expiry,\n            'expiryDatetime': expiryDatetime,\n            'strike': this.safeNumber (market, 'optionStrikePrice'),\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSize'),\n                'price': this.safeNumber (market, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': contract ? this.parseNumber ('1') : undefined,\n                    'max': contract ? maxLeverage : undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': positionIsQuote ? undefined : maxOrderQty,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'maxPrice'),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': positionIsQuote ? maxOrderQty : undefined,\n                },\n            },\n            'created': undefined, // 'listing' field is buggy, e.g. 2200-02-01T00:00:00.000Z\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1591,
        "line_end": 1620,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"timestamp\":\"2015-09-25T13:38:00.000Z\",\n         \"symbol\":\"XBTUSD\",\n         \"open\":237.45,\n         \"high\":237.45,\n         \"low\":237.45,\n         \"close\":237.45,\n         \"trades\":0,\n         \"volume\":0,\n         \"vwap\":null,\n         \"lastSize\":null,\n         \"turnover\":0,\n         \"homeNotional\":0,\n         \"foreignNotional\":0\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"timestamp\":\"2015-09-25T13:38:00.000Z\",\n        //         \"symbol\":\"XBTUSD\",\n        //         \"open\":237.45,\n        //         \"high\":237.45,\n        //         \"low\":237.45,\n        //         \"close\":237.45,\n        //         \"trades\":0,\n        //         \"volume\":0,\n        //         \"vwap\":null,\n        //         \"lastSize\":null,\n        //         \"turnover\":0,\n        //         \"homeNotional\":0,\n        //         \"foreignNotional\":0\n        //     }\n        //\n        const marketId = this.safeString (ohlcv, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const volume = this.convertFromRawQuantity (market['symbol'], this.safeString (ohlcv, 'volume'));\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'timestamp')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            volume,\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3025,
        "line_end": 3058,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "interest",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "openInterest",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openValue",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        currency: 'XBt',\n        openInterest: '0',\n        openValue: '323890820079',\n        rootSymbol: 'Total',\n        turnover24h: '447088001322',\n        volume24h: '0'\n    }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterest\n        //\n        //    {\n        //        currency: 'XBt',\n        //        openInterest: '0',\n        //        openValue: '323890820079',\n        //        rootSymbol: 'Total',\n        //        turnover24h: '447088001322',\n        //        volume24h: '0'\n        //    }\n        //\n        const quoteId = this.safeString (interest, 'currency');\n        const baseId = this.safeString (interest, 'rootSymbol');\n        const quoteSymbol = this.safeCurrencyCode (quoteId);\n        const baseSymbol = this.safeCurrencyCode (baseId);\n        let symbol = baseSymbol;\n        if (quoteSymbol !== undefined) {\n            symbol = baseSymbol + '/' + quoteSymbol + ':' + quoteSymbol;\n        }\n        const openInterest = this.safeNumber (interest, 'openInterest');\n        const openValue = this.safeNumber (interest, 'openValue');\n        return this.safeOpenInterest ({\n            'info': interest,\n            'symbol': symbol,\n            'baseVolume': openInterest,  // deprecated\n            'quoteVolume': openValue,  // deprecated\n            'openInterestAmount': openInterest,\n            'openInterestValue': openValue,\n            'timestamp': undefined,\n            'datetime': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1841,
        "line_end": 1939,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderID')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clOrdID')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.parse8601 (this.safeString (order, 'transactTime'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (order, 'ordType')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'timeInForce'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.convertFromRawQuantity (symbol, remaining)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'ordStatus'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderID\":\"56222c7a-9956-413a-82cf-99f4812c214b\",\n         \"clOrdID\":\"\",\n         \"clOrdLinkID\":\"\",\n         \"account\":1455728,\n         \"symbol\":\"XBTUSD\",\n         \"side\":\"Sell\",\n         \"simpleOrderQty\":null,\n         \"orderQty\":1,\n         \"price\":40000,\n         \"displayQty\":null,\n         \"stopPx\":null,\n         \"pegOffsetValue\":null,\n         \"pegPriceType\":\"\",\n         \"currency\":\"USD\",\n         \"settlCurrency\":\"XBt\",\n         \"ordType\":\"Limit\",\n         \"timeInForce\":\"GoodTillCancel\",\n         \"execInst\":\"\",\n         \"contingencyType\":\"\",\n         \"exDestination\":\"XBME\",\n         \"ordStatus\":\"New\",\n         \"triggered\":\"\",\n         \"workingIndicator\":true,\n         \"ordRejReason\":\"\",\n         \"simpleLeavesQty\":null,\n         \"leavesQty\":1,\n         \"simpleCumQty\":null,\n         \"cumQty\":0,\n         \"avgPx\":null,\n         \"multiLegReportingType\":\"SingleSecurity\",\n         \"text\":\"Submitted via API.\",\n         \"transactTime\":\"2021-01-02T21:38:49.246Z\",\n         \"timestamp\":\"2021-01-02T21:38:49.246Z\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"orderID\":\"56222c7a-9956-413a-82cf-99f4812c214b\",\n        //         \"clOrdID\":\"\",\n        //         \"clOrdLinkID\":\"\",\n        //         \"account\":1455728,\n        //         \"symbol\":\"XBTUSD\",\n        //         \"side\":\"Sell\",\n        //         \"simpleOrderQty\":null,\n        //         \"orderQty\":1,\n        //         \"price\":40000,\n        //         \"displayQty\":null,\n        //         \"stopPx\":null,\n        //         \"pegOffsetValue\":null,\n        //         \"pegPriceType\":\"\",\n        //         \"currency\":\"USD\",\n        //         \"settlCurrency\":\"XBt\",\n        //         \"ordType\":\"Limit\",\n        //         \"timeInForce\":\"GoodTillCancel\",\n        //         \"execInst\":\"\",\n        //         \"contingencyType\":\"\",\n        //         \"exDestination\":\"XBME\",\n        //         \"ordStatus\":\"New\",\n        //         \"triggered\":\"\",\n        //         \"workingIndicator\":true,\n        //         \"ordRejReason\":\"\",\n        //         \"simpleLeavesQty\":null,\n        //         \"leavesQty\":1,\n        //         \"simpleCumQty\":null,\n        //         \"cumQty\":0,\n        //         \"avgPx\":null,\n        //         \"multiLegReportingType\":\"SingleSecurity\",\n        //         \"text\":\"Submitted via API.\",\n        //         \"transactTime\":\"2021-01-02T21:38:49.246Z\",\n        //         \"timestamp\":\"2021-01-02T21:38:49.246Z\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const qty = this.safeString (order, 'orderQty');\n        let cost = undefined;\n        let amount = undefined;\n        let isInverse = false;\n        if (marketId === undefined) {\n            const defaultSubType = this.safeString (this.options, 'defaultSubType', 'linear');\n            isInverse = (defaultSubType === 'inverse');\n        } else {\n            isInverse = this.safeBool (market, 'inverse', false);\n        }\n        if (isInverse) {\n            cost = this.convertFromRawQuantity (symbol, qty);\n        } else {\n            amount = this.convertFromRawQuantity (symbol, qty);\n        }\n        const average = this.safeString (order, 'avgPx');\n        let filled = undefined;\n        const cumQty = this.numberToString (this.convertFromRawQuantity (symbol, this.safeString (order, 'cumQty')));\n        if (isInverse) {\n            filled = Precise.stringDiv (cumQty, average);\n        } else {\n            filled = cumQty;\n        }\n        const execInst = this.safeString (order, 'execInst', '');\n        let postOnly = undefined;\n        let reduceOnly = undefined;\n        if (execInst.length > 0) {\n            postOnly = (execInst.indexOf ('ParticipateDoNotInitiate') >= 0);\n            reduceOnly = ((execInst.indexOf ('ReduceOnly') >= 0) || (execInst.indexOf ('Close') >= 0));\n        }\n        const timestamp = this.parse8601 (this.safeString (order, 'timestamp'));\n        const triggerPrice = this.safeNumber (order, 'stopPx');\n        const remaining = this.safeString (order, 'leavesQty');\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'orderID'),\n            'clientOrderId': this.safeString (order, 'clOrdID'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.parse8601 (this.safeString (order, 'transactTime')),\n            'symbol': symbol,\n            'type': this.safeStringLower (order, 'ordType'),\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'timeInForce')),\n            'postOnly': postOnly,\n            'reduceOnly': reduceOnly,\n            'side': this.safeStringLower (order, 'side'),\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': this.convertFromRawQuantity (symbol, remaining),\n            'status': this.parseOrderStatus (this.safeString (order, 'ordStatus')),\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1813,
        "line_end": 1829,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'New': 'open',\n            'PartiallyFilled': 'open',\n            'Filled': 'closed',\n            'DoneForDay': 'open',\n            'Canceled': 'canceled',\n            'PendingCancel': 'open',\n            'PendingNew': 'open',\n            'Rejected': 'rejected',\n            'Expired': 'expired',\n            'Stopped': 'open',\n            'Untriggered': 'open',\n            'Triggered': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2450,
        "line_end": 2595,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'account')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'avgEntryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notionalString)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'initMargin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.safeNumber (position, 'initMarginReq')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.safeNumber (position, 'maintMarginReq')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealisedPnl",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidationPrice')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (position, 'unrealisedPnlPcnt')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"account\": 9371654,\n         \"symbol\": \"ETHUSDT\",\n         \"currency\": \"USDt\",\n         \"underlying\": \"ETH\",\n         \"quoteCurrency\": \"USDT\",\n         \"commission\": 0.00075,\n         \"initMarginReq\": 0.3333333333333333,\n         \"maintMarginReq\": 0.01,\n         \"riskLimit\": 1000000000000,\n         \"leverage\": 3,\n         \"crossMargin\": false,\n         \"deleveragePercentile\": 1,\n         \"rebalancedPnl\": 0,\n         \"prevRealisedPnl\": 0,\n         \"prevUnrealisedPnl\": 0,\n         \"prevClosePrice\": 2053.738,\n         \"openingTimestamp\": \"2022-05-21T04:00:00.000Z\",\n         \"openingQty\": 0,\n         \"openingCost\": 0,\n         \"openingComm\": 0,\n         \"openOrderBuyQty\": 0,\n         \"openOrderBuyCost\": 0,\n         \"openOrderBuyPremium\": 0,\n         \"openOrderSellQty\": 0,\n         \"openOrderSellCost\": 0,\n         \"openOrderSellPremium\": 0,\n         \"execBuyQty\": 2000,\n         \"execBuyCost\": 39260000,\n         \"execSellQty\": 0,\n         \"execSellCost\": 0,\n         \"execQty\": 2000,\n         \"execCost\": 39260000,\n         \"execComm\": 26500,\n         \"currentTimestamp\": \"2022-05-21T04:35:16.397Z\",\n         \"currentQty\": 2000,\n         \"currentCost\": 39260000,\n         \"currentComm\": 26500,\n         \"realisedCost\": 0,\n         \"unrealisedCost\": 39260000,\n         \"grossOpenCost\": 0,\n         \"grossOpenPremium\": 0,\n         \"grossExecCost\": 39260000,\n         \"isOpen\": true,\n         \"markPrice\": 1964.195,\n         \"markValue\": 39283900,\n         \"riskValue\": 39283900,\n         \"homeNotional\": 0.02,\n         \"foreignNotional\": -39.2839,\n         \"posState\": \"\",\n         \"posCost\": 39260000,\n         \"posCost2\": 39260000,\n         \"posCross\": 0,\n         \"posInit\": 13086667,\n         \"posComm\": 39261,\n         \"posLoss\": 0,\n         \"posMargin\": 13125928,\n         \"posMaint\": 435787,\n         \"posAllowance\": 0,\n         \"taxableMargin\": 0,\n         \"initMargin\": 0,\n         \"maintMargin\": 13149828,\n         \"sessionMargin\": 0,\n         \"targetExcessMargin\": 0,\n         \"varMargin\": 0,\n         \"realisedGrossPnl\": 0,\n         \"realisedTax\": 0,\n         \"realisedPnl\": -26500,\n         \"unrealisedGrossPnl\": 23900,\n         \"longBankrupt\": 0,\n         \"shortBankrupt\": 0,\n         \"taxBase\": 0,\n         \"indicativeTaxRate\": null,\n         \"indicativeTax\": 0,\n         \"unrealisedTax\": 0,\n         \"unrealisedPnl\": 23900,\n         \"unrealisedPnlPcnt\": 0.0006,\n         \"unrealisedRoePcnt\": 0.0018,\n         \"simpleQty\": null,\n         \"simpleCost\": null,\n         \"simpleValue\": null,\n         \"simplePnl\": null,\n         \"simplePnlPcnt\": null,\n         \"avgCostPrice\": 1963,\n         \"avgEntryPrice\": 1963,\n         \"breakEvenPrice\": 1964.35,\n         \"marginCallPrice\": 1328.5,\n         \"liquidationPrice\": 1328.5,\n         \"bankruptPrice\": 1308.7,\n         \"timestamp\": \"2022-05-21T04:35:16.397Z\",\n         \"lastPrice\": 1964.195,\n         \"lastValue\": 39283900\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"account\": 9371654,\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"currency\": \"USDt\",\n        //         \"underlying\": \"ETH\",\n        //         \"quoteCurrency\": \"USDT\",\n        //         \"commission\": 0.00075,\n        //         \"initMarginReq\": 0.3333333333333333,\n        //         \"maintMarginReq\": 0.01,\n        //         \"riskLimit\": 1000000000000,\n        //         \"leverage\": 3,\n        //         \"crossMargin\": false,\n        //         \"deleveragePercentile\": 1,\n        //         \"rebalancedPnl\": 0,\n        //         \"prevRealisedPnl\": 0,\n        //         \"prevUnrealisedPnl\": 0,\n        //         \"prevClosePrice\": 2053.738,\n        //         \"openingTimestamp\": \"2022-05-21T04:00:00.000Z\",\n        //         \"openingQty\": 0,\n        //         \"openingCost\": 0,\n        //         \"openingComm\": 0,\n        //         \"openOrderBuyQty\": 0,\n        //         \"openOrderBuyCost\": 0,\n        //         \"openOrderBuyPremium\": 0,\n        //         \"openOrderSellQty\": 0,\n        //         \"openOrderSellCost\": 0,\n        //         \"openOrderSellPremium\": 0,\n        //         \"execBuyQty\": 2000,\n        //         \"execBuyCost\": 39260000,\n        //         \"execSellQty\": 0,\n        //         \"execSellCost\": 0,\n        //         \"execQty\": 2000,\n        //         \"execCost\": 39260000,\n        //         \"execComm\": 26500,\n        //         \"currentTimestamp\": \"2022-05-21T04:35:16.397Z\",\n        //         \"currentQty\": 2000,\n        //         \"currentCost\": 39260000,\n        //         \"currentComm\": 26500,\n        //         \"realisedCost\": 0,\n        //         \"unrealisedCost\": 39260000,\n        //         \"grossOpenCost\": 0,\n        //         \"grossOpenPremium\": 0,\n        //         \"grossExecCost\": 39260000,\n        //         \"isOpen\": true,\n        //         \"markPrice\": 1964.195,\n        //         \"markValue\": 39283900,\n        //         \"riskValue\": 39283900,\n        //         \"homeNotional\": 0.02,\n        //         \"foreignNotional\": -39.2839,\n        //         \"posState\": \"\",\n        //         \"posCost\": 39260000,\n        //         \"posCost2\": 39260000,\n        //         \"posCross\": 0,\n        //         \"posInit\": 13086667,\n        //         \"posComm\": 39261,\n        //         \"posLoss\": 0,\n        //         \"posMargin\": 13125928,\n        //         \"posMaint\": 435787,\n        //         \"posAllowance\": 0,\n        //         \"taxableMargin\": 0,\n        //         \"initMargin\": 0,\n        //         \"maintMargin\": 13149828,\n        //         \"sessionMargin\": 0,\n        //         \"targetExcessMargin\": 0,\n        //         \"varMargin\": 0,\n        //         \"realisedGrossPnl\": 0,\n        //         \"realisedTax\": 0,\n        //         \"realisedPnl\": -26500,\n        //         \"unrealisedGrossPnl\": 23900,\n        //         \"longBankrupt\": 0,\n        //         \"shortBankrupt\": 0,\n        //         \"taxBase\": 0,\n        //         \"indicativeTaxRate\": null,\n        //         \"indicativeTax\": 0,\n        //         \"unrealisedTax\": 0,\n        //         \"unrealisedPnl\": 23900,\n        //         \"unrealisedPnlPcnt\": 0.0006,\n        //         \"unrealisedRoePcnt\": 0.0018,\n        //         \"simpleQty\": null,\n        //         \"simpleCost\": null,\n        //         \"simpleValue\": null,\n        //         \"simplePnl\": null,\n        //         \"simplePnlPcnt\": null,\n        //         \"avgCostPrice\": 1963,\n        //         \"avgEntryPrice\": 1963,\n        //         \"breakEvenPrice\": 1964.35,\n        //         \"marginCallPrice\": 1328.5,\n        //         \"liquidationPrice\": 1328.5,\n        //         \"bankruptPrice\": 1308.7,\n        //         \"timestamp\": \"2022-05-21T04:35:16.397Z\",\n        //         \"lastPrice\": 1964.195,\n        //         \"lastValue\": 39283900\n        //     }\n        //\n        market = this.safeMarket (this.safeString (position, 'symbol'), market);\n        const symbol = market['symbol'];\n        const datetime = this.safeString (position, 'timestamp');\n        const crossMargin = this.safeValue (position, 'crossMargin');\n        const marginMode = (crossMargin === true) ? 'cross' : 'isolated';\n        const notionalString = Precise.stringAbs (this.safeString2 (position, 'foreignNotional', 'homeNotional'));\n        const settleCurrencyCode = this.safeString (market, 'settle');\n        const maintenanceMargin = this.convertToRealAmount (settleCurrencyCode, this.safeString (position, 'maintMargin'));\n        const unrealisedPnl = this.convertToRealAmount (settleCurrencyCode, this.safeString (position, 'unrealisedPnl'));\n        const contracts = this.parseNumber (Precise.stringAbs (this.safeString (position, 'currentQty')));\n        const contractSize = this.safeNumber (market, 'contractSize');\n        let side = undefined;\n        const homeNotional = this.safeString (position, 'homeNotional');\n        if (homeNotional !== undefined) {\n            if (homeNotional[0] === '-') {\n                side = 'short';\n            } else {\n                side = 'long';\n            }\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'account'),\n            'symbol': symbol,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastUpdateTimestamp': undefined,\n            'hedged': undefined,\n            'side': side,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'entryPrice': this.safeNumber (position, 'avgEntryPrice'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'lastPrice': undefined,\n            'notional': this.parseNumber (notionalString),\n            'leverage': this.safeNumber (position, 'leverage'),\n            'collateral': undefined,\n            'initialMargin': this.safeNumber (position, 'initMargin'),\n            'initialMarginPercentage': this.safeNumber (position, 'initMarginReq'),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': this.safeNumber (position, 'maintMarginReq'),\n            'unrealizedPnl': unrealisedPnl,\n            'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n            'marginMode': marginMode,\n            'marginRatio': undefined,\n            'percentage': this.safeNumber (position, 'unrealisedPnlPcnt'),\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market = undefined)",
        "line_start": 3476,
        "line_end": 3494,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'settledPrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n        timestamp: '2025-03-28T12:00:00.000Z',\n        symbol: 'ETHUSDH25',\n        settlementType: 'Settlement',\n        settledPrice: '1897.53'\n    }"
        ],
        "source": "parseSettlement (settlement, market = undefined) {\n        //\n        //    {\n        //        timestamp: '2025-03-28T12:00:00.000Z',\n        //        symbol: 'ETHUSDH25',\n        //        settlementType: 'Settlement',\n        //        settledPrice: '1897.53'\n        //    }\n        //\n        const datetime = this.safeString (settlement, 'timestamp');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'settledPrice'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market = undefined, since = undefined, limit = undefined)",
        "line_start": 3466,
        "line_end": 3474,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSettlements (settlements, market = undefined, since = undefined, limit = undefined) {\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        const sorted = this.sortBy (result, 'timestamp');\n        const symbol = this.safeString (market, 'symbol');\n        return this.filterBySymbolSinceLimit (sorted, symbol, since, limit);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1559,
        "line_end": 1589,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'highPrice')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'lowPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "this.safeString (ticker, 'vwap')",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'homeNotional24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'foreignNotional24h')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // see response sample under \"fetchMarkets\" because same endpoint is being used here\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.parse8601 (this.safeString (ticker, 'timestamp'));\n        const open = this.safeString (ticker, 'prevPrice24h');\n        const last = this.safeString (ticker, 'lastPrice');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'highPrice'),\n            'low': this.safeString (ticker, 'lowPrice'),\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': undefined,\n            'vwap': this.safeString (ticker, 'vwap'),\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'homeNotional24h'),\n            'quoteVolume': this.safeString (ticker, 'foreignNotional24h'),\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1831,
        "line_end": 1839,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'Day': 'Day',\n            'GoodTillCancel': 'GTC',\n            'ImmediateOrCancel': 'IOC',\n            'FillOrKill': 'FOK',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1700,
        "line_end": 1811,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "Precise.stringAbs (execCost)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeString (trade, 'commission')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"timestamp\": \"2018-08-28T00:00:02.735Z\",\n         \"symbol\": \"XBTUSD\",\n         \"side\": \"Buy\",\n         \"size\": 2000,\n         \"price\": 6906.5,\n         \"tickDirection\": \"PlusTick\",\n         \"trdMatchID\": \"b9a42432-0a46-6a2f-5ecc-c32e9ca4baf8\",\n         \"grossValue\": 28958000,\n         \"homeNotional\": 0.28958,\n         \"foreignNotional\": 2000\n     }",
          "{\n         \"execID\": \"string\",\n         \"orderID\": \"string\",\n         \"clOrdID\": \"string\",\n         \"clOrdLinkID\": \"string\",\n         \"account\": 0,\n         \"symbol\": \"string\",\n         \"side\": \"string\",\n         \"lastQty\": 0,\n         \"lastPx\": 0,\n         \"underlyingLastPx\": 0,\n         \"lastMkt\": \"string\",\n         \"lastLiquidityInd\": \"string\",\n         \"simpleOrderQty\": 0,\n         \"orderQty\": 0,\n         \"price\": 0,\n         \"displayQty\": 0,\n         \"stopPx\": 0,\n         \"pegOffsetValue\": 0,\n         \"pegPriceType\": \"string\",\n         \"currency\": \"string\",\n         \"settlCurrency\": \"string\",\n         \"execType\": \"string\",\n         \"ordType\": \"string\",\n         \"timeInForce\": \"string\",\n         \"execInst\": \"string\",\n         \"contingencyType\": \"string\",\n         \"exDestination\": \"string\",\n         \"ordStatus\": \"string\",\n         \"triggered\": \"string\",\n         \"workingIndicator\": true,\n         \"ordRejReason\": \"string\",\n         \"simpleLeavesQty\": 0,\n         \"leavesQty\": 0,\n         \"simpleCumQty\": 0,\n         \"cumQty\": 0,\n         \"avgPx\": 0,\n         \"commission\": 0,\n         \"tradePublishIndicator\": \"string\",\n         \"multiLegReportingType\": \"string\",\n         \"text\": \"string\",\n         \"trdMatchID\": \"string\",\n         \"execCost\": 0,\n         \"execComm\": 0,\n         \"homeNotional\": 0,\n         \"foreignNotional\": 0,\n         \"transactTime\": \"2019-03-05T12:47:02.762Z\",\n         \"timestamp\": \"2019-03-05T12:47:02.762Z\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"timestamp\": \"2018-08-28T00:00:02.735Z\",\n        //         \"symbol\": \"XBTUSD\",\n        //         \"side\": \"Buy\",\n        //         \"size\": 2000,\n        //         \"price\": 6906.5,\n        //         \"tickDirection\": \"PlusTick\",\n        //         \"trdMatchID\": \"b9a42432-0a46-6a2f-5ecc-c32e9ca4baf8\",\n        //         \"grossValue\": 28958000,\n        //         \"homeNotional\": 0.28958,\n        //         \"foreignNotional\": 2000\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"execID\": \"string\",\n        //         \"orderID\": \"string\",\n        //         \"clOrdID\": \"string\",\n        //         \"clOrdLinkID\": \"string\",\n        //         \"account\": 0,\n        //         \"symbol\": \"string\",\n        //         \"side\": \"string\",\n        //         \"lastQty\": 0,\n        //         \"lastPx\": 0,\n        //         \"underlyingLastPx\": 0,\n        //         \"lastMkt\": \"string\",\n        //         \"lastLiquidityInd\": \"string\",\n        //         \"simpleOrderQty\": 0,\n        //         \"orderQty\": 0,\n        //         \"price\": 0,\n        //         \"displayQty\": 0,\n        //         \"stopPx\": 0,\n        //         \"pegOffsetValue\": 0,\n        //         \"pegPriceType\": \"string\",\n        //         \"currency\": \"string\",\n        //         \"settlCurrency\": \"string\",\n        //         \"execType\": \"string\",\n        //         \"ordType\": \"string\",\n        //         \"timeInForce\": \"string\",\n        //         \"execInst\": \"string\",\n        //         \"contingencyType\": \"string\",\n        //         \"exDestination\": \"string\",\n        //         \"ordStatus\": \"string\",\n        //         \"triggered\": \"string\",\n        //         \"workingIndicator\": true,\n        //         \"ordRejReason\": \"string\",\n        //         \"simpleLeavesQty\": 0,\n        //         \"leavesQty\": 0,\n        //         \"simpleCumQty\": 0,\n        //         \"cumQty\": 0,\n        //         \"avgPx\": 0,\n        //         \"commission\": 0,\n        //         \"tradePublishIndicator\": \"string\",\n        //         \"multiLegReportingType\": \"string\",\n        //         \"text\": \"string\",\n        //         \"trdMatchID\": \"string\",\n        //         \"execCost\": 0,\n        //         \"execComm\": 0,\n        //         \"homeNotional\": 0,\n        //         \"foreignNotional\": 0,\n        //         \"transactTime\": \"2019-03-05T12:47:02.762Z\",\n        //         \"timestamp\": \"2019-03-05T12:47:02.762Z\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.parse8601 (this.safeString (trade, 'timestamp'));\n        const priceString = this.safeString2 (trade, 'avgPx', 'price');\n        const amountString = this.convertFromRawQuantity (symbol, this.safeString2 (trade, 'size', 'lastQty'));\n        const execCost = this.numberToString (this.convertFromRawCost (symbol, this.safeString (trade, 'execCost')));\n        const id = this.safeString (trade, 'trdMatchID');\n        const order = this.safeString (trade, 'orderID');\n        const side = this.safeStringLower (trade, 'side');\n        // price * amount doesn't work for all symbols (e.g. XBT, ETH)\n        let fee = undefined;\n        const feeCostString = this.numberToString (this.convertFromRawCost (symbol, this.safeString (trade, 'execComm')));\n        if (feeCostString !== undefined) {\n            const currencyId = this.safeString2 (trade, 'settlCurrency', 'currency');\n            fee = {\n                'cost': feeCostString,\n                'currency': this.safeCurrencyCode (currencyId),\n                'rate': this.safeString (trade, 'commission'),\n            };\n        }\n        // Trade or Funding\n        const execType = this.safeString (trade, 'execType');\n        let takerOrMaker = undefined;\n        if (feeCostString !== undefined && execType === 'Trade') {\n            takerOrMaker = Precise.stringLt (feeCostString, '0') ? 'maker' : 'taker';\n        }\n        const type = this.safeStringLower (trade, 'ordType');\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': order,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': priceString,\n            'cost': Precise.stringAbs (execCost),\n            'amount': amountString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1435,
        "line_end": 1509,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'transactID')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'tx')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'network'), currency['code'])",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "transactTime",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (transactTime)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': currency['code'],\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"transactID\": \"ffe699c2-95ee-4c13-91f9-0faf41daec25\",\n        \"account\": 123456,\n        \"currency\": \"XBt\",\n        \"network\":'', // \"tron\" for USDt, etc...\n        \"transactType\": \"Withdrawal\",\n        \"amount\": -100100000,\n        \"fee\": 100000,\n        \"transactStatus\": \"Completed\",\n        \"address\": \"385cR5DM96n1HvBDMzLHPYcw89fZAXULJP\",\n        \"tx\": \"3BMEXabcdefghijklmnopqrstuvwxyz123\",\n        \"text\": '',\n        \"transactTime\": \"2019-01-02T01:00:00.000Z\",\n        \"walletBalance\": 99900000, // this field might be inexistent\n        \"marginBalance\": None, // this field might be inexistent\n        \"timestamp\": \"2019-01-02T13:00:00.000Z\"\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //    {\n        //        \"transactID\": \"ffe699c2-95ee-4c13-91f9-0faf41daec25\",\n        //        \"account\": 123456,\n        //        \"currency\": \"XBt\",\n        //        \"network\":'', // \"tron\" for USDt, etc...\n        //        \"transactType\": \"Withdrawal\",\n        //        \"amount\": -100100000,\n        //        \"fee\": 100000,\n        //        \"transactStatus\": \"Completed\",\n        //        \"address\": \"385cR5DM96n1HvBDMzLHPYcw89fZAXULJP\",\n        //        \"tx\": \"3BMEXabcdefghijklmnopqrstuvwxyz123\",\n        //        \"text\": '',\n        //        \"transactTime\": \"2019-01-02T01:00:00.000Z\",\n        //        \"walletBalance\": 99900000, // this field might be inexistent\n        //        \"marginBalance\": None, // this field might be inexistent\n        //        \"timestamp\": \"2019-01-02T13:00:00.000Z\"\n        //    }\n        //\n        const currencyId = this.safeString (transaction, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        // For deposits, transactTime == timestamp\n        // For withdrawals, transactTime is submission, timestamp is processed\n        const transactTime = this.parse8601 (this.safeString (transaction, 'transactTime'));\n        const timestamp = this.parse8601 (this.safeString (transaction, 'timestamp'));\n        const type = this.safeStringLower (transaction, 'transactType');\n        // Deposits have no from address or to address, withdrawals have both\n        let address = undefined;\n        let addressFrom = undefined;\n        let addressTo = undefined;\n        if (type === 'withdrawal') {\n            address = this.safeString (transaction, 'address');\n            addressFrom = this.safeString (transaction, 'tx');\n            addressTo = address;\n        } else if (type === 'deposit') {\n            addressTo = this.safeString (transaction, 'address');\n            addressFrom = this.safeString (transaction, 'tx');\n        }\n        const amountString = this.safeString (transaction, 'amount');\n        const amountStringAbs = Precise.stringAbs (amountString);\n        const amount = this.convertToRealAmount (currency['code'], amountStringAbs);\n        const feeCostString = this.safeString (transaction, 'fee');\n        const feeCost = this.convertToRealAmount (currency['code'], feeCostString);\n        let status = this.safeString (transaction, 'transactStatus');\n        if (status !== undefined) {\n            status = this.parseTransactionStatus (status);\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'transactID'),\n            'txid': this.safeString (transaction, 'tx'),\n            'type': type,\n            'currency': currency['code'],\n            'network': this.networkIdToCode (this.safeString (transaction, 'network'), currency['code']),\n            'amount': this.parseNumber (amount),\n            'status': status,\n            'timestamp': transactTime,\n            'datetime': this.iso8601 (transactTime),\n            'address': address,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': undefined,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': timestamp,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': currency['code'],\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1425,
        "line_end": 1433,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'Confirmed': 'pending',\n            'Canceled': 'canceled',\n            'Completed': 'ok',\n            'Pending': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitopro": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 973,
        "line_end": 999,
        "comment": null,
        "mappings": [
          {
            "key": "free",
            "value": "available",
            "comment": null
          },
          {
            "key": "total",
            "value": "amount",
            "comment": null
          }
        ],
        "examples": [
          "[{\n         \"currency\":\"twd\",\n         \"amount\":\"0\",\n         \"available\":\"0\",\n         \"stake\":\"0\",\n         \"tradable\":true\n     }]"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        //     [{\n        //         \"currency\":\"twd\",\n        //         \"amount\":\"0\",\n        //         \"available\":\"0\",\n        //         \"stake\":\"0\",\n        //         \"tradable\":true\n        //     }]\n        //\n        const result: Dict = {\n            'info': response,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const amount = this.safeString (balance, 'amount');\n            const available = this.safeString (balance, 'available');\n            const account: Dict = {\n                'free': available,\n                'total': amount,\n            };\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseCancelOrders",
        "signature": "parseCancelOrders (data)",
        "line_start": 1226,
        "line_end": 1241,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "orderIds[j]",
            "comment": null
          },
          {
            "key": "id",
            "value": "orderIds[j]",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCancelOrders (data) {\n        const dataKeys = Object.keys (data);\n        const orders = [];\n        for (let i = 0; i < dataKeys.length; i++) {\n            const marketId = dataKeys[i];\n            const orderIds = data[marketId];\n            for (let j = 0; j < orderIds.length; j++) {\n                orders.push (this.safeOrder ({\n                    'info': orderIds[j],\n                    'id': orderIds[j],\n                    'symbol': this.safeSymbol (marketId),\n                }));\n            }\n        }\n        return orders;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 1807,
        "line_end": 1830,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': this.safeNumber (fee, 'withdrawFee'),\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\":\"eth\",\n        \"withdrawFee\":\"0.007\",\n        \"minWithdraw\":\"0.001\",\n        \"maxWithdraw\":\"1000\",\n        \"maxDailyWithdraw\":\"2000\",\n        \"withdraw\":true,\n        \"deposit\":true,\n        \"depositConfirmation\":\"12\"\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //    {\n        //        \"currency\":\"eth\",\n        //        \"withdrawFee\":\"0.007\",\n        //        \"minWithdraw\":\"0.001\",\n        //        \"maxWithdraw\":\"1000\",\n        //        \"maxDailyWithdraw\":\"2000\",\n        //        \"withdraw\":true,\n        //        \"deposit\":true,\n        //        \"depositConfirmation\":\"12\"\n        //    }\n        return {\n            'info': fee,\n            'withdraw': {\n                'fee': this.safeNumber (fee, 'withdrawFee'),\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 445,
        "line_end": 505,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "uppercaseId",
            "value": "uppercaseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "base",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "limits",
            "value": "limits",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                'min': this.safeNumber (market, 'minLimitBaseAmount'),\n                'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n            }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                'min': undefined,\n                'max': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                'min': undefined,\n                'max': undefined,\n            }",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                'min': undefined,\n                'max': undefined,\n            }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const active = !this.safeBool (market, 'maintain');\n        const id = this.safeString (market, 'pair');\n        const uppercaseId = id.toUpperCase ();\n        const baseId = this.safeString (market, 'base');\n        const quoteId = this.safeString (market, 'quote');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote;\n        const limits: Dict = {\n            'amount': {\n                'min': this.safeNumber (market, 'minLimitBaseAmount'),\n                'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n            },\n            'price': {\n                'min': undefined,\n                'max': undefined,\n            },\n            'cost': {\n                'min': undefined,\n                'max': undefined,\n            },\n            'leverage': {\n                'min': undefined,\n                'max': undefined,\n            },\n        };\n        return {\n            'id': id,\n            'uppercaseId': uppercaseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'baseId': base,\n            'quoteId': quote,\n            'settle': undefined,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'limits': limits,\n            'precision': {\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n            },\n            'active': active,\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 865,
        "line_end": 874,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1042,
        "line_end": 1129,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'updatedTimestamp')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"orderId\": \"2220595581\",\n             \"timestamp\": \"1644896744886\",\n             \"action\": \"SELL\",\n             \"amount\": \"0.01\",\n             \"price\": \"15000\",\n             \"timeInForce\": \"GTC\"\n         }",
          "{\n             \"id\":\"8777138788\",\n             \"pair\":\"bnb_twd\",\n             \"price\":\"16000\",\n             \"avgExecutionPrice\":\"0\",\n             \"action\":\"SELL\",\n             \"type\":\"LIMIT\",\n             \"timestamp\":1644899002598,\n             \"status\":4,\n             \"originalAmount\":\"0.01\",\n             \"remainingAmount\":\"0.01\",\n             \"executedAmount\":\"0\",\n             \"fee\":\"0\",\n             \"feeSymbol\":\"twd\",\n             \"bitoFee\":\"0\",\n             \"total\":\"0\",\n             \"seq\":\"BNBTWD548774666\",\n             \"timeInForce\":\"GTC\",\n             \"createdTimestamp\":1644898944074,\n             \"updatedTimestamp\":1644899002598\n         }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //         {\n        //             \"orderId\": \"2220595581\",\n        //             \"timestamp\": \"1644896744886\",\n        //             \"action\": \"SELL\",\n        //             \"amount\": \"0.01\",\n        //             \"price\": \"15000\",\n        //             \"timeInForce\": \"GTC\"\n        //         }\n        //\n        // fetchOrder\n        //         {\n        //             \"id\":\"8777138788\",\n        //             \"pair\":\"bnb_twd\",\n        //             \"price\":\"16000\",\n        //             \"avgExecutionPrice\":\"0\",\n        //             \"action\":\"SELL\",\n        //             \"type\":\"LIMIT\",\n        //             \"timestamp\":1644899002598,\n        //             \"status\":4,\n        //             \"originalAmount\":\"0.01\",\n        //             \"remainingAmount\":\"0.01\",\n        //             \"executedAmount\":\"0\",\n        //             \"fee\":\"0\",\n        //             \"feeSymbol\":\"twd\",\n        //             \"bitoFee\":\"0\",\n        //             \"total\":\"0\",\n        //             \"seq\":\"BNBTWD548774666\",\n        //             \"timeInForce\":\"GTC\",\n        //             \"createdTimestamp\":1644898944074,\n        //             \"updatedTimestamp\":1644899002598\n        //         }\n        //\n        const id = this.safeString2 (order, 'id', 'orderId');\n        const timestamp = this.safeInteger2 (order, 'timestamp', 'createdTimestamp');\n        let side = this.safeString (order, 'action');\n        side = side.toLowerCase ();\n        const amount = this.safeString2 (order, 'amount', 'originalAmount');\n        const price = this.safeString (order, 'price');\n        const marketId = this.safeString (order, 'pair');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = this.safeString (market, 'symbol');\n        const orderStatus = this.safeString (order, 'status');\n        const status = this.parseOrderStatus (orderStatus);\n        const type = this.safeStringLower (order, 'type');\n        const average = this.safeString (order, 'avgExecutionPrice');\n        const filled = this.safeString (order, 'executedAmount');\n        const remaining = this.safeString (order, 'remainingAmount');\n        const timeInForce = this.safeString (order, 'timeInForce');\n        let postOnly = undefined;\n        if (timeInForce === 'POST_ONLY') {\n            postOnly = true;\n        }\n        let fee = undefined;\n        const feeAmount = this.safeString (order, 'fee');\n        const feeSymbol = this.safeCurrencyCode (this.safeString (order, 'feeSymbol'));\n        if (Precise.stringGt (feeAmount, '0')) {\n            fee = {\n                'currency': feeSymbol,\n                'cost': feeAmount,\n            };\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.safeInteger (order, 'updatedTimestamp'),\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'average': average,\n            'filled': filled,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1029,
        "line_end": 1040,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '-1': 'open',\n            '0': 'open',\n            '1': 'open',\n            '2': 'closed',\n            '3': 'closed',\n            '4': 'canceled',\n            '6': 'canceled',\n        };\n        return this.safeString (statuses, status, undefined);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 507,
        "line_end": 544,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high24hr')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low24hr')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString (ticker, 'lastPrice')",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeString (ticker, 'lastPrice')",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChange24hr')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume24hr')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"pair\":\"btc_twd\",\n         \"lastPrice\":\"1182449.00000000\",\n         \"isBuyer\":false,\n         \"priceChange24hr\":\"-1.99\",\n         \"volume24hr\":\"9.13089740\",\n         \"high24hr\":\"1226097.00000000\",\n         \"low24hr\":\"1181000.00000000\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"pair\":\"btc_twd\",\n        //         \"lastPrice\":\"1182449.00000000\",\n        //         \"isBuyer\":false,\n        //         \"priceChange24hr\":\"-1.99\",\n        //         \"volume24hr\":\"9.13089740\",\n        //         \"high24hr\":\"1226097.00000000\",\n        //         \"low24hr\":\"1181000.00000000\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'pair');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeString (market, 'symbol');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString (ticker, 'high24hr'),\n            'low': this.safeString (ticker, 'low24hr'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': this.safeString (ticker, 'lastPrice'),\n            'last': this.safeString (ticker, 'lastPrice'),\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (ticker, 'priceChange24hr'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume24hr'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 653,
        "line_end": 738,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n                 \"timestamp\":1644651458,\n                 \"price\":\"1180785.00000000\",\n                 \"amount\":\"0.00020000\",\n                 \"isBuyer\":false\n         }",
          "{\n                 \"tradeId\":\"5685030251\",\n                 \"orderId\":\"9669168142\",\n                 \"price\":\"11821.8\",\n                 \"action\":\"SELL\",\n                 \"baseAmount\":\"0.01\",\n                 \"quoteAmount\":\"118.218\",\n                 \"fee\":\"0.236436\",\n                 \"feeSymbol\":\"BNB\",\n                 \"isTaker\":true,\n                 \"timestamp\":1644905714862,\n                 \"createdTimestamp\":1644905714862\n         }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //         {\n        //                 \"timestamp\":1644651458,\n        //                 \"price\":\"1180785.00000000\",\n        //                 \"amount\":\"0.00020000\",\n        //                 \"isBuyer\":false\n        //         }\n        //\n        // fetchMyTrades\n        //         {\n        //                 \"tradeId\":\"5685030251\",\n        //                 \"orderId\":\"9669168142\",\n        //                 \"price\":\"11821.8\",\n        //                 \"action\":\"SELL\",\n        //                 \"baseAmount\":\"0.01\",\n        //                 \"quoteAmount\":\"118.218\",\n        //                 \"fee\":\"0.236436\",\n        //                 \"feeSymbol\":\"BNB\",\n        //                 \"isTaker\":true,\n        //                 \"timestamp\":1644905714862,\n        //                 \"createdTimestamp\":1644905714862\n        //         }\n        //\n        const id = this.safeString (trade, 'tradeId');\n        const orderId = this.safeString (trade, 'orderId');\n        let timestamp = undefined;\n        if (id === undefined) {\n            timestamp = this.safeTimestamp (trade, 'timestamp');\n        } else {\n            timestamp = this.safeInteger (trade, 'timestamp');\n        }\n        const marketId = this.safeString (trade, 'pair');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeString (market, 'symbol');\n        const price = this.safeString (trade, 'price');\n        const type = this.safeStringLower (trade, 'type');\n        let side = this.safeStringLower (trade, 'action');\n        if (side === undefined) {\n            const isBuyer = this.safeBool (trade, 'isBuyer');\n            if (isBuyer) {\n                side = 'buy';\n            } else {\n                side = 'sell';\n            }\n        }\n        let amount = this.safeString (trade, 'amount');\n        if (amount === undefined) {\n            amount = this.safeString (trade, 'baseAmount');\n        }\n        let fee = undefined;\n        const feeAmount = this.safeString (trade, 'fee');\n        const feeSymbol = this.safeCurrencyCode (this.safeString (trade, 'feeSymbol'));\n        if (feeAmount !== undefined) {\n            fee = {\n                'cost': feeAmount,\n                'currency': feeSymbol,\n                'rate': undefined,\n            };\n        }\n        const isTaker = this.safeBool (trade, 'isTaker');\n        let takerOrMaker = undefined;\n        if (isTaker !== undefined) {\n            if (isTaker) {\n                takerOrMaker = 'taker';\n            } else {\n                takerOrMaker = 'maker';\n            }\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'takerOrMaker': takerOrMaker,\n            'type': type,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1525,
        "line_end": 1606,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'serial')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'total')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'fee'),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (transaction, 'fee')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"serial\": \"20220214X766799\",\n        \"timestamp\": \"1644833015053\",\n        \"address\": \"bnb1xml62k5a9dcewgc542fha75fyxdcp0zv8eqfsh\",\n        \"amount\": \"0.20000000\",\n        \"fee\": \"0.00000000\",\n        \"total\": \"0.20000000\",\n        \"status\": \"COMPLETE\",\n        \"txid\": \"A3CC4F6828CC752B9F3737F48B5826B9EC2857040CB5141D0CC955F7E53DB6D9\",\n        \"message\": \"778553959\",\n        \"protocol\": \"MAIN\",\n        \"id\": \"2905906537\"\n    }",
          "{\n        \"serial\": \"20220215BW14069838\",\n        \"timestamp\": \"1644907716044\",\n        \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n        \"amount\": \"8.00000000\",\n        \"fee\": \"2.00000000\",\n        \"total\": \"10.00000000\",\n        \"status\": \"COMPLETE\",\n        \"txid\": \"50bf250c71a582f40cf699fb58bab978437ea9bdf7259ff8072e669aab30c32b\",\n        \"protocol\": \"TRX\",\n        \"id\": \"9925310345\"\n    }",
          "{\n        \"serial\": \"20220215BW14069838\",\n        \"currency\": \"USDT\",\n        \"protocol\": \"TRX\",\n        \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n        \"amount\": \"8\",\n        \"fee\": \"2\",\n        \"total\": \"10\"\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //    {\n        //        \"serial\": \"20220214X766799\",\n        //        \"timestamp\": \"1644833015053\",\n        //        \"address\": \"bnb1xml62k5a9dcewgc542fha75fyxdcp0zv8eqfsh\",\n        //        \"amount\": \"0.20000000\",\n        //        \"fee\": \"0.00000000\",\n        //        \"total\": \"0.20000000\",\n        //        \"status\": \"COMPLETE\",\n        //        \"txid\": \"A3CC4F6828CC752B9F3737F48B5826B9EC2857040CB5141D0CC955F7E53DB6D9\",\n        //        \"message\": \"778553959\",\n        //        \"protocol\": \"MAIN\",\n        //        \"id\": \"2905906537\"\n        //    }\n        //\n        // fetchWithdrawals || fetchWithdraw\n        //\n        //    {\n        //        \"serial\": \"20220215BW14069838\",\n        //        \"timestamp\": \"1644907716044\",\n        //        \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n        //        \"amount\": \"8.00000000\",\n        //        \"fee\": \"2.00000000\",\n        //        \"total\": \"10.00000000\",\n        //        \"status\": \"COMPLETE\",\n        //        \"txid\": \"50bf250c71a582f40cf699fb58bab978437ea9bdf7259ff8072e669aab30c32b\",\n        //        \"protocol\": \"TRX\",\n        //        \"id\": \"9925310345\"\n        //    }\n        //\n        // withdraw\n        //\n        //    {\n        //        \"serial\": \"20220215BW14069838\",\n        //        \"currency\": \"USDT\",\n        //        \"protocol\": \"TRX\",\n        //        \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n        //        \"amount\": \"8\",\n        //        \"fee\": \"2\",\n        //        \"total\": \"10\"\n        //    }\n        //\n        const currencyId = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'message');\n        const status = this.safeString (transaction, 'status');\n        let networkId = this.safeString (transaction, 'protocol');\n        if (networkId === 'MAIN') {\n            networkId = code;\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'serial'),\n            'txid': this.safeString (transaction, 'txid'),\n            'type': undefined,\n            'currency': code,\n            'network': this.networkIdToCode (networkId),\n            'amount': this.safeNumber (transaction, 'total'),\n            'status': this.parseTransactionStatus (status),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tag,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'fee'),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1510,
        "line_end": 1523,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const states: Dict = {\n            'COMPLETE': 'ok',\n            'INVALID': 'failed',\n            'PROCESSING': 'pending',\n            'WAIT_PROCESS': 'pending',\n            'FAILED': 'failed',\n            'EXPIRED': 'failed',\n            'CANCELLED': 'failed',\n            'EMAIL_VERIFICATION': 'pending',\n            'WAIT_CONFIRMATION': 'pending',\n        };\n        return this.safeString (states, status, status);\n    }"
      }
    ],
    "bitrue": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1040,
        "line_end": 1104,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"makerCommission\":0,\n         \"takerCommission\":0,\n         \"buyerCommission\":0,\n         \"sellerCommission\":0,\n         \"updateTime\":null,\n         \"balances\":[\n             {\"asset\":\"sbr\",\"free\":\"0\",\"locked\":\"0\"},\n             {\"asset\":\"ksm\",\"free\":\"0\",\"locked\":\"0\"},\n             {\"asset\":\"neo3s\",\"free\":\"0\",\"locked\":\"0\"},\n         ],\n         \"canTrade\":false,\n         \"canWithdraw\":false,\n         \"canDeposit\":false\n     }",
          "{\n         \"account\":[\n             {\n                 \"marginCoin\":\"USDT\",\n                 \"coinPrecious\":4,\n                 \"accountNormal\":1010.4043400372839856,\n                 \"accountLock\":2.9827889600000006,\n                 \"partPositionNormal\":0,\n                 \"totalPositionNormal\":0,\n                 \"achievedAmount\":0,\n                 \"unrealizedAmount\":0,\n                 \"totalMarginRate\":0,\n                 \"totalEquity\":1010.4043400372839856,\n                 \"partEquity\":0,\n                 \"totalCost\":0,\n                 \"sumMarginRate\":0,\n                 \"sumOpenRealizedAmount\":0,\n                 \"canUseTrialFund\":0,\n                 \"sumMaintenanceMargin\":null,\n                 \"futureModel\":null,\n                 \"positionVos\":[]\n             }\n         ]\n     }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // spot\n        //\n        //     {\n        //         \"makerCommission\":0,\n        //         \"takerCommission\":0,\n        //         \"buyerCommission\":0,\n        //         \"sellerCommission\":0,\n        //         \"updateTime\":null,\n        //         \"balances\":[\n        //             {\"asset\":\"sbr\",\"free\":\"0\",\"locked\":\"0\"},\n        //             {\"asset\":\"ksm\",\"free\":\"0\",\"locked\":\"0\"},\n        //             {\"asset\":\"neo3s\",\"free\":\"0\",\"locked\":\"0\"},\n        //         ],\n        //         \"canTrade\":false,\n        //         \"canWithdraw\":false,\n        //         \"canDeposit\":false\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"account\":[\n        //             {\n        //                 \"marginCoin\":\"USDT\",\n        //                 \"coinPrecious\":4,\n        //                 \"accountNormal\":1010.4043400372839856,\n        //                 \"accountLock\":2.9827889600000006,\n        //                 \"partPositionNormal\":0,\n        //                 \"totalPositionNormal\":0,\n        //                 \"achievedAmount\":0,\n        //                 \"unrealizedAmount\":0,\n        //                 \"totalMarginRate\":0,\n        //                 \"totalEquity\":1010.4043400372839856,\n        //                 \"partEquity\":0,\n        //                 \"totalCost\":0,\n        //                 \"sumMarginRate\":0,\n        //                 \"sumOpenRealizedAmount\":0,\n        //                 \"canUseTrialFund\":0,\n        //                 \"sumMaintenanceMargin\":null,\n        //                 \"futureModel\":null,\n        //                 \"positionVos\":[]\n        //             }\n        //         ]\n        //     }\n        //\n        const result: Dict = {\n            'info': response,\n        };\n        const timestamp = this.safeInteger (response, 'updateTime');\n        const balances = this.safeValue2 (response, 'balances', 'account', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString2 (balance, 'asset', 'marginCoin');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString2 (balance, 'free', 'accountNormal');\n            account['used'] = this.safeString2 (balance, 'locked', 'accountLock');\n            result[code] = account;\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2915,
        "line_end": 2955,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': this.safeNumber (chainDetail, 'withdrawFee'), 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"coin\": \"adx\",\n       \"coinFulName\": \"Ambire AdEx\",\n       \"chains\": [ \"BSC\" ],\n       \"chainDetail\": [ [Object] ]\n   }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //   {\n        //       \"coin\": \"adx\",\n        //       \"coinFulName\": \"Ambire AdEx\",\n        //       \"chains\": [ \"BSC\" ],\n        //       \"chainDetail\": [ [Object] ]\n        //   }\n        //\n        const chainDetails = this.safeList (fee, 'chainDetail', []);\n        const chainDetailLength = chainDetails.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        if (chainDetailLength !== 0) {\n            for (let i = 0; i < chainDetailLength; i++) {\n                const chainDetail = chainDetails[i];\n                const networkId = this.safeString (chainDetail, 'chain');\n                const currencyCode = this.safeString (currency, 'code');\n                const networkCode = this.networkIdToCode (networkId, currencyCode);\n                result['networks'][networkCode] = {\n                    'deposit': { 'fee': undefined, 'percentage': undefined },\n                    'withdraw': { 'fee': this.safeNumber (chainDetail, 'withdrawFee'), 'percentage': false },\n                };\n                if (chainDetailLength === 1) {\n                    result['withdraw']['fee'] = this.safeNumber (chainDetail, 'withdrawFee');\n                    result['withdraw']['percentage'] = false;\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data, market = undefined): MarginModification",
        "line_start": 3140,
        "line_end": 3162,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 0,\n         \"msg\": \"success\"\n         \"data\": null\n     }"
        ],
        "source": "parseMarginModification (data, market = undefined): MarginModification {\n        //\n        // setMargin\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"msg\": \"success\"\n        //         \"data\": null\n        //     }\n        //\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': undefined,\n            'status': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 934,
        "line_end": 1038,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "lowercaseId",
            "value": "lowercaseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "(type === 'spot')",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isContract",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(status === 'TRADING')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "isContract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isInverse",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (Precise.stringAbs (multiplier))",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (amountPrecision)),\n                'price': this.parseNumber (this.parsePrecision (pricePrecision)),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (amountFilter, 'minQty'),\n                    'max': maxQuantity,\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (priceFilter, 'minPrice')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (priceFilter, 'maxPrice')",
            "comment": null
          },
          {
            "key": "min",
            "value": "minCost",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        const lowercaseId = this.safeStringLower (market, 'symbol');\n        const side = this.safeInteger (market, 'side'); // 1 linear, 0 inverse, undefined spot\n        let type = undefined;\n        let isLinear = undefined;\n        let isInverse = undefined;\n        if (side === undefined) {\n            type = 'spot';\n        } else {\n            type = 'swap';\n            isLinear = (side === 1);\n            isInverse = (side === 0);\n        }\n        const isContract = (type !== 'spot');\n        let baseId = this.safeString (market, 'baseAsset');\n        let quoteId = this.safeString (market, 'quoteAsset');\n        let settleId = undefined;\n        let settle = undefined;\n        if (isContract) {\n            const symbolSplit = id.split ('-');\n            baseId = this.safeString (symbolSplit, 1);\n            quoteId = this.safeString (symbolSplit, 2);\n            if (isLinear) {\n                settleId = quoteId;\n            } else {\n                settleId = baseId;\n            }\n            settle = this.safeCurrencyCode (settleId);\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        if (settle !== undefined) {\n            symbol += ':' + settle;\n        }\n        const filters = this.safeList (market, 'filters', []);\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const status = this.safeString (market, 'status');\n        const priceFilter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n        const amountFilter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n        const defaultPricePrecision = this.safeString (market, 'pricePrecision');\n        const defaultAmountPrecision = this.safeString (market, 'quantityPrecision');\n        const pricePrecision = this.safeString (priceFilter, 'priceScale', defaultPricePrecision);\n        const amountPrecision = this.safeString (amountFilter, 'volumeScale', defaultAmountPrecision);\n        const multiplier = this.safeString (market, 'multiplier');\n        let maxQuantity = this.safeNumber (amountFilter, 'maxQty');\n        if (maxQuantity === undefined) {\n            maxQuantity = this.safeNumber (market, 'maxValidOrder');\n        }\n        let minCost = this.safeNumber (amountFilter, 'minVal');\n        if (minCost === undefined) {\n            minCost = this.safeNumber (market, 'minOrderMoney');\n        }\n        return {\n            'id': id,\n            'lowercaseId': lowercaseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': (type === 'spot'),\n            'margin': false,\n            'swap': isContract,\n            'future': false,\n            'option': false,\n            'active': (status === 'TRADING'),\n            'contract': isContract,\n            'linear': isLinear,\n            'inverse': isInverse,\n            'contractSize': this.parseNumber (Precise.stringAbs (multiplier)),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (amountPrecision)),\n                'price': this.parseNumber (this.parsePrecision (pricePrecision)),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (amountFilter, 'minQty'),\n                    'max': maxQuantity,\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1530,
        "line_end": 1567,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"i\":\"1660825020\",\n         \"a\":\"93458.778\",\n         \"v\":\"3.9774\",\n         \"c\":\"23494.99\",\n         \"h\":\"23509.63\",\n         \"l\":\"23491.93\",\n         \"o\":\"23508.34\"\n      }",
          "{\n         \"high\": \"35360.7\",\n         \"vol\": \"110288\",\n         \"low\": \"35347.9\",\n         \"idx\": 1699411680000,\n         \"close\": \"35347.9\",\n         \"open\": \"35349.4\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // spot\n        //\n        //      {\n        //         \"i\":\"1660825020\",\n        //         \"a\":\"93458.778\",\n        //         \"v\":\"3.9774\",\n        //         \"c\":\"23494.99\",\n        //         \"h\":\"23509.63\",\n        //         \"l\":\"23491.93\",\n        //         \"o\":\"23508.34\"\n        //      }\n        //\n        // swap\n        //\n        //     {\n        //         \"high\": \"35360.7\",\n        //         \"vol\": \"110288\",\n        //         \"low\": \"35347.9\",\n        //         \"idx\": 1699411680000,\n        //         \"close\": \"35347.9\",\n        //         \"open\": \"35349.4\"\n        //     }\n        //\n        let timestamp = this.safeTimestamp (ohlcv, 'i');\n        if (timestamp === undefined) {\n            timestamp = this.safeInteger (ohlcv, 'idx');\n        }\n        return [\n            timestamp,\n            this.safeNumber2 (ohlcv, 'o', 'open'),\n            this.safeNumber2 (ohlcv, 'h', 'high'),\n            this.safeNumber2 (ohlcv, 'l', 'low'),\n            this.safeNumber2 (ohlcv, 'c', 'close'),\n            this.safeNumber2 (ohlcv, 'v', 'vol'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1872,
        "line_end": 1987,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "fills",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"USDCUSDT\",\n         \"orderId\":2878854881,\n         \"clientOrderId\":\"\",\n         \"transactTime\":1635551031276\n     }",
          "{\n         \"orderId\":1690615676032452985,\n     }",
          "{\n         \"symbol\":\"USDCUSDT\",\n         \"orderId\":\"2878854881\",\n         \"clientOrderId\":\"\",\n         \"price\":\"1.1000000000000000\",\n         \"origQty\":\"100.0000000000000000\",\n         \"executedQty\":\"0.0000000000000000\",\n         \"cummulativeQuoteQty\":\"0.0000000000000000\",\n         \"status\":\"NEW\",\n         \"timeInForce\":\"\",\n         \"type\":\"LIMIT\",\n         \"side\":\"SELL\",\n         \"stopPrice\":\"\",\n         \"icebergQty\":\"\",\n         \"time\":1635551031000,\n         \"updateTime\":1635551031000,\n         \"isWorking\":false\n     }",
          "{\n         \"orderId\":1917641,\n         \"price\":100,\n         \"origQty\":10,\n         \"origAmount\":10,\n         \"executedQty\":1,\n         \"avgPrice\":10000,\n         \"status\":\"INIT\",\n         \"type\":\"LIMIT\",\n         \"side\":\"BUY\",\n         \"action\":\"OPEN\",\n         \"transactTime\":1686716571425\n         \"clientOrderId\":4949299210\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder - spot\n        //\n        //     {\n        //         \"symbol\":\"USDCUSDT\",\n        //         \"orderId\":2878854881,\n        //         \"clientOrderId\":\"\",\n        //         \"transactTime\":1635551031276\n        //     }\n        //\n        // createOrder - future\n        //\n        //     {\n        //         \"orderId\":1690615676032452985,\n        //     }\n        //\n        // fetchOrders - spot\n        //\n        //     {\n        //         \"symbol\":\"USDCUSDT\",\n        //         \"orderId\":\"2878854881\",\n        //         \"clientOrderId\":\"\",\n        //         \"price\":\"1.1000000000000000\",\n        //         \"origQty\":\"100.0000000000000000\",\n        //         \"executedQty\":\"0.0000000000000000\",\n        //         \"cummulativeQuoteQty\":\"0.0000000000000000\",\n        //         \"status\":\"NEW\",\n        //         \"timeInForce\":\"\",\n        //         \"type\":\"LIMIT\",\n        //         \"side\":\"SELL\",\n        //         \"stopPrice\":\"\",\n        //         \"icebergQty\":\"\",\n        //         \"time\":1635551031000,\n        //         \"updateTime\":1635551031000,\n        //         \"isWorking\":false\n        //     }\n        //\n        // fetchOrders - future\n        //\n        //     {\n        //         \"orderId\":1917641,\n        //         \"price\":100,\n        //         \"origQty\":10,\n        //         \"origAmount\":10,\n        //         \"executedQty\":1,\n        //         \"avgPrice\":10000,\n        //         \"status\":\"INIT\",\n        //         \"type\":\"LIMIT\",\n        //         \"side\":\"BUY\",\n        //         \"action\":\"OPEN\",\n        //         \"transactTime\":1686716571425\n        //         \"clientOrderId\":4949299210\n        //     }\n        //\n        const status = this.parseOrderStatus (this.safeString2 (order, 'status', 'orderStatus'));\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const filled = this.safeString (order, 'executedQty');\n        let timestamp = undefined;\n        let lastTradeTimestamp = undefined;\n        if ('time' in order) {\n            timestamp = this.safeInteger (order, 'time');\n        } else if ('transactTime' in order) {\n            timestamp = this.safeInteger (order, 'transactTime');\n        } else if ('updateTime' in order) {\n            if (status === 'open') {\n                if (Precise.stringGt (filled, '0')) {\n                    lastTradeTimestamp = this.safeInteger (order, 'updateTime');\n                } else {\n                    timestamp = this.safeInteger (order, 'updateTime');\n                }\n            }\n        }\n        const average = this.safeString (order, 'avgPrice');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'origQty');\n        // - Spot/Margin market: cummulativeQuoteQty\n        // - Futures market: cumQuote.\n        //   Note this is not the actual cost, since Binance futures uses leverage to calculate margins.\n        const cost = this.safeString2 (order, 'cummulativeQuoteQty', 'cumQuote');\n        const id = this.safeString (order, 'orderId');\n        let type = this.safeStringLower (order, 'type');\n        const side = this.safeStringLower (order, 'side');\n        const fills = this.safeList (order, 'fills', []);\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const postOnly = (type === 'limit_maker') || (timeInForce === 'GTX') || (type === 'post_only');\n        if (type === 'limit_maker') {\n            type = 'limit';\n        }\n        const triggerPrice = this.parseNumber (this.omitZero (this.safeString (order, 'stopPrice')));\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': undefined,\n            'trades': fills,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1857,
        "line_end": 1870,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'INIT': 'open',\n            'PENDING_CREATE': 'open',\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'PENDING_CANCEL': 'canceling', // currently unused\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1294,
        "line_end": 1361,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'highPrice', 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'lowPrice', 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'bidPrice', 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'askPrice', 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "this.safeString (ticker, 'weightedAvgPrice')",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'openPrice')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'volume', 'vol')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quoteVolume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"bidPrice\": \"4.00000000\",\n         \"bidQty\": \"431.00000000\",\n         \"askPrice\": \"4.00000200\",\n         \"askQty\": \"9.00000000\"\n     }",
          "{\n         \"symbol\": \"BNBBTC\",\n         \"priceChange\": \"0.000248\",\n         \"priceChangePercent\": \"3.5500\",\n         \"weightedAvgPrice\": null,\n         \"prevClosePrice\": null,\n         \"lastPrice\": \"0.007226\",\n         \"lastQty\": null,\n         \"bidPrice\": \"0.007208\",\n         \"askPrice\": \"0.007240\",\n         \"openPrice\": \"0.006978\",\n         \"highPrice\": \"0.007295\",\n         \"lowPrice\": \"0.006935\",\n         \"volume\": \"11749.86\",\n         \"quoteVolume\": \"84.1066211\",\n         \"openTime\": 0,\n         \"closeTime\": 0,\n         \"firstId\": 0,\n         \"lastId\": 0,\n         \"count\": 0\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchBidsAsks\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"bidPrice\": \"4.00000000\",\n        //         \"bidQty\": \"431.00000000\",\n        //         \"askPrice\": \"4.00000200\",\n        //         \"askQty\": \"9.00000000\"\n        //     }\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"symbol\": \"BNBBTC\",\n        //         \"priceChange\": \"0.000248\",\n        //         \"priceChangePercent\": \"3.5500\",\n        //         \"weightedAvgPrice\": null,\n        //         \"prevClosePrice\": null,\n        //         \"lastPrice\": \"0.007226\",\n        //         \"lastQty\": null,\n        //         \"bidPrice\": \"0.007208\",\n        //         \"askPrice\": \"0.007240\",\n        //         \"openPrice\": \"0.006978\",\n        //         \"highPrice\": \"0.007295\",\n        //         \"lowPrice\": \"0.006935\",\n        //         \"volume\": \"11749.86\",\n        //         \"quoteVolume\": \"84.1066211\",\n        //         \"openTime\": 0,\n        //         \"closeTime\": 0,\n        //         \"firstId\": 0,\n        //         \"lastId\": 0,\n        //         \"count\": 0\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const last = this.safeString2 (ticker, 'lastPrice', 'last');\n        const timestamp = this.safeInteger (ticker, 'time');\n        let percentage = undefined;\n        if (market['swap']) {\n            percentage = Precise.stringMul (this.safeString (ticker, 'rose'), '100');\n        } else {\n            percentage = this.safeString (ticker, 'priceChangePercent');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'highPrice', 'high'),\n            'low': this.safeString2 (ticker, 'lowPrice', 'low'),\n            'bid': this.safeString2 (ticker, 'bidPrice', 'buy'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString2 (ticker, 'askPrice', 'sell'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': this.safeString (ticker, 'weightedAvgPrice'),\n            'open': this.safeString (ticker, 'openPrice'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'priceChange'),\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'volume', 'vol'),\n            'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1719,
        "line_end": 1811,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 28457,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"time\": 1499865549590,  // Actual timestamp of trade\n         \"isBuyerMaker\": true,\n         \"isBestMatch\": true\n     }",
          "{\n         \"symbol\":\"USDCUSDT\",\n         \"id\":20725156,\n         \"orderId\":2880918576,\n         \"origClientOrderId\":null,\n         \"price\":\"0.9996000000000000\",\n         \"qty\":\"100.0000000000000000\",\n         \"commission\":null,\n         \"commissionAssert\":null,\n         \"time\":1635558511000,\n         \"isBuyer\":false,\n         \"isMaker\":false,\n         \"isBestMatch\":true\n     }",
          "{\n         \"tradeId\":12,\n         \"price\":0.9,\n         \"qty\":1,\n         \"amount\":9,\n         \"contractName\":\"E-SAND-USDT\",\n         \"side\":\"BUY\",\n         \"fee\":\"0.0018\",\n         \"bidId\":1558124009467904992,\n         \"askId\":1558124043827644908,\n         \"bidUserId\":10294,\n         \"askUserId\":10467,\n         \"isBuyer\":true,\n         \"isMaker\":true,\n         \"ctime\":1678426306000\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"id\": 28457,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"time\": 1499865549590,  // Actual timestamp of trade\n        //         \"isBuyerMaker\": true,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // fetchTrades - spot\n        //\n        //     {\n        //         \"symbol\":\"USDCUSDT\",\n        //         \"id\":20725156,\n        //         \"orderId\":2880918576,\n        //         \"origClientOrderId\":null,\n        //         \"price\":\"0.9996000000000000\",\n        //         \"qty\":\"100.0000000000000000\",\n        //         \"commission\":null,\n        //         \"commissionAssert\":null,\n        //         \"time\":1635558511000,\n        //         \"isBuyer\":false,\n        //         \"isMaker\":false,\n        //         \"isBestMatch\":true\n        //     }\n        //\n        // fetchTrades - future\n        //\n        //     {\n        //         \"tradeId\":12,\n        //         \"price\":0.9,\n        //         \"qty\":1,\n        //         \"amount\":9,\n        //         \"contractName\":\"E-SAND-USDT\",\n        //         \"side\":\"BUY\",\n        //         \"fee\":\"0.0018\",\n        //         \"bidId\":1558124009467904992,\n        //         \"askId\":1558124043827644908,\n        //         \"bidUserId\":10294,\n        //         \"askUserId\":10467,\n        //         \"isBuyer\":true,\n        //         \"isMaker\":true,\n        //         \"ctime\":1678426306000\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'ctime', 'time');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'qty');\n        const marketId = this.safeString2 (trade, 'symbol', 'contractName');\n        const symbol = this.safeSymbol (marketId, market);\n        const orderId = this.safeString (trade, 'orderId');\n        const id = this.safeString2 (trade, 'id', 'tradeId');\n        let side = undefined;\n        const buyerMaker = this.safeBool (trade, 'isBuyerMaker');  // ignore \"m\" until Bitrue fixes api\n        const isBuyer = this.safeBool (trade, 'isBuyer');\n        if (buyerMaker !== undefined) {\n            side = buyerMaker ? 'sell' : 'buy';\n        }\n        if (isBuyer !== undefined) {\n            side = isBuyer ? 'buy' : 'sell'; // this is a true side\n        }\n        let fee = undefined;\n        if ('commission' in trade) {\n            fee = {\n                'cost': this.safeString2 (trade, 'commission', 'fee'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'commissionAssert')),\n            };\n        }\n        let takerOrMaker = undefined;\n        const isMaker = this.safeBool (trade, 'isMaker');\n        if (isMaker !== undefined) {\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2734,
        "line_end": 2859,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "tagFrom",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"XRP\",\n         \"amount\": \"261.3361000000000000\",\n         \"fee\": \"0.0E-15\",\n         \"createdAt\": 1548816979000,\n         \"updatedAt\": 1548816999000,\n         \"addressFrom\": \"\",\n         \"addressTo\": \"raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5_18113641\",\n         \"txid\": \"86D6EB68A7A28938BCE06BD348F8C07DEF500C5F7FE92069EF8C0551CE0F2C7D\",\n         \"confirmations\": 8,\n         \"status\": 1,\n         \"tagType\": \"Tag\"\n     },",
          "{\n         \"symbol\": \"XRP\",\n         \"amount\": \"20.0000000000000000\",\n         \"fee\": \"0.0E-15\",\n         \"createdAt\": 1544669393000,\n         \"updatedAt\": 1544669413000,\n         \"addressFrom\": \"\",\n         \"addressTo\": \"raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5_18113641\",\n         \"txid\": \"515B23E1F9864D3AF7F5B4C4FCBED784BAE861854FAB95F4031922B6AAEFC7AC\",\n         \"confirmations\": 7,\n         \"status\": 1,\n         \"tagType\": \"Tag\"\n     }",
          "{\n         \"id\": 183745,\n         \"symbol\": \"usdt_erc20\",\n         \"amount\": \"8.4000000000000000\",\n         \"fee\": \"1.6000000000000000\",\n         \"payAmount\": \"0.0000000000000000\",\n         \"createdAt\": 1595336441000,\n         \"updatedAt\": 1595336576000,\n         \"addressFrom\": \"\",\n         \"addressTo\": \"0x2edfae3878d7b6db70ce4abed177ab2636f60c83\",\n         \"txid\": \"\",\n         \"confirmations\": 0,\n         \"status\": 6,\n         \"tagType\": null\n     }",
          "{\n         \"msg\": null,\n         \"amount\": 1000,\n         \"fee\": 1,\n         \"ctime\": null,\n         \"coin\": \"usdt_erc20\",\n         \"withdrawId\": 1156423,\n         \"addressTo\": \"0x2edfae3878d7b6db70ce4abed177ab2636f60c83\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"symbol\": \"XRP\",\n        //         \"amount\": \"261.3361000000000000\",\n        //         \"fee\": \"0.0E-15\",\n        //         \"createdAt\": 1548816979000,\n        //         \"updatedAt\": 1548816999000,\n        //         \"addressFrom\": \"\",\n        //         \"addressTo\": \"raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5_18113641\",\n        //         \"txid\": \"86D6EB68A7A28938BCE06BD348F8C07DEF500C5F7FE92069EF8C0551CE0F2C7D\",\n        //         \"confirmations\": 8,\n        //         \"status\": 1,\n        //         \"tagType\": \"Tag\"\n        //     },\n        //     {\n        //         \"symbol\": \"XRP\",\n        //         \"amount\": \"20.0000000000000000\",\n        //         \"fee\": \"0.0E-15\",\n        //         \"createdAt\": 1544669393000,\n        //         \"updatedAt\": 1544669413000,\n        //         \"addressFrom\": \"\",\n        //         \"addressTo\": \"raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5_18113641\",\n        //         \"txid\": \"515B23E1F9864D3AF7F5B4C4FCBED784BAE861854FAB95F4031922B6AAEFC7AC\",\n        //         \"confirmations\": 7,\n        //         \"status\": 1,\n        //         \"tagType\": \"Tag\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": 183745,\n        //         \"symbol\": \"usdt_erc20\",\n        //         \"amount\": \"8.4000000000000000\",\n        //         \"fee\": \"1.6000000000000000\",\n        //         \"payAmount\": \"0.0000000000000000\",\n        //         \"createdAt\": 1595336441000,\n        //         \"updatedAt\": 1595336576000,\n        //         \"addressFrom\": \"\",\n        //         \"addressTo\": \"0x2edfae3878d7b6db70ce4abed177ab2636f60c83\",\n        //         \"txid\": \"\",\n        //         \"confirmations\": 0,\n        //         \"status\": 6,\n        //         \"tagType\": null\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"msg\": null,\n        //         \"amount\": 1000,\n        //         \"fee\": 1,\n        //         \"ctime\": null,\n        //         \"coin\": \"usdt_erc20\",\n        //         \"withdrawId\": 1156423,\n        //         \"addressTo\": \"0x2edfae3878d7b6db70ce4abed177ab2636f60c83\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'id', 'withdrawId');\n        const tagType = this.safeString (transaction, 'tagType');\n        let addressTo = this.safeString (transaction, 'addressTo');\n        let addressFrom = this.safeString (transaction, 'addressFrom');\n        let tagTo = undefined;\n        let tagFrom = undefined;\n        if (tagType !== undefined) {\n            if (addressTo !== undefined) {\n                const parts = addressTo.split ('_');\n                addressTo = this.safeString (parts, 0);\n                tagTo = this.safeString (parts, 1);\n            }\n            if (addressFrom !== undefined) {\n                const parts = addressFrom.split ('_');\n                addressFrom = this.safeString (parts, 0);\n                tagFrom = this.safeString (parts, 1);\n            }\n        }\n        const txid = this.safeString (transaction, 'txid');\n        const timestamp = this.safeInteger (transaction, 'createdAt');\n        const updated = this.safeInteger (transaction, 'updatedAt');\n        const payAmount = ('payAmount' in transaction);\n        const ctime = ('ctime' in transaction);\n        const type = (payAmount || ctime) ? 'withdrawal' : 'deposit';\n        const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        const amount = this.safeNumber (transaction, 'amount');\n        let network = undefined;\n        let currencyId = this.safeString2 (transaction, 'symbol', 'coin');\n        if (currencyId !== undefined) {\n            const parts = currencyId.split ('_');\n            currencyId = this.safeString (parts, 0);\n            const networkId = this.safeString (parts, 1);\n            if (networkId !== undefined) {\n                network = networkId.toUpperCase ();\n            }\n        }\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': addressTo,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': tagTo,\n            'tagTo': tagTo,\n            'tagFrom': tagFrom,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': false,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 2718,
        "line_end": 2732,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '5': 'ok', // Failure\n                '6': 'canceled',\n            },\n        };\n        const statuses = this.safeDict (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency = undefined)",
        "line_start": 2973,
        "line_end": 3009,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          }
        ],
        "examples": [
          "{\n         'transferType': 'wallet_to_contract',\n         'symbol': 'USDT',\n         'amount': 1.0,\n         'status': 1,\n         'ctime': 1685404575000\n     }"
        ],
        "source": "parseTransfer (transfer, currency = undefined) {\n        //\n        //     fetchTransfers\n        //\n        //     {\n        //         'transferType': 'wallet_to_contract',\n        //         'symbol': 'USDT',\n        //         'amount': 1.0,\n        //         'status': 1,\n        //         'ctime': 1685404575000\n        //     }\n        //\n        //     transfer\n        //\n        //     {}\n        //\n        const transferType = this.safeString (transfer, 'transferType');\n        let fromAccount = undefined;\n        let toAccount = undefined;\n        if (transferType !== undefined) {\n            const accountSplit = transferType.split ('_to_');\n            fromAccount = this.safeString (accountSplit, 0);\n            toAccount = this.safeString (accountSplit, 1);\n        }\n        const timestamp = this.safeInteger (transfer, 'ctime');\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeString (currency, 'code'),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': 'ok',\n        };\n    }"
      }
    ],
    "bitso": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 595,
        "line_end": 614,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const payload = this.safeValue (response, 'payload', {});\n        const balances = this.safeValue (payload, 'balances', []);\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'locked');\n            account['total'] = this.safeString (balance, 'total');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 1625,
        "line_end": 1703,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"fees\": [\n            {\n                \"book\": \"btc_mxn\",\n                \"fee_percent\": \"0.6500\",\n                \"fee_decimal\": \"0.00650000\",\n                \"taker_fee_percent\": \"0.6500\",\n                \"taker_fee_decimal\": \"0.00650000\",\n                \"maker_fee_percent\": \"0.5000\",\n                \"maker_fee_decimal\": \"0.00500000\",\n                \"volume_currency\": \"mxn\",\n                \"current_volume\": \"0.00\",\n                \"next_volume\": \"1500000.00\",\n                \"next_maker_fee_percent\": \"0.490\",\n                \"next_taker_fee_percent\": \"0.637\",\n                \"nextVolume\": \"1500000.00\",\n                \"nextFee\": \"0.490\",\n                \"nextTakerFee\": \"0.637\"\n            },\n            ...\n        ],\n        \"deposit_fees\": [\n            {\n                \"currency\": \"btc\",\n                \"method\": \"rewards\",\n                \"fee\": \"0.00\",\n                \"is_fixed\": false\n            },\n            ...\n        ],\n        \"withdrawal_fees\": {\n            \"ada\": \"0.20958100\",\n            \"bch\": \"0.00009437\",\n            \"ars\": \"0\",\n            \"btc\": \"0.00001209\",\n            ...\n        }\n    }"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        //    {\n        //        \"fees\": [\n        //            {\n        //                \"book\": \"btc_mxn\",\n        //                \"fee_percent\": \"0.6500\",\n        //                \"fee_decimal\": \"0.00650000\",\n        //                \"taker_fee_percent\": \"0.6500\",\n        //                \"taker_fee_decimal\": \"0.00650000\",\n        //                \"maker_fee_percent\": \"0.5000\",\n        //                \"maker_fee_decimal\": \"0.00500000\",\n        //                \"volume_currency\": \"mxn\",\n        //                \"current_volume\": \"0.00\",\n        //                \"next_volume\": \"1500000.00\",\n        //                \"next_maker_fee_percent\": \"0.490\",\n        //                \"next_taker_fee_percent\": \"0.637\",\n        //                \"nextVolume\": \"1500000.00\",\n        //                \"nextFee\": \"0.490\",\n        //                \"nextTakerFee\": \"0.637\"\n        //            },\n        //            ...\n        //        ],\n        //        \"deposit_fees\": [\n        //            {\n        //                \"currency\": \"btc\",\n        //                \"method\": \"rewards\",\n        //                \"fee\": \"0.00\",\n        //                \"is_fixed\": false\n        //            },\n        //            ...\n        //        ],\n        //        \"withdrawal_fees\": {\n        //            \"ada\": \"0.20958100\",\n        //            \"bch\": \"0.00009437\",\n        //            \"ars\": \"0\",\n        //            \"btc\": \"0.00001209\",\n        //            ...\n        //        }\n        //    }\n        //\n        const result: Dict = {};\n        const depositResponse = this.safeValue (response, 'deposit_fees', []);\n        const withdrawalResponse = this.safeValue (response, 'withdrawal_fees', []);\n        for (let i = 0; i < depositResponse.length; i++) {\n            const entry = depositResponse[i];\n            const currencyId = this.safeString (entry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (code in codes)) {\n                result[code] = {\n                    'deposit': {\n                        'fee': this.safeNumber (entry, 'fee'),\n                        'percentage': !this.safeValue (entry, 'is_fixed'),\n                    },\n                    'withdraw': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                    'networks': {},\n                    'info': entry,\n                };\n            }\n        }\n        const withdrawalKeys = Object.keys (withdrawalResponse);\n        for (let i = 0; i < withdrawalKeys.length; i++) {\n            const currencyId = withdrawalKeys[i];\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (code in codes)) {\n                const withdrawFee = this.parseNumber (withdrawalResponse[currencyId]);\n                const resultValue = this.safeValue (result, code);\n                if (resultValue === undefined) {\n                    result[code] = this.depositWithdrawFee ({});\n                }\n                result[code]['withdraw']['fee'] = withdrawFee;\n                result[code]['info'][code] = withdrawFee;\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 350,
        "line_end": 452,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'eid')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"eid\": \"2510b3e2bc1c87f584500a18084f35ed\",\n         \"created_at\": \"2022-06-08T12:21:42+0000\",\n         \"balance_updates\": [{\n             \"amount\": \"0.00080000\",\n             \"currency\": \"btc\"\n         }],\n         \"operation\": \"funding\",\n         \"details\": {\n             \"network\": \"btc\",\n             \"method\": \"btc\",\n             \"method_name\": \"Bitcoin\",\n             \"asset\": \"btc\",\n             \"protocol\": \"btc\",\n             \"integration\": \"bitgo-v2\",\n             \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\"\n         }\n     }",
          "{\n         \"eid\": \"8976c6053f078f704f037d82a813678a\",\n         \"created_at\": \"2022-06-08T17:01:48+0000\",\n         \"balance_updates\": [{\n                 \"amount\": \"59.21320500\",\n                 \"currency\": \"mxn\"\n             },\n             {\n                 \"amount\": \"-0.00010000\",\n                 \"currency\": \"btc\"\n             }\n         ],\n         \"operation\": \"trade\",\n         \"details\": {\n             \"tid\": \"72145428\",\n             \"oid\": \"JO5TZmMZjzjlZDyT\"\n         }\n     }",
          "{\n         \"eid\": \"cbbb3c8d4e41723d25d2850dcb7c3c74\",\n         \"created_at\": \"2022-06-08T17:01:48+0000\",\n         \"balance_updates\": [{\n             \"amount\": \"-0.38488583\",\n             \"currency\": \"mxn\"\n         }],\n         \"operation\": \"fee\",\n         \"details\": {\n             \"tid\": \"72145428\",\n             \"oid\": \"JO5TZmMZjzjlZDyT\"\n         }\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"eid\": \"2510b3e2bc1c87f584500a18084f35ed\",\n        //         \"created_at\": \"2022-06-08T12:21:42+0000\",\n        //         \"balance_updates\": [{\n        //             \"amount\": \"0.00080000\",\n        //             \"currency\": \"btc\"\n        //         }],\n        //         \"operation\": \"funding\",\n        //         \"details\": {\n        //             \"network\": \"btc\",\n        //             \"method\": \"btc\",\n        //             \"method_name\": \"Bitcoin\",\n        //             \"asset\": \"btc\",\n        //             \"protocol\": \"btc\",\n        //             \"integration\": \"bitgo-v2\",\n        //             \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\"\n        //         }\n        //     }\n        //\n        //  trade\n        //     {\n        //         \"eid\": \"8976c6053f078f704f037d82a813678a\",\n        //         \"created_at\": \"2022-06-08T17:01:48+0000\",\n        //         \"balance_updates\": [{\n        //                 \"amount\": \"59.21320500\",\n        //                 \"currency\": \"mxn\"\n        //             },\n        //             {\n        //                 \"amount\": \"-0.00010000\",\n        //                 \"currency\": \"btc\"\n        //             }\n        //         ],\n        //         \"operation\": \"trade\",\n        //         \"details\": {\n        //             \"tid\": \"72145428\",\n        //             \"oid\": \"JO5TZmMZjzjlZDyT\"\n        //         }\n        //     }\n        //\n        //  fee\n        //     {\n        //         \"eid\": \"cbbb3c8d4e41723d25d2850dcb7c3c74\",\n        //         \"created_at\": \"2022-06-08T17:01:48+0000\",\n        //         \"balance_updates\": [{\n        //             \"amount\": \"-0.38488583\",\n        //             \"currency\": \"mxn\"\n        //         }],\n        //         \"operation\": \"fee\",\n        //         \"details\": {\n        //             \"tid\": \"72145428\",\n        //             \"oid\": \"JO5TZmMZjzjlZDyT\"\n        //         }\n        //     }\n        const operation = this.safeString (item, 'operation');\n        const type = this.parseLedgerEntryType (operation);\n        const balanceUpdates = this.safeValue (item, 'balance_updates', []);\n        const firstBalance = this.safeValue (balanceUpdates, 0, {});\n        let direction = undefined;\n        let fee = undefined;\n        const amount = this.safeString (firstBalance, 'amount');\n        const currencyId = this.safeString (firstBalance, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const details = this.safeValue (item, 'details', {});\n        let referenceId = this.safeString2 (details, 'fid', 'wid');\n        if (referenceId === undefined) {\n            referenceId = this.safeString (details, 'tid');\n        }\n        if (operation === 'funding') {\n            direction = 'in';\n        } else if (operation === 'withdrawal') {\n            direction = 'out';\n        } else if (operation === 'trade') {\n            direction = undefined;\n        } else if (operation === 'fee') {\n            direction = 'out';\n            const cost = Precise.stringAbs (amount);\n            fee = {\n                'cost': cost,\n                'currency': currency,\n            };\n        }\n        const timestamp = this.parse8601 (this.safeString (item, 'created_at'));\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'eid'),\n            'direction': direction,\n            'account': undefined,\n            'referenceId': referenceId,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'amount': amount,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': 'ok',\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 340,
        "line_end": 348,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'funding': 'transaction',\n            'withdrawal': 'transaction',\n            'trade': 'trade',\n            'fee': 'fee',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 812,
        "line_end": 835,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"bucket_start_time\":1648219140000,\n         \"first_trade_time\":1648219154990,\n         \"last_trade_time\":1648219189441,\n         \"first_rate\":\"44958.60\",\n         \"last_rate\":\"44979.88\",\n         \"min_rate\":\"44957.33\",\n         \"max_rate\":\"44979.88\",\n         \"trade_count\":8,\n         \"volume\":\"0.00082814\",\n         \"vwap\":\"44965.02\"\n     },"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"bucket_start_time\":1648219140000,\n        //         \"first_trade_time\":1648219154990,\n        //         \"last_trade_time\":1648219189441,\n        //         \"first_rate\":\"44958.60\",\n        //         \"last_rate\":\"44979.88\",\n        //         \"min_rate\":\"44957.33\",\n        //         \"max_rate\":\"44979.88\",\n        //         \"trade_count\":8,\n        //         \"volume\":\"0.00082814\",\n        //         \"vwap\":\"44965.02\"\n        //     },\n        //\n        return [\n            this.safeInteger (ohlcv, 'bucket_start_time'),\n            this.safeNumber (ohlcv, 'first_rate'),\n            this.safeNumber (ohlcv, 'max_rate'),\n            this.safeNumber (ohlcv, 'min_rate'),\n            this.safeNumber (ohlcv, 'last_rate'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1216,
        "line_end": 1261,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //\n        // canceledOrder\n        // yWTQGxDMZ0VimZgZ\n        //\n        let id = undefined;\n        if (typeof order === 'string') {\n            id = order;\n        } else {\n            id = this.safeString (order, 'oid');\n        }\n        const side = this.safeString (order, 'side');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'book');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const orderType = this.safeString (order, 'type');\n        const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'original_amount');\n        const remaining = this.safeString (order, 'unfilled_amount');\n        const clientOrderId = this.safeString (order, 'client_id');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': orderType,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'remaining': remaining,\n            'filled': undefined,\n            'status': status,\n            'fee': undefined,\n            'average': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1206,
        "line_end": 1214,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'partial-fill': 'open', // this is a common substitution in ccxt\n            'partially filled': 'open',\n            'queued': 'open',\n            'completed': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 677,
        "line_end": 720,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"high\":\"37446.85\",\n         \"last\":\"36599.54\",\n         \"created_at\":\"2022-01-28T12:06:11+00:00\",\n         \"book\":\"btc_usdt\",\n         \"volume\":\"7.29075419\",\n         \"vwap\":\"36579.1564400307\",\n         \"low\":\"35578.52\",\n         \"ask\":\"36574.76\",\n         \"bid\":\"36538.22\",\n         \"change_24\":\"-105.64\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"high\":\"37446.85\",\n        //         \"last\":\"36599.54\",\n        //         \"created_at\":\"2022-01-28T12:06:11+00:00\",\n        //         \"book\":\"btc_usdt\",\n        //         \"volume\":\"7.29075419\",\n        //         \"vwap\":\"36579.1564400307\",\n        //         \"low\":\"35578.52\",\n        //         \"ask\":\"36574.76\",\n        //         \"bid\":\"36538.22\",\n        //         \"change_24\":\"-105.64\"\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.parse8601 (this.safeString (ticker, 'created_at'));\n        const vwap = this.safeString (ticker, 'vwap');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = Precise.stringMul (baseVolume, vwap);\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': vwap,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 837,
        "line_end": 941,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"book\": \"btc_usdt\",\n          \"created_at\": \"2021-11-24T12:14:53+0000\",\n          \"amount\": \"0.00026562\",\n          \"maker_side\": \"sell\",\n          \"price\": \"56471.55\",\n          \"tid\": \"52557338\"\n      }",
          "{\n          \"book\": \"btc_usdt\",\n          \"created_at\": \"2021-11-24T12:31:03+0000\",\n          \"minor\": \"11.30356000\",\n          \"major\": \"-0.00020000\",\n          \"fees_amount\": \"0.01119052\",\n          \"fees_currency\": \"usdt\",\n          \"minor_currency\": \"usdt\",\n          \"major_currency\": \"btc\",\n          \"oid\": \"djTzMIWx2Vi3iMjl\",\n          \"tid\": \"52559051\",\n          \"price\": \"56517.80\",\n          \"side\": \"sell\",\n          \"maker_side\": \"buy\"\n      }",
          "{\n          \"book\": \"btc_usdt\",\n          \"created_at\": \"2021-11-24T12:30:52+0000\",\n          \"minor\": \"-11.33047916\",\n          \"major\": \"0.00020020\",\n          \"fees_amount\": \"0.00000020\",\n          \"fees_currency\": \"btc\",\n          \"minor_currency\": \"usdt\",\n          \"major_currency\": \"btc\",\n          \"oid\": \"O0D2zcljjjQF5xlG\",\n          \"tid\": \"52559030\",\n          \"price\": \"56595.80\",\n          \"side\": \"buy\",\n          \"maker_side\": \"sell\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"book\": \"btc_usdt\",\n        //          \"created_at\": \"2021-11-24T12:14:53+0000\",\n        //          \"amount\": \"0.00026562\",\n        //          \"maker_side\": \"sell\",\n        //          \"price\": \"56471.55\",\n        //          \"tid\": \"52557338\"\n        //      }\n        //\n        // fetchMyTrades (private)\n        //\n        //      {\n        //          \"book\": \"btc_usdt\",\n        //          \"created_at\": \"2021-11-24T12:31:03+0000\",\n        //          \"minor\": \"11.30356000\",\n        //          \"major\": \"-0.00020000\",\n        //          \"fees_amount\": \"0.01119052\",\n        //          \"fees_currency\": \"usdt\",\n        //          \"minor_currency\": \"usdt\",\n        //          \"major_currency\": \"btc\",\n        //          \"oid\": \"djTzMIWx2Vi3iMjl\",\n        //          \"tid\": \"52559051\",\n        //          \"price\": \"56517.80\",\n        //          \"side\": \"sell\",\n        //          \"maker_side\": \"buy\"\n        //      }\n        //\n        // fetchOrderTrades (private)\n        //\n        //      {\n        //          \"book\": \"btc_usdt\",\n        //          \"created_at\": \"2021-11-24T12:30:52+0000\",\n        //          \"minor\": \"-11.33047916\",\n        //          \"major\": \"0.00020020\",\n        //          \"fees_amount\": \"0.00000020\",\n        //          \"fees_currency\": \"btc\",\n        //          \"minor_currency\": \"usdt\",\n        //          \"major_currency\": \"btc\",\n        //          \"oid\": \"O0D2zcljjjQF5xlG\",\n        //          \"tid\": \"52559030\",\n        //          \"price\": \"56595.80\",\n        //          \"side\": \"buy\",\n        //          \"maker_side\": \"sell\"\n        //      }\n        //\n        const timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n        const marketId = this.safeString (trade, 'book');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        let side = this.safeString (trade, 'side');\n        const makerSide = this.safeString (trade, 'maker_side');\n        let takerOrMaker = undefined;\n        if (side !== undefined) {\n            if (side === makerSide) {\n                takerOrMaker = 'maker';\n            } else {\n                takerOrMaker = 'taker';\n            }\n        } else {\n            if (makerSide === 'buy') {\n                side = 'sell';\n            } else {\n                side = 'buy';\n            }\n        }\n        let amount = this.safeString2 (trade, 'amount', 'major');\n        if (amount !== undefined) {\n            amount = Precise.stringAbs (amount);\n        }\n        let fee = undefined;\n        const feeCost = this.safeString (trade, 'fees_amount');\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fees_currency');\n            const feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        let cost = this.safeString (trade, 'minor');\n        if (cost !== undefined) {\n            cost = Precise.stringAbs (cost);\n        }\n        const price = this.safeString (trade, 'price');\n        const orderId = this.safeString (trade, 'oid');\n        const id = this.safeString (trade, 'tid');\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1763,
        "line_end": 1833,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'wid', 'fid')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (details, 'tx_hash')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCodeUpper",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "receivingAddress",
            "comment": null
          },
          {
            "key": "address",
            "value": "(withdrawalAddress !== undefined) ? withdrawalAddress : receivingAddress",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "withdrawalAddress",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "type",
            "value": "(withdrawId === undefined) ? 'deposit' : 'withdrawal'",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\",\n         \"status\": \"complete\",\n         \"created_at\": \"2022-06-08T12:02:49+0000\",\n         \"currency\": \"btc\",\n         \"method\": \"btc\",\n         \"method_name\": \"Bitcoin\",\n         \"amount\": \"0.00080000\",\n         \"asset\": \"btc\",\n         \"network\": \"btc\",\n         \"protocol\": \"btc\",\n         \"integration\": \"bitgo-v2\",\n         \"details\": {\n             \"receiving_address\": \"3NmvbcYKhogs6RoTb4eYCUJ3beRSqLgSif\",\n             \"tx_hash\": \"327f3838531f611485ec59f9d0a119fea1595591e274d942b2c10b9b8262eb1d\",\n             \"confirmations\": \"4\"\n         }\n     }",
          "{\n         \"wid\": \"c5b8d7f0768ee91d3b33bee648318688\",\n         \"status\": \"pending\",\n         \"created_at\": \"2016-04-08T17:52:31.000+00:00\",\n         \"currency\": \"btc\",\n         \"method\": \"Bitcoin\",\n         \"amount\": \"0.48650929\",\n         \"details\": {\n             \"withdrawal_address\": \"18MsnATiNiKLqUHDTRKjurwMg7inCrdNEp\",\n             \"tx_hash\": \"d4f28394693e9fb5fffcaf730c11f32d1922e5837f76ca82189d3bfe30ded433\"\n         }\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // deposit\n        //     {\n        //         \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\",\n        //         \"status\": \"complete\",\n        //         \"created_at\": \"2022-06-08T12:02:49+0000\",\n        //         \"currency\": \"btc\",\n        //         \"method\": \"btc\",\n        //         \"method_name\": \"Bitcoin\",\n        //         \"amount\": \"0.00080000\",\n        //         \"asset\": \"btc\",\n        //         \"network\": \"btc\",\n        //         \"protocol\": \"btc\",\n        //         \"integration\": \"bitgo-v2\",\n        //         \"details\": {\n        //             \"receiving_address\": \"3NmvbcYKhogs6RoTb4eYCUJ3beRSqLgSif\",\n        //             \"tx_hash\": \"327f3838531f611485ec59f9d0a119fea1595591e274d942b2c10b9b8262eb1d\",\n        //             \"confirmations\": \"4\"\n        //         }\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"wid\": \"c5b8d7f0768ee91d3b33bee648318688\",\n        //         \"status\": \"pending\",\n        //         \"created_at\": \"2016-04-08T17:52:31.000+00:00\",\n        //         \"currency\": \"btc\",\n        //         \"method\": \"Bitcoin\",\n        //         \"amount\": \"0.48650929\",\n        //         \"details\": {\n        //             \"withdrawal_address\": \"18MsnATiNiKLqUHDTRKjurwMg7inCrdNEp\",\n        //             \"tx_hash\": \"d4f28394693e9fb5fffcaf730c11f32d1922e5837f76ca82189d3bfe30ded433\"\n        //         }\n        //     }\n        //\n        const currencyId = this.safeString2 (transaction, 'currency', 'asset');\n        currency = this.safeCurrency (currencyId, currency);\n        const details = this.safeValue (transaction, 'details', {});\n        const datetime = this.safeString (transaction, 'created_at');\n        const withdrawalAddress = this.safeString (details, 'withdrawal_address');\n        const receivingAddress = this.safeString (details, 'receiving_address');\n        const networkId = this.safeString2 (transaction, 'network', 'method');\n        const status = this.safeString (transaction, 'status');\n        const withdrawId = this.safeString (transaction, 'wid');\n        const networkCode = this.networkIdToCode (networkId);\n        const networkCodeUpper = (networkCode !== undefined) ? networkCode.toUpperCase () : undefined;\n        return {\n            'id': this.safeString2 (transaction, 'wid', 'fid'),\n            'txid': this.safeString (details, 'tx_hash'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'network': networkCodeUpper,\n            'addressFrom': receivingAddress,\n            'address': (withdrawalAddress !== undefined) ? withdrawalAddress : receivingAddress,\n            'addressTo': withdrawalAddress,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'type': (withdrawId === undefined) ? 'deposit' : 'withdrawal',\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'status': this.parseTransactionStatus (status),\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'info': transaction,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1835,
        "line_end": 1843,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'pending': 'pending',\n            'in_progress': 'pending',\n            'complete': 'ok',\n            'failed': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitstamp": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1327,
        "line_end": 1347,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        if (response === undefined) {\n            response = [];\n        }\n        for (let i = 0; i < response.length; i++) {\n            const currencyBalance = response[i];\n            const currencyId = this.safeString (currencyBalance, 'currency');\n            const currencyCode = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (currencyBalance, 'available');\n            account['used'] = this.safeString (currencyBalance, 'reserved');\n            account['total'] = this.safeString (currencyBalance, 'total');\n            result[currencyCode] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency = undefined)",
        "line_start": 1532,
        "line_end": 1555,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositWithdrawFee (fee, currency = undefined) {\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < fee.length; j++) {\n            const networkEntry = fee[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.networkIdToCode (networkId);\n            const withdrawFee = this.safeNumber (networkEntry, 'fee');\n            result['withdraw'] = {\n                'fee': withdrawFee,\n                'percentage': undefined,\n            };\n            result['networks'][networkCode] = {\n                'withdraw': {\n                    'fee': withdrawFee,\n                    'percentage': undefined,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate",
        "line_start": 2369,
        "line_end": 2401,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "currentTime",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (currentTime)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (fundingRate, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"funding_rate\": \"0.0024\",\n         \"timestamp\": \"1644406050\",\n         \"market\": \"BTC/USD-PERP\",\n         \"next_funding_time\": \"1644406050\"\n     }"
        ],
        "source": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"funding_rate\": \"0.0024\",\n        //         \"timestamp\": \"1644406050\",\n        //         \"market\": \"BTC/USD-PERP\",\n        //         \"next_funding_time\": \"1644406050\"\n        //     }\n        //\n        const currentTime = this.safeIntegerProduct (fundingRate, 'timestamp', 1000);\n        const nextFundingRateTimestamp = this.safeIntegerProduct (fundingRate, 'next_funding_time', 1000);\n        const marketId = this.safeString (fundingRate, 'market');\n        return {\n            'info': fundingRate,\n            'symbol': this.safeSymbol (marketId, market),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': currentTime,\n            'datetime': this.iso8601 (currentTime),\n            'previousFundingRate': undefined,\n            'nextFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'nextFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'nextFundingDatetime': undefined,\n            'fundingRate': this.safeNumber (fundingRate, 'funding_rate'),\n            'fundingTimestamp': nextFundingRateTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 1871,
        "line_end": 1886,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"funding_rate\": \"0.0024\",\n         \"timestamp\": \"1644406050\"\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"funding_rate\": \"0.0024\",\n        //         \"timestamp\": \"1644406050\"\n        //     }\n        //\n        const timestamp = this.safeIntegerProduct (contract, 'timestamp', 0.001);\n        return {\n            'info': contract,\n            'symbol': undefined,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2224,
        "line_end": 2315,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "parsedTrade['id']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "parsedTrade['timestamp']",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "parsedTrade['datetime']",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "parsedTrade['order']",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['base']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "parsedTrade['amount']",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "parsedTrade['fee']",
            "comment": null
          },
          {
            "key": "id",
            "value": "parsedTransaction['id']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "parsedTransaction['timestamp']",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "parsedTransaction['datetime']",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "parsedTransaction['txid']",
            "comment": null
          },
          {
            "key": "currency",
            "value": "parsedTransaction['currency']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "parsedTransaction['amount']",
            "comment": null
          },
          {
            "key": "status",
            "value": "parsedTransaction['status']",
            "comment": null
          },
          {
            "key": "fee",
            "value": "parsedTransaction['fee']",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"fee\": \"0.00000000\",\n             \"btc_usd\": \"0.00\",\n             \"id\": 1234567894,\n             \"usd\": 0,\n             \"btc\": 0,\n             \"datetime\": \"2018-09-08 09:00:31\",\n             \"type\": \"1\",\n             \"xrp\": \"-20.00000000\",\n             \"eur\": 0,\n         },\n         {\n             \"fee\": \"0.00000000\",\n             \"btc_usd\": \"0.00\",\n             \"id\": 1134567891,\n             \"usd\": 0,\n             \"btc\": 0,\n             \"datetime\": \"2018-09-07 18:47:52\",\n             \"type\": \"0\",\n             \"xrp\": \"20.00000000\",\n             \"eur\": 0,\n         },\n     ]"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     [\n        //         {\n        //             \"fee\": \"0.00000000\",\n        //             \"btc_usd\": \"0.00\",\n        //             \"id\": 1234567894,\n        //             \"usd\": 0,\n        //             \"btc\": 0,\n        //             \"datetime\": \"2018-09-08 09:00:31\",\n        //             \"type\": \"1\",\n        //             \"xrp\": \"-20.00000000\",\n        //             \"eur\": 0,\n        //         },\n        //         {\n        //             \"fee\": \"0.00000000\",\n        //             \"btc_usd\": \"0.00\",\n        //             \"id\": 1134567891,\n        //             \"usd\": 0,\n        //             \"btc\": 0,\n        //             \"datetime\": \"2018-09-07 18:47:52\",\n        //             \"type\": \"0\",\n        //             \"xrp\": \"20.00000000\",\n        //             \"eur\": 0,\n        //         },\n        //     ]\n        //\n        const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n        if (type === 'trade') {\n            const parsedTrade = this.parseTrade (item);\n            let market = undefined;\n            const keys = Object.keys (item);\n            for (let i = 0; i < keys.length; i++) {\n                if (keys[i].indexOf ('_') >= 0) {\n                    const marketId = keys[i].replace ('_', '');\n                    market = this.safeMarket (marketId, market);\n                }\n            }\n            // if the market is still not defined\n            // try to deduce it from used keys\n            if (market === undefined) {\n                market = this.getMarketFromTrade (item);\n            }\n            const direction = (parsedTrade['side'] === 'buy') ? 'in' : 'out';\n            return this.safeLedgerEntry ({\n                'info': item,\n                'id': parsedTrade['id'],\n                'timestamp': parsedTrade['timestamp'],\n                'datetime': parsedTrade['datetime'],\n                'direction': direction,\n                'account': undefined,\n                'referenceId': parsedTrade['order'],\n                'referenceAccount': undefined,\n                'type': type,\n                'currency': market['base'],\n                'amount': parsedTrade['amount'],\n                'before': undefined,\n                'after': undefined,\n                'status': 'ok',\n                'fee': parsedTrade['fee'],\n            }, currency) as LedgerEntry;\n        } else {\n            const parsedTransaction = this.parseTransaction (item, currency);\n            let direction = undefined;\n            if ('amount' in item) {\n                const amount = this.safeString (item, 'amount');\n                direction = Precise.stringGt (amount, '0') ? 'in' : 'out';\n            } else if (('currency' in parsedTransaction) && parsedTransaction['currency'] !== undefined) {\n                const currencyCode = this.safeString (parsedTransaction, 'currency');\n                currency = this.currency (currencyCode);\n                const amount = this.safeString (item, currency['id']);\n                direction = Precise.stringGt (amount, '0') ? 'in' : 'out';\n            }\n            return this.safeLedgerEntry ({\n                'info': item,\n                'id': parsedTransaction['id'],\n                'timestamp': parsedTransaction['timestamp'],\n                'datetime': parsedTransaction['datetime'],\n                'direction': direction,\n                'account': undefined,\n                'referenceId': parsedTransaction['txid'],\n                'referenceAccount': undefined,\n                'type': type,\n                'currency': parsedTransaction['currency'],\n                'amount': parsedTransaction['amount'],\n                'before': undefined,\n                'after': undefined,\n                'status': parsedTransaction['status'],\n                'fee': parsedTransaction['fee'],\n            }, currency) as LedgerEntry;\n        }\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2214,
        "line_end": 2222,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            '0': 'transaction',\n            '1': 'transaction',\n            '2': 'trade',\n            '14': 'transfer',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1250,
        "line_end": 1269,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"high\": \"9064.77\",\n         \"timestamp\": \"1593961440\",\n         \"volume\": \"18.49436608\",\n         \"low\": \"9040.87\",\n         \"close\": \"9064.77\",\n         \"open\": \"9040.87\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"high\": \"9064.77\",\n        //         \"timestamp\": \"1593961440\",\n        //         \"volume\": \"18.49436608\",\n        //         \"low\": \"9040.87\",\n        //         \"close\": \"9064.77\",\n        //         \"open\": \"9040.87\"\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2125,
        "line_end": 2212,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "transactions",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{ status: \"Finished\",\n       \"id\": 731693945,\n       \"client_order_id\": '',\n       \"transactions\":\n       [ { fee: \"0.000019\",\n           \"price\": \"0.00015803\",\n           \"datetime\": \"2018-01-07 10:45:34.132551\",\n           \"btc\": \"0.0079015000000000\",\n           \"tid\": 42777395,\n           \"type\": 2,\n           \"xrp\": \"50.00000000\" } ] }",
          "{ \"id\": 468646390,\n       \"client_order_id\": \"\",\n       \"status\": \"Canceled\",\n       \"transactions\": [{\n           \"eth\": \"0.23000000\",\n           \"fee\": \"0.09\",\n           \"tid\": 25810126,\n           \"usd\": \"69.8947000000000000\",\n           \"type\": 2,\n           \"price\": \"303.89000000\",\n           \"datetime\": \"2017-11-11 07:22:20.710567\"\n       }]}",
          "{\n           \"price\": \"0.00008012\",\n           \"client_order_id\": '',\n           \"currency_pair\": \"XRP/BTC\",\n           \"datetime\": \"2019-01-31 21:23:36\",\n           \"amount\": \"15.00000000\",\n           \"type\": \"0\",\n           \"id\": \"2814205012\"\n       }",
          "{\n        \"id\": 1453282316578816,\n        \"amount\": \"0.02035278\",\n        \"price\": \"2100.45\",\n        \"type\": 0,\n        \"market\": \"BTC/USD\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //   from fetch order:\n        //     { status: \"Finished\",\n        //       \"id\": 731693945,\n        //       \"client_order_id\": '',\n        //       \"transactions\":\n        //       [ { fee: \"0.000019\",\n        //           \"price\": \"0.00015803\",\n        //           \"datetime\": \"2018-01-07 10:45:34.132551\",\n        //           \"btc\": \"0.0079015000000000\",\n        //           \"tid\": 42777395,\n        //           \"type\": 2,\n        //           \"xrp\": \"50.00000000\" } ] }\n        //\n        //   partially filled order:\n        //     { \"id\": 468646390,\n        //       \"client_order_id\": \"\",\n        //       \"status\": \"Canceled\",\n        //       \"transactions\": [{\n        //           \"eth\": \"0.23000000\",\n        //           \"fee\": \"0.09\",\n        //           \"tid\": 25810126,\n        //           \"usd\": \"69.8947000000000000\",\n        //           \"type\": 2,\n        //           \"price\": \"303.89000000\",\n        //           \"datetime\": \"2017-11-11 07:22:20.710567\"\n        //       }]}\n        //\n        //   from create order response:\n        //       {\n        //           \"price\": \"0.00008012\",\n        //           \"client_order_id\": '',\n        //           \"currency_pair\": \"XRP/BTC\",\n        //           \"datetime\": \"2019-01-31 21:23:36\",\n        //           \"amount\": \"15.00000000\",\n        //           \"type\": \"0\",\n        //           \"id\": \"2814205012\"\n        //       }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"id\": 1453282316578816,\n        //        \"amount\": \"0.02035278\",\n        //        \"price\": \"2100.45\",\n        //        \"type\": 0,\n        //        \"market\": \"BTC/USD\"\n        //    }\n        //\n        const id = this.safeString (order, 'id');\n        const clientOrderId = this.safeString (order, 'client_order_id');\n        let side = this.safeString (order, 'type');\n        if (side !== undefined) {\n            side = (side === '1') ? 'sell' : 'buy';\n        }\n        // there is no timestamp from fetchOrder\n        const timestamp = this.parse8601 (this.safeString (order, 'datetime'));\n        const marketId = this.safeStringLower (order, 'currency_pair');\n        const symbol = this.safeSymbol (marketId, market, '/');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const amount = this.safeString (order, 'amount');\n        const transactions = this.safeValue (order, 'transactions', []);\n        const price = this.safeString (order, 'price');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': undefined,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': undefined,\n            'trades': transactions,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1720,
        "line_end": 1729,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'In Queue': 'open',\n            'Open': 'open',\n            'Finished': 'closed',\n            'Canceled': 'canceled',\n            'Cancel pending': 'canceling',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 899,
        "line_end": 945,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"timestamp\": \"1686068944\",\n     \"high\": \"26252\",\n     \"last\": \"26216\",\n     \"bid\": \"26208\",\n     \"vwap\": \"25681\",\n     \"volume\": \"3563.13819902\",\n     \"low\": \"25350\",\n     \"ask\": \"26211\",\n     \"open\": \"25730\",\n     \"open_24\": \"25895\",\n     \"percent_change_24\": \"1.24\",\n     \"pair\": \"BTC/USD\"\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // {\n        //     \"timestamp\": \"1686068944\",\n        //     \"high\": \"26252\",\n        //     \"last\": \"26216\",\n        //     \"bid\": \"26208\",\n        //     \"vwap\": \"25681\",\n        //     \"volume\": \"3563.13819902\",\n        //     \"low\": \"25350\",\n        //     \"ask\": \"26211\",\n        //     \"open\": \"25730\",\n        //     \"open_24\": \"25895\",\n        //     \"percent_change_24\": \"1.24\",\n        //     \"pair\": \"BTC/USD\"\n        // }\n        //\n        const marketId = this.safeString (ticker, 'pair');\n        const symbol = this.safeSymbol (marketId, market, undefined);\n        const timestamp = this.safeTimestamp (ticker, 'timestamp');\n        const vwap = this.safeString (ticker, 'vwap');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = Precise.stringMul (baseVolume, vwap);\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': vwap,\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1079,
        "line_end": 1208,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"date\": \"1637845199\",\n          \"tid\": \"209895701\",\n          \"amount\": \"0.00500000\",\n          \"type\": \"0\",             // Transaction type: 0 - buy; 1 - sell\n          \"price\": \"4451.25\"\n      }",
          "{\n          \"fee\": \"0.11128\",\n          \"eth_usdt\":  4451.25,\n          \"datetime\": \"2021-11-25 12:59:59.322000\",\n          \"usdt\": \"-22.26\",\n          \"order_id\":  1429545880227846,\n          \"usd\":  0,\n          \"btc\":  0,\n          \"eth\": \"0.00500000\",\n          \"type\": \"2\",                    // Transaction type: 0 - deposit; 1 - withdrawal; 2 - market trade; 14 - sub account transfer; 25 - credited with staked assets; 26 - sent assets to staking; 27 - staking reward; 32 - referral reward; 35 - inter account transfer.\n          \"id\":  209895701,\n          \"eur\":  0\n      }",
          "{\n          \"fee\": \"0.11128\",\n          \"price\": \"4451.25000000\",\n          \"datetime\": \"2021-11-25 12:59:59.322000\",\n          \"usdt\": \"22.25625000\",\n          \"tid\": 209895701,\n          \"eth\": \"0.00500000\",\n          \"type\": 2                       // Transaction type: 0 - deposit; 1 - withdrawal; 2 - market trade\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"date\": \"1637845199\",\n        //          \"tid\": \"209895701\",\n        //          \"amount\": \"0.00500000\",\n        //          \"type\": \"0\",             // Transaction type: 0 - buy; 1 - sell\n        //          \"price\": \"4451.25\"\n        //      }\n        //\n        // fetchMyTrades, trades returned within fetchOrder (private)\n        //\n        //      {\n        //          \"fee\": \"0.11128\",\n        //          \"eth_usdt\":  4451.25,\n        //          \"datetime\": \"2021-11-25 12:59:59.322000\",\n        //          \"usdt\": \"-22.26\",\n        //          \"order_id\":  1429545880227846,\n        //          \"usd\":  0,\n        //          \"btc\":  0,\n        //          \"eth\": \"0.00500000\",\n        //          \"type\": \"2\",                    // Transaction type: 0 - deposit; 1 - withdrawal; 2 - market trade; 14 - sub account transfer; 25 - credited with staked assets; 26 - sent assets to staking; 27 - staking reward; 32 - referral reward; 35 - inter account transfer.\n        //          \"id\":  209895701,\n        //          \"eur\":  0\n        //      }\n        //\n        // from fetchOrder (private)\n        //\n        //      {\n        //          \"fee\": \"0.11128\",\n        //          \"price\": \"4451.25000000\",\n        //          \"datetime\": \"2021-11-25 12:59:59.322000\",\n        //          \"usdt\": \"22.25625000\",\n        //          \"tid\": 209895701,\n        //          \"eth\": \"0.00500000\",\n        //          \"type\": 2                       // Transaction type: 0 - deposit; 1 - withdrawal; 2 - market trade\n        //      }\n        //\n        const id = this.safeString2 (trade, 'id', 'tid');\n        let symbol = undefined;\n        let side = undefined;\n        let priceString = this.safeString (trade, 'price');\n        let amountString = this.safeString (trade, 'amount');\n        const orderId = this.safeString (trade, 'order_id');\n        const type = undefined;\n        let costString = this.safeString (trade, 'cost');\n        let rawMarketId = undefined;\n        if (market === undefined) {\n            const keys = Object.keys (trade);\n            for (let i = 0; i < keys.length; i++) {\n                const currentKey = keys[i];\n                if (currentKey !== 'order_id' && currentKey.indexOf ('_') >= 0) {\n                    rawMarketId = currentKey;\n                    market = this.safeMarket (rawMarketId, market, '_');\n                }\n            }\n        }\n        // if the market is still not defined\n        // try to deduce it from used keys\n        if (market === undefined) {\n            market = this.getMarketFromTrade (trade);\n        }\n        const feeCostString = this.safeString (trade, 'fee');\n        const feeCurrency = market['quote'];\n        const priceId = (rawMarketId !== undefined) ? rawMarketId : market['id'];\n        priceString = this.safeString (trade, priceId, priceString);\n        amountString = this.safeString (trade, market['baseId'], amountString);\n        costString = this.safeString (trade, market['quoteId'], costString);\n        symbol = market['symbol'];\n        const datetimeString = this.safeString2 (trade, 'date', 'datetime');\n        let timestamp = undefined;\n        if (datetimeString !== undefined) {\n            if (datetimeString.indexOf (' ') >= 0) {\n                // iso8601\n                timestamp = this.parse8601 (datetimeString);\n            } else {\n                // string unix epoch in seconds\n                timestamp = parseInt (datetimeString);\n                timestamp = timestamp * 1000;\n            }\n        }\n        // if it is a private trade\n        if ('id' in trade) {\n            if (amountString !== undefined) {\n                const isAmountNeg = Precise.stringLt (amountString, '0');\n                if (isAmountNeg) {\n                    side = 'sell';\n                    amountString = Precise.stringNeg (amountString);\n                } else {\n                    side = 'buy';\n                }\n            }\n        } else {\n            side = this.safeString (trade, 'type');\n            if (side === '1') {\n                side = 'sell';\n            } else if (side === '0') {\n                side = 'buy';\n            } else {\n                side = undefined;\n            }\n        }\n        if (costString !== undefined) {\n            costString = Precise.stringAbs (costString);\n        }\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrency,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': type,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1409,
        "line_end": 1420,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        const marketId = this.safeString (fee, 'market');\n        const fees = this.safeDict (fee, 'fees', {});\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (marketId, market),\n            'maker': this.safeNumber (fees, 'maker'),\n            'taker': this.safeNumber (fees, 'taker'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTradingFees",
        "signature": "parseTradingFees (fees)",
        "line_start": 1422,
        "line_end": 1430,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingFees (fees) {\n        const result: Dict = { 'info': fees };\n        for (let i = 0; i < fees.length; i++) {\n            const fee = this.parseTradingFee (fees[i]);\n            const symbol = fee['symbol'];\n            result[symbol] = fee;\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1987,
        "line_end": 2108,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transaction_id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fee\": \"0.00000000\",\n         \"btc_usd\": \"0.00\",\n         \"id\": 1234567894,\n         \"usd\": 0,\n         \"btc\": 0,\n         \"datetime\": \"2018-09-08 09:00:31\",\n         \"type\": \"1\",\n         \"xrp\": \"-20.00000000\",\n         \"eur\": 0,\n     }",
          "{\n         \"status\": 2,\n         \"datetime\": \"2018-10-17 10:58:13\",\n         \"currency\": \"BTC\",\n         \"amount\": \"0.29669259\",\n         \"address\": \"aaaaa\",\n         \"type\": 1,\n         \"id\": 111111,\n         \"transaction_id\": \"xxxx\",\n     }",
          "{\n         \"id\": 3386432,\n         \"type\": 14,\n         \"amount\": \"863.21332500\",\n         \"status\": 2,\n         \"address\": \"rE1sdh25BJQ3qFwngiTBwaq3zPGGYcrjp1?dt=1455\",\n         \"currency\": \"XRP\",\n         \"datetime\": \"2018-01-05 15:27:55\",\n         \"transaction_id\": \"001743B03B0C79BA166A064AC0142917B050347B4CB23BA2AB4B91B3C5608F4C\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDepositsWithdrawals\n        //\n        //     {\n        //         \"fee\": \"0.00000000\",\n        //         \"btc_usd\": \"0.00\",\n        //         \"id\": 1234567894,\n        //         \"usd\": 0,\n        //         \"btc\": 0,\n        //         \"datetime\": \"2018-09-08 09:00:31\",\n        //         \"type\": \"1\",\n        //         \"xrp\": \"-20.00000000\",\n        //         \"eur\": 0,\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"status\": 2,\n        //         \"datetime\": \"2018-10-17 10:58:13\",\n        //         \"currency\": \"BTC\",\n        //         \"amount\": \"0.29669259\",\n        //         \"address\": \"aaaaa\",\n        //         \"type\": 1,\n        //         \"id\": 111111,\n        //         \"transaction_id\": \"xxxx\",\n        //     }\n        //\n        //     {\n        //         \"id\": 3386432,\n        //         \"type\": 14,\n        //         \"amount\": \"863.21332500\",\n        //         \"status\": 2,\n        //         \"address\": \"rE1sdh25BJQ3qFwngiTBwaq3zPGGYcrjp1?dt=1455\",\n        //         \"currency\": \"XRP\",\n        //         \"datetime\": \"2018-01-05 15:27:55\",\n        //         \"transaction_id\": \"001743B03B0C79BA166A064AC0142917B050347B4CB23BA2AB4B91B3C5608F4C\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString (transaction, 'datetime'));\n        const currencyId = this.getCurrencyIdFromTransaction (transaction);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const feeCost = this.safeString (transaction, 'fee');\n        let feeCurrency = undefined;\n        let amount = undefined;\n        if ('amount' in transaction) {\n            amount = this.safeString (transaction, 'amount');\n        } else if (currency !== undefined) {\n            amount = this.safeString (transaction, currency['id'], amount);\n            feeCurrency = currency['code'];\n        } else if ((code !== undefined) && (currencyId !== undefined)) {\n            amount = this.safeString (transaction, currencyId, amount);\n            feeCurrency = code;\n        }\n        if (amount !== undefined) {\n            // withdrawals have a negative amount\n            amount = Precise.stringAbs (amount);\n        }\n        let status = 'ok';\n        if ('status' in transaction) {\n            status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        }\n        let type = undefined;\n        if ('type' in transaction) {\n            // from fetchDepositsWithdrawals\n            const rawType = this.safeString (transaction, 'type');\n            if (rawType === '0') {\n                type = 'deposit';\n            } else if (rawType === '1') {\n                type = 'withdrawal';\n            }\n        } else {\n            // from fetchWithdrawals\n            type = 'withdrawal';\n        }\n        let tag = undefined;\n        let address = this.safeString (transaction, 'address');\n        if (address !== undefined) {\n            // dt (destination tag) is embedded into the address field\n            const addressParts = address.split ('?dt=');\n            const numParts = addressParts.length;\n            if (numParts > 1) {\n                address = addressParts[0];\n                tag = addressParts[1];\n            }\n        }\n        let fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': feeCurrency,\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'transaction_id'),\n            'type': type,\n            'currency': code,\n            'network': undefined,\n            'amount': this.parseNumber (amount),\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tag,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionFees",
        "signature": "parseTransactionFees (response, codes = undefined)",
        "line_start": 1486,
        "line_end": 1504,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionFees (response, codes = undefined) {\n        const result: Dict = {};\n        const currencies = this.indexBy (response, 'currency');\n        const ids = Object.keys (currencies);\n        for (let i = 0; i < ids.length; i++) {\n            const id = ids[i];\n            const fees = this.safeValue (response, i, {});\n            const code = this.safeCurrencyCode (id);\n            if ((codes !== undefined) && !this.inArray (code, codes)) {\n                continue;\n            }\n            result[code] = {\n                'withdraw_fee': this.safeNumber (fees, 'fee'),\n                'deposit': {},\n                'info': this.safeDict (currencies, id),\n            };\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2110,
        "line_end": 2123,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        //\n        //   withdrawals:\n        //   0 (open), 1 (in process), 2 (finished), 3 (canceled) or 4 (failed).\n        //\n        const statuses: Dict = {\n            '0': 'pending', // Open\n            '1': 'pending', // In process\n            '2': 'ok', // Finished\n            '3': 'canceled', // Canceled\n            '4': 'failed', // Failed\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency = undefined)",
        "line_start": 2570,
        "line_end": 2586,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer, currency = undefined) {\n        //\n        //    { status: 'ok' }\n        //\n        const status = this.safeString (transfer, 'status');\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': currency['code'],\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 2588,
        "line_end": 2594,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'ok': 'ok',\n            'error': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitteam": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2101,
        "line_end": 2166,
        "comment": null,
        "mappings": [
          {
            "key": "free",
            "value": "free",
            "comment": null
          },
          {
            "key": "used",
            "value": "used",
            "comment": null
          },
          {
            "key": "total",
            "value": "total",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"ok\": true,\n         \"result\": {\n             \"free\": {\n                 \"USDT\": \"0\",\n                 \"DEL\": \"0\",\n                 \"BTC\": \"0\",\n                 ...\n             },\n                 \"used\": {\n                 \"USDT\": \"0\",\n                 \"DEL\": \"0\",\n                 \"BTC\": \"0\",\n                 ...\n             },\n             \"total\": {\n                 \"USDT\": \"0\",\n                 \"DEL\": \"0\",\n                 \"BTC\": \"0\",\n                 ...\n             },\n             \"USDT\": {\n                 \"free\": \"0\",\n                 \"used\": \"0\",\n                 \"total\": \"0\",\n             },\n             \"DEL\": {\n                 \"free\": \"0\",\n                 \"used\": \"0\",\n                 \"total\": \"0\",\n             },\n             \"BTC\": {\n                 \"free\": \"0\",\n                 \"used\": \"0\",\n                 \"total\": \"0\",\n             }\n             ...\n         }\n     }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        //     {\n        //         \"ok\": true,\n        //         \"result\": {\n        //             \"free\": {\n        //                 \"USDT\": \"0\",\n        //                 \"DEL\": \"0\",\n        //                 \"BTC\": \"0\",\n        //                 ...\n        //             },\n        //                 \"used\": {\n        //                 \"USDT\": \"0\",\n        //                 \"DEL\": \"0\",\n        //                 \"BTC\": \"0\",\n        //                 ...\n        //             },\n        //             \"total\": {\n        //                 \"USDT\": \"0\",\n        //                 \"DEL\": \"0\",\n        //                 \"BTC\": \"0\",\n        //                 ...\n        //             },\n        //             \"USDT\": {\n        //                 \"free\": \"0\",\n        //                 \"used\": \"0\",\n        //                 \"total\": \"0\",\n        //             },\n        //             \"DEL\": {\n        //                 \"free\": \"0\",\n        //                 \"used\": \"0\",\n        //                 \"total\": \"0\",\n        //             },\n        //             \"BTC\": {\n        //                 \"free\": \"0\",\n        //                 \"used\": \"0\",\n        //                 \"total\": \"0\",\n        //             }\n        //             ...\n        //         }\n        //     }\n        //\n        const timestamp = this.milliseconds ();\n        const balance: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const result = this.safeValue (response, 'result', {});\n        const balanceByCurrencies = this.omit (result, [ 'free', 'used', 'total' ]);\n        const rawCurrencyIds = Object.keys (balanceByCurrencies);\n        for (let i = 0; i < rawCurrencyIds.length; i++) {\n            const rawCurrencyId = rawCurrencyIds[i];\n            const currencyBalance = this.safeValue (result, rawCurrencyId);\n            const free = this.safeString (currencyBalance, 'free');\n            const used = this.safeString (currencyBalance, 'used');\n            const total = this.safeString (currencyBalance, 'total');\n            const currencyCode = this.safeCurrencyCode (rawCurrencyId.toLowerCase ());\n            balance[currencyCode] = {\n                'free': free,\n                'used': used,\n                'total': total,\n            };\n        }\n        return this.safeBalance (balance);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 458,
        "line_end": 526,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "numericId",
            "value": "numericId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseStep'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteStep'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "created",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': minCost,\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'name');\n        const numericId = this.safeInteger (market, 'id');\n        const parts = id.split ('_');\n        const baseId = this.safeString (parts, 0);\n        const quoteId = this.safeString (parts, 1);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const active = this.safeValue (market, 'active');\n        const timeStart = this.safeString (market, 'timeStart');\n        const created = this.parse8601 (timeStart);\n        let minCost = undefined;\n        const currenciesValuedInUsd = this.safeValue (this.options, 'currenciesValuedInUsd', {});\n        const quoteInUsd = this.safeBool (currenciesValuedInUsd, quote, false);\n        if (quoteInUsd) {\n            const settings = this.safeValue (market, 'settings', {});\n            minCost = this.safeNumber (settings, 'limit_usd');\n        }\n        return this.safeMarketStructure ({\n            'id': id,\n            'numericId': numericId,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseStep'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteStep'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            },\n            'created': created,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 796,
        "line_end": 815,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"t\": 1669680000,\n         \"o\": 16430.636894,\n         \"h\": 17065.229582,\n         \"l\": 16346.114155,\n         \"c\": 16882.297736,\n         \"v\": 3.0872548400000115\n     },"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"t\": 1669680000,\n        //         \"o\": 16430.636894,\n        //         \"h\": 17065.229582,\n        //         \"l\": 16346.114155,\n        //         \"c\": 16882.297736,\n        //         \"v\": 3.0872548400000115\n        //     },\n        //\n        return [\n            this.safeTimestamp (ohlcv, 't'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber (ohlcv, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1216,
        "line_end": 1356,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "'GTC'",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "false",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 106733308,\n         \"orderId\": \"13074362\",\n         \"userId\": 21639,\n         \"pair\": \"btc_usdt\",\n         \"pairId\": 22,\n         \"quantity\": \"0.00001\",\n         \"price\": \"50000\",\n         \"executedPrice\": \"37017.495008\",\n         \"fee\": {\n             \"amount\": \"0.00000002\",\n             \"symbol\": \"btc\",\n             \"userId\": 21639,\n             \"decimals\": 8,\n             \"symbolId\": 11\n         },\n         \"orderCid\": null,\n         \"executed\": \"0.00001\",\n         \"expires\": null,\n         \"baseDecimals\": 8,\n         \"quoteDecimals\": 6,\n         \"timestamp\": 1700594959,\n         \"status\": \"executed\",\n         \"side\": \"buy\",\n         \"type\": \"limit\",\n         \"createdAt\": \"2023-11-21T19:29:19.946Z\",\n         \"updatedAt\": \"2023-11-21T19:29:19.946Z\"\n     },",
          "{\n         \"id\": 106494347,\n         \"orderId\": \"13214332\",\n         \"userId\": 15912,\n         \"pair\": \"eth_usdt\",\n         \"pairId\": 2,\n         \"quantity\": \"0.00448598\",\n         \"price\": \"2015.644995\",\n         \"executedPrice\": \"2015.644995\",\n         \"fee\": {\n             \"amount\": \"0\",\n             \"symbol\": \"eth\",\n             \"userId\": 15912,\n             \"decimals\": 18,\n             \"symbolId\": 2,\n             \"discountAmount\": \"0\",\n             \"discountSymbol\": \"btt\",\n             \"discountDecimals\": 18,\n             \"discountSymbolId\": 5\n         },\n         \"orderCid\": null,\n         \"executed\": \"0.00448598\",\n         \"expires\": null,\n         \"baseDecimals\": 18,\n         \"quoteDecimals\": 6,\n         \"timestamp\": 1700470476,\n         \"status\": \"executed\",\n         \"side\": \"buy\",\n         \"type\": \"limit\",\n         \"stopPrice\": null,\n         \"slippage\": null\n     }",
          "{\n         \"id\": 106733308,\n         \"userId\": 21639,\n         \"quantity\": \"0.00001\",\n         \"pair\": \"btc_usdt\",\n         \"side\": \"buy\",\n         \"price\": \"50000\",\n         \"executed\": \"0\",\n         \"executedPrice\": \"0\",\n         \"status\": \"created\",\n         \"baseDecimals\": 8,\n         \"quoteDecimals\": 6,\n         \"pairId\": 22,\n         \"type\": \"limit\",\n         \"stopPrice\": null,\n         \"slippage\": null,\n         \"timestamp\": \"1700594959\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrders\n        //     {\n        //         \"id\": 106733308,\n        //         \"orderId\": \"13074362\",\n        //         \"userId\": 21639,\n        //         \"pair\": \"btc_usdt\",\n        //         \"pairId\": 22,\n        //         \"quantity\": \"0.00001\",\n        //         \"price\": \"50000\",\n        //         \"executedPrice\": \"37017.495008\",\n        //         \"fee\": {\n        //             \"amount\": \"0.00000002\",\n        //             \"symbol\": \"btc\",\n        //             \"userId\": 21639,\n        //             \"decimals\": 8,\n        //             \"symbolId\": 11\n        //         },\n        //         \"orderCid\": null,\n        //         \"executed\": \"0.00001\",\n        //         \"expires\": null,\n        //         \"baseDecimals\": 8,\n        //         \"quoteDecimals\": 6,\n        //         \"timestamp\": 1700594959,\n        //         \"status\": \"executed\",\n        //         \"side\": \"buy\",\n        //         \"type\": \"limit\",\n        //         \"createdAt\": \"2023-11-21T19:29:19.946Z\",\n        //         \"updatedAt\": \"2023-11-21T19:29:19.946Z\"\n        //     },\n        //\n        // fetchOrder\n        //     {\n        //         \"id\": 106494347,\n        //         \"orderId\": \"13214332\",\n        //         \"userId\": 15912,\n        //         \"pair\": \"eth_usdt\",\n        //         \"pairId\": 2,\n        //         \"quantity\": \"0.00448598\",\n        //         \"price\": \"2015.644995\",\n        //         \"executedPrice\": \"2015.644995\",\n        //         \"fee\": {\n        //             \"amount\": \"0\",\n        //             \"symbol\": \"eth\",\n        //             \"userId\": 15912,\n        //             \"decimals\": 18,\n        //             \"symbolId\": 2,\n        //             \"discountAmount\": \"0\",\n        //             \"discountSymbol\": \"btt\",\n        //             \"discountDecimals\": 18,\n        //             \"discountSymbolId\": 5\n        //         },\n        //         \"orderCid\": null,\n        //         \"executed\": \"0.00448598\",\n        //         \"expires\": null,\n        //         \"baseDecimals\": 18,\n        //         \"quoteDecimals\": 6,\n        //         \"timestamp\": 1700470476,\n        //         \"status\": \"executed\",\n        //         \"side\": \"buy\",\n        //         \"type\": \"limit\",\n        //         \"stopPrice\": null,\n        //         \"slippage\": null\n        //     }\n        //\n        // createOrder\n        //     {\n        //         \"id\": 106733308,\n        //         \"userId\": 21639,\n        //         \"quantity\": \"0.00001\",\n        //         \"pair\": \"btc_usdt\",\n        //         \"side\": \"buy\",\n        //         \"price\": \"50000\",\n        //         \"executed\": \"0\",\n        //         \"executedPrice\": \"0\",\n        //         \"status\": \"created\",\n        //         \"baseDecimals\": 8,\n        //         \"quoteDecimals\": 6,\n        //         \"pairId\": 22,\n        //         \"type\": \"limit\",\n        //         \"stopPrice\": null,\n        //         \"slippage\": null,\n        //         \"timestamp\": \"1700594959\"\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const marketId = this.safeString (order, 'pair');\n        market = this.safeMarket (marketId, market);\n        const clientOrderId = this.safeString (order, 'orderCid');\n        let timestamp = undefined;\n        const createdAt = this.safeString (order, 'createdAt');\n        if (createdAt !== undefined) {\n            timestamp = this.parse8601 (createdAt);\n        } else {\n            timestamp = this.safeTimestamp (order, 'timestamp');\n        }\n        const updatedAt = this.safeString (order, 'updatedAt');\n        const lastUpdateTimestamp = this.parse8601 (updatedAt);\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const type = this.parseOrderType (this.safeString (order, 'type'));\n        const side = this.safeString (order, 'side');\n        const feeRaw = this.safeValue (order, 'fee');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'quantity');\n        const filled = this.safeString (order, 'executed');\n        let fee = undefined;\n        if (feeRaw !== undefined) {\n            const feeCost = this.safeString (feeRaw, 'amount');\n            const feeCurrencyId = this.safeString (feeRaw, 'symbol');\n            fee = {\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': status,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': 'GTC',\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString (order, 'stopPrice'),\n            'average': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'filled': filled,\n            'remaining': undefined,\n            'fee': fee,\n            'trades': undefined,\n            'info': order,\n            'postOnly': false,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1358,
        "line_end": 1370,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'accepted': 'open',\n            'executed': 'closed',\n            'cancelled': 'canceled',\n            'partiallyCancelled': 'canceled',\n            'delete': 'rejected',\n            'inactive': 'rejected',\n            'executing': 'open',\n            'created': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1372,
        "line_end": 1378,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'market': 'market',\n            'limit': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1649,
        "line_end": 1775,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bestBidPrice",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bestBidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "bestAskPrice",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "bestAskVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "changePcnt",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 2,\n         \"name\": \"eth_usdt\",\n         \"baseAssetId\": 2,\n         \"quoteAssetId\": 3,\n         \"fullName\": \"ETH USDT\",\n         \"description\": \"ETH   USDT\",\n         \"lastBuy\": \"1976.715012\",\n         \"lastSell\": \"1971.995006\",\n         \"lastPrice\": \"1976.715012\",\n         \"change24\": \"1.02\",\n         \"volume24\": 24.0796457,\n         \"volume24USD\": 44282.347995912205,\n         \"active\": true,\n         \"baseStep\": 8,\n         \"quoteStep\": 6,\n         \"status\": 1,\n         \"asks\": [\n             {\n             \"price\": \"1976.405003\",\n             \"quantity\": \"0.0051171\",\n             \"amount\": \"10.1134620408513\"\n             },\n             {\n             \"price\": \"1976.405013\",\n             \"quantity\": \"0.09001559\",\n             \"amount\": \"177.90726332415267\"\n             },\n             {\n             \"price\": \"2010.704988\",\n             \"quantity\": \"0.00127892\",\n             \"amount\": \"2.57153082325296\"\n             }\n                ...\n         ],\n         \"bids\": [\n             {\n             \"price\": \"1976.404988\",\n             \"quantity\": \"0.09875861\",\n             \"amount\": \"195.18700941194668\"\n             },\n             {\n             \"price\": \"1905.472973\",\n             \"quantity\": \"0.00263591\",\n             \"amount\": \"5.02265526426043\"\n             },\n             {\n             \"price\": \"1904.274973\",\n             \"quantity\": \"0.09425304\",\n             \"amount\": \"179.48370520116792\"\n             }\n                ...\n         ],\n         \"updateId\": \"78\",\n         \"timeStart\": \"2021-01-28T09:19:30.706Z\",\n         \"makerFee\": 200,\n         \"takerFee\": 200,\n         \"quoteVolume24\": 49125.1374009045,\n         \"lowPrice24\": 1966.704999,\n         \"highPrice24\": 2080.354997,\n         ...\n     }",
          "{\n         \"trading_pairs\": \"BTC_USDT\",\n         \"base_currency\": \"BTC\",\n         \"quote_currency\": \"USDT\",\n         \"last_price\": 37669.955001,\n         \"lowest_ask\": 37670.055,\n         \"highest_bid\": 37669.955,\n         \"base_volume\": 6.81156888,\n         \"quote_volume\": 257400.516878529,\n         \"price_change_percent_24h\": -0.29,\n         \"highest_price_24h\": 38389.994463,\n         \"lowest_price_24h\": 37574.894999\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //     {\n        //         \"id\": 2,\n        //         \"name\": \"eth_usdt\",\n        //         \"baseAssetId\": 2,\n        //         \"quoteAssetId\": 3,\n        //         \"fullName\": \"ETH USDT\",\n        //         \"description\": \"ETH   USDT\",\n        //         \"lastBuy\": \"1976.715012\",\n        //         \"lastSell\": \"1971.995006\",\n        //         \"lastPrice\": \"1976.715012\",\n        //         \"change24\": \"1.02\",\n        //         \"volume24\": 24.0796457,\n        //         \"volume24USD\": 44282.347995912205,\n        //         \"active\": true,\n        //         \"baseStep\": 8,\n        //         \"quoteStep\": 6,\n        //         \"status\": 1,\n        //         \"asks\": [\n        //             {\n        //             \"price\": \"1976.405003\",\n        //             \"quantity\": \"0.0051171\",\n        //             \"amount\": \"10.1134620408513\"\n        //             },\n        //             {\n        //             \"price\": \"1976.405013\",\n        //             \"quantity\": \"0.09001559\",\n        //             \"amount\": \"177.90726332415267\"\n        //             },\n        //             {\n        //             \"price\": \"2010.704988\",\n        //             \"quantity\": \"0.00127892\",\n        //             \"amount\": \"2.57153082325296\"\n        //             }\n        //                ...\n        //         ],\n        //         \"bids\": [\n        //             {\n        //             \"price\": \"1976.404988\",\n        //             \"quantity\": \"0.09875861\",\n        //             \"amount\": \"195.18700941194668\"\n        //             },\n        //             {\n        //             \"price\": \"1905.472973\",\n        //             \"quantity\": \"0.00263591\",\n        //             \"amount\": \"5.02265526426043\"\n        //             },\n        //             {\n        //             \"price\": \"1904.274973\",\n        //             \"quantity\": \"0.09425304\",\n        //             \"amount\": \"179.48370520116792\"\n        //             }\n        //                ...\n        //         ],\n        //         \"updateId\": \"78\",\n        //         \"timeStart\": \"2021-01-28T09:19:30.706Z\",\n        //         \"makerFee\": 200,\n        //         \"takerFee\": 200,\n        //         \"quoteVolume24\": 49125.1374009045,\n        //         \"lowPrice24\": 1966.704999,\n        //         \"highPrice24\": 2080.354997,\n        //         ...\n        //     }\n        //\n        // fetchTickers\n        //     {\n        //         \"trading_pairs\": \"BTC_USDT\",\n        //         \"base_currency\": \"BTC\",\n        //         \"quote_currency\": \"USDT\",\n        //         \"last_price\": 37669.955001,\n        //         \"lowest_ask\": 37670.055,\n        //         \"highest_bid\": 37669.955,\n        //         \"base_volume\": 6.81156888,\n        //         \"quote_volume\": 257400.516878529,\n        //         \"price_change_percent_24h\": -0.29,\n        //         \"highest_price_24h\": 38389.994463,\n        //         \"lowest_price_24h\": 37574.894999\n        //     }\n        const marketId = this.safeStringLower (ticker, 'trading_pairs');\n        market = this.safeMarket (marketId, market);\n        let bestBidPrice = undefined;\n        let bestAskPrice = undefined;\n        let bestBidVolume = undefined;\n        let bestAskVolume = undefined;\n        const bids = this.safeValue (ticker, 'bids');\n        const asks = this.safeValue (ticker, 'asks');\n        if ((bids !== undefined) && (Array.isArray (bids)) && (asks !== undefined) && (Array.isArray (asks))) {\n            const bestBid = this.safeValue (bids, 0, {});\n            bestBidPrice = this.safeString (bestBid, 'price');\n            bestBidVolume = this.safeString (bestBid, 'quantity');\n            const bestAsk = this.safeValue (asks, 0, {});\n            bestAskPrice = this.safeString (bestAsk, 'price');\n            bestAskVolume = this.safeString (bestAsk, 'quantity');\n        } else {\n            bestBidPrice = this.safeString (ticker, 'highest_bid');\n            bestAskPrice = this.safeString (ticker, 'lowest_ask');\n        }\n        const baseVolume = this.safeString2 (ticker, 'volume24', 'base_volume');\n        const quoteVolume = this.safeString2 (ticker, 'quoteVolume24', 'quote_volume');\n        const high = this.safeString2 (ticker, 'highPrice24', 'highest_price_24h');\n        const low = this.safeString2 (ticker, 'lowPrice24', 'lowest_price_24h');\n        const close = this.safeString2 (ticker, 'lastPrice', 'last_price');\n        const changePcnt = this.safeString2 (ticker, 'change24', 'price_change_percent_24h');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'open': undefined,\n            'high': high,\n            'low': low,\n            'close': close,\n            'bid': bestBidPrice,\n            'bidVolume': bestBidVolume,\n            'ask': bestAskPrice,\n            'askVolume': bestAskVolume,\n            'vwap': undefined,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': changePcnt,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1980,
        "line_end": 2085,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "intTs",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (intTs)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"trade_id\": 34970337,\n         \"price\": 37769.994793,\n         \"base_volume\": 0.00119062,\n         \"quote_volume\": 44.96971120044166,\n         \"timestamp\": 1700827234000,\n         \"type\": \"buy\"\n     },",
          "{\n         \"id\": 34875793,\n         \"tradeId\": \"4368010\",\n         \"makerOrderId\": 106742914,\n         \"takerOrderId\": 106745926,\n         \"pairId\": 2,\n         \"quantity\": \"0.0027193\",\n         \"price\": \"1993.674994\",\n         \"isBuyerMaker\": true,\n         \"baseDecimals\": 18,\n         \"quoteDecimals\": 6,\n         \"side\": \"sell\",\n         \"timestamp\": 1700602983,\n         \"rewarded\": true,\n         \"makerUserId\": 21639,\n         \"takerUserId\": 15912,\n         \"baseCurrencyId\": 2,\n         \"quoteCurrencyId\": 3,\n         \"feeMaker\": {\n             \"amount\": \"0.00000543\",\n             \"symbol\": \"eth\",\n             \"userId\": 21639,\n             \"decimals\": 18,\n             \"symbolId\": 2\n         },\n         \"feeTaker\": {\n             \"amount\": \"0\",\n             \"symbol\": \"usdt\",\n             \"userId\": 15912,\n             \"decimals\": 6,\n             \"symbolId\": 3,\n             \"discountAmount\": \"0\",\n             \"discountSymbol\": \"btt\",\n             \"discountDecimals\": 18,\n             \"discountSymbolId\": 5\n         },\n         \"pair\": \"eth_usdt\",\n         \"createdAt\": \"2023-11-21T21:43:02.758Z\",\n         \"updatedAt\": \"2023-11-21T21:45:00.147Z\",\n         \"isCurrentSide\": \"maker\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //         \"trade_id\": 34970337,\n        //         \"price\": 37769.994793,\n        //         \"base_volume\": 0.00119062,\n        //         \"quote_volume\": 44.96971120044166,\n        //         \"timestamp\": 1700827234000,\n        //         \"type\": \"buy\"\n        //     },\n        //\n        // fetchMyTrades\n        //     {\n        //         \"id\": 34875793,\n        //         \"tradeId\": \"4368010\",\n        //         \"makerOrderId\": 106742914,\n        //         \"takerOrderId\": 106745926,\n        //         \"pairId\": 2,\n        //         \"quantity\": \"0.0027193\",\n        //         \"price\": \"1993.674994\",\n        //         \"isBuyerMaker\": true,\n        //         \"baseDecimals\": 18,\n        //         \"quoteDecimals\": 6,\n        //         \"side\": \"sell\",\n        //         \"timestamp\": 1700602983,\n        //         \"rewarded\": true,\n        //         \"makerUserId\": 21639,\n        //         \"takerUserId\": 15912,\n        //         \"baseCurrencyId\": 2,\n        //         \"quoteCurrencyId\": 3,\n        //         \"feeMaker\": {\n        //             \"amount\": \"0.00000543\",\n        //             \"symbol\": \"eth\",\n        //             \"userId\": 21639,\n        //             \"decimals\": 18,\n        //             \"symbolId\": 2\n        //         },\n        //         \"feeTaker\": {\n        //             \"amount\": \"0\",\n        //             \"symbol\": \"usdt\",\n        //             \"userId\": 15912,\n        //             \"decimals\": 6,\n        //             \"symbolId\": 3,\n        //             \"discountAmount\": \"0\",\n        //             \"discountSymbol\": \"btt\",\n        //             \"discountDecimals\": 18,\n        //             \"discountSymbolId\": 5\n        //         },\n        //         \"pair\": \"eth_usdt\",\n        //         \"createdAt\": \"2023-11-21T21:43:02.758Z\",\n        //         \"updatedAt\": \"2023-11-21T21:45:00.147Z\",\n        //         \"isCurrentSide\": \"maker\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'pair');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const id = this.safeString2 (trade, 'id', 'trade_id');\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString2 (trade, 'quantity', 'base_volume');\n        const cost = this.safeString (trade, 'quote_volume');\n        const takerOrMaker = this.safeString (trade, 'isCurrentSide');\n        let timestamp = this.safeString (trade, 'timestamp');\n        if (takerOrMaker !== undefined) {\n            timestamp = Precise.stringMul (timestamp, '1000');\n        }\n        // the exchange returns the side of the taker\n        let side = this.safeString2 (trade, 'side', 'type');\n        let feeInfo = undefined;\n        let order = undefined;\n        if (takerOrMaker === 'maker') {\n            if (side === 'sell') {\n                side = 'buy';\n            } else if (side === 'buy') {\n                side = 'sell';\n            }\n            order = this.safeString (trade, 'makerOrderId');\n            feeInfo = this.safeValue (trade, 'feeMaker', {});\n        } else if (takerOrMaker === 'taker') {\n            order = this.safeString (trade, 'takerOrderId');\n            feeInfo = this.safeValue (trade, 'feeTaker', {});\n        }\n        const feeCurrencyId = this.safeString (feeInfo, 'symbol');\n        const feeCost = this.safeString (feeInfo, 'amount');\n        const fee = {\n            'currency': this.safeCurrencyCode (feeCurrencyId),\n            'cost': feeCost,\n        };\n        const intTs = this.parseToInt (timestamp);\n        return this.safeTrade ({\n            'id': id,\n            'order': order,\n            'timestamp': intTs,\n            'datetime': this.iso8601 (intTs),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2284,
        "line_end": 2373,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'description')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 1329229,\n         \"orderId\": null,\n         \"transactionCoreId\": \"561418\",\n         \"userId\": 21639,\n         \"recipient\": \"0x7d6a797f2406e06b2f9b41d067df324affa315dd\",\n         \"sender\": null,\n         \"symbolId\": 3,\n         \"CommissionId\": null,\n         \"amount\": \"100000000\",\n         \"params\": {\n             \"tx_id\": \"0x2253823c828d838acd983fe6a348fb0e034efe3874b081871d8b80da76ec758b\"\n         },\n         \"reason\": null,\n         \"timestamp\": 1700594180417,\n         \"status\": \"success\",\n         \"statusDescription\": null,\n         \"type\": \"deposit\",\n         \"message\": null,\n         \"blockChain\": \"Ethereum\",\n         \"before\": 0,\n         \"after\": 100000000,\n         \"currency\": {\n             \"symbol\": \"usdt\",\n             \"decimals\": 6,\n             \"blockChain\": \"\",\n             \"links\": [\n                 {\n                     \"tx\": \"https://etherscan.io/tx/\",\n                     \"address\": \"https://etherscan.io/address/\",\n                     \"blockChain\": \"Ethereum\"\n                 },\n                 {\n                     \"tx\": \"https://tronscan.org/#/transaction/\",\n                     \"address\": \"https://tronscan.org/#/address/\",\n                     \"blockChain\": \"Tron\"\n                 },\n                 {\n                     \"tx\": \"https://bscscan.com/tx/\",\n                     \"address\": \"https://bscscan.com/address/\",\n                     \"blockChain\": \"Binance\"\n                 }\n             ]\n         }\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"id\": 1329229,\n        //         \"orderId\": null,\n        //         \"transactionCoreId\": \"561418\",\n        //         \"userId\": 21639,\n        //         \"recipient\": \"0x7d6a797f2406e06b2f9b41d067df324affa315dd\",\n        //         \"sender\": null,\n        //         \"symbolId\": 3,\n        //         \"CommissionId\": null,\n        //         \"amount\": \"100000000\",\n        //         \"params\": {\n        //             \"tx_id\": \"0x2253823c828d838acd983fe6a348fb0e034efe3874b081871d8b80da76ec758b\"\n        //         },\n        //         \"reason\": null,\n        //         \"timestamp\": 1700594180417,\n        //         \"status\": \"success\",\n        //         \"statusDescription\": null,\n        //         \"type\": \"deposit\",\n        //         \"message\": null,\n        //         \"blockChain\": \"Ethereum\",\n        //         \"before\": 0,\n        //         \"after\": 100000000,\n        //         \"currency\": {\n        //             \"symbol\": \"usdt\",\n        //             \"decimals\": 6,\n        //             \"blockChain\": \"\",\n        //             \"links\": [\n        //                 {\n        //                     \"tx\": \"https://etherscan.io/tx/\",\n        //                     \"address\": \"https://etherscan.io/address/\",\n        //                     \"blockChain\": \"Ethereum\"\n        //                 },\n        //                 {\n        //                     \"tx\": \"https://tronscan.org/#/transaction/\",\n        //                     \"address\": \"https://tronscan.org/#/address/\",\n        //                     \"blockChain\": \"Tron\"\n        //                 },\n        //                 {\n        //                     \"tx\": \"https://bscscan.com/tx/\",\n        //                     \"address\": \"https://bscscan.com/address/\",\n        //                     \"blockChain\": \"Binance\"\n        //                 }\n        //             ]\n        //         }\n        //     }\n        //\n        const currencyObject = this.safeValue (transaction, 'currency');\n        const currencyId = this.safeString (currencyObject, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const id = this.safeString (transaction, 'id');\n        const params = this.safeValue (transaction, 'params');\n        const txid = this.safeString (params, 'tx_id');\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        let networkId = this.safeString (transaction, 'blockChain');\n        if (networkId === undefined) {\n            const links = this.safeValue (currencyObject, 'links', []);\n            const blockChain = this.safeValue (links, 0, {});\n            networkId = this.safeString (blockChain, 'blockChain');\n        }\n        const addressFrom = this.safeString (transaction, 'sender');\n        const addressTo = this.safeString (transaction, 'recipient');\n        const tag = this.safeString (transaction, 'message');\n        const type = this.parseTransactionType (this.safeString (transaction, 'type'));\n        const amount = this.parseValueToPricision (transaction, 'amount', currencyObject, 'decimals');\n        const status = this.parseTransactionStatus (this.safeValue (transaction, 'status'));\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (networkId),\n            'addressFrom': addressFrom,\n            'address': undefined,\n            'addressTo': addressTo,\n            'tagFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'type': type,\n            'amount': this.parseNumber (amount),\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'fee': undefined,\n            'comment': this.safeString (transaction, 'description'),\n            'internal': false,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2383,
        "line_end": 2389,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'approving': 'pending',\n            'success': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 2375,
        "line_end": 2381,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseValueToPricision",
        "signature": "parseValueToPricision (valueObject, valueKey, preciseObject, precisionKey)",
        "line_start": 1380,
        "line_end": 1388,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseValueToPricision (valueObject, valueKey, preciseObject, precisionKey) {\n        const valueRawString = this.safeString (valueObject, valueKey);\n        const precisionRawString = this.safeString (preciseObject, precisionKey);\n        if (valueRawString === undefined || precisionRawString === undefined) {\n            return undefined;\n        }\n        const precisionString = this.parsePrecision (precisionRawString);\n        return Precise.stringMul (valueRawString, precisionString);\n    }"
      }
    ],
    "bittrade": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1182,
        "line_end": 1204,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response['data'], 'list', []);\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            let account = undefined;\n            if (code in result) {\n                account = result[code];\n            } else {\n                account = this.account ();\n            }\n            if (balance['type'] === 'trade') {\n                account['free'] = this.safeString (balance, 'balance');\n            }\n            if (balance['type'] === 'frozen') {\n                account['used'] = this.safeString (balance, 'balance');\n            }\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseCancelOrders",
        "signature": "parseCancelOrders (orders)",
        "line_start": 1657,
        "line_end": 1713,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'order-id', 'order_id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'failed'",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client-order-id')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"success\": [\n            \"5983466\"\n        ],\n        \"failed\": [\n            {\n                \"err-msg\": \"Incorrect order state\",\n                \"order-state\": 7,\n                \"order-id\": \"\",\n                \"err-code\": \"order-orderstate-error\",\n                \"client-order-id\": \"first\"\n            },\n            ...\n        ]\n    }",
          "{\n        \"errors\": [\n            {\n                \"order_id\": \"769206471845261312\",\n                \"err_code\": 1061,\n                \"err_msg\": \"This order doesnt exist.\"\n            }\n        ],\n        \"successes\": \"1258075374411399168,1258075393254871040\"\n    }"
        ],
        "source": "parseCancelOrders (orders) {\n        //\n        //    {\n        //        \"success\": [\n        //            \"5983466\"\n        //        ],\n        //        \"failed\": [\n        //            {\n        //                \"err-msg\": \"Incorrect order state\",\n        //                \"order-state\": 7,\n        //                \"order-id\": \"\",\n        //                \"err-code\": \"order-orderstate-error\",\n        //                \"client-order-id\": \"first\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        //    {\n        //        \"errors\": [\n        //            {\n        //                \"order_id\": \"769206471845261312\",\n        //                \"err_code\": 1061,\n        //                \"err_msg\": \"This order doesnt exist.\"\n        //            }\n        //        ],\n        //        \"successes\": \"1258075374411399168,1258075393254871040\"\n        //    }\n        //\n        const successes = this.safeString (orders, 'successes');\n        let success = undefined;\n        if (successes !== undefined) {\n            success = successes.split (',');\n        } else {\n            success = this.safeList (orders, 'success', []);\n        }\n        const failed = this.safeList2 (orders, 'errors', 'failed', []);\n        const result = [];\n        for (let i = 0; i < success.length; i++) {\n            const order = success[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': order,\n                'status': 'canceled',\n            }));\n        }\n        for (let i = 0; i < failed.length; i++) {\n            const order = failed[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': this.safeString2 (order, 'order-id', 'order_id'),\n                'status': 'failed',\n                'clientOrderId': this.safeString (order, 'client-order-id'),\n            }));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined)",
        "line_start": 1756,
        "line_end": 1783,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"usdt\",\n         \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n         \"addressTag\": \"\",\n         \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"currency\": \"usdt\",\n        //         \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n        //         \"addressTag\": \"\",\n        //         \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const tag = this.safeString (depositAddress, 'addressTag');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const networkId = this.safeString (depositAddress, 'chain');\n        const networks = this.safeValue (currency, 'networks', {});\n        const networksById = this.indexBy (networks, 'id');\n        const networkValue = this.safeValue (networksById, networkId, networkId);\n        const network = this.safeString (networkValue, 'network');\n        this.checkAddress (address);\n        return {\n            'currency': code,\n            'address': address,\n            'tag': tag,\n            'network': network,\n            'info': depositAddress,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1008,
        "line_end": 1029,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"amount\":1.2082,\n         \"open\":0.025096,\n         \"close\":0.025095,\n         \"high\":0.025096,\n         \"id\":1591515300,\n         \"count\":6,\n         \"low\":0.025095,\n         \"vol\":0.0303205097\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"amount\":1.2082,\n        //         \"open\":0.025096,\n        //         \"close\":0.025095,\n        //         \"high\":0.025096,\n        //         \"id\":1591515300,\n        //         \"count\":6,\n        //         \"low\":0.025095,\n        //         \"vol\":0.0303205097\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'id'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'amount'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1389,
        "line_end": 1471,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{                  id:  13997833014,\n                    \"symbol\": \"ethbtc\",\n              \"account-id\":  3398321,\n                    \"amount\": \"0.045000000000000000\",\n                     \"price\": \"0.034014000000000000\",\n              \"created-at\":  1545836976871,\n                      \"type\": \"sell-limit\",\n            \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n       \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n              \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n             \"finished-at\":  1545837948214,\n                    \"source\": \"spot-api\",\n                     \"state\": \"filled\",\n             \"canceled-at\":  0                      }",
          "{                  id:  20395337822,\n                    \"symbol\": \"ethbtc\",\n              \"account-id\":  5685075,\n                    \"amount\": \"0.001000000000000000\",\n                     \"price\": \"0.0\",\n              \"created-at\":  1545831584023,\n                      \"type\": \"buy-market\",\n            \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n       \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n              \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n             \"finished-at\":  1545831584181,\n                    \"source\": \"spot-api\",\n                     \"state\": \"filled\",\n             \"canceled-at\":  0                      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {                  id:  13997833014,\n        //                    \"symbol\": \"ethbtc\",\n        //              \"account-id\":  3398321,\n        //                    \"amount\": \"0.045000000000000000\",\n        //                     \"price\": \"0.034014000000000000\",\n        //              \"created-at\":  1545836976871,\n        //                      \"type\": \"sell-limit\",\n        //            \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n        //       \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n        //              \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n        //             \"finished-at\":  1545837948214,\n        //                    \"source\": \"spot-api\",\n        //                     \"state\": \"filled\",\n        //             \"canceled-at\":  0                      }\n        //\n        //     {                  id:  20395337822,\n        //                    \"symbol\": \"ethbtc\",\n        //              \"account-id\":  5685075,\n        //                    \"amount\": \"0.001000000000000000\",\n        //                     \"price\": \"0.0\",\n        //              \"created-at\":  1545831584023,\n        //                      \"type\": \"buy-market\",\n        //            \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n        //       \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n        //              \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n        //             \"finished-at\":  1545831584181,\n        //                    \"source\": \"spot-api\",\n        //                     \"state\": \"filled\",\n        //             \"canceled-at\":  0                      }\n        //\n        const id = this.safeString (order, 'id');\n        let side = undefined;\n        let type = undefined;\n        let status = undefined;\n        if ('type' in order) {\n            const orderType = order['type'].split ('-');\n            side = orderType[0];\n            type = orderType[1];\n            status = this.parseOrderStatus (this.safeString (order, 'state'));\n        }\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (order, 'created-at');\n        const clientOrderId = this.safeString (order, 'client-order-id');\n        const amount = this.safeString (order, 'amount');\n        const filled = this.safeString2 (order, 'filled-amount', 'field-amount'); // typo in their API, filled amount\n        const price = this.safeString (order, 'price');\n        const cost = this.safeString2 (order, 'filled-cash-amount', 'field-cash-amount'); // same typo\n        const feeCost = this.safeString2 (order, 'filled-fees', 'field-fees'); // typo in their API, filled fees\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            const feeCurrency = (side === 'sell') ? market['quote'] : market['base'];\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'average': undefined,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1378,
        "line_end": 1387,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'partial-filled': 'open',\n            'partial-canceled': 'canceled',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'submitted': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 613,
        "line_end": 697,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 26228.672978342216,\n         \"open\": 9078.95,\n         \"close\": 9146.86,\n         \"high\": 9155.41,\n         \"id\": 209988544334,\n         \"count\": 265846,\n         \"low\": 8988.0,\n         \"version\": 209988544334,\n         \"ask\": [ 9146.87, 0.156134 ],\n         \"vol\": 2.3822168242201668E8,\n         \"bid\": [ 9146.86, 0.080758 ],\n     }",
          "{\n         \"symbol\": \"bhdht\",\n         \"open\":  2.3938,\n         \"high\":  2.4151,\n         \"low\":  2.3323,\n         \"close\":  2.3909,\n         \"amount\":  628.992,\n         \"vol\":  1493.71841095,\n         \"count\":  2088,\n         \"bid\":  2.3643,\n         \"bidSize\":  0.7136,\n         \"ask\":  2.4061,\n         \"askSize\":  0.4156\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"amount\": 26228.672978342216,\n        //         \"open\": 9078.95,\n        //         \"close\": 9146.86,\n        //         \"high\": 9155.41,\n        //         \"id\": 209988544334,\n        //         \"count\": 265846,\n        //         \"low\": 8988.0,\n        //         \"version\": 209988544334,\n        //         \"ask\": [ 9146.87, 0.156134 ],\n        //         \"vol\": 2.3822168242201668E8,\n        //         \"bid\": [ 9146.86, 0.080758 ],\n        //     }\n        //\n        // fetchTickers\n        //     {\n        //         \"symbol\": \"bhdht\",\n        //         \"open\":  2.3938,\n        //         \"high\":  2.4151,\n        //         \"low\":  2.3323,\n        //         \"close\":  2.3909,\n        //         \"amount\":  628.992,\n        //         \"vol\":  1493.71841095,\n        //         \"count\":  2088,\n        //         \"bid\":  2.3643,\n        //         \"bidSize\":  0.7136,\n        //         \"ask\":  2.4061,\n        //         \"askSize\":  0.4156\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeInteger (ticker, 'ts');\n        let bid = undefined;\n        let bidVolume = undefined;\n        let ask = undefined;\n        let askVolume = undefined;\n        if ('bid' in ticker) {\n            if (Array.isArray (ticker['bid'])) {\n                bid = this.safeString (ticker['bid'], 0);\n                bidVolume = this.safeString (ticker['bid'], 1);\n            } else {\n                bid = this.safeString (ticker, 'bid');\n                bidVolume = this.safeString (ticker, 'bidSize');\n            }\n        }\n        if ('ask' in ticker) {\n            if (Array.isArray (ticker['ask'])) {\n                ask = this.safeString (ticker['ask'], 0);\n                askVolume = this.safeString (ticker['ask'], 1);\n            } else {\n                ask = this.safeString (ticker, 'ask');\n                askVolume = this.safeString (ticker, 'askSize');\n            }\n        }\n        const open = this.safeString (ticker, 'open');\n        const close = this.safeString (ticker, 'close');\n        const baseVolume = this.safeString (ticker, 'amount');\n        const quoteVolume = this.safeString (ticker, 'vol');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': close,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 819,
        "line_end": 900,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 0.010411000000000000,\n         \"trade-id\": 102090736910,\n         \"ts\": 1583497692182,\n         \"id\": 10500517034273194594947,\n         \"price\": 9096.050000000000000000,\n         \"direction\": \"sell\"\n     }",
          "{\n          \"symbol\": \"swftcbtc\",\n          \"fee-currency\": \"swftc\",\n          \"filled-fees\": \"0\",\n          \"source\": \"spot-api\",\n          \"id\": 83789509854000,\n          \"type\": \"buy-limit\",\n          \"order-id\": 83711103204909,\n          'filled-points': \"0.005826843283532154\",\n          \"fee-deduct-currency\": \"ht\",\n          'filled-amount': \"45941.53\",\n          \"price\": \"0.0000001401\",\n          \"created-at\": 1597933260729,\n          \"match-id\": 100087455560,\n          \"role\": \"maker\",\n          \"trade-id\": 100050305348\n     },"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"amount\": 0.010411000000000000,\n        //         \"trade-id\": 102090736910,\n        //         \"ts\": 1583497692182,\n        //         \"id\": 10500517034273194594947,\n        //         \"price\": 9096.050000000000000000,\n        //         \"direction\": \"sell\"\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //          \"symbol\": \"swftcbtc\",\n        //          \"fee-currency\": \"swftc\",\n        //          \"filled-fees\": \"0\",\n        //          \"source\": \"spot-api\",\n        //          \"id\": 83789509854000,\n        //          \"type\": \"buy-limit\",\n        //          \"order-id\": 83711103204909,\n        //          'filled-points': \"0.005826843283532154\",\n        //          \"fee-deduct-currency\": \"ht\",\n        //          'filled-amount': \"45941.53\",\n        //          \"price\": \"0.0000001401\",\n        //          \"created-at\": 1597933260729,\n        //          \"match-id\": 100087455560,\n        //          \"role\": \"maker\",\n        //          \"trade-id\": 100050305348\n        //     },\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.safeInteger2 (trade, 'ts', 'created-at');\n        const order = this.safeString (trade, 'order-id');\n        let side = this.safeString (trade, 'direction');\n        let type = this.safeString (trade, 'type');\n        if (type !== undefined) {\n            const typeParts = type.split ('-');\n            side = typeParts[0];\n            type = typeParts[1];\n        }\n        const takerOrMaker = this.safeString (trade, 'role');\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString2 (trade, 'filled-amount', 'amount');\n        const cost = Precise.stringMul (price, amount);\n        let fee = undefined;\n        let feeCost = this.safeString (trade, 'filled-fees');\n        let feeCurrency = this.safeCurrencyCode (this.safeString (trade, 'fee-currency'));\n        const filledPoints = this.safeString (trade, 'filled-points');\n        if (filledPoints !== undefined) {\n            if ((feeCost === undefined) || (Precise.stringEq (feeCost, '0.0'))) {\n                feeCost = filledPoints;\n                feeCurrency = this.safeCurrencyCode (this.safeString (trade, 'fee-deduct-currency'));\n            }\n        }\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        const tradeId = this.safeString2 (trade, 'trade-id', 'tradeId');\n        const id = this.safeString (trade, 'id', tradeId);\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'symbol': symbol,\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        });\n    }"
      },
      {
        "name": "parseTradingLimits",
        "signature": "parseTradingLimits (limits, symbol: Str = undefined, params = {})",
        "line_start": 466,
        "line_end": 491,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "limits",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n                    'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n                },\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{                                  symbol: \"aidocbtc\",\n                  \"buy-limit-must-less-than\":  1.1,\n              \"sell-limit-must-greater-than\":  0.9,\n             \"limit-order-must-greater-than\":  1,\n                \"limit-order-must-less-than\":  5000000,\n        \"market-buy-order-must-greater-than\":  0.0001,\n           \"market-buy-order-must-less-than\":  100,\n       \"market-sell-order-must-greater-than\":  1,\n          \"market-sell-order-must-less-than\":  500000,\n           \"circuit-break-when-greater-than\":  10000,\n              \"circuit-break-when-less-than\":  10,\n     \"market-sell-order-rate-must-less-than\":  0.1,\n      \"market-buy-order-rate-must-less-than\":  0.1        }"
        ],
        "source": "parseTradingLimits (limits, symbol: Str = undefined, params = {}) {\n        //\n        //   {                                  symbol: \"aidocbtc\",\n        //                  \"buy-limit-must-less-than\":  1.1,\n        //              \"sell-limit-must-greater-than\":  0.9,\n        //             \"limit-order-must-greater-than\":  1,\n        //                \"limit-order-must-less-than\":  5000000,\n        //        \"market-buy-order-must-greater-than\":  0.0001,\n        //           \"market-buy-order-must-less-than\":  100,\n        //       \"market-sell-order-must-greater-than\":  1,\n        //          \"market-sell-order-must-less-than\":  500000,\n        //           \"circuit-break-when-greater-than\":  10000,\n        //              \"circuit-break-when-less-than\":  10,\n        //     \"market-sell-order-rate-must-less-than\":  0.1,\n        //      \"market-buy-order-rate-must-less-than\":  0.1        }\n        //\n        return {\n            'info': limits,\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n                    'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n                },\n            },\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1853,
        "line_end": 1932,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'data')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'tx-hash')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeStringUpper (transaction, 'chain')",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'address')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'address-tag')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'state'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'updated-at')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 8211029,\n         \"type\": \"deposit\",\n         \"currency\": \"eth\",\n         \"chain\": \"eth\",\n         'tx-hash': \"bd315....\",\n         \"amount\": 0.81162421,\n         \"address\": \"4b8b....\",\n         'address-tag\": '\",\n         \"fee\": 0,\n         \"state\": \"safe\",\n         \"created-at\": 1542180380965,\n         \"updated-at\": 1542180788077\n     }",
          "{\n         \"id\": 6908275,\n         \"type\": \"withdraw\",\n         \"currency\": \"btc\",\n         \"chain\": \"btc\",\n         'tx-hash': \"c1a1a....\",\n         \"amount\": 0.80257005,\n         \"address\": \"1QR....\",\n         'address-tag\": '\",\n         \"fee\": 0.0005,\n         \"state\": \"confirmed\",\n         \"created-at\": 1552107295685,\n         \"updated-at\": 1552108032859\n     }",
          "{\n         \"status\": \"ok\",\n         \"data\": \"99562054\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": 8211029,\n        //         \"type\": \"deposit\",\n        //         \"currency\": \"eth\",\n        //         \"chain\": \"eth\",\n        //         'tx-hash': \"bd315....\",\n        //         \"amount\": 0.81162421,\n        //         \"address\": \"4b8b....\",\n        //         'address-tag\": '\",\n        //         \"fee\": 0,\n        //         \"state\": \"safe\",\n        //         \"created-at\": 1542180380965,\n        //         \"updated-at\": 1542180788077\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": 6908275,\n        //         \"type\": \"withdraw\",\n        //         \"currency\": \"btc\",\n        //         \"chain\": \"btc\",\n        //         'tx-hash': \"c1a1a....\",\n        //         \"amount\": 0.80257005,\n        //         \"address\": \"1QR....\",\n        //         'address-tag\": '\",\n        //         \"fee\": 0.0005,\n        //         \"state\": \"confirmed\",\n        //         \"created-at\": 1552107295685,\n        //         \"updated-at\": 1552108032859\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"status\": \"ok\",\n        //         \"data\": \"99562054\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transaction, 'created-at');\n        const code = this.safeCurrencyCode (this.safeString (transaction, 'currency'));\n        let type = this.safeString (transaction, 'type');\n        if (type === 'withdraw') {\n            type = 'withdrawal';\n        }\n        let feeCost = this.safeString (transaction, 'fee');\n        if (feeCost !== undefined) {\n            feeCost = Precise.stringAbs (feeCost);\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'data'),\n            'txid': this.safeString (transaction, 'tx-hash'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.safeStringUpper (transaction, 'chain'),\n            'address': this.safeString (transaction, 'address'),\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': this.safeString (transaction, 'address-tag'),\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'state')),\n            'updated': this.safeInteger (transaction, 'updated-at'),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1934,
        "line_end": 1956,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // deposit statuses\n            'unknown': 'failed',\n            'confirming': 'pending',\n            'confirmed': 'ok',\n            'safe': 'ok',\n            'orphan': 'failed',\n            // withdrawal statuses\n            'submitted': 'pending',\n            'canceled': 'canceled',\n            'reexamine': 'pending',\n            'reject': 'failed',\n            'pass': 'pending',\n            'wallet-reject': 'failed',\n            // 'confirmed': 'ok', // present in deposit statuses\n            'confirm-error': 'failed',\n            'repealed': 'failed',\n            'wallet-transfer': 'pending',\n            'pre-transfer': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bitvavo": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1107,
        "line_end": 1123,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'symbol');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'inOrder');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseCurrenciesCustom",
        "signature": "parseCurrenciesCustom (currencies)",
        "line_start": 567,
        "line_end": 666,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "currency",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "name",
            "value": "this.safeString (currency, 'name')",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "deposit",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "withdrawal",
            "comment": null
          },
          {
            "key": "networks",
            "value": "networks",
            "comment": null
          },
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "precision",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "isFiat ? 'fiat' : 'crypto'",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                    'amount': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'deposit': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'withdraw': {\n                        'min': minWithdraw,\n                        'max': undefined,\n                    },\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                        'min': undefined,\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'min': undefined,\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                        'min': minWithdraw,\n                        'max': undefined,\n                    }",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"symbol\": \"USDT\",\n             \"displayTicker\": \"USDT\",\n             \"name\": \"Tether\",\n             \"slug\": \"tether\",\n             \"popularity\": -1,\n             \"decimals\": 6,\n             \"depositFee\": \"0\",\n             \"depositConfirmations\": 64,\n             \"depositStatus\": \"OK\",\n             \"withdrawalFee\": \"3.2\",\n             \"withdrawalMinAmount\": \"3.2\",\n             \"withdrawalStatus\": \"OK\",\n             \"networks\": [\n               \"ETH\"\n             ],\n             \"light\": {\n               \"color\": \"#009393\",\n               \"icon\": { \"hash\": \"4ad7c699\", \"svg\": \"https://...\", \"webp16\": \"https://...\", \"webp32\": \"https://...\", \"webp64\": \"https://...\", \"webp128\": \"https://...\", \"webp256\": \"https://...\", \"png16\": \"https://...\", \"png32\": \"https://...\", \"png64\": \"https://...\", \"png128\": \"https://...\", \"png256\": \"https://...\"\n               }\n             },\n             \"dark\": {\n               \"color\": \"#009393\",\n               \"icon\": { \"hash\": \"4ad7c699\", \"svg\": \"https://...\", \"webp16\": \"https://...\", \"webp32\": \"https://...\", \"webp64\": \"https://...\", \"webp128\": \"https://...\", \"webp256\": \"https://...\", \"png16\": \"https://...\", \"png32\": \"https://...\", \"png64\": \"https://...\", \"png128\": \"https://...\", \"png256\": \"https://...\"\n               }\n             },\n             \"visibility\": \"PUBLIC\",\n             \"message\": \"\"\n         },\n     ]"
        ],
        "source": "parseCurrenciesCustom (currencies) {\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"USDT\",\n        //             \"displayTicker\": \"USDT\",\n        //             \"name\": \"Tether\",\n        //             \"slug\": \"tether\",\n        //             \"popularity\": -1,\n        //             \"decimals\": 6,\n        //             \"depositFee\": \"0\",\n        //             \"depositConfirmations\": 64,\n        //             \"depositStatus\": \"OK\",\n        //             \"withdrawalFee\": \"3.2\",\n        //             \"withdrawalMinAmount\": \"3.2\",\n        //             \"withdrawalStatus\": \"OK\",\n        //             \"networks\": [\n        //               \"ETH\"\n        //             ],\n        //             \"light\": {\n        //               \"color\": \"#009393\",\n        //               \"icon\": { \"hash\": \"4ad7c699\", \"svg\": \"https://...\", \"webp16\": \"https://...\", \"webp32\": \"https://...\", \"webp64\": \"https://...\", \"webp128\": \"https://...\", \"webp256\": \"https://...\", \"png16\": \"https://...\", \"png32\": \"https://...\", \"png64\": \"https://...\", \"png128\": \"https://...\", \"png256\": \"https://...\"\n        //               }\n        //             },\n        //             \"dark\": {\n        //               \"color\": \"#009393\",\n        //               \"icon\": { \"hash\": \"4ad7c699\", \"svg\": \"https://...\", \"webp16\": \"https://...\", \"webp32\": \"https://...\", \"webp64\": \"https://...\", \"webp128\": \"https://...\", \"webp256\": \"https://...\", \"png16\": \"https://...\", \"png32\": \"https://...\", \"png64\": \"https://...\", \"png128\": \"https://...\", \"png256\": \"https://...\"\n        //               }\n        //             },\n        //             \"visibility\": \"PUBLIC\",\n        //             \"message\": \"\"\n        //         },\n        //     ]\n        //\n        const fiatCurrencies = this.safeList (this.options, 'fiatCurrencies', []);\n        const result: Dict = {};\n        for (let i = 0; i < currencies.length; i++) {\n            const currency = currencies[i];\n            const id = this.safeString (currency, 'symbol');\n            const code = this.safeCurrencyCode (id);\n            const isFiat = this.inArray (code, fiatCurrencies);\n            const networks: Dict = {};\n            const networksArray = this.safeList (currency, 'networks', []);\n            const deposit = this.safeString (currency, 'depositStatus') === 'OK';\n            const withdrawal = this.safeString (currency, 'withdrawalStatus') === 'OK';\n            const active = deposit && withdrawal;\n            const withdrawFee = this.safeNumber (currency, 'withdrawalFee');\n            const precision = this.safeString (currency, 'decimals', '8');\n            const minWithdraw = this.safeNumber (currency, 'withdrawalMinAmount');\n            // btw, absolutely all of them have 1 network atm\n            for (let j = 0; j < networksArray.length; j++) {\n                const networkId = networksArray[j];\n                const networkCode = this.networkIdToCode (networkId);\n                networks[networkCode] = {\n                    'info': currency,\n                    'id': networkId,\n                    'network': networkCode,\n                    'active': active,\n                    'deposit': deposit,\n                    'withdraw': withdrawal,\n                    'fee': withdrawFee,\n                    'precision': this.parseNumber (this.parsePrecision (precision)),\n                    'limits': {\n                        'withdraw': {\n                            'min': minWithdraw,\n                            'max': undefined,\n                        },\n                    },\n                };\n            }\n            result[code] = this.safeCurrencyStructure ({\n                'info': currency,\n                'id': id,\n                'code': code,\n                'name': this.safeString (currency, 'name'),\n                'active': active,\n                'deposit': deposit,\n                'withdraw': withdrawal,\n                'networks': networks,\n                'fee': withdrawFee,\n                'precision': undefined,\n                'type': isFiat ? 'fiat' : 'crypto',\n                'limits': {\n                    'amount': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'deposit': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'withdraw': {\n                        'min': minWithdraw,\n                        'max': undefined,\n                    },\n                },\n            });\n        }\n        return result;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2118,
        "line_end": 2160,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "this.safeNumber (fee, 'depositFee')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\": \"1INCH\",\n       \"name\": \"1inch\",\n       \"decimals\": 8,\n       \"depositFee\": \"0\",\n       \"depositConfirmations\": 64,\n       \"depositStatus\": \"OK\",\n       \"withdrawalFee\": \"6.1\",\n       \"withdrawalMinAmount\": \"6.1\",\n       \"withdrawalStatus\": \"OK\",\n       \"networks\": [\n         \"ETH\"\n       ],\n       \"message\": \"\"\n   }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //   {\n        //       \"symbol\": \"1INCH\",\n        //       \"name\": \"1inch\",\n        //       \"decimals\": 8,\n        //       \"depositFee\": \"0\",\n        //       \"depositConfirmations\": 64,\n        //       \"depositStatus\": \"OK\",\n        //       \"withdrawalFee\": \"6.1\",\n        //       \"withdrawalMinAmount\": \"6.1\",\n        //       \"withdrawalStatus\": \"OK\",\n        //       \"networks\": [\n        //         \"ETH\"\n        //       ],\n        //       \"message\": \"\"\n        //   }\n        //\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': this.safeNumber (fee, 'withdrawalFee'),\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': this.safeNumber (fee, 'depositFee'),\n                'percentage': false,\n            },\n            'networks': {},\n        };\n        const networks = this.safeValue (fee, 'networks');\n        let networkId = this.safeValue (networks, 0); // Bitvavo currently only supports one network per currency\n        const currencyCode = this.safeString (currency, 'code');\n        if (networkId === 'Mainnet') {\n            networkId = currencyCode;\n        }\n        const networkCode = this.networkIdToCode (networkId, currencyCode);\n        result['networks'][networkCode] = {\n            'deposit': result['deposit'],\n            'withdraw': result['withdraw'],\n        };\n        return result;\n    }"
      },
      {
        "name": "parseMarkets",
        "signature": "parseMarkets (markets)",
        "line_start": 454,
        "line_end": 519,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(status === 'trading')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                    'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'quantityDecimals'))),\n                    'price': this.safeNumber (market, 'tickSize'),\n                    'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'notionalDecimals'))),\n                }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                    'leverage': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'amount': {\n                        'min': this.safeNumber (market, 'minOrderInBaseAsset'),\n                        'max': this.safeNumber (market, 'maxOrderInBaseAsset'),\n                    },\n                    'price': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'cost': {\n                        'min': this.safeNumber (market, 'minOrderInQuoteAsset'),\n                        'max': this.safeNumber (market, 'maxOrderInQuoteAsset'),\n                    },\n                }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                        'min': undefined,\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                        'min': this.safeNumber (market, 'minOrderInBaseAsset'),\n                        'max': this.safeNumber (market, 'maxOrderInBaseAsset'),\n                    }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                        'min': undefined,\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                        'min': this.safeNumber (market, 'minOrderInQuoteAsset'),\n                        'max': this.safeNumber (market, 'maxOrderInQuoteAsset'),\n                    }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarkets (markets) {\n        const result = [];\n        const fees = this.fees;\n        for (let i = 0; i < markets.length; i++) {\n            const market = markets[i];\n            const id = this.safeString (market, 'market');\n            const baseId = this.safeString (market, 'base');\n            const quoteId = this.safeString (market, 'quote');\n            const base = this.safeCurrencyCode (baseId);\n            const quote = this.safeCurrencyCode (quoteId);\n            const status = this.safeString (market, 'status');\n            result.push (this.safeMarketStructure ({\n                'id': id,\n                'symbol': base + '/' + quote,\n                'base': base,\n                'quote': quote,\n                'settle': undefined,\n                'baseId': baseId,\n                'quoteId': quoteId,\n                'settleId': undefined,\n                'type': 'spot',\n                'spot': true,\n                'margin': false,\n                'swap': false,\n                'future': false,\n                'option': false,\n                'active': (status === 'trading'),\n                'contract': false,\n                'linear': undefined,\n                'inverse': undefined,\n                'contractSize': undefined,\n                'expiry': undefined,\n                'expiryDatetime': undefined,\n                'strike': undefined,\n                'optionType': undefined,\n                'taker': fees['trading']['taker'],\n                'maker': fees['trading']['maker'],\n                'precision': {\n                    'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'quantityDecimals'))),\n                    'price': this.safeNumber (market, 'tickSize'),\n                    'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'notionalDecimals'))),\n                },\n                'limits': {\n                    'leverage': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'amount': {\n                        'min': this.safeNumber (market, 'minOrderInBaseAsset'),\n                        'max': this.safeNumber (market, 'maxOrderInBaseAsset'),\n                    },\n                    'price': {\n                        'min': undefined,\n                        'max': undefined,\n                    },\n                    'cost': {\n                        'min': this.safeNumber (market, 'minOrderInQuoteAsset'),\n                        'max': this.safeNumber (market, 'maxOrderInQuoteAsset'),\n                    },\n                },\n                'created': undefined,\n                'info': market,\n            }));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1025,
        "line_end": 1044,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1590383700000,\n         \"8088.5\",\n         \"8088.5\",\n         \"8088.5\",\n         \"8088.5\",\n         \"0.04788623\"\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1590383700000,\n        //         \"8088.5\",\n        //         \"8088.5\",\n        //         \"8088.5\",\n        //         \"8088.5\",\n        //         \"0.04788623\"\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1698,
        "line_end": 1799,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'triggerPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": \"2e7ce7fc-44e2-4d80-a4a7-d079c4750b61\"\n     }",
          "{\n         \"orderId\":\"af76d6ce-9f7c-4006-b715-bb5d430652d0\",\n         \"market\":\"ETH-EUR\",\n         \"created\":1590505649241,\n         \"updated\":1590505649241,\n         \"status\":\"filled\",\n         \"side\":\"sell\",\n         \"orderType\":\"market\",\n         \"amount\":\"0.249825\",\n         \"amountRemaining\":\"0\",\n         \"price\": \"183.49\", // limit orders only\n         \"onHold\":\"0\",\n         \"onHoldCurrency\":\"ETH\",\n         \"filledAmount\":\"0.249825\",\n         \"filledAmountQuote\":\"45.84038925\",\n         \"feePaid\":\"0.12038925\",\n         \"feeCurrency\":\"EUR\",\n         \"fills\":[\n             {\n                 \"id\":\"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4\",\n                 \"timestamp\":1590505649245,\n                 \"amount\":\"0.249825\",\n                 \"price\":\"183.49\",\n                 \"taker\":true,\n                 \"fee\":\"0.12038925\",\n                 \"feeCurrency\":\"EUR\",\n                 \"settled\":true\n             }\n         ],\n         \"selfTradePrevention\":\"decrementAndCancel\",\n         \"visible\":false,\n         \"disableMarketProtection\":false\n         \"timeInForce\": \"GTC\",\n         \"postOnly\": true,\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // cancelOrder, cancelAllOrders\n        //\n        //     {\n        //         \"orderId\": \"2e7ce7fc-44e2-4d80-a4a7-d079c4750b61\"\n        //     }\n        //\n        // createOrder, fetchOrder, fetchOpenOrders, fetchOrders, editOrder\n        //\n        //     {\n        //         \"orderId\":\"af76d6ce-9f7c-4006-b715-bb5d430652d0\",\n        //         \"market\":\"ETH-EUR\",\n        //         \"created\":1590505649241,\n        //         \"updated\":1590505649241,\n        //         \"status\":\"filled\",\n        //         \"side\":\"sell\",\n        //         \"orderType\":\"market\",\n        //         \"amount\":\"0.249825\",\n        //         \"amountRemaining\":\"0\",\n        //         \"price\": \"183.49\", // limit orders only\n        //         \"onHold\":\"0\",\n        //         \"onHoldCurrency\":\"ETH\",\n        //         \"filledAmount\":\"0.249825\",\n        //         \"filledAmountQuote\":\"45.84038925\",\n        //         \"feePaid\":\"0.12038925\",\n        //         \"feeCurrency\":\"EUR\",\n        //         \"fills\":[\n        //             {\n        //                 \"id\":\"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4\",\n        //                 \"timestamp\":1590505649245,\n        //                 \"amount\":\"0.249825\",\n        //                 \"price\":\"183.49\",\n        //                 \"taker\":true,\n        //                 \"fee\":\"0.12038925\",\n        //                 \"feeCurrency\":\"EUR\",\n        //                 \"settled\":true\n        //             }\n        //         ],\n        //         \"selfTradePrevention\":\"decrementAndCancel\",\n        //         \"visible\":false,\n        //         \"disableMarketProtection\":false\n        //         \"timeInForce\": \"GTC\",\n        //         \"postOnly\": true,\n        //     }\n        //\n        const id = this.safeString (order, 'orderId');\n        const timestamp = this.safeInteger (order, 'created');\n        const marketId = this.safeString (order, 'market');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const side = this.safeString (order, 'side');\n        const type = this.safeString (order, 'orderType');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'amount');\n        const remaining = this.safeString (order, 'amountRemaining');\n        const filled = this.safeString (order, 'filledAmount');\n        let cost = this.safeString (order, 'filledAmountQuote');\n        if (cost === undefined) {\n            const amountQuote = this.safeString (order, 'amountQuote');\n            const amountQuoteRemaining = this.safeString (order, 'amountQuoteRemaining');\n            cost = Precise.stringSub (amountQuote, amountQuoteRemaining);\n        }\n        let fee = undefined;\n        const feeCost = this.safeNumber (order, 'feePaid');\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (order, 'feeCurrency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const rawTrades = this.safeValue (order, 'fills', []);\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const postOnly = this.safeValue (order, 'postOnly');\n        // https://github.com/ccxt/ccxt/issues/8489\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeNumber (order, 'triggerPrice'),\n            'amount': amount,\n            'cost': cost,\n            'average': undefined,\n            'filled': filled,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': rawTrades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1679,
        "line_end": 1696,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'open',\n            'canceled': 'canceled',\n            'canceledAuction': 'canceled',\n            'canceledSelfTradePrevention': 'canceled',\n            'canceledIOC': 'canceled',\n            'canceledFOK': 'canceled',\n            'canceledMarketProtection': 'canceled',\n            'canceledPostOnly': 'canceled',\n            'filled': 'closed',\n            'partiallyFilled': 'open',\n            'expired': 'canceled',\n            'rejected': 'canceled',\n            'awaitingTrigger': 'open', // https://github.com/ccxt/ccxt/issues/8489\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 703,
        "line_end": 751,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSize')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSize')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"market\":\"ETH-BTC\",\n         \"open\":\"0.022578\",\n         \"high\":\"0.023019\",\n         \"low\":\"0.022573\",\n         \"last\":\"0.023019\",\n         \"volume\":\"25.16366324\",\n         \"volumeQuote\":\"0.57333305\",\n         \"bid\":\"0.023039\",\n         \"bidSize\":\"0.53500578\",\n         \"ask\":\"0.023041\",\n         \"askSize\":\"0.47859202\",\n         \"timestamp\":1590381666900\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"market\":\"ETH-BTC\",\n        //         \"open\":\"0.022578\",\n        //         \"high\":\"0.023019\",\n        //         \"low\":\"0.022573\",\n        //         \"last\":\"0.023019\",\n        //         \"volume\":\"25.16366324\",\n        //         \"volumeQuote\":\"0.57333305\",\n        //         \"bid\":\"0.023039\",\n        //         \"bidSize\":\"0.53500578\",\n        //         \"ask\":\"0.023041\",\n        //         \"askSize\":\"0.47859202\",\n        //         \"timestamp\":1590381666900\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'market');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const last = this.safeString (ticker, 'last');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = this.safeString (ticker, 'volumeQuote');\n        const open = this.safeString (ticker, 'open');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': this.safeString (ticker, 'bidSize'),\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': this.safeString (ticker, 'askSize'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined, // previous day close\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 836,
        "line_end": 931,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":\"94154c98-6e8b-4e33-92a8-74e33fc05650\",\n         \"timestamp\":1590382761859,\n         \"amount\":\"0.06026079\",\n         \"price\":\"8095.3\",\n         \"side\":\"buy\"\n     }",
          "{\n         \"id\":\"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4\",\n         \"timestamp\":1590505649245,\n         \"amount\":\"0.249825\",\n         \"price\":\"183.49\",\n         \"taker\":true,\n         \"fee\":\"0.12038925\",\n         \"feeCurrency\":\"EUR\",\n         \"settled\":true\n     }",
          "{\n         \"id\":\"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4\",\n         \"orderId\":\"af76d6ce-9f7c-4006-b715-bb5d430652d0\",\n         \"timestamp\":1590505649245,\n         \"market\":\"ETH-EUR\",\n         \"side\":\"sell\",\n         \"amount\":\"0.249825\",\n         \"price\":\"183.49\",\n         \"taker\":true,\n         \"fee\":\"0.12038925\",\n         \"feeCurrency\":\"EUR\",\n         \"settled\":true\n     }",
          "{\n         \"event\": \"fill\",\n         \"timestamp\": 1590964470132,\n         \"market\": \"ETH-EUR\",\n         \"orderId\": \"85d082e1-eda4-4209-9580-248281a29a9a\",\n         \"fillId\": \"861d2da5-aa93-475c-8d9a-dce431bd4211\",\n         \"side\": \"sell\",\n         \"amount\": \"0.1\",\n         \"price\": \"211.46\",\n         \"taker\": true,\n         \"fee\": \"0.056\",\n         \"feeCurrency\": \"EUR\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"id\":\"94154c98-6e8b-4e33-92a8-74e33fc05650\",\n        //         \"timestamp\":1590382761859,\n        //         \"amount\":\"0.06026079\",\n        //         \"price\":\"8095.3\",\n        //         \"side\":\"buy\"\n        //     }\n        //\n        // createOrder, fetchOpenOrders, fetchOrders, editOrder (private)\n        //\n        //     {\n        //         \"id\":\"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4\",\n        //         \"timestamp\":1590505649245,\n        //         \"amount\":\"0.249825\",\n        //         \"price\":\"183.49\",\n        //         \"taker\":true,\n        //         \"fee\":\"0.12038925\",\n        //         \"feeCurrency\":\"EUR\",\n        //         \"settled\":true\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"id\":\"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4\",\n        //         \"orderId\":\"af76d6ce-9f7c-4006-b715-bb5d430652d0\",\n        //         \"timestamp\":1590505649245,\n        //         \"market\":\"ETH-EUR\",\n        //         \"side\":\"sell\",\n        //         \"amount\":\"0.249825\",\n        //         \"price\":\"183.49\",\n        //         \"taker\":true,\n        //         \"fee\":\"0.12038925\",\n        //         \"feeCurrency\":\"EUR\",\n        //         \"settled\":true\n        //     }\n        //\n        // watchMyTrades (private)\n        //\n        //     {\n        //         \"event\": \"fill\",\n        //         \"timestamp\": 1590964470132,\n        //         \"market\": \"ETH-EUR\",\n        //         \"orderId\": \"85d082e1-eda4-4209-9580-248281a29a9a\",\n        //         \"fillId\": \"861d2da5-aa93-475c-8d9a-dce431bd4211\",\n        //         \"side\": \"sell\",\n        //         \"amount\": \"0.1\",\n        //         \"price\": \"211.46\",\n        //         \"taker\": true,\n        //         \"fee\": \"0.056\",\n        //         \"feeCurrency\": \"EUR\"\n        //     }\n        //\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const side = this.safeString (trade, 'side');\n        const id = this.safeString2 (trade, 'id', 'fillId');\n        const marketId = this.safeString (trade, 'market');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const taker = this.safeValue (trade, 'taker');\n        let takerOrMaker = undefined;\n        if (taker !== undefined) {\n            takerOrMaker = taker ? 'taker' : 'maker';\n        }\n        const feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'feeCurrency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const orderId = this.safeString (trade, 'orderId');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFees",
        "signature": "parseTradingFees (fees, market = undefined)",
        "line_start": 956,
        "line_end": 982,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"fees\": {\n           \"taker\": \"0.0025\",\n           \"maker\": \"0.0015\",\n           \"volume\": \"10000.00\"\n         }\n     }"
        ],
        "source": "parseTradingFees (fees, market = undefined) {\n        //\n        //     {\n        //         \"fees\": {\n        //           \"taker\": \"0.0025\",\n        //           \"maker\": \"0.0015\",\n        //           \"volume\": \"10000.00\"\n        //         }\n        //     }\n        //\n        const feesValue = this.safeValue (fees, 'fees');\n        const maker = this.safeNumber (feesValue, 'maker');\n        const taker = this.safeNumber (feesValue, 'taker');\n        const result: Dict = {};\n        for (let i = 0; i < this.symbols.length; i++) {\n            const symbol = this.symbols[i];\n            result[symbol] = {\n                'info': fees,\n                'symbol': symbol,\n                'maker': maker,\n                'taker': taker,\n                'percentage': true,\n                'tierBased': true,\n            };\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2037,
        "line_end": 2116,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"success\": true,\n         \"symbol\": \"BTC\",\n         \"amount\": \"1.5\"\n     }",
          "{\n         \"timestamp\": 1542967486256,\n         \"symbol\": \"BTC\",\n         \"amount\": \"0.99994\",\n         \"address\": \"BitcoinAddress\",\n         \"paymentId\": \"10002653\",\n         \"txId\": \"927b3ea50c5bb52c6854152d305dfa1e27fc01d10464cf10825d96d69d235eb3\",\n         \"fee\": \"0.00006\",\n         \"status\": \"awaiting_processing\"\n     }",
          "{\n         \"timestamp\":1590492401000,\n         \"symbol\":\"ETH\",\n         \"amount\":\"0.249825\",\n         \"fee\":\"0\",\n         \"status\":\"completed\",\n         \"txId\":\"0x5167b473fd37811f9ef22364c3d54726a859ef9d98934b3a1e11d7baa8d2c2e2\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"success\": true,\n        //         \"symbol\": \"BTC\",\n        //         \"amount\": \"1.5\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"timestamp\": 1542967486256,\n        //         \"symbol\": \"BTC\",\n        //         \"amount\": \"0.99994\",\n        //         \"address\": \"BitcoinAddress\",\n        //         \"paymentId\": \"10002653\",\n        //         \"txId\": \"927b3ea50c5bb52c6854152d305dfa1e27fc01d10464cf10825d96d69d235eb3\",\n        //         \"fee\": \"0.00006\",\n        //         \"status\": \"awaiting_processing\"\n        //     }\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"timestamp\":1590492401000,\n        //         \"symbol\":\"ETH\",\n        //         \"amount\":\"0.249825\",\n        //         \"fee\":\"0\",\n        //         \"status\":\"completed\",\n        //         \"txId\":\"0x5167b473fd37811f9ef22364c3d54726a859ef9d98934b3a1e11d7baa8d2c2e2\"\n        //     }\n        //\n        const id = undefined;\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        const currencyId = this.safeString (transaction, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const amount = this.safeNumber (transaction, 'amount');\n        const address = this.safeString (transaction, 'address');\n        const txid = this.safeString (transaction, 'txId');\n        let fee = undefined;\n        const feeCost = this.safeNumber (transaction, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        let type = undefined;\n        if (('success' in transaction) || ('address' in transaction)) {\n            type = 'withdrawal';\n        } else {\n            type = 'deposit';\n        }\n        const tag = this.safeString (transaction, 'paymentId');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'addressFrom': undefined,\n            'address': address,\n            'addressTo': address,\n            'tagFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'fee': fee,\n            'network': undefined,\n            'comment': undefined,\n            'internal': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2022,
        "line_end": 2035,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'awaiting_processing': 'pending',\n            'awaiting_email_confirmation': 'pending',\n            'awaiting_bitvavo_inspection': 'pending',\n            'approved': 'pending',\n            'sending': 'pending',\n            'in_mempool': 'pending',\n            'processed': 'pending',\n            'completed': 'ok',\n            'canceled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "blockchaincom": [
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 560,
        "line_end": 615,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "exchangeOrderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "state",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "[]",
            "comment": null
          },
          {
            "key": "fees",
            "value": "[]",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clOrdId\": \"00001\",\n         \"ordType\": \"MARKET\",\n         \"ordStatus\": \"FILLED\",\n         \"side\": \"BUY\",\n         \"symbol\": \"USDC-USDT\",\n         \"exOrdId\": \"281775861306290\",\n         \"price\": null,\n         \"text\": \"Fill\",\n         \"lastShares\": \"30.0\",\n         \"lastPx\": \"0.9999\",\n         \"leavesQty\": \"0.0\",\n         \"cumQty\": \"30.0\",\n         \"avgPx\": \"0.9999\",\n         \"timestamp\": \"1633940339619\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"clOrdId\": \"00001\",\n        //         \"ordType\": \"MARKET\",\n        //         \"ordStatus\": \"FILLED\",\n        //         \"side\": \"BUY\",\n        //         \"symbol\": \"USDC-USDT\",\n        //         \"exOrdId\": \"281775861306290\",\n        //         \"price\": null,\n        //         \"text\": \"Fill\",\n        //         \"lastShares\": \"30.0\",\n        //         \"lastPx\": \"0.9999\",\n        //         \"leavesQty\": \"0.0\",\n        //         \"cumQty\": \"30.0\",\n        //         \"avgPx\": \"0.9999\",\n        //         \"timestamp\": \"1633940339619\"\n        //     }\n        //\n        const clientOrderId = this.safeString (order, 'clOrdId');\n        const type = this.safeStringLower (order, 'ordType');\n        const statusId = this.safeString (order, 'ordStatus');\n        const state = this.parseOrderState (statusId);\n        const side = this.safeStringLower (order, 'side');\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const exchangeOrderId = this.safeString (order, 'exOrdId');\n        const price = (type !== 'market') ? this.safeString (order, 'price') : undefined;\n        const average = this.safeNumber (order, 'avgPx');\n        const timestamp = this.safeInteger (order, 'timestamp');\n        const datetime = this.iso8601 (timestamp);\n        const filled = this.safeString (order, 'cumQty');\n        const remaining = this.safeString (order, 'leavesQty');\n        const result = this.safeOrder ({\n            'id': exchangeOrderId,\n            'clientOrderId': clientOrderId,\n            'datetime': datetime,\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'status': state,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'side': side,\n            'price': price,\n            'average': average,\n            'amount': undefined,\n            'filled': filled,\n            'remaining': remaining,\n            'cost': undefined,\n            'trades': [],\n            'fees': [],\n            'info': order,\n        });\n        return result;\n    }"
      },
      {
        "name": "parseOrderState",
        "signature": "parseOrderState (state)",
        "line_start": 548,
        "line_end": 558,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderState (state) {\n        const states: Dict = {\n            'OPEN': 'open',\n            'REJECTED': 'rejected',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'PART_FILLED': 'open',\n            'EXPIRED': 'expired',\n        };\n        return this.safeString (states, state, state);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 476,
        "line_end": 512,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"BTC-USD\",\n     \"price_24h\": 47791.86,\n     \"volume_24h\": 362.88635738,\n     \"last_trade_price\": 47587.75\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //     \"symbol\": \"BTC-USD\",\n        //     \"price_24h\": 47791.86,\n        //     \"volume_24h\": 362.88635738,\n        //     \"last_trade_price\": 47587.75\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const last = this.safeString (ticker, 'last_trade_price');\n        const baseVolume = this.safeString (ticker, 'volume_24h');\n        const open = this.safeString (ticker, 'price_24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': undefined,\n            'low': undefined,\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': undefined,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 830,
        "line_end": 875,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "tradeId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"exOrdId\":281685751028507,\n         \"tradeId\":281685434947633,\n         \"execId\":8847494003,\n         \"side\":\"BUY\",\n         \"symbol\":\"AAVE-USDT\",\n         \"price\":405.34,\n         \"qty\":0.1,\n         \"fee\":0.162136,\n         \"timestamp\":1634559249687\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        //     {\n        //         \"exOrdId\":281685751028507,\n        //         \"tradeId\":281685434947633,\n        //         \"execId\":8847494003,\n        //         \"side\":\"BUY\",\n        //         \"symbol\":\"AAVE-USDT\",\n        //         \"price\":405.34,\n        //         \"qty\":0.1,\n        //         \"fee\":0.162136,\n        //         \"timestamp\":1634559249687\n        //     }\n        //\n        const orderId = this.safeString (trade, 'exOrdId');\n        const tradeId = this.safeString (trade, 'tradeId');\n        const side = this.safeString (trade, 'side').toLowerCase ();\n        const marketId = this.safeString (trade, 'symbol');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'qty');\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const datetime = this.iso8601 (timestamp);\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrency = market['quote'];\n            fee = { 'cost': feeCostString, 'currency': feeCurrency };\n        }\n        return this.safeTrade ({\n            'id': tradeId,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'symbol': symbol,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 948,
        "line_end": 1017,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionState (state)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"depositId\":\"748e9180-be0d-4a80-e175-0156150efc95\",\n         \"amount\":0.009,\n         \"currency\":\"ETH\",\n         \"address\":\"0xEC6B5929D454C8D9546d4221ace969E1810Fa92c\",\n         \"state\":\"COMPLETED\",\n         \"txHash\":\"582114562140e51a80b481c2dfebaf62b4ab9769b8ff54820bb67e34d4a3ab0c\",\n         \"timestamp\":1633697196241\n     }",
          "{\n         \"amount\":30.0,\n         \"currency\":\"USDT\",\n         \"beneficiary\":\"cab00d11-6e7f-46b7-b453-2e8ef6f101fa\", // blockchain specific id\n         \"withdrawalId\":\"99df5ef7-eab6-4033-be49-312930fbd1ea\",\n         \"fee\":34.005078,\n         \"state\":\"COMPLETED\",\n         \"timestamp\":1634218452549\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // deposit\n        //\n        //     {\n        //         \"depositId\":\"748e9180-be0d-4a80-e175-0156150efc95\",\n        //         \"amount\":0.009,\n        //         \"currency\":\"ETH\",\n        //         \"address\":\"0xEC6B5929D454C8D9546d4221ace969E1810Fa92c\",\n        //         \"state\":\"COMPLETED\",\n        //         \"txHash\":\"582114562140e51a80b481c2dfebaf62b4ab9769b8ff54820bb67e34d4a3ab0c\",\n        //         \"timestamp\":1633697196241\n        //     }\n        //\n        // withdrawal\n        //\n        //     {\n        //         \"amount\":30.0,\n        //         \"currency\":\"USDT\",\n        //         \"beneficiary\":\"cab00d11-6e7f-46b7-b453-2e8ef6f101fa\", // blockchain specific id\n        //         \"withdrawalId\":\"99df5ef7-eab6-4033-be49-312930fbd1ea\",\n        //         \"fee\":34.005078,\n        //         \"state\":\"COMPLETED\",\n        //         \"timestamp\":1634218452549\n        //     }\n        //\n        let type = undefined;\n        let id = undefined;\n        const amount = this.safeNumber (transaction, 'amount');\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const state = this.safeString (transaction, 'state');\n        if ('depositId' in transaction) {\n            type = 'deposit';\n            id = this.safeString (transaction, 'depositId');\n        } else if ('withdrawalId' in transaction) {\n            type = 'withdrawal';\n            id = this.safeString (transaction, 'withdrawalId');\n        }\n        const feeCost = (type === 'withdrawal') ? this.safeNumber (transaction, 'fee') : undefined;\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const address = this.safeString (transaction, 'address');\n        const txid = this.safeString (transaction, 'txhash');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': address,\n            'addressTo': address,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': this.parseTransactionState (state), // 'status':   'pending',   // 'ok', 'failed', 'canceled', string\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionState",
        "signature": "parseTransactionState (state)",
        "line_start": 937,
        "line_end": 946,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionState (state) {\n        const states: Dict = {\n            'COMPLETED': 'ok', //\n            'REJECTED': 'failed',\n            'PENDING': 'pending',\n            'FAILED': 'failed',\n            'REFUNDED': 'refunded',\n        };\n        return this.safeString (states, state, state);\n    }"
      }
    ],
    "blofin": [
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 2583,
        "line_end": 2620,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeInteger (info, 'adl')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"positionId\": \"756786\",\n         \"instId\": \"BTC-USDT\",\n         \"instType\": \"SWAP\",\n         \"marginMode\": \"cross\",\n         \"positionSide\": \"net\",\n         \"adl\": \"1\",\n         \"positions\": \"0.1\",\n         \"availablePositions\": \"0.1\",\n         \"averagePrice\": \"88564.9\",\n         \"markPrice\": \"88546.3696492756\",\n         \"marginRatio\": \"822.305183525552961566\",\n         \"liquidationPrice\": \"\",\n         \"unrealizedPnl\": \"-0.00185303507244\",\n         \"unrealizedPnlRatio\": \"-0.000627687178252332\",\n         \"initialMargin\": \"2.951545654975853333\",\n         \"maintenanceMargin\": \"0.02656391089478268\",\n         \"createTime\": \"1767169876207\",\n         \"updateTime\": \"1767169876207\",\n         \"leverage\": \"3\"\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionsADLRank\n        //\n        //     {\n        //         \"positionId\": \"756786\",\n        //         \"instId\": \"BTC-USDT\",\n        //         \"instType\": \"SWAP\",\n        //         \"marginMode\": \"cross\",\n        //         \"positionSide\": \"net\",\n        //         \"adl\": \"1\",\n        //         \"positions\": \"0.1\",\n        //         \"availablePositions\": \"0.1\",\n        //         \"averagePrice\": \"88564.9\",\n        //         \"markPrice\": \"88546.3696492756\",\n        //         \"marginRatio\": \"822.305183525552961566\",\n        //         \"liquidationPrice\": \"\",\n        //         \"unrealizedPnl\": \"-0.00185303507244\",\n        //         \"unrealizedPnlRatio\": \"-0.000627687178252332\",\n        //         \"initialMargin\": \"2.951545654975853333\",\n        //         \"maintenanceMargin\": \"0.02656391089478268\",\n        //         \"createTime\": \"1767169876207\",\n        //         \"updateTime\": \"1767169876207\",\n        //         \"leverage\": \"3\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'instId');\n        const timestamp = this.safeIntegerOmitZero (info, 'createTime');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeInteger (info, 'adl'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response)",
        "line_start": 1048,
        "line_end": 1103,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n     \"code\": \"0\",\n     \"msg\": \"success\",\n     \"data\": {\n         \"ts\": \"1697021343571\",\n         \"totalEquity\": \"10011254.077985990315787910\",\n         \"isolatedEquity\": \"861.763132108800000000\",\n         \"details\": [\n             {\n                 \"currency\": \"USDT\",\n                 \"equity\": \"10014042.988958415234430699548\",\n                 \"balance\": \"10013119.885958415234430699\",\n                 \"ts\": \"1697021343571\",\n                 \"isolatedEquity\": \"862.003200000000000000048\",\n                 \"available\": \"9996399.4708691159703362725\",\n                 \"availableEquity\": \"9996399.4708691159703362725\",\n                 \"frozen\": \"15805.149672632597427761\",\n                 \"orderFrozen\": \"14920.994472632597427761\",\n                 \"equityUsd\": \"10011254.077985990315787910\",\n                 \"isolatedUnrealizedPnl\": \"-22.151999999999999999952\",\n                 \"bonus\": \"0\" // present only in REST\n                 \"unrealizedPnl\": \"0\" // present only in WS\n             }\n         ]\n     }\n }"
        ],
        "source": "parseBalance (response) {\n        //\n        // \"data\" similar for REST & WS\n        //\n        // {\n        //     \"code\": \"0\",\n        //     \"msg\": \"success\",\n        //     \"data\": {\n        //         \"ts\": \"1697021343571\",\n        //         \"totalEquity\": \"10011254.077985990315787910\",\n        //         \"isolatedEquity\": \"861.763132108800000000\",\n        //         \"details\": [\n        //             {\n        //                 \"currency\": \"USDT\",\n        //                 \"equity\": \"10014042.988958415234430699548\",\n        //                 \"balance\": \"10013119.885958415234430699\",\n        //                 \"ts\": \"1697021343571\",\n        //                 \"isolatedEquity\": \"862.003200000000000000048\",\n        //                 \"available\": \"9996399.4708691159703362725\",\n        //                 \"availableEquity\": \"9996399.4708691159703362725\",\n        //                 \"frozen\": \"15805.149672632597427761\",\n        //                 \"orderFrozen\": \"14920.994472632597427761\",\n        //                 \"equityUsd\": \"10011254.077985990315787910\",\n        //                 \"isolatedUnrealizedPnl\": \"-22.151999999999999999952\",\n        //                 \"bonus\": \"0\" // present only in REST\n        //                 \"unrealizedPnl\": \"0\" // present only in WS\n        //             }\n        //         ]\n        //     }\n        // }\n        //\n        const result: Dict = { 'info': response };\n        const data = this.safeDict (response, 'data', {});\n        const timestamp = this.safeInteger (data, 'ts');\n        const details = this.safeList (data, 'details', []);\n        for (let i = 0; i < details.length; i++) {\n            const balance = details[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            const eq = this.safeString (balance, 'equity');\n            const availEq = this.safeString (balance, 'available');\n            if ((eq === undefined) || (availEq === undefined)) {\n                account['free'] = this.safeString (balance, 'availableEquity');\n                account['used'] = this.safeString (balance, 'frozen');\n            } else {\n                account['total'] = eq;\n                account['free'] = availEq;\n            }\n            result[code] = account;\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBalanceByType",
        "signature": "parseBalanceByType (response)",
        "line_start": 1039,
        "line_end": 1046,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceByType (response) {\n        const data = this.safeList (response, 'data');\n        if ((data !== undefined) && Array.isArray (data)) {\n            return this.parseFundingBalance (response);\n        } else {\n            return this.parseBalance (response);\n        }\n    }"
      },
      {
        "name": "parseFundingBalance",
        "signature": "parseFundingBalance (response)",
        "line_start": 1105,
        "line_end": 1135,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n      \"code\": \"0\",\n      \"msg\": \"success\",\n      \"data\": [\n          {\n              \"currency\": \"USDT\",\n              \"balance\": \"10012514.919418081548717298\",\n              \"available\": \"9872132.414278782284622898\",\n              \"frozen\": \"138556.471805965930761067\",\n              \"bonus\": \"0\"\n          }\n      ]\n  }"
        ],
        "source": "parseFundingBalance (response) {\n        //\n        //  {\n        //      \"code\": \"0\",\n        //      \"msg\": \"success\",\n        //      \"data\": [\n        //          {\n        //              \"currency\": \"USDT\",\n        //              \"balance\": \"10012514.919418081548717298\",\n        //              \"available\": \"9872132.414278782284622898\",\n        //              \"frozen\": \"138556.471805965930761067\",\n        //              \"bonus\": \"0\"\n        //          }\n        //      ]\n        //  }\n        //\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        for (let i = 0; i < data.length; i++) {\n            const balance = data[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            account['total'] = this.safeString (balance, 'balance');\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'frozen');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 968,
        "line_end": 1000,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"fundingRate\": \"0.00027815\",\n        \"fundingTime\": \"1634256000000\",\n        \"instId\": \"BTC-USD-SWAP\",\n    }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"fundingRate\": \"0.00027815\",\n        //        \"fundingTime\": \"1634256000000\",\n        //        \"instId\": \"BTC-USD-SWAP\",\n        //    }\n        //\n        const marketId = this.safeString (contract, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        const fundingTime = this.safeInteger (contract, 'fundingTime');\n        // > The current interest is 0.\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIds",
        "signature": "parseIds (ids)",
        "line_start": 1901,
        "line_end": 1914,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {string[]|string} ids order ids",
          "@returns {string[]} list of order ids"
        ],
        "source": "parseIds (ids) {\n        /**\n         * @ignore\n         * @method\n         * @name blofin#parseIds\n         * @param {string[]|string} ids order ids\n         * @returns {string[]} list of order ids\n         */\n        if (typeof ids === 'string') {\n            return ids.split (',');\n        } else {\n            return ids;\n        }\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1877,
        "line_end": 1899,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'transferId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'clientId')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'amount')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        const currencyId = this.safeString (item, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'ts');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'transferId'),\n            'direction': undefined,\n            'account': undefined,\n            'referenceId': this.safeString (item, 'clientId'),\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': code,\n            'amount': this.safeNumber (item, 'amount'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': 'ok',\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1860,
        "line_end": 1875,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            '1': 'transfer', // transfer\n            '2': 'trade', // trade\n            '3': 'trade', // delivery\n            '4': 'rebate', // auto token conversion\n            '5': 'trade', // liquidation\n            '6': 'transfer', // margin transfer\n            '7': 'trade', // interest deduction\n            '8': 'fee', // funding rate\n            '9': 'trade', // adl\n            '10': 'trade', // clawback\n            '11': 'trade', // system token conversion\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2284,
        "line_end": 2294,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'marginMode')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'instId');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'marginMode'),\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market: Market = undefined): MarginMode",
        "line_start": 2441,
        "line_end": 2447,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (marginMode, 'marginMode')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market: Market = undefined): MarginMode {\n        return {\n            'info': marginMode,\n            'symbol': this.safeString (market, 'symbol'),\n            'marginMode': this.safeString (marginMode, 'marginMode'),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 503,
        "line_end": 582,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && (Precise.stringGt (maxLeverage, '1'))",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "active",
            "value": "isActive",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "contract ? (quoteId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "contract ? (baseId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contract ? this.safeNumber (market, 'contractValue') : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "strike",
            "value": "strikePrice",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "optionType",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'listTime')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'lotSize'),\n                'price': this.parseNumber (tickSize),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSize'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (tickSize)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSize'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'instId');\n        const type = this.safeStringLower (market, 'instType');\n        const spot = (type === 'spot');\n        const future = (type === 'future');\n        const swap = (type === 'swap');\n        const option = (type === 'option');\n        const contract = swap || future;\n        const baseId = this.safeString (market, 'baseCurrency');\n        const quoteId = this.safeString (market, 'quoteCurrency');\n        const settleId = this.safeString (market, 'quoteCurrency');\n        const settle = this.safeCurrencyCode (settleId);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        if (swap) {\n            symbol = symbol + ':' + settle;\n        }\n        const expiry = undefined;\n        const strikePrice = undefined;\n        const optionType = undefined;\n        const tickSize = this.safeString (market, 'tickSize');\n        const fees = this.safeDict2 (this.fees, type, 'trading', {});\n        const taker = this.safeNumber (fees, 'taker');\n        const maker = this.safeNumber (fees, 'maker');\n        let maxLeverage = this.safeString (market, 'maxLeverage', '100');\n        maxLeverage = Precise.stringMax (maxLeverage, '1');\n        const isActive = (this.safeString (market, 'state') === 'live');\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settle': settle,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'option': option,\n            'margin': spot && (Precise.stringGt (maxLeverage, '1')),\n            'swap': swap,\n            'future': future,\n            'active': isActive,\n            'taker': taker,\n            'maker': maker,\n            'contract': contract,\n            'linear': contract ? (quoteId === settleId) : undefined,\n            'inverse': contract ? (baseId === settleId) : undefined,\n            'contractSize': contract ? this.safeNumber (market, 'contractValue') : undefined,\n            'expiry': expiry,\n            'expiryDatetime': expiry,\n            'strike': strikePrice,\n            'optionType': optionType,\n            'created': this.safeInteger (market, 'listTime'),\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSize'),\n                'price': this.parseNumber (tickSize),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSize'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 847,
        "line_end": 869,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1678928760000\", // timestamp\n         \"24341.4\", // open\n         \"24344\", // high\n         \"24313.2\", // low\n         \"24323\", // close\n         \"628\", // contract volume\n         \"2.5819\", // base volume\n         \"62800\", // quote volume\n         \"0\" // candlestick state\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1678928760000\", // timestamp\n        //         \"24341.4\", // open\n        //         \"24344\", // high\n        //         \"24313.2\", // low\n        //         \"24323\", // close\n        //         \"628\", // contract volume\n        //         \"2.5819\", // base volume\n        //         \"62800\", // quote volume\n        //         \"0\" // candlestick state\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 6),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1250,
        "line_end": 1372,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "stopLossTriggerPrice",
            "value": "stopLossTriggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitTriggerPrice",
            "value": "takeProfitTriggerPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostSigned)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"orderId\": \"2075628533\",\n     \"clientOrderId\": \"\",\n     \"instId\": \"LTC-USDT\",\n     \"marginMode\": \"cross\",\n     \"positionSide\": \"net\",\n     \"side\": \"buy\",\n     \"orderType\": \"market\",\n     \"price\": \"0.000000000000000000\",\n     \"size\": \"1.000000000000000000\",\n     \"reduceOnly\": \"true\",\n     \"leverage\": \"3\",\n     \"state\": \"filled\",\n     \"filledSize\": \"1.000000000000000000\",\n     \"pnl\": \"-0.050000000000000000\",\n     \"averagePrice\": \"68.110000000000000000\",\n     \"fee\": \"0.040866000000000000\",\n     \"createTime\": \"1706891359010\",\n     \"updateTime\": \"1706891359098\",\n     \"orderCategory\": \"normal\",\n     \"tpTriggerPrice\": null,\n     \"tpOrderPrice\": null,\n     \"slTriggerPrice\": null,\n     \"slOrderPrice\": null,\n     \"cancelSource\": \"not_canceled\",\n     \"cancelSourceReason\": null,\n     \"brokerId\": \"ec6dd3a7dd982d0b\"\n     \"filled_amount\": \"1.000000000000000000\", // filledAmount in \"ws\" watchOrders\n     \"cancelSource\": \"\", // only in WS\n     \"instType\": \"SWAP\", // only in WS\n }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // response similar for REST & WS\n        //\n        // {\n        //     \"orderId\": \"2075628533\",\n        //     \"clientOrderId\": \"\",\n        //     \"instId\": \"LTC-USDT\",\n        //     \"marginMode\": \"cross\",\n        //     \"positionSide\": \"net\",\n        //     \"side\": \"buy\",\n        //     \"orderType\": \"market\",\n        //     \"price\": \"0.000000000000000000\",\n        //     \"size\": \"1.000000000000000000\",\n        //     \"reduceOnly\": \"true\",\n        //     \"leverage\": \"3\",\n        //     \"state\": \"filled\",\n        //     \"filledSize\": \"1.000000000000000000\",\n        //     \"pnl\": \"-0.050000000000000000\",\n        //     \"averagePrice\": \"68.110000000000000000\",\n        //     \"fee\": \"0.040866000000000000\",\n        //     \"createTime\": \"1706891359010\",\n        //     \"updateTime\": \"1706891359098\",\n        //     \"orderCategory\": \"normal\",\n        //     \"tpTriggerPrice\": null,\n        //     \"tpOrderPrice\": null,\n        //     \"slTriggerPrice\": null,\n        //     \"slOrderPrice\": null,\n        //     \"cancelSource\": \"not_canceled\",\n        //     \"cancelSourceReason\": null,\n        //     \"brokerId\": \"ec6dd3a7dd982d0b\"\n        //     \"filled_amount\": \"1.000000000000000000\", // filledAmount in \"ws\" watchOrders\n        //     \"cancelSource\": \"\", // only in WS\n        //     \"instType\": \"SWAP\", // only in WS\n        // }\n        //\n        const id = this.safeStringN (order, [ 'tpslId', 'orderId', 'algoId' ]);\n        const timestamp = this.safeInteger (order, 'createTime');\n        const lastUpdateTimestamp = this.safeInteger (order, 'updateTime');\n        const lastTradeTimestamp = this.safeInteger (order, 'fillTime');\n        const side = this.safeString (order, 'side');\n        let type = this.safeString (order, 'orderType');\n        let postOnly = undefined;\n        let timeInForce = undefined;\n        if (type === 'post_only') {\n            postOnly = true;\n            type = 'limit';\n        } else if (type === 'fok') {\n            timeInForce = 'FOK';\n            type = 'limit';\n        } else if (type === 'ioc') {\n            timeInForce = 'IOC';\n            type = 'limit';\n        } else if (type === 'conditional') {\n            type = 'trigger';\n        }\n        const marketId = this.safeString (order, 'instId');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const filled = this.safeString (order, 'filledSize');\n        const price = this.safeStringN (order, [ 'px', 'price', 'orderPrice' ]);\n        const average = this.safeString (order, 'averagePrice');\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const feeCostString = this.safeString (order, 'fee');\n        const amount = this.safeString (order, 'size');\n        const leverage = this.safeString (order, 'leverage', '1');\n        const contractSize = this.safeString (market, 'contractSize');\n        const baseAmount = Precise.stringMul (contractSize, filled);\n        let cost: Str = undefined;\n        if (average !== undefined) {\n            cost = Precise.stringMul (average, baseAmount);\n            cost = Precise.stringDiv (cost, leverage);\n        }\n        // spot market buy: \"sz\" can refer either to base currency units or to quote currency units\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringAbs (feeCostString);\n            const feeCurrencyId = this.safeString (order, 'feeCcy', 'USDT');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': this.parseNumber (feeCostSigned),\n                'currency': feeCurrencyCode,\n            };\n        }\n        let clientOrderId = this.safeString (order, 'clientOrderId');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined; // fix empty clientOrderId string\n        }\n        const stopLossTriggerPrice = this.safeNumber (order, 'slTriggerPrice');\n        const stopLossPrice = this.safeNumber (order, 'slOrderPrice');\n        const takeProfitTriggerPrice = this.safeNumber (order, 'tpTriggerPrice');\n        const takeProfitPrice = this.safeNumber (order, 'tpOrderPrice');\n        const reduceOnlyRaw = this.safeString (order, 'reduceOnly');\n        const reduceOnly = (reduceOnlyRaw === 'true');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'stopLossTriggerPrice': stopLossTriggerPrice,\n            'takeProfitTriggerPrice': takeProfitTriggerPrice,\n            'stopLossPrice': stopLossPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'average': average,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'reduceOnly': reduceOnly,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1238,
        "line_end": 1248,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'canceled': 'canceled',\n            'order_failed': 'canceled',\n            'live': 'open',\n            'partially_filled': 'open',\n            'filled': 'closed',\n            'effective': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2073,
        "line_end": 2185,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPriceString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealizedPnlString)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPriceString)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateralString)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentage)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         instType: 'SWAP',\n         instId: 'LTC-USDT',\n         marginMode: 'cross',\n         positionId: '644159',\n         positionSide: 'net',\n         positions: '1',\n         availablePositions: '1',\n         averagePrice: '68.16',\n         unrealizedPnl: '0.80631223',\n         unrealizedPnlRatio: '0.03548909463028169',\n         leverage: '3',\n         liquidationPrice: '10.116655172370356435',\n         markPrice: '68.96',\n         initialMargin: '22.988770743333333333',\n         margin: '', // this field might not exist in rest response\n         marginRatio: '152.523509620342499273',\n         maintenanceMargin: '0.34483156115',\n         adl: '4',\n         createTime: '1707235776528',\n         updateTime: '1707235776528'\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // response similar for REST & WS\n        //\n        //     {\n        //         instType: 'SWAP',\n        //         instId: 'LTC-USDT',\n        //         marginMode: 'cross',\n        //         positionId: '644159',\n        //         positionSide: 'net',\n        //         positions: '1',\n        //         availablePositions: '1',\n        //         averagePrice: '68.16',\n        //         unrealizedPnl: '0.80631223',\n        //         unrealizedPnlRatio: '0.03548909463028169',\n        //         leverage: '3',\n        //         liquidationPrice: '10.116655172370356435',\n        //         markPrice: '68.96',\n        //         initialMargin: '22.988770743333333333',\n        //         margin: '', // this field might not exist in rest response\n        //         marginRatio: '152.523509620342499273',\n        //         maintenanceMargin: '0.34483156115',\n        //         adl: '4',\n        //         createTime: '1707235776528',\n        //         updateTime: '1707235776528'\n        //     }\n        //\n        const marketId = this.safeString (position, 'instId');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const pos = this.safeString (position, 'positions');\n        const contractsAbs = Precise.stringAbs (pos);\n        let side = this.safeString (position, 'positionSide');\n        const hedged = side !== 'net';\n        const contracts = this.parseNumber (contractsAbs);\n        if (pos !== undefined) {\n            if (side === 'net') {\n                if (Precise.stringGt (pos, '0')) {\n                    side = 'long';\n                } else if (Precise.stringLt (pos, '0')) {\n                    side = 'short';\n                } else {\n                    side = undefined;\n                }\n            }\n        }\n        const contractSize = this.safeNumber (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const markPriceString = this.safeString (position, 'markPrice');\n        let notionalString = this.safeString (position, 'notionalUsd');\n        if (market['inverse']) {\n            notionalString = Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), markPriceString);\n        }\n        const notional = this.parseNumber (notionalString);\n        const marginMode = this.safeString (position, 'marginMode');\n        let initialMarginString = undefined;\n        const entryPriceString = this.safeString (position, 'averagePrice');\n        const unrealizedPnlString = this.safeString (position, 'unrealizedPnl');\n        const leverageString = this.safeString (position, 'leverage');\n        let initialMarginPercentage = undefined;\n        let collateralString = undefined;\n        if (marginMode === 'cross') {\n            initialMarginString = this.safeString (position, 'initialMargin');\n            collateralString = Precise.stringAdd (initialMarginString, unrealizedPnlString);\n        } else if (marginMode === 'isolated') {\n            initialMarginPercentage = Precise.stringDiv ('1', leverageString);\n            collateralString = this.safeString (position, 'margin');\n        }\n        const maintenanceMarginString = this.safeString (position, 'maintenanceMargin');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const maintenanceMarginPercentageString = Precise.stringDiv (maintenanceMarginString, notionalString);\n        if (initialMarginPercentage === undefined) {\n            initialMarginPercentage = this.parseNumber (Precise.stringDiv (initialMarginString, notionalString, 4));\n        } else if (initialMarginString === undefined) {\n            initialMarginString = Precise.stringMul (initialMarginPercentage, notionalString);\n        }\n        const rounder = '0.00005'; // round to closest 0.01%\n        const maintenanceMarginPercentage = this.parseNumber (Precise.stringDiv (Precise.stringAdd (maintenanceMarginPercentageString, rounder), '1', 4));\n        const liquidationPrice = this.safeNumber (position, 'liquidationPrice');\n        const percentageString = this.safeString (position, 'unrealizedPnlRatio');\n        const percentage = this.parseNumber (Precise.stringMul (percentageString, '100'));\n        const timestamp = this.safeInteger (position, 'updateTime');\n        const marginRatio = this.parseNumber (Precise.stringDiv (maintenanceMarginString, collateralString, 4));\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'notional': notional,\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.parseNumber (entryPriceString),\n            'unrealizedPnl': this.parseNumber (unrealizedPnlString),\n            'percentage': percentage,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'markPrice': this.parseNumber (markPriceString),\n            'lastPrice': undefined,\n            'side': side,\n            'hedged': hedged,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'collateral': this.parseNumber (collateralString),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentage),\n            'leverage': this.parseNumber (leverageString),\n            'marginRatio': marginRatio,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 632,
        "line_end": 687,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSize')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSize')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         instId: \"ADA-USDT\",\n         ts: \"1707736811486\",\n         last: \"0.5315\",\n         lastSize: \"4\",\n         askPrice: \"0.5318\",\n         askSize: \"248\",\n         bidPrice: \"0.5315\",\n         bidSize: \"63\",\n         open24h: \"0.5555\",\n         high24h: \"0.5563\",\n         low24h: \"0.5315\",\n         volCurrency24h: \"198560100\",\n         vol24h: \"1985601\",\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // response similar for REST & WS\n        //\n        //     {\n        //         instId: \"ADA-USDT\",\n        //         ts: \"1707736811486\",\n        //         last: \"0.5315\",\n        //         lastSize: \"4\",\n        //         askPrice: \"0.5318\",\n        //         askSize: \"248\",\n        //         bidPrice: \"0.5315\",\n        //         bidSize: \"63\",\n        //         open24h: \"0.5555\",\n        //         high24h: \"0.5563\",\n        //         low24h: \"0.5315\",\n        //         volCurrency24h: \"198560100\",\n        //         vol24h: \"1985601\",\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'ts');\n        const marketId = this.safeString (ticker, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'last');\n        const open = this.safeString (ticker, 'open24h');\n        const spot = this.safeBool (market, 'spot', false);\n        const quoteVolume = spot ? this.safeString (ticker, 'volCurrency24h') : undefined;\n        const baseVolume = this.safeString (ticker, 'vol24h');\n        const high = this.safeString (ticker, 'high24h');\n        const low = this.safeString (ticker, 'low24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidSize'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askSize'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 749,
        "line_end": 809,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"tradeId\": \"3263934920\",\n       \"instId\": \"LTC-USDT\",\n       \"price\": \"67.87\",\n       \"size\": \"1\",\n       \"side\": \"buy\",\n       \"ts\": \"1707232020854\"\n   }",
          "{\n       \"instId\": \"LTC-USDT\",\n       \"tradeId\": \"1440847\",\n       \"orderId\": \"2075705202\",\n       \"fillPrice\": \"67.850000000000000000\",\n       \"fillSize\": \"1.000000000000000000\",\n       \"fillPnl\": \"0.000000000000000000\",\n       \"side\": \"buy\",\n       \"positionSide\": \"net\",\n       \"fee\": \"0.040710000000000000\",\n       \"ts\": \"1707224678878\",\n       \"brokerId\": \"\"\n   }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetch trades (response similar for REST & WS)\n        //\n        //   {\n        //       \"tradeId\": \"3263934920\",\n        //       \"instId\": \"LTC-USDT\",\n        //       \"price\": \"67.87\",\n        //       \"size\": \"1\",\n        //       \"side\": \"buy\",\n        //       \"ts\": \"1707232020854\"\n        //   }\n        //\n        // my trades\n        //   {\n        //       \"instId\": \"LTC-USDT\",\n        //       \"tradeId\": \"1440847\",\n        //       \"orderId\": \"2075705202\",\n        //       \"fillPrice\": \"67.850000000000000000\",\n        //       \"fillSize\": \"1.000000000000000000\",\n        //       \"fillPnl\": \"0.000000000000000000\",\n        //       \"side\": \"buy\",\n        //       \"positionSide\": \"net\",\n        //       \"fee\": \"0.040710000000000000\",\n        //       \"ts\": \"1707224678878\",\n        //       \"brokerId\": \"\"\n        //   }\n        //\n        const id = this.safeString (trade, 'tradeId');\n        const marketId = this.safeString (trade, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (trade, 'ts');\n        const price = this.safeString2 (trade, 'price', 'fillPrice');\n        const amount = this.safeString2 (trade, 'size', 'fillSize');\n        const side = this.safeString (trade, 'side');\n        const orderId = this.safeString (trade, 'orderId');\n        const feeCost = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': market['settle'],\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'takerOrMaker': undefined,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1137,
        "line_end": 1147,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU')))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (undefined, market),\n            // blofin returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped\n            'maker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'maker', 'makerU'))),\n            'taker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU'))),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1764,
        "line_end": 1848,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCode,\n                'cost': feeCost,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"USDT\",\n         \"chain\": \"TRC20\",\n         \"address\": \"TGfJLtnsh3B9EqekFEBZ1nR14QanBUf5Bi\",\n         \"txId\": \"892f4e0c32268b29b2e541ef30d32a30bbf10f902adcc4b1428319ed7c3758fd\",\n         \"type\": \"0\",\n         \"amount\": \"86.975843\",\n         \"state\": \"1\",\n         \"ts\": \"1703163304153\",\n         \"tag\": null,\n         \"confirm\": \"16\",\n         \"depositId\": \"36c8e2a7ea184a219de72215a696acaf\"\n     }",
          "{\n       \"currency\": \"USDT\",\n        \"chain\": \"TRC20\",\n        \"address\": \"TYgB3sVXHPEDQUu288EG1uMFh9Pk2swLgW\",\n        \"txId\": \"1fd5ac52df414d7ea66194cadd9a5b4d2422c2b9720037f66d98207f9858fd96\",\n        \"type\": \"0\",\n        \"amount\": \"9\",\n        \"fee\": \"1\",\n        \"feeCurrency\": \"USDT\",\n        \"state\": \"3\",\n        \"clientId\": null,\n        \"ts\": \"1707217439351\",\n        \"tag\": null,\n        \"memo\": null,\n        \"withdrawId\": \"e0768698cfdf4aee8e54654c3775914b\"\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"currency\": \"USDT\",\n        //         \"chain\": \"TRC20\",\n        //         \"address\": \"TGfJLtnsh3B9EqekFEBZ1nR14QanBUf5Bi\",\n        //         \"txId\": \"892f4e0c32268b29b2e541ef30d32a30bbf10f902adcc4b1428319ed7c3758fd\",\n        //         \"type\": \"0\",\n        //         \"amount\": \"86.975843\",\n        //         \"state\": \"1\",\n        //         \"ts\": \"1703163304153\",\n        //         \"tag\": null,\n        //         \"confirm\": \"16\",\n        //         \"depositId\": \"36c8e2a7ea184a219de72215a696acaf\"\n        //     }\n        // fetchWithdrawals\n        //    {\n        //       \"currency\": \"USDT\",\n        //        \"chain\": \"TRC20\",\n        //        \"address\": \"TYgB3sVXHPEDQUu288EG1uMFh9Pk2swLgW\",\n        //        \"txId\": \"1fd5ac52df414d7ea66194cadd9a5b4d2422c2b9720037f66d98207f9858fd96\",\n        //        \"type\": \"0\",\n        //        \"amount\": \"9\",\n        //        \"fee\": \"1\",\n        //        \"feeCurrency\": \"USDT\",\n        //        \"state\": \"3\",\n        //        \"clientId\": null,\n        //        \"ts\": \"1707217439351\",\n        //        \"tag\": null,\n        //        \"memo\": null,\n        //        \"withdrawId\": \"e0768698cfdf4aee8e54654c3775914b\"\n        //    }\n        //\n        let type = undefined;\n        let id = undefined;\n        const withdrawalId = this.safeString (transaction, 'withdrawId');\n        const depositId = this.safeString (transaction, 'depositId');\n        const addressTo = this.safeString (transaction, 'address');\n        const address = addressTo;\n        const tagTo = this.safeString (transaction, 'tag');\n        if (withdrawalId !== undefined) {\n            type = 'withdrawal';\n            id = withdrawalId;\n        } else {\n            id = depositId;\n            type = 'deposit';\n        }\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const amount = this.safeNumber (transaction, 'amount');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const txid = this.safeString (transaction, 'txId');\n        const timestamp = this.safeInteger (transaction, 'ts');\n        const feeCurrencyId = this.safeString (transaction, 'feeCurrency');\n        const feeCode = this.safeCurrencyCode (feeCurrencyId);\n        const feeCost = this.safeNumber (transaction, 'fee');\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': undefined,\n            'addressFrom': undefined,\n            'addressTo': addressTo,\n            'address': address,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'tag': tagTo,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': feeCode,\n                'cost': feeCost,\n            },\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1850,
        "line_end": 1858,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            '0': 'pending',\n            '1': 'ok',\n            '2': 'failed',\n            '3': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2014,
        "line_end": 2027,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        const id = this.safeString (transfer, 'transferId');\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': undefined,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "btcbox": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 378,
        "line_end": 395,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const codes = Object.keys (this.currencies);\n        for (let i = 0; i < codes.length; i++) {\n            const code = codes[i];\n            const currency = this.currency (code);\n            const currencyId = currency['id'];\n            const free = currencyId + '_balance';\n            if (free in response) {\n                const account = this.account ();\n                const used = currencyId + '_lock';\n                account['free'] = this.safeString (response, free);\n                account['used'] = this.safeString (response, used);\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 320,
        "line_end": 376,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "uppercaseId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (market, 'minLimitBaseAmount'),\n                    'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minLimitBaseAmount'),\n                    'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const baseId = this.safeString (market, 'base');\n        const base = this.safeCurrencyCode (baseId);\n        const quoteId = this.safeString (market, 'quote');\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote;\n        return {\n            'id': this.safeString (market, 'symbol'),\n            'uppercaseId': undefined,\n            'symbol': symbol,\n            'base': base,\n            'baseId': baseId,\n            'quote': quote,\n            'quoteId': quoteId,\n            'settle': undefined,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (market, 'minLimitBaseAmount'),\n                    'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'precision': {\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n            },\n            'active': undefined,\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 637,
        "line_end": 693,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":11,\n         \"datetime\":\"2014-10-21 10:47:20\",\n         \"type\":\"sell\",\n         \"price\":42000,\n         \"amount_original\":1.2,\n         \"amount_outstanding\":1.2,\n         \"status\":\"closed\",\n         \"trades\":[] // no clarification of trade value structure of order endpoint\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"id\":11,\n        //         \"datetime\":\"2014-10-21 10:47:20\",\n        //         \"type\":\"sell\",\n        //         \"price\":42000,\n        //         \"amount_original\":1.2,\n        //         \"amount_outstanding\":1.2,\n        //         \"status\":\"closed\",\n        //         \"trades\":[] // no clarification of trade value structure of order endpoint\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const datetimeString = this.safeString (order, 'datetime');\n        let timestamp = undefined;\n        if (datetimeString !== undefined) {\n            timestamp = this.parse8601 (order['datetime'] + '+09:00'); // Tokyo time\n        }\n        const amount = this.safeString (order, 'amount_original');\n        const remaining = this.safeString (order, 'amount_outstanding');\n        const price = this.safeString (order, 'price');\n        // status is set by fetchOrder method only\n        let status = this.parseOrderStatus (this.safeString (order, 'status'));\n        // fetchOrders do not return status, use heuristic\n        if (status === undefined) {\n            if (Precise.stringEquals (remaining, '0')) {\n                status = 'closed';\n            }\n        }\n        const trades = undefined; // todo: this.parseTrades (order['trades']);\n        market = this.safeMarket (undefined, market);\n        const side = this.safeString (order, 'type');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'amount': amount,\n            'remaining': remaining,\n            'filled': undefined,\n            'side': side,\n            'type': undefined,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'status': status,\n            'symbol': market['symbol'],\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'trades': trades,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 625,
        "line_end": 635,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            // TODO: complete list\n            'part': 'open', // partially or not at all executed\n            'all': 'closed', // fully executed\n            'cancelled': 'canceled',\n            'closed': 'closed', // never encountered, seems to be bug in the doc\n            'no': 'closed', // not clarified in the docs...\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 433,
        "line_end": 458,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'vol')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const symbol = this.safeSymbol (undefined, market);\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'vol'),\n            'quoteVolume': this.safeString (ticker, 'volume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 495,
        "line_end": 529,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"date\":\"0\",\n          \"price\":3,\n          \"amount\":0.1,\n          \"tid\":\"1\",\n          \"type\":\"buy\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"date\":\"0\",\n        //          \"price\":3,\n        //          \"amount\":0.1,\n        //          \"tid\":\"1\",\n        //          \"type\":\"buy\"\n        //      }\n        //\n        const timestamp = this.safeTimestamp (trade, 'date');\n        market = this.safeMarket (undefined, market);\n        const id = this.safeString (trade, 'tid');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const type = undefined;\n        const side = this.safeString (trade, 'type');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': type,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      }
    ],
    "btcmarkets": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 602,
        "line_end": 614,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'assetName');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['used'] = this.safeString (balance, 'locked');\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 515,
        "line_end": 582,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(status === 'Online')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amountDecimals'))),\n                'price': pricePrecision,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': minAmount,\n                    'max': maxAmount,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': minPrice,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const baseId = this.safeString (market, 'baseAssetName');\n        const quoteId = this.safeString (market, 'quoteAssetName');\n        const id = this.safeString (market, 'marketId');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote;\n        const fees = this.safeValue (this.safeDict (this.options, 'fees', {}), quote, this.fees);\n        const pricePrecision = this.parseNumber (this.parsePrecision (this.safeString (market, 'priceDecimals')));\n        const minAmount = this.safeNumber (market, 'minOrderAmount');\n        const maxAmount = this.safeNumber (market, 'maxOrderAmount');\n        const status = this.safeString (market, 'status');\n        let minPrice = undefined;\n        if (quote === 'AUD') {\n            minPrice = pricePrecision;\n        }\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': (status === 'Online'),\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': fees['taker'],\n            'maker': fees['maker'],\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amountDecimals'))),\n                'price': pricePrecision,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 630,
        "line_end": 649,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"2020-09-12T18:30:00.000000Z\",\n         \"14409.45\", // open\n         \"14409.45\", // high\n         \"14403.91\", // low\n         \"14403.91\", // close\n         \"0.01571701\" // volume\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"2020-09-12T18:30:00.000000Z\",\n        //         \"14409.45\", // open\n        //         \"14409.45\", // high\n        //         \"14403.91\", // low\n        //         \"14403.91\", // close\n        //         \"0.01571701\" // volume\n        //     ]\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 0)),\n            this.safeNumber (ohlcv, 1), // open\n            this.safeNumber (ohlcv, 2), // high\n            this.safeNumber (ohlcv, 3), // low\n            this.safeNumber (ohlcv, 4), // close\n            this.safeNumber (ohlcv, 5), // volume\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1139,
        "line_end": 1202,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'triggerPrice')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": \"7524\",\n         \"marketId\": \"BTC-AUD\",\n         \"side\": \"Bid\",\n         \"type\": \"Limit\",\n         \"creationTime\": \"2019-08-30T11:08:21.956000Z\",\n         \"price\": \"100.12\",\n         \"amount\": \"1.034\",\n         \"openAmount\": \"1.034\",\n         \"status\": \"Accepted\",\n         \"clientOrderId\": \"1234-5678\",\n         \"timeInForce\": \"IOC\",\n         \"postOnly\": false,\n         \"selfTrade\": \"P\",\n         \"triggerAmount\": \"105\",\n         \"targetAmount\": \"1000\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"orderId\": \"7524\",\n        //         \"marketId\": \"BTC-AUD\",\n        //         \"side\": \"Bid\",\n        //         \"type\": \"Limit\",\n        //         \"creationTime\": \"2019-08-30T11:08:21.956000Z\",\n        //         \"price\": \"100.12\",\n        //         \"amount\": \"1.034\",\n        //         \"openAmount\": \"1.034\",\n        //         \"status\": \"Accepted\",\n        //         \"clientOrderId\": \"1234-5678\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"postOnly\": false,\n        //         \"selfTrade\": \"P\",\n        //         \"triggerAmount\": \"105\",\n        //         \"targetAmount\": \"1000\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString (order, 'creationTime'));\n        const marketId = this.safeString (order, 'marketId');\n        market = this.safeMarket (marketId, market, '-');\n        let side = this.safeString (order, 'side');\n        if (side === 'Bid') {\n            side = 'buy';\n        } else if (side === 'Ask') {\n            side = 'sell';\n        }\n        const type = this.safeStringLower (order, 'type');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'amount');\n        const remaining = this.safeString (order, 'openAmount');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const id = this.safeString (order, 'orderId');\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const postOnly = this.safeBool (order, 'postOnly');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeNumber (order, 'triggerPrice'),\n            'cost': undefined,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': remaining,\n            'average': undefined,\n            'status': status,\n            'trades': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1126,
        "line_end": 1137,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Accepted': 'open',\n            'Placed': 'open',\n            'Partially Matched': 'open',\n            'Fully Matched': 'closed',\n            'Cancelled': 'canceled',\n            'Partially Cancelled': 'canceled',\n            'Failed': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 731,
        "line_end": 780,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'bestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marketId\":\"BAT-AUD\",\n         \"bestBid\":\"0.3751\",\n         \"bestAsk\":\"0.377\",\n         \"lastPrice\":\"0.3769\",\n         \"volume24h\":\"56192.97613335\",\n         \"volumeQte24h\":\"21179.13270465\",\n         \"price24h\":\"0.0119\",\n         \"pricePct24h\":\"3.26\",\n         \"low24h\":\"0.3611\",\n         \"high24h\":\"0.3799\",\n         \"timestamp\":\"2020-08-09T18:28:23.280000Z\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"marketId\":\"BAT-AUD\",\n        //         \"bestBid\":\"0.3751\",\n        //         \"bestAsk\":\"0.377\",\n        //         \"lastPrice\":\"0.3769\",\n        //         \"volume24h\":\"56192.97613335\",\n        //         \"volumeQte24h\":\"21179.13270465\",\n        //         \"price24h\":\"0.0119\",\n        //         \"pricePct24h\":\"3.26\",\n        //         \"low24h\":\"0.3611\",\n        //         \"high24h\":\"0.3799\",\n        //         \"timestamp\":\"2020-08-09T18:28:23.280000Z\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'marketId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const timestamp = this.parse8601 (this.safeString (ticker, 'timestamp'));\n        const last = this.safeString (ticker, 'lastPrice');\n        const baseVolume = this.safeString (ticker, 'volume24h');\n        const quoteVolume = this.safeString (ticker, 'volumeQte24h');\n        const change = this.safeString (ticker, 'price24h');\n        const percentage = this.safeString (ticker, 'pricePct24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high24h'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bestBid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'bestAsk'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 826,
        "line_end": 891,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":\"6191646611\",\n         \"price\":\"539.98\",\n         \"amount\":\"0.5\",\n         \"timestamp\":\"2020-08-09T15:21:05.016000Z\",\n         \"side\":\"Ask\"\n     }",
          "{\n         \"id\": \"36014819\",\n         \"marketId\": \"XRP-AUD\",\n         \"timestamp\": \"2019-06-25T16:01:02.977000Z\",\n         \"price\": \"0.67\",\n         \"amount\": \"1.50533262\",\n         \"side\": \"Ask\",\n         \"fee\": \"0.00857285\",\n         \"orderId\": \"3648306\",\n         \"liquidityType\": \"Taker\",\n         \"clientOrderId\": \"48\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"id\":\"6191646611\",\n        //         \"price\":\"539.98\",\n        //         \"amount\":\"0.5\",\n        //         \"timestamp\":\"2020-08-09T15:21:05.016000Z\",\n        //         \"side\":\"Ask\"\n        //     }\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"id\": \"36014819\",\n        //         \"marketId\": \"XRP-AUD\",\n        //         \"timestamp\": \"2019-06-25T16:01:02.977000Z\",\n        //         \"price\": \"0.67\",\n        //         \"amount\": \"1.50533262\",\n        //         \"side\": \"Ask\",\n        //         \"fee\": \"0.00857285\",\n        //         \"orderId\": \"3648306\",\n        //         \"liquidityType\": \"Taker\",\n        //         \"clientOrderId\": \"48\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString (trade, 'timestamp'));\n        const marketId = this.safeString (trade, 'marketId');\n        market = this.safeMarket (marketId, market, '-');\n        const feeCurrencyCode = (market['quote'] === 'AUD') ? market['quote'] : market['base'];\n        let side = this.safeString (trade, 'side');\n        if (side === 'Bid') {\n            side = 'buy';\n        } else if (side === 'Ask') {\n            side = 'sell';\n        }\n        const id = this.safeString (trade, 'id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const orderId = this.safeString (trade, 'orderId');\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const takerOrMaker = this.safeStringLower (trade, 'liquidityType');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': orderId,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 384,
        "line_end": 486,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "tagFrom",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "lastUpdate",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'description')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (fee),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (fee)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"6500230339\",\n         \"assetName\": \"XRP\",\n         \"amount\": \"500\",\n         \"type\": \"Deposit\",\n         \"creationTime\": \"2020-07-27T07:52:08.640000Z\",\n         \"status\": \"Complete\",\n         \"description\": \"RIPPLE Deposit, XRP 500\",\n         \"fee\": \"0\",\n         \"lastUpdate\": \"2020-07-27T07:52:08.665000Z\",\n         \"paymentDetail\": {\n             \"txId\": \"lsjflsjdfljsd\",\n             \"address\": \"kjasfkjsdf?dt=873874545\"\n         }\n    }",
          "{\n         \"id\": \"500985282\",\n         \"assetName\": \"BTC\",\n         \"amount\": \"0.42570126\",\n         \"type\": \"Withdraw\",\n         \"creationTime\": \"2017-07-29T12:49:03.931000Z\",\n         \"status\": \"Complete\",\n         \"description\": \"BTC withdraw from [nick-btcmarkets@snowmonkey.co.uk] to Address: 1B9DsnSYQ54VMqFHVJYdGoLMCYzFwrQzsj amount: 0.42570126 fee: 0.00000000\",\n         \"fee\": \"0.0005\",\n         \"lastUpdate\": \"2017-07-29T12:52:20.676000Z\",\n         \"paymentDetail\": {\n             \"txId\": \"fkjdsfjsfljsdfl\",\n             \"address\": \"a;daddjas;djas\"\n         }\n    }",
          "{\n         \"id\": \"505102262\",\n         \"assetName\": \"XRP\",\n         \"amount\": \"979.836\",\n         \"type\": \"Deposit\",\n         \"creationTime\": \"2017-07-31T08:50:01.053000Z\",\n         \"status\": \"Complete\",\n         \"description\": \"Ripple Deposit, X 979.8360\",\n         \"fee\": \"0\",\n         \"lastUpdate\": \"2017-07-31T08:50:01.290000Z\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //    {\n        //         \"id\": \"6500230339\",\n        //         \"assetName\": \"XRP\",\n        //         \"amount\": \"500\",\n        //         \"type\": \"Deposit\",\n        //         \"creationTime\": \"2020-07-27T07:52:08.640000Z\",\n        //         \"status\": \"Complete\",\n        //         \"description\": \"RIPPLE Deposit, XRP 500\",\n        //         \"fee\": \"0\",\n        //         \"lastUpdate\": \"2020-07-27T07:52:08.665000Z\",\n        //         \"paymentDetail\": {\n        //             \"txId\": \"lsjflsjdfljsd\",\n        //             \"address\": \"kjasfkjsdf?dt=873874545\"\n        //         }\n        //    }\n        //\n        //    {\n        //         \"id\": \"500985282\",\n        //         \"assetName\": \"BTC\",\n        //         \"amount\": \"0.42570126\",\n        //         \"type\": \"Withdraw\",\n        //         \"creationTime\": \"2017-07-29T12:49:03.931000Z\",\n        //         \"status\": \"Complete\",\n        //         \"description\": \"BTC withdraw from [nick-btcmarkets@snowmonkey.co.uk] to Address: 1B9DsnSYQ54VMqFHVJYdGoLMCYzFwrQzsj amount: 0.42570126 fee: 0.00000000\",\n        //         \"fee\": \"0.0005\",\n        //         \"lastUpdate\": \"2017-07-29T12:52:20.676000Z\",\n        //         \"paymentDetail\": {\n        //             \"txId\": \"fkjdsfjsfljsdfl\",\n        //             \"address\": \"a;daddjas;djas\"\n        //         }\n        //    }\n        //\n        //    {\n        //         \"id\": \"505102262\",\n        //         \"assetName\": \"XRP\",\n        //         \"amount\": \"979.836\",\n        //         \"type\": \"Deposit\",\n        //         \"creationTime\": \"2017-07-31T08:50:01.053000Z\",\n        //         \"status\": \"Complete\",\n        //         \"description\": \"Ripple Deposit, X 979.8360\",\n        //         \"fee\": \"0\",\n        //         \"lastUpdate\": \"2017-07-31T08:50:01.290000Z\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString (transaction, 'creationTime'));\n        const lastUpdate = this.parse8601 (this.safeString (transaction, 'lastUpdate'));\n        let type = this.parseTransactionType (this.safeStringLower (transaction, 'type'));\n        if (type === 'withdraw') {\n            type = 'withdrawal';\n        }\n        const cryptoPaymentDetail = this.safeDict (transaction, 'paymentDetail', {});\n        const txid = this.safeString (cryptoPaymentDetail, 'txId');\n        let address = this.safeString (cryptoPaymentDetail, 'address');\n        let tag = undefined;\n        if (address !== undefined) {\n            const addressParts = address.split ('?dt=');\n            const numParts = addressParts.length;\n            if (numParts > 1) {\n                address = addressParts[0];\n                tag = addressParts[1];\n            }\n        }\n        const addressTo = address;\n        const tagTo = tag;\n        const addressFrom = undefined;\n        const tagFrom = undefined;\n        const fee = this.safeString (transaction, 'fee');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const currencyId = this.safeString (transaction, 'assetName');\n        const code = this.safeCurrencyCode (currencyId);\n        let amount = this.safeString (transaction, 'amount');\n        if (fee) {\n            amount = Precise.stringSub (amount, fee);\n        }\n        return {\n            'id': this.safeString (transaction, 'id'),\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': tag,\n            'tagTo': tagTo,\n            'tagFrom': tagFrom,\n            'type': type,\n            'amount': this.parseNumber (amount),\n            'currency': code,\n            'status': status,\n            'updated': lastUpdate,\n            'comment': this.safeString (transaction, 'description'),\n            'internal': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (fee),\n                'rate': undefined,\n            },\n            'info': transaction,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 365,
        "line_end": 374,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'Accepted': 'pending',\n            'Pending Authorization': 'pending',\n            'Complete': 'ok',\n            'Cancelled': 'cancelled',\n            'Failed': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 376,
        "line_end": 382,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const statuses: Dict = {\n            'Withdraw': 'withdrawal',\n            'Deposit': 'deposit',\n        };\n        return this.safeString (statuses, type, type);\n    }"
      }
    ],
    "btcturk": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 385,
        "line_end": 403,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const data = this.safeList (response, 'data', []);\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < data.length; i++) {\n            const entry = data[i];\n            const currencyId = this.safeString (entry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (entry, 'balance');\n            account['free'] = this.safeString (entry, 'free');\n            account['used'] = this.safeString (entry, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (entry): Market",
        "line_start": 310,
        "line_end": 383,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(status === 'TRADING')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (entry, 'numeratorScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (entry, 'denominatorScale'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': maxPrice,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': minAmount,\n                    'max': maxAmount,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': minPrice,\n                    'max': maxPrice,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': minCost,\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (entry): Market {\n        const id = this.safeString (entry, 'name');\n        const baseId = this.safeString (entry, 'numerator');\n        const quoteId = this.safeString (entry, 'denominator');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const filters = this.safeList (entry, 'filters', []);\n        let minPrice = undefined;\n        let maxPrice = undefined;\n        let minAmount = undefined;\n        let maxAmount = undefined;\n        let minCost = undefined;\n        for (let j = 0; j < filters.length; j++) {\n            const filter = filters[j];\n            const filterType = this.safeString (filter, 'filterType');\n            if (filterType === 'PRICE_FILTER') {\n                minPrice = this.safeNumber (filter, 'minPrice');\n                maxPrice = this.safeNumber (filter, 'maxPrice');\n                minAmount = this.safeNumber (filter, 'minAmount');\n                maxAmount = this.safeNumber (filter, 'maxAmount');\n                minCost = this.safeNumber (filter, 'minExchangeValue');\n            }\n        }\n        const status = this.safeString (entry, 'status');\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': (status === 'TRADING'),\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (entry, 'numeratorScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (entry, 'denominatorScale'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': maxPrice,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': entry,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 655,
        "line_end": 674,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"timestamp\": 1661990400,\n        \"high\": 368388.0,\n        \"open\": 368388.0,\n        \"low\": 368388.0,\n        \"close\": 368388.0,\n        \"volume\": 0.00035208,\n    }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //    {\n        //        \"timestamp\": 1661990400,\n        //        \"high\": 368388.0,\n        //        \"open\": 368388.0,\n        //        \"low\": 368388.0,\n        //        \"close\": 368388.0,\n        //        \"volume\": 0.00035208,\n        //    }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOHLCVs",
        "signature": "parseOHLCVs (ohlcvs, market = undefined, timeframe = '1m', since: Int = undefined, limit: Int = undefined, tail: Bool = false)",
        "line_start": 756,
        "line_end": 777,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCVs (ohlcvs, market = undefined, timeframe = '1m', since: Int = undefined, limit: Int = undefined, tail: Bool = false) {\n        const results = [];\n        const timestamp = this.safeList (ohlcvs, 't', []);\n        const high = this.safeList (ohlcvs, 'h', []);\n        const open = this.safeList (ohlcvs, 'o', []);\n        const low = this.safeList (ohlcvs, 'l', []);\n        const close = this.safeList (ohlcvs, 'c', []);\n        const volume = this.safeList (ohlcvs, 'v', []);\n        for (let i = 0; i < timestamp.length; i++) {\n            const ohlcv: Dict = {\n                'timestamp': this.safeInteger (timestamp, i),\n                'high': this.safeNumber (high, i),\n                'open': this.safeNumber (open, i),\n                'low': this.safeNumber (low, i),\n                'close': this.safeNumber (close, i),\n                'volume': this.safeNumber (volume, i),\n            };\n            results.push (this.parseOHLCV (ohlcv, market));\n        }\n        const sorted = this.sortBy (results, 0);\n        return this.filterBySinceLimit (sorted, since, limit, 0, tail) as OHLCV[];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 926,
        "line_end": 991,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": 2605984008,\n       \"price\": \"55000\",\n       \"amount\": \"0.00050000\",\n       \"quantity\": \"0.00050000\",\n       \"stopPrice\": \"0\",\n       \"pairSymbol\": \"BTCUSDT\",\n       \"pairSymbolNormalized\": \"BTC_USDT\",\n       \"type\": \"buy\",\n       \"method\": \"limit\",\n       \"orderClientId\": \"f479bdb6-0965-4f03-95b5-daeb7aa5a3a5\",\n       \"time\": 0,\n       \"updateTime\": 1618913083543,\n       \"status\": \"Untouched\",\n       \"leftAmount\": \"0.00050000\"\n     }",
          "{\n       \"id\": \"2606935102\",\n       \"quantity\": \"0.0002\",\n       \"price\": \"56000\",\n       \"stopPrice\": null,\n       \"newOrderClientId\": \"98e5c491-7ed9-462b-9666-93553180fb28\",\n       \"type\": \"buy\",\n       \"method\": \"limit\",\n       \"pairSymbol\": \"BTCUSDT\",\n       \"pairSymbolNormalized\": \"BTC_USDT\",\n       \"datetime\": \"1618916479523\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrders / fetchOpenOrders\n        //     {\n        //       \"id\": 2605984008,\n        //       \"price\": \"55000\",\n        //       \"amount\": \"0.00050000\",\n        //       \"quantity\": \"0.00050000\",\n        //       \"stopPrice\": \"0\",\n        //       \"pairSymbol\": \"BTCUSDT\",\n        //       \"pairSymbolNormalized\": \"BTC_USDT\",\n        //       \"type\": \"buy\",\n        //       \"method\": \"limit\",\n        //       \"orderClientId\": \"f479bdb6-0965-4f03-95b5-daeb7aa5a3a5\",\n        //       \"time\": 0,\n        //       \"updateTime\": 1618913083543,\n        //       \"status\": \"Untouched\",\n        //       \"leftAmount\": \"0.00050000\"\n        //     }\n        //\n        // createOrder\n        //     {\n        //       \"id\": \"2606935102\",\n        //       \"quantity\": \"0.0002\",\n        //       \"price\": \"56000\",\n        //       \"stopPrice\": null,\n        //       \"newOrderClientId\": \"98e5c491-7ed9-462b-9666-93553180fb28\",\n        //       \"type\": \"buy\",\n        //       \"method\": \"limit\",\n        //       \"pairSymbol\": \"BTCUSDT\",\n        //       \"pairSymbolNormalized\": \"BTC_USDT\",\n        //       \"datetime\": \"1618916479523\"\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const price = this.safeString (order, 'price');\n        const amountString = this.safeString2 (order, 'amount', 'quantity');\n        const amount = Precise.stringAbs (amountString);\n        const remaining = this.safeString (order, 'leftAmount');\n        const marketId = this.safeString (order, 'pairSymbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const side = this.safeString (order, 'type');\n        const type = this.safeString (order, 'method');\n        const clientOrderId = this.safeString (order, 'orderClientId');\n        const timestamp = this.safeInteger2 (order, 'updateTime', 'datetime');\n        const rawStatus = this.safeString (order, 'status');\n        const status = this.parseOrderStatus (rawStatus);\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'price': price,\n            'amount': amount,\n            'remaining': remaining,\n            'filled': undefined,\n            'cost': undefined,\n            'average': undefined,\n            'status': status,\n            'side': side,\n            'type': type,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 916,
        "line_end": 924,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Untouched': 'open',\n            'Partial': 'open',\n            'Canceled': 'canceled',\n            'Closed': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 468,
        "line_end": 516,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'daily')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'dailyPercent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'average')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"pair\": \"BTCTRY\",\n     \"pairNormalized\": \"BTC_TRY\",\n     \"timestamp\": 1618826361234,\n     \"last\": 462485,\n     \"high\": 473976,\n     \"low\": 444201,\n     \"bid\": 461928,\n     \"ask\": 462485,\n     \"open\": 456915,\n     \"volume\": 917.41368645,\n     \"average\": 462868.29574589,\n     \"daily\": 5570,\n     \"dailyPercent\": 1.22,\n     \"denominatorSymbol\": \"TRY\",\n     \"numeratorSymbol\": \"BTC\",\n     \"order\": 1000\n   }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //   {\n        //     \"pair\": \"BTCTRY\",\n        //     \"pairNormalized\": \"BTC_TRY\",\n        //     \"timestamp\": 1618826361234,\n        //     \"last\": 462485,\n        //     \"high\": 473976,\n        //     \"low\": 444201,\n        //     \"bid\": 461928,\n        //     \"ask\": 462485,\n        //     \"open\": 456915,\n        //     \"volume\": 917.41368645,\n        //     \"average\": 462868.29574589,\n        //     \"daily\": 5570,\n        //     \"dailyPercent\": 1.22,\n        //     \"denominatorSymbol\": \"TRY\",\n        //     \"numeratorSymbol\": \"BTC\",\n        //     \"order\": 1000\n        //   }\n        //\n        const marketId = this.safeString (ticker, 'pair');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'daily'),\n            'percentage': this.safeString (ticker, 'dailyPercent'),\n            'average': this.safeString (ticker, 'average'),\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 549,
        "line_end": 610,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "Precise.stringAbs (feeAmountString)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrency)",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"pair\": \"BTCUSDT\",\n       \"pairNormalized\": \"BTC_USDT\",\n       \"numerator\": \"BTC\",\n       \"denominator\": \"USDT\",\n       \"date\": \"1618916879083\",\n       \"tid\": \"637545136790672520\",\n       \"price\": \"55774\",\n       \"amount\": \"0.27917100\",\n       \"side\": \"buy\"\n     }",
          "{\n       \"price\": \"56000\",\n       \"numeratorSymbol\": \"BTC\",\n       \"denominatorSymbol\": \"USDT\",\n       \"orderType\": \"buy\",\n       \"orderId\": \"2606935102\",\n       \"id\": \"320874372\",\n       \"timestamp\": \"1618916479593\",\n       \"amount\": \"0.00020000\",\n       \"fee\": \"0\",\n       \"tax\": \"0\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //       \"pair\": \"BTCUSDT\",\n        //       \"pairNormalized\": \"BTC_USDT\",\n        //       \"numerator\": \"BTC\",\n        //       \"denominator\": \"USDT\",\n        //       \"date\": \"1618916879083\",\n        //       \"tid\": \"637545136790672520\",\n        //       \"price\": \"55774\",\n        //       \"amount\": \"0.27917100\",\n        //       \"side\": \"buy\"\n        //     }\n        //\n        // fetchMyTrades\n        //     {\n        //       \"price\": \"56000\",\n        //       \"numeratorSymbol\": \"BTC\",\n        //       \"denominatorSymbol\": \"USDT\",\n        //       \"orderType\": \"buy\",\n        //       \"orderId\": \"2606935102\",\n        //       \"id\": \"320874372\",\n        //       \"timestamp\": \"1618916479593\",\n        //       \"amount\": \"0.00020000\",\n        //       \"fee\": \"0\",\n        //       \"tax\": \"0\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'date', 'timestamp');\n        const id = this.safeString2 (trade, 'tid', 'id');\n        const order = this.safeString (trade, 'orderId');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = Precise.stringAbs (this.safeString (trade, 'amount'));\n        const marketId = this.safeString (trade, 'pair');\n        const symbol = this.safeSymbol (marketId, market);\n        const side = this.safeString2 (trade, 'side', 'orderType');\n        let fee = undefined;\n        const feeAmountString = this.safeString (trade, 'fee');\n        if (feeAmountString !== undefined) {\n            const feeCurrency = this.safeString (trade, 'denominatorSymbol');\n            fee = {\n                'cost': Precise.stringAbs (feeAmountString),\n                'currency': this.safeCurrencyCode (feeCurrency),\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      }
    ],
    "bullish": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account: Dict): Account",
        "line_start": 2344,
        "line_end": 2351,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (account, 'tradingAccountId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccount (account: Dict): Account {\n        return {\n            'id': this.safeString (account, 'tradingAccountId'),\n            'type': undefined,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2476,
        "line_end": 2490,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const symbol = this.safeString (balance, 'assetSymbol');\n            const code = this.safeCurrencyCode (symbol);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'availableQuantity');\n            account['used'] = this.safeString (balance, 'lockedQuantity');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBalanceForSingleCurrency",
        "signature": "parseBalanceForSingleCurrency (response, code: Str): Balances",
        "line_start": 2467,
        "line_end": 2474,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceForSingleCurrency (response, code: Str): Balances {\n        const result: Dict = { 'info': response };\n        const account = this.account ();\n        account['free'] = this.safeString (response, 'availableQuantity');\n        account['used'] = this.safeString (response, 'lockedQuantity');\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 2803,
        "line_end": 2824,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (info, 'borrowedQuantity')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"assetId\": \"1\",\n         \"assetSymbol\": \"BTC\",\n         \"borrowedQuantity\": \"1.00000000\",\n         \"totalBorrowedQuantity\": \"1.00000000\",\n         \"createdAtDatetime\": \"2020-08-21T08:00:00.000Z\",\n         \"createdAtTimestamp\": \"1621490985000\"\n     }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"assetId\": \"1\",\n        //         \"assetSymbol\": \"BTC\",\n        //         \"borrowedQuantity\": \"1.00000000\",\n        //         \"totalBorrowedQuantity\": \"1.00000000\",\n        //         \"createdAtDatetime\": \"2020-08-21T08:00:00.000Z\",\n        //         \"createdAtTimestamp\": \"1621490985000\"\n        //     }\n        //\n        const timestamp = this.safeInteger (info, 'createdAtTimestamp');\n        const currencyId = this.safeString (info, 'assetSymbol');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber (info, 'borrowedQuantity'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2410,
        "line_end": 2420,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (id, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (network)",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        const id = this.safeString (depositAddress, 'symbol');\n        const network = this.safeString (depositAddress, 'network');\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (id, currency),\n            'network': this.networkIdToCode (network),\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 559,
        "line_end": 887,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "margin",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "this.parse8601 (expiryDatetime)",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "expiryDatetime",
            "comment": null
          },
          {
            "key": "strike",
            "value": "strike",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "optionType",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.parseNumber (minQuantityLimit),\n                    'max': this.parseNumber (maxQuantityLimit),\n                },\n                'price': {\n                    'min': this.parseNumber (minPriceLimit),\n                    'max': this.parseNumber (maxPriceLimit),\n                },\n                'cost': {\n                    'min': this.parseNumber (minCostLimit),\n                    'max': this.parseNumber (maxCostLimit),\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (amountPrecision)),\n                'price': this.parseNumber (this.parsePrecision (pricePrecision)),\n                'cost': this.parseNumber (this.parsePrecision (costPrecision)),\n                'base': this.parseNumber (this.parsePrecision (basePrecision)),\n                'quote': this.parseNumber (this.parsePrecision (quotePrecision)),\n            }",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeBool (market, 'marketEnabled')",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marketId\": \"20069\",\n         \"symbol\": \"BTC-USDC-20250516\",\n         \"quoteAssetId\": \"5\",\n         \"baseAssetId\": \"1\",\n         \"quoteSymbol\": \"USDC\",\n         \"baseSymbol\": \"BTC\",\n         \"quotePrecision\": \"4\",\n         \"basePrecision\": \"8\",\n         \"pricePrecision\": \"4\",\n         \"quantityPrecision\": \"8\",\n         \"costPrecision\": \"4\",\n         \"minQuantityLimit\": \"0.00050000\",\n         \"maxQuantityLimit\": \"200.00000000\",\n         \"maxPriceLimit\": null,\n         \"minPriceLimit\": null,\n         \"maxCostLimit\": null,\n         \"minCostLimit\": null,\n         \"timeZone\": \"Etc/UTC\",\n         \"tickSize\": \"0.1000\",\n         \"liquidityTickSize\": \"100.0000\",\n         \"liquidityPrecision\": \"4\",\n         \"makerFee\": \"0\",\n         \"takerFee\": \"2\",\n         \"roundingCorrectionFactor\": \"0.00000100\",\n         \"makerMinLiquidityAddition\": \"1000000\",\n         \"orderTypes\":\n             [\n                 \"LMT\",\n                 \"MKT\",\n                 \"STOP_LIMIT\",\n                 \"POST_ONLY\"\n             ],\n         \"spotTradingEnabled\": true,\n         \"marginTradingEnabled\": true,\n         \"marketEnabled\": true,\n         \"createOrderEnabled\": true,\n         \"cancelOrderEnabled\": true,\n         \"liquidityInvestEnabled\": true,\n         \"liquidityWithdrawEnabled\": true,\n         \"feeTiers\":\n             [\n                 {\n                     \"feeTierId\": \"1\",\n                     \"staticSpreadFee\": \"0.00000000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"10\",\n                     \"staticSpreadFee\": \"0.00100000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"11\",\n                     \"staticSpreadFee\": \"0.00150000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"12\",\n                     \"staticSpreadFee\": \"0.00150000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"13\",\n                     \"staticSpreadFee\": \"0.00300000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"14\",\n                     \"staticSpreadFee\": \"0.00300000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"15\",\n                     \"staticSpreadFee\": \"0.00500000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"16\",\n                     \"staticSpreadFee\": \"0.00500000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"17\",\n                     \"staticSpreadFee\": \"0.01000000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"18\",\n                     \"staticSpreadFee\": \"0.01000000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"19\",\n                     \"staticSpreadFee\": \"0.01500000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"2\",\n                     \"staticSpreadFee\": \"0.00000000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"20\",\n                     \"staticSpreadFee\": \"0.01500000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"21\",\n                     \"staticSpreadFee\": \"0.02000000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"22\",\n                     \"staticSpreadFee\": \"0.02000000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"3\",\n                     \"staticSpreadFee\": \"0.00010000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"4\",\n                     \"staticSpreadFee\": \"0.00010000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"5\",\n                     \"staticSpreadFee\": \"0.00020000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"6\",\n                     \"staticSpreadFee\": \"0.00020000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"7\",\n                     \"staticSpreadFee\": \"0.00060000\",\n                     \"isDislocationEnabled\": false\n                 },\n                 {\n                     \"feeTierId\": \"8\",\n                     \"staticSpreadFee\": \"0.00060000\",\n                     \"isDislocationEnabled\": true\n                 },\n                 {\n                     \"feeTierId\": \"9\",\n                     \"staticSpreadFee\": \"0.00100000\",\n                     \"isDislocationEnabled\": false\n                 }\n             ],\n         \"marketType\": \"DATED_FUTURE\",\n         \"contractMultiplier\": \"1\",\n         \"settlementAssetSymbol\": \"USDC\",\n         \"underlyingQuoteSymbol\": \"USDC\",\n         \"underlyingBaseSymbol\": \"BTC\",\n         \"openInterestLimitUSD\": \"100000000.0000\",\n         \"concentrationRiskPercentage\": \"100.00\",\n         \"concentrationRiskThresholdUSD\": \"30000000.0000\",\n         \"expiryDatetime\": \"2025-05-16T08:00:00.000Z\",\n         \"priceBuffer\": \"0.1\",\n         \"feeGroupId\": \"4\"\n     }",
          "{\n         \"marketId\": \"20997\",\n         \"symbol\": \"BTC-USDC-20260130-160000-P\",\n         \"quoteAssetId\": \"5\",\n         \"baseAssetId\": \"1\",\n         \"quoteSymbol\": \"USDC\",\n         \"baseSymbol\": \"BTC\",\n         \"quotePrecision\": \"4\",\n         \"basePrecision\": \"8\",\n         \"pricePrecision\": \"4\",\n         \"quantityPrecision\": \"8\",\n         \"costPrecision\": \"4\",\n         \"minQuantityLimit\": \"0.00050000\",\n         \"maxQuantityLimit\": \"200.00000000\",\n         \"maxPriceLimit\": null,\n         \"minPriceLimit\": null,\n         \"maxCostLimit\": null,\n         \"minCostLimit\": null,\n         \"timeZone\": \"Etc/UTC\",\n         \"tickSize\": \"10.0000\",\n         \"makerFee\": \"0\",\n         \"takerFee\": \"2\",\n         \"roundingCorrectionFactor\": \"0.00000100\",\n         \"makerMinLiquidityAddition\": \"-1\",\n         \"orderTypes\": [ \"LMT\", \"MKT\", \"STOP_LIMIT\", \"POST_ONLY\" ],\n         \"spotTradingEnabled\": true,\n         \"marginTradingEnabled\": true,\n         \"marketEnabled\": true,\n         \"createOrderEnabled\": true,\n         \"cancelOrderEnabled\": true,\n         \"amendOrderEnabled\": true,\n         \"marketType\": \"OPTION\",\n         \"contractMultiplier\": \"1\",\n         \"settlementAssetSymbol\": \"USDC\",\n         \"underlyingQuoteSymbol\": \"USDC\",\n         \"underlyingBaseSymbol\": \"BTC\",\n         \"openInterestLimitUSD\": \"100000000.0000\",\n         \"concentrationRiskPercentage\": \"100.00\",\n         \"concentrationRiskThresholdUSD\": \"30000000.0000\",\n         \"expiryDatetime\": \"2026-01-30T08:00:00.000Z\",\n         \"priceBuffer\": \"0\",\n         \"feeGroupId\": \"10\",\n         \"optionStrikePrice\": \"160000.0000\",\n         \"optionType\": \"PUT\",\n         \"premiumCapRatio\": \"0.1000\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"marketId\": \"20069\",\n        //         \"symbol\": \"BTC-USDC-20250516\",\n        //         \"quoteAssetId\": \"5\",\n        //         \"baseAssetId\": \"1\",\n        //         \"quoteSymbol\": \"USDC\",\n        //         \"baseSymbol\": \"BTC\",\n        //         \"quotePrecision\": \"4\",\n        //         \"basePrecision\": \"8\",\n        //         \"pricePrecision\": \"4\",\n        //         \"quantityPrecision\": \"8\",\n        //         \"costPrecision\": \"4\",\n        //         \"minQuantityLimit\": \"0.00050000\",\n        //         \"maxQuantityLimit\": \"200.00000000\",\n        //         \"maxPriceLimit\": null,\n        //         \"minPriceLimit\": null,\n        //         \"maxCostLimit\": null,\n        //         \"minCostLimit\": null,\n        //         \"timeZone\": \"Etc/UTC\",\n        //         \"tickSize\": \"0.1000\",\n        //         \"liquidityTickSize\": \"100.0000\",\n        //         \"liquidityPrecision\": \"4\",\n        //         \"makerFee\": \"0\",\n        //         \"takerFee\": \"2\",\n        //         \"roundingCorrectionFactor\": \"0.00000100\",\n        //         \"makerMinLiquidityAddition\": \"1000000\",\n        //         \"orderTypes\":\n        //             [\n        //                 \"LMT\",\n        //                 \"MKT\",\n        //                 \"STOP_LIMIT\",\n        //                 \"POST_ONLY\"\n        //             ],\n        //         \"spotTradingEnabled\": true,\n        //         \"marginTradingEnabled\": true,\n        //         \"marketEnabled\": true,\n        //         \"createOrderEnabled\": true,\n        //         \"cancelOrderEnabled\": true,\n        //         \"liquidityInvestEnabled\": true,\n        //         \"liquidityWithdrawEnabled\": true,\n        //         \"feeTiers\":\n        //             [\n        //                 {\n        //                     \"feeTierId\": \"1\",\n        //                     \"staticSpreadFee\": \"0.00000000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"10\",\n        //                     \"staticSpreadFee\": \"0.00100000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"11\",\n        //                     \"staticSpreadFee\": \"0.00150000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"12\",\n        //                     \"staticSpreadFee\": \"0.00150000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"13\",\n        //                     \"staticSpreadFee\": \"0.00300000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"14\",\n        //                     \"staticSpreadFee\": \"0.00300000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"15\",\n        //                     \"staticSpreadFee\": \"0.00500000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"16\",\n        //                     \"staticSpreadFee\": \"0.00500000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"17\",\n        //                     \"staticSpreadFee\": \"0.01000000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"18\",\n        //                     \"staticSpreadFee\": \"0.01000000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"19\",\n        //                     \"staticSpreadFee\": \"0.01500000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"2\",\n        //                     \"staticSpreadFee\": \"0.00000000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"20\",\n        //                     \"staticSpreadFee\": \"0.01500000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"21\",\n        //                     \"staticSpreadFee\": \"0.02000000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"22\",\n        //                     \"staticSpreadFee\": \"0.02000000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"3\",\n        //                     \"staticSpreadFee\": \"0.00010000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"4\",\n        //                     \"staticSpreadFee\": \"0.00010000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"5\",\n        //                     \"staticSpreadFee\": \"0.00020000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"6\",\n        //                     \"staticSpreadFee\": \"0.00020000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"7\",\n        //                     \"staticSpreadFee\": \"0.00060000\",\n        //                     \"isDislocationEnabled\": false\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"8\",\n        //                     \"staticSpreadFee\": \"0.00060000\",\n        //                     \"isDislocationEnabled\": true\n        //                 },\n        //                 {\n        //                     \"feeTierId\": \"9\",\n        //                     \"staticSpreadFee\": \"0.00100000\",\n        //                     \"isDislocationEnabled\": false\n        //                 }\n        //             ],\n        //         \"marketType\": \"DATED_FUTURE\",\n        //         \"contractMultiplier\": \"1\",\n        //         \"settlementAssetSymbol\": \"USDC\",\n        //         \"underlyingQuoteSymbol\": \"USDC\",\n        //         \"underlyingBaseSymbol\": \"BTC\",\n        //         \"openInterestLimitUSD\": \"100000000.0000\",\n        //         \"concentrationRiskPercentage\": \"100.00\",\n        //         \"concentrationRiskThresholdUSD\": \"30000000.0000\",\n        //         \"expiryDatetime\": \"2025-05-16T08:00:00.000Z\",\n        //         \"priceBuffer\": \"0.1\",\n        //         \"feeGroupId\": \"4\"\n        //     }\n        //\n        // option\n        //     {\n        //         \"marketId\": \"20997\",\n        //         \"symbol\": \"BTC-USDC-20260130-160000-P\",\n        //         \"quoteAssetId\": \"5\",\n        //         \"baseAssetId\": \"1\",\n        //         \"quoteSymbol\": \"USDC\",\n        //         \"baseSymbol\": \"BTC\",\n        //         \"quotePrecision\": \"4\",\n        //         \"basePrecision\": \"8\",\n        //         \"pricePrecision\": \"4\",\n        //         \"quantityPrecision\": \"8\",\n        //         \"costPrecision\": \"4\",\n        //         \"minQuantityLimit\": \"0.00050000\",\n        //         \"maxQuantityLimit\": \"200.00000000\",\n        //         \"maxPriceLimit\": null,\n        //         \"minPriceLimit\": null,\n        //         \"maxCostLimit\": null,\n        //         \"minCostLimit\": null,\n        //         \"timeZone\": \"Etc/UTC\",\n        //         \"tickSize\": \"10.0000\",\n        //         \"makerFee\": \"0\",\n        //         \"takerFee\": \"2\",\n        //         \"roundingCorrectionFactor\": \"0.00000100\",\n        //         \"makerMinLiquidityAddition\": \"-1\",\n        //         \"orderTypes\": [ \"LMT\", \"MKT\", \"STOP_LIMIT\", \"POST_ONLY\" ],\n        //         \"spotTradingEnabled\": true,\n        //         \"marginTradingEnabled\": true,\n        //         \"marketEnabled\": true,\n        //         \"createOrderEnabled\": true,\n        //         \"cancelOrderEnabled\": true,\n        //         \"amendOrderEnabled\": true,\n        //         \"marketType\": \"OPTION\",\n        //         \"contractMultiplier\": \"1\",\n        //         \"settlementAssetSymbol\": \"USDC\",\n        //         \"underlyingQuoteSymbol\": \"USDC\",\n        //         \"underlyingBaseSymbol\": \"BTC\",\n        //         \"openInterestLimitUSD\": \"100000000.0000\",\n        //         \"concentrationRiskPercentage\": \"100.00\",\n        //         \"concentrationRiskThresholdUSD\": \"30000000.0000\",\n        //         \"expiryDatetime\": \"2026-01-30T08:00:00.000Z\",\n        //         \"priceBuffer\": \"0\",\n        //         \"feeGroupId\": \"10\",\n        //         \"optionStrikePrice\": \"160000.0000\",\n        //         \"optionType\": \"PUT\",\n        //         \"premiumCapRatio\": \"0.1000\"\n        //     }\n        //\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'baseSymbol');\n        const quoteId = this.safeString (market, 'quoteSymbol');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        const basePrecision = this.safeString (market, 'basePrecision');\n        const quotePrecision = this.safeString (market, 'quotePrecision');\n        const amountPrecision = this.safeString (market, 'quantityPrecision');\n        const pricePrecision = this.safeString (market, 'pricePrecision');\n        const costPrecision = this.safeString (market, 'costPrecision');\n        const minQuantityLimit = this.safeString (market, 'minQuantityLimit');\n        const maxQuantityLimit = this.safeString (market, 'maxQuantityLimit');\n        const minPriceLimit = this.safeString (market, 'minPriceLimit');\n        const maxPriceLimit = this.safeString (market, 'maxPriceLimit');\n        const minCostLimit = this.safeString (market, 'minCostLimit');\n        const maxCostLimit = this.safeString (market, 'maxCostLimit');\n        const settleId = this.safeString (market, 'settlementAssetSymbol');\n        const settle = this.safeCurrencyCode (settleId);\n        const type = this.parseMarketType (this.safeString (market, 'marketType'), 'spot');\n        let spot: Bool = false;\n        let swap: Bool = false;\n        let future: Bool = false;\n        let option: Bool = false;\n        let contract: Bool = true;\n        let linear: Bool = undefined;\n        let inverse: Bool = undefined;\n        let expiryDatetime: Str = undefined;\n        let contractSize: Num = undefined;\n        let optionType: Str = undefined;\n        let strike: Num = undefined;\n        let margin: Bool = false;\n        if (type === 'spot') {\n            spot = true;\n            contract = false;\n            margin = this.safeBool (market, 'marginTradingEnabled');\n        } else {\n            contractSize = this.safeNumber (market, 'contractMultiplier');\n            symbol += ':' + settle;\n            linear = settle === quote;\n            inverse = !linear;\n            if (type === 'swap') {\n                swap = true;\n            } else {\n                expiryDatetime = this.safeString (market, 'expiryDatetime');\n                const idParts = id.split ('-');\n                const datePart = this.safeString (idParts, 2);\n                symbol += '-' + datePart;\n                if (type === 'future') {\n                    future = true;\n                } else if (type === 'option') {\n                    option = true;\n                    optionType = this.safeStringLower (market, 'optionType');\n                    strike = this.parseToNumeric (this.safeString (market, 'optionStrikePrice'));\n                    symbol += '-' + this.numberToString (strike) + '-' + this.safeString (idParts, 4);\n                }\n            }\n        }\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'baseId': baseId,\n            'quote': quote,\n            'quoteId': quoteId,\n            'settle': settle,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': margin,\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': this.fees['trading']['taker'],\n            'maker': this.fees['trading']['maker'],\n            'contractSize': contractSize,\n            'expiry': this.parse8601 (expiryDatetime),\n            'expiryDatetime': expiryDatetime,\n            'strike': strike,\n            'optionType': optionType,\n            'limits': {\n                'amount': {\n                    'min': this.parseNumber (minQuantityLimit),\n                    'max': this.parseNumber (maxQuantityLimit),\n                },\n                'price': {\n                    'min': this.parseNumber (minPriceLimit),\n                    'max': this.parseNumber (maxPriceLimit),\n                },\n                'cost': {\n                    'min': this.parseNumber (minCostLimit),\n                    'max': this.parseNumber (maxCostLimit),\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (amountPrecision)),\n                'price': this.parseNumber (this.parsePrecision (pricePrecision)),\n                'cost': this.parseNumber (this.parsePrecision (costPrecision)),\n                'base': this.parseNumber (this.parsePrecision (basePrecision)),\n                'quote': this.parseNumber (this.parsePrecision (quotePrecision)),\n            },\n            'active': this.safeBool (market, 'marketEnabled'),\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketType",
        "signature": "parseMarketType (type: string, defaultType: Str = undefined): string",
        "line_start": 889,
        "line_end": 897,
        "comment": null,
        "mappings": [
          {
            "key": "SPOT",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "PERPETUAL",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "DATED_FUTURE",
            "value": "'future'",
            "comment": null
          },
          {
            "key": "OPTION",
            "value": "'option'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketType (type: string, defaultType: Str = undefined): string {\n        const types = {\n            'SPOT': 'spot',\n            'PERPETUAL': 'swap',\n            'DATED_FUTURE': 'future',\n            'OPTION': 'option',\n        };\n        return this.safeString (types, type, defaultType);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1379,
        "line_end": 1388,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'createdAtTimestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1900,
        "line_end": 2002,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "type === 'POST_ONLY'",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "stopPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "quoteFee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clientOrderId\": \"187\",\n         \"orderId\": \"297735387747975680\",\n         \"symbol\": \"BTCUSDC\",\n         \"price\": \"1.00000000\",\n         \"averageFillPrice\": \"1.00000000\",\n         \"stopPrice\": \"1.00000000\",\n         \"allowBorrow\": false,\n         \"quantity\": \"1.00000000\",\n         \"quantityFilled\": \"1.00000000\",\n         \"quoteAmount\": \"1.00000000\",\n         \"baseFee\": \"0.00100000\",\n         \"quoteFee\": \"0.0010\",\n         \"borrowedBaseQuantity\": \"1.00000000\",\n         \"borrowedQuoteQuantity\": \"1.00000000\",\n         \"isLiquidation\": false,\n         \"side\": \"BUY\",\n         \"type\": \"LMT\",\n         \"timeInForce\": \"GTC\",\n         \"status\": \"OPEN\",\n         \"statusReason\": \"User cancelled\",\n         \"statusReasonCode\": \"1002\",\n         \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n         \"createdAtTimestamp\": \"1621490985000\",\n     }",
          "{\n         \"message\": \"Command acknowledged - CreateOrder\",\n         \"requestId\": \"633910976353665024\",\n         \"orderId\": \"633910775316480001\",\n         \"clientOrderId\": \"1234567\"\n     }",
          "{\n         \"message\": \"Command acknowledged - CancelOrder\",\n         \"requestId\": \"633910976353665024\",\n         \"orderId\": \"633910775316480001\"\n     }",
          "{\n         \"message\": \"Command acknowledged - CancelAllOrders\",\n         \"requestId\": \"633900538459062272\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrders, fetchOrder\n        //     {\n        //         \"clientOrderId\": \"187\",\n        //         \"orderId\": \"297735387747975680\",\n        //         \"symbol\": \"BTCUSDC\",\n        //         \"price\": \"1.00000000\",\n        //         \"averageFillPrice\": \"1.00000000\",\n        //         \"stopPrice\": \"1.00000000\",\n        //         \"allowBorrow\": false,\n        //         \"quantity\": \"1.00000000\",\n        //         \"quantityFilled\": \"1.00000000\",\n        //         \"quoteAmount\": \"1.00000000\",\n        //         \"baseFee\": \"0.00100000\",\n        //         \"quoteFee\": \"0.0010\",\n        //         \"borrowedBaseQuantity\": \"1.00000000\",\n        //         \"borrowedQuoteQuantity\": \"1.00000000\",\n        //         \"isLiquidation\": false,\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LMT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"status\": \"OPEN\",\n        //         \"statusReason\": \"User cancelled\",\n        //         \"statusReasonCode\": \"1002\",\n        //         \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n        //         \"createdAtTimestamp\": \"1621490985000\",\n        //     }\n        //\n        // createOrder\n        //     {\n        //         \"message\": \"Command acknowledged - CreateOrder\",\n        //         \"requestId\": \"633910976353665024\",\n        //         \"orderId\": \"633910775316480001\",\n        //         \"clientOrderId\": \"1234567\"\n        //     }\n        //\n        // cancelOrder\n        //     {\n        //         \"message\": \"Command acknowledged - CancelOrder\",\n        //         \"requestId\": \"633910976353665024\",\n        //         \"orderId\": \"633910775316480001\"\n        //     }\n        //\n        // cancelAllOrders\n        //     {\n        //         \"message\": \"Command acknowledged - CancelAllOrders\",\n        //         \"requestId\": \"633900538459062272\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        if (market === undefined) {\n            market = this.safeMarket (marketId);\n        }\n        const symbol = this.safeSymbol (marketId, market);\n        const id = this.safeString (order, 'orderId');\n        const timestamp = this.safeInteger (order, 'createdAtTimestamp');\n        const type = this.safeString (order, 'type');\n        const side = this.safeStringLower (order, 'side');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'quantity');\n        const filled = this.safeString (order, 'quantityFilled');\n        let status = this.parseOrderStatus (this.safeString (order, 'status'));\n        if (status === 'closed') {\n            const statusReason = this.safeString (order, 'statusReason');\n            if (statusReason === 'User cancelled') {\n                status = 'canceled';\n            }\n        }\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const stopPrice = this.safeString (order, 'stopPrice');\n        const cost = this.safeString (order, 'quoteAmount');\n        const fee = {};\n        const quoteFee = this.safeNumber (order, 'quoteFee');\n        if (quoteFee !== undefined) {\n            fee['cost'] = quoteFee;\n            fee['currency'] = market['quote'];\n        }\n        const average = this.safeString (order, 'averageFillPrice');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': type === 'POST_ONLY',\n            'side': side,\n            'price': price,\n            'triggerPrice': stopPrice,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'cost': cost,\n            'trades': undefined,\n            'fee': fee,\n            'info': order,\n            'average': average,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2004,
        "line_end": 2012,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'OPEN': 'open',\n            'CLOSED': 'closed',\n            'CANCELLED': 'canceled',\n            'REJECTED': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 2014,
        "line_end": 2022,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LMT': 'limit',\n            'MKT': 'market',\n            'POST_ONLY': 'limit',\n            'STOP_LIMIT': 'limit',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2534,
        "line_end": 2589,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'updatedAtTimestamp')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parsePositionSide (side)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'quantity')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'notional')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"tradingAccountId\": \"111000000000001\",\n             \"symbol\": \"BTC-USDC-PERP\",\n             \"side\": \"BUY\",\n             \"quantity\": \"1.00000000\",\n             \"notional\": \"1.0000\",\n             \"entryNotional\": \"1.0000\",\n             \"mtmPnl\": \"1.0000\",\n             \"reportedMtmPnl\": \"1.0000\",\n             \"reportedFundingPnl\": \"1.0000\",\n             \"realizedPnl\": \"1.0000\",\n             \"settlementAssetSymbol\": \"USDC\",\n             \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n             \"createdAtTimestamp\": \"1621490985000\",\n             \"updatedAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n             \"updatedAtTimestamp\": \"1621490985000\"\n         }\n     ]"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     [\n        //         {\n        //             \"tradingAccountId\": \"111000000000001\",\n        //             \"symbol\": \"BTC-USDC-PERP\",\n        //             \"side\": \"BUY\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"notional\": \"1.0000\",\n        //             \"entryNotional\": \"1.0000\",\n        //             \"mtmPnl\": \"1.0000\",\n        //             \"reportedMtmPnl\": \"1.0000\",\n        //             \"reportedFundingPnl\": \"1.0000\",\n        //             \"realizedPnl\": \"1.0000\",\n        //             \"settlementAssetSymbol\": \"USDC\",\n        //             \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n        //             \"createdAtTimestamp\": \"1621490985000\",\n        //             \"updatedAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n        //             \"updatedAtTimestamp\": \"1621490985000\"\n        //         }\n        //     ]\n        //\n        market = this.safeMarket (this.safeString (position, 'symbol'), market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (position, 'createdAtTimestamp');\n        const side = this.safeString (position, 'side');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'updatedAtTimestamp'),\n            'hedged': undefined,\n            'side': this.parsePositionSide (side),\n            'contracts': this.safeNumber (position, 'quantity'),\n            'contractSize': undefined,\n            'entryPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'notional': this.safeNumber (position, 'notional'),\n            'leverage': undefined,\n            'collateral': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'unrealizedPnl': undefined,\n            'liquidationPrice': undefined,\n            'marginMode': undefined,\n            'marginRatio': undefined,\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parsePositionSide",
        "signature": "parsePositionSide (side: Str)",
        "line_start": 2591,
        "line_end": 2597,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parsePositionSide (side: Str) {\n        const sides: Dict = {\n            'BUY': 'long',\n            'SELL': 'short',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1223,
        "line_end": 1288,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'bid', 'bestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidVolume')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'ask', 'bestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askVolume')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "this.safeString (ticker, 'vwap')",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString (ticker, 'close')",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeString (ticker, 'last')",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'change')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'percentage')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'average')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'baseVolume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quoteVolume')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n         \"createdAtTimestamp\": \"1621490985000\",\n         \"high\": \"1.00000000\",\n         \"low\": \"1.00000000\",\n         \"bestBid\": \"1.00000000\",\n         \"bidVolume\": \"1.00000000\",\n         \"bestAsk\": \"1.00000000\",\n         \"askVolume\": \"1.00000000\",\n         \"vwap\": \"1.00000000\",\n         \"open\": \"1.00000000\",\n         \"close\": \"1.00000000\",\n         \"last\": \"1.00000000\",\n         \"change\": \"1.00000000\",\n         \"percentage\": \"1.00000000\",\n         \"average\": \"1.00000000\",\n         \"baseVolume\": \"1.00000000\",\n         \"quoteVolume\": \"1.00000000\",\n         \"bancorPrice\": \"1.00000000\",\n         \"markPrice\": \"19999.00\",\n         \"fundingRate\": \"0.01\",\n         \"openInterest\": \"100000.32452\",\n         \"lastTradeDatetime\": \"2021-05-20T01:01:01.000Z\",\n         \"lastTradeTimestamp\": \"1621490985000\",\n         \"lastTradeQuantity\": \"1.00000000\",\n         \"ammData\": [\n             {\n                 \"feeTierId\": \"1\",\n                 \"bidSpreadFee\": \"0.00040000\",\n                 \"askSpreadFee\": \"0.00040000\",\n                 \"baseReservesQuantity\": \"245.56257825\",\n                 \"quoteReservesQuantity\": \"3424383.3629\",\n                 \"currentPrice\": \"16856.0000\"\n             }\n         ]\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n        //         \"createdAtTimestamp\": \"1621490985000\",\n        //         \"high\": \"1.00000000\",\n        //         \"low\": \"1.00000000\",\n        //         \"bestBid\": \"1.00000000\",\n        //         \"bidVolume\": \"1.00000000\",\n        //         \"bestAsk\": \"1.00000000\",\n        //         \"askVolume\": \"1.00000000\",\n        //         \"vwap\": \"1.00000000\",\n        //         \"open\": \"1.00000000\",\n        //         \"close\": \"1.00000000\",\n        //         \"last\": \"1.00000000\",\n        //         \"change\": \"1.00000000\",\n        //         \"percentage\": \"1.00000000\",\n        //         \"average\": \"1.00000000\",\n        //         \"baseVolume\": \"1.00000000\",\n        //         \"quoteVolume\": \"1.00000000\",\n        //         \"bancorPrice\": \"1.00000000\",\n        //         \"markPrice\": \"19999.00\",\n        //         \"fundingRate\": \"0.01\",\n        //         \"openInterest\": \"100000.32452\",\n        //         \"lastTradeDatetime\": \"2021-05-20T01:01:01.000Z\",\n        //         \"lastTradeTimestamp\": \"1621490985000\",\n        //         \"lastTradeQuantity\": \"1.00000000\",\n        //         \"ammData\": [\n        //             {\n        //                 \"feeTierId\": \"1\",\n        //                 \"bidSpreadFee\": \"0.00040000\",\n        //                 \"askSpreadFee\": \"0.00040000\",\n        //                 \"baseReservesQuantity\": \"245.56257825\",\n        //                 \"quoteReservesQuantity\": \"3424383.3629\",\n        //                 \"currentPrice\": \"16856.0000\"\n        //             }\n        //         ]\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (ticker, 'createdAtTimestamp');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString2 (ticker, 'bid', 'bestBid'),\n            'bidVolume': this.safeString (ticker, 'bidVolume'),\n            'ask': this.safeString2 (ticker, 'ask', 'bestAsk'),\n            'askVolume': this.safeString (ticker, 'askVolume'),\n            'vwap': this.safeString (ticker, 'vwap'),\n            'open': this.safeString (ticker, 'open'),\n            'close': this.safeString (ticker, 'close'),\n            'last': this.safeString (ticker, 'last'),\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'change'),\n            'percentage': this.safeString (ticker, 'percentage'),\n            'average': this.safeString (ticker, 'average'),\n            'baseVolume': this.safeString (ticker, 'baseVolume'),\n            'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1077,
        "line_end": 1164,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'tradeId')",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"tradeId\": \"100178000000367159\",\n             \"symbol\": \"BTCUSDC\",\n             \"price\": \"103891.8977\",\n             \"quantity\": \"0.00029411\",\n             \"quoteAmount\": \"30.5556\",\n             \"side\": \"BUY\",\n             \"isTaker\": true,\n             \"createdAtTimestamp\": \"1747768055826\",\n             \"createdAtDatetime\": \"2025-05-20T19:07:35.826Z\"\n         }, ...\n     ]",
          "[\n         {\n             \"tradeId\": \"100020000000000060\",\n             \"symbol\": \"BTCUSDC\",\n             \"price\": \"1.00000000\",\n             \"quantity\": \"1.00000000\",\n             \"side\": \"BUY\",\n             \"isTaker\": true,\n             \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n             \"createdAtTimestamp\": \"1621490985000\"\n         }\n     ]",
          "[\n         {\n             \"baseFee\": \"0.00000000\",\n             \"createdAtDatetime\": \"2025-05-18T15:57:28.132Z\",\n             \"createdAtTimestamp\": \"1747583848132\",\n             \"handle\": null,\n             \"isTaker\": true,\n             \"orderId\": \"844242293909618689\",\n             \"price\": \"103942.7048\",\n             \"publishedAtTimestamp\": \"1747769786131\",\n             \"quantity\": \"1.00000000\",\n             \"quoteAmount\": \"103942.7048\",\n             \"quoteFee\": \"0.0000\",\n             \"side\": \"BUY\",\n             \"symbol\": \"BTCUSDC\",\n             \"tradeId\": \"100178000000288892\"\n         }, ...\n     ]"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     [\n        //         {\n        //             \"tradeId\": \"100178000000367159\",\n        //             \"symbol\": \"BTCUSDC\",\n        //             \"price\": \"103891.8977\",\n        //             \"quantity\": \"0.00029411\",\n        //             \"quoteAmount\": \"30.5556\",\n        //             \"side\": \"BUY\",\n        //             \"isTaker\": true,\n        //             \"createdAtTimestamp\": \"1747768055826\",\n        //             \"createdAtDatetime\": \"2025-05-20T19:07:35.826Z\"\n        //         }, ...\n        //     ]\n        //\n        //     [\n        //         {\n        //             \"tradeId\": \"100020000000000060\",\n        //             \"symbol\": \"BTCUSDC\",\n        //             \"price\": \"1.00000000\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"side\": \"BUY\",\n        //             \"isTaker\": true,\n        //             \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\",\n        //             \"createdAtTimestamp\": \"1621490985000\"\n        //         }\n        //     ]\n        //\n        // fetchMyTrades\n        //     [\n        //         {\n        //             \"baseFee\": \"0.00000000\",\n        //             \"createdAtDatetime\": \"2025-05-18T15:57:28.132Z\",\n        //             \"createdAtTimestamp\": \"1747583848132\",\n        //             \"handle\": null,\n        //             \"isTaker\": true,\n        //             \"orderId\": \"844242293909618689\",\n        //             \"price\": \"103942.7048\",\n        //             \"publishedAtTimestamp\": \"1747769786131\",\n        //             \"quantity\": \"1.00000000\",\n        //             \"quoteAmount\": \"103942.7048\",\n        //             \"quoteFee\": \"0.0000\",\n        //             \"side\": \"BUY\",\n        //             \"symbol\": \"BTCUSDC\",\n        //             \"tradeId\": \"100178000000288892\"\n        //         }, ...\n        //     ]\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (trade, 'createdAtTimestamp');\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'quantity');\n        const side = this.safeStringLower (trade, 'side');\n        const isTaker = this.safeBool (trade, 'isTaker');\n        const currency = market['quote'];\n        const code = this.safeCurrencyCode (currency);\n        const feeCost = this.safeNumber (trade, 'quoteFee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        let takerOrMaker = undefined;\n        if (isTaker) {\n            takerOrMaker = 'taker';\n        } else {\n            takerOrMaker = 'maker';\n        }\n        const orderId = this.safeString (trade, 'orderId');\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': this.safeString (trade, 'tradeId'),\n            'order': orderId,\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2137,
        "line_end": 2210,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (network)",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "sourceAddress",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseTransactionType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"custodyTransactionId\": \"0x791fc85f16a84cbd5250d5517ecad497f564d2e5cc54d31466fe70b952fd58da\",\n         \"direction\": \"DEPOSIT\",\n         \"quantity\": \"150\",\n         \"symbol\": \"USDC\",\n         \"fee\": \"0\",\n         \"memo\": \"0x34625d5f0b6575503a0669994dea24271bfbd443\",\n         \"createdAtDateTime\": \"2025-11-04T14:31:17.000Z\",\n         \"updatedAtDateTime\": \"2025-11-04T14:44:17.500Z\",\n         \"status\": \"COMPLETE\",\n         \"statusReason\": \"OK\",\n         \"network\": \"ETH\",\n         \"transactionDetails\": {\n             \"address\": \"0x34625d5f0b6575503a0669994dea24271bfbd443\",\n             \"blockchainTxId\": \"0x791fc85f16a84cbd5250d5517ecad497f564d2e5cc54d31466fe70b952fd58da\",\n             \"swiftUetr\": null,\n             \"sources\": [\n                 {\n                     \"address\": \"0x2653435d52a5f49551ebb757f25b2c8bb954859b\"\n                 }\n             ]\n         }\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"custodyTransactionId\": \"0x791fc85f16a84cbd5250d5517ecad497f564d2e5cc54d31466fe70b952fd58da\",\n        //         \"direction\": \"DEPOSIT\",\n        //         \"quantity\": \"150\",\n        //         \"symbol\": \"USDC\",\n        //         \"fee\": \"0\",\n        //         \"memo\": \"0x34625d5f0b6575503a0669994dea24271bfbd443\",\n        //         \"createdAtDateTime\": \"2025-11-04T14:31:17.000Z\",\n        //         \"updatedAtDateTime\": \"2025-11-04T14:44:17.500Z\",\n        //         \"status\": \"COMPLETE\",\n        //         \"statusReason\": \"OK\",\n        //         \"network\": \"ETH\",\n        //         \"transactionDetails\": {\n        //             \"address\": \"0x34625d5f0b6575503a0669994dea24271bfbd443\",\n        //             \"blockchainTxId\": \"0x791fc85f16a84cbd5250d5517ecad497f564d2e5cc54d31466fe70b952fd58da\",\n        //             \"swiftUetr\": null,\n        //             \"sources\": [\n        //                 {\n        //                     \"address\": \"0x2653435d52a5f49551ebb757f25b2c8bb954859b\"\n        //                 }\n        //             ]\n        //         }\n        //     }\n        //\n        const id = this.safeString (transaction, 'custodyTransactionId');\n        const type = this.safeString (transaction, 'direction');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'createdAtDateTime'));\n        const updated = this.parse8601 (this.safeString (transaction, 'updatedAtDateTime'));\n        const network = this.safeString (transaction, 'network');\n        const transactionDetails = this.safeDict (transaction, 'transactionDetails');\n        const txid = this.safeString (transactionDetails, 'blockchainTxId');\n        const address = this.safeString (transactionDetails, 'address');\n        const amount = this.safeNumber (transaction, 'quantity');\n        const currencyId = this.safeString (transaction, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.safeString (transaction, 'status');\n        const sources = this.safeList (transactionDetails, 'sources', []);\n        const source = this.safeDict (sources, 0, {});\n        const sourceAddress = this.safeString (source, 'address');\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        const feeCost = this.safeNumber (transaction, 'fee');\n        if (feeCost !== undefined) {\n            fee['cost'] = feeCost;\n            fee['currency'] = code;\n        }\n        return {\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (network),\n            'addressFrom': sourceAddress,\n            'address': address,\n            'addressTo': address,\n            'amount': amount,\n            'type': this.parseTransactionType (type),\n            'currency': code,\n            'status': this.parseTransactionStatus (status),\n            'updated': updated,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n            'info': transaction,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2220,
        "line_end": 2228,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'COMPLETE': 'ok',\n            'FAILED': 'failed',\n            'PENDING': 'pending',\n            'CANCELLED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 2212,
        "line_end": 2218,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'DEPOSIT': 'deposit',\n            'WITHDRAW': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency: Currency = undefined)",
        "line_start": 2702,
        "line_end": 2741,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'requestId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'quantity')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (transfer, 'fromTradingAccountId')",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (transfer, 'toTradingAccountId')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"requestId\": \"1\",\n         \"toTradingAccountId\": \"111000000000001\",\n         \"fromTradingAccountId\": \"121000000000001\",\n         \"assetSymbol\": \"BTC\",\n         \"quantity\": \"1.00000000\",\n         \"status\": \"CLOSED\",\n         \"statusReasonCode\": \"6002\",\n         \"statusReason\": \"Executed\",\n         \"createdAtTimestamp\": \"1621490985000\",\n         \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\"\n     }",
          "{\n         \"message\": \"Command acknowledged - TransferAsset\",\n         \"requestId\": \"633909659774222336\"\n     }"
        ],
        "source": "parseTransfer (transfer, currency: Currency = undefined) {\n        //\n        // fetchTransfers\n        //     {\n        //         \"requestId\": \"1\",\n        //         \"toTradingAccountId\": \"111000000000001\",\n        //         \"fromTradingAccountId\": \"121000000000001\",\n        //         \"assetSymbol\": \"BTC\",\n        //         \"quantity\": \"1.00000000\",\n        //         \"status\": \"CLOSED\",\n        //         \"statusReasonCode\": \"6002\",\n        //         \"statusReason\": \"Executed\",\n        //         \"createdAtTimestamp\": \"1621490985000\",\n        //         \"createdAtDatetime\": \"2021-05-20T01:01:01.000Z\"\n        //     }\n        //\n        // transfer\n        //     {\n        //         \"message\": \"Command acknowledged - TransferAsset\",\n        //         \"requestId\": \"633909659774222336\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transfer, 'createdAtTimestamp');\n        const currencyId = this.safeString (transfer, 'assetSymbol');\n        let status = this.safeString (transfer, 'status');\n        if (status === undefined) {\n            status = this.safeString (transfer, 'message');\n        }\n        return {\n            'id': this.safeString (transfer, 'requestId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'quantity'),\n            'fromAccount': this.safeString (transfer, 'fromTradingAccountId'),\n            'toAccount': this.safeString (transfer, 'toTradingAccountId'),\n            'status': this.parseTransferStatus (status),\n            'info': transfer,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status)",
        "line_start": 2743,
        "line_end": 2751,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status) {\n        const statuses: Dict = {\n            'CLOSED': 'ok',\n            'OPEN': 'pending',\n            'REJECTED': 'failed',\n            'Command acknowledged - TransferAsset': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "bybit": [
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 9550,
        "line_end": 9603,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeInteger (info, 'adlRankIndicator')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"leverage\": \"\",\n         \"autoAddMargin\": 0,\n         \"avgPrice\": \"177489.6\",\n         \"liqPrice\": \"\",\n         \"riskLimitValue\": \"\",\n         \"takeProfit\": \"\",\n         \"positionValue\": \"1774.896\",\n         \"isReduceOnly\": false,\n         \"positionIMByMp\": \"\",\n         \"tpslMode\": \"Full\",\n         \"riskId\": 0,\n         \"trailingStop\": \"0\",\n         \"unrealisedPnl\": \"-3.016\",\n         \"markPrice\": \"177188\",\n         \"adlRankIndicator\": 2,\n         \"cumRealisedPnl\": \"-9782.391468\",\n         \"positionMM\": \"\",\n         \"createdTime\": \"1699928551230\",\n         \"positionIdx\": 0,\n         \"positionIM\": \"\",\n         \"positionMMByMp\": \"\",\n         \"seq\": 9558506126,\n         \"updatedTime\": \"1767085496112\",\n         \"side\": \"Buy\",\n         \"bustPrice\": \"\",\n         \"positionBalance\": \"\",\n         \"leverageSysUpdatedTime\": \"\",\n         \"curRealisedPnl\": \"-0.9761928\",\n         \"size\": \"0.01\",\n         \"positionStatus\": \"Normal\",\n         \"mmrSysUpdatedTime\": \"\",\n         \"stopLoss\": \"\",\n         \"tradeMode\": 0,\n         \"sessionAvgPrice\": \"\"\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionsADLRank\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"leverage\": \"\",\n        //         \"autoAddMargin\": 0,\n        //         \"avgPrice\": \"177489.6\",\n        //         \"liqPrice\": \"\",\n        //         \"riskLimitValue\": \"\",\n        //         \"takeProfit\": \"\",\n        //         \"positionValue\": \"1774.896\",\n        //         \"isReduceOnly\": false,\n        //         \"positionIMByMp\": \"\",\n        //         \"tpslMode\": \"Full\",\n        //         \"riskId\": 0,\n        //         \"trailingStop\": \"0\",\n        //         \"unrealisedPnl\": \"-3.016\",\n        //         \"markPrice\": \"177188\",\n        //         \"adlRankIndicator\": 2,\n        //         \"cumRealisedPnl\": \"-9782.391468\",\n        //         \"positionMM\": \"\",\n        //         \"createdTime\": \"1699928551230\",\n        //         \"positionIdx\": 0,\n        //         \"positionIM\": \"\",\n        //         \"positionMMByMp\": \"\",\n        //         \"seq\": 9558506126,\n        //         \"updatedTime\": \"1767085496112\",\n        //         \"side\": \"Buy\",\n        //         \"bustPrice\": \"\",\n        //         \"positionBalance\": \"\",\n        //         \"leverageSysUpdatedTime\": \"\",\n        //         \"curRealisedPnl\": \"-0.9761928\",\n        //         \"size\": \"0.01\",\n        //         \"positionStatus\": \"Normal\",\n        //         \"mmrSysUpdatedTime\": \"\",\n        //         \"stopLoss\": \"\",\n        //         \"tradeMode\": 0,\n        //         \"sessionAvgPrice\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger (info, 'updatedTime');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeInteger (info, 'adlRankIndicator'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 3350,
        "line_end": 3516,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"retCode\": 0,\n         \"retMsg\": \"success\",\n         \"result\": {\n             \"acctBalanceSum\": \"0.122995614474732872\",\n             \"debtBalanceSum\": \"0.011734191124529754\",\n             \"loanAccountList\": [\n                 {\n                     \"free\": \"0.001143855\",\n                     \"interest\": \"0\",\n                     \"loan\": \"0\",\n                     \"locked\": \"0\",\n                     \"tokenId\": \"BTC\",\n                     \"total\": \"0.001143855\"\n                 },\n                 {\n                     \"free\": \"200.00005568\",\n                     \"interest\": \"0.0008391\",\n                     \"loan\": \"200\",\n                     \"locked\": \"0\",\n                     \"tokenId\": \"USDT\",\n                     \"total\": \"200.00005568\"\n                 },\n             ],\n             \"riskRate\": \"0.0954\",\n             \"status\": 1\n         },\n         \"retExtInfo\": {},\n         \"time\": 1669843584123\n     }",
          "{\n         \"retCode\": 0,\n         \"retMsg\": \"success\",\n         \"result\": {\n             \"memberId\": \"533285\",\n             \"accountType\": \"FUND\",\n             \"balance\": [\n                 {\n                     \"coin\": \"USDT\",\n                     \"transferBalance\": \"1010\",\n                     \"walletBalance\": \"1010\",\n                     \"bonus\": \"\"\n                 },\n                 {\n                     \"coin\": \"USDC\",\n                     \"transferBalance\": \"0\",\n                     \"walletBalance\": \"0\",\n                     \"bonus\": \"\"\n                 }\n             ]\n         },\n         \"retExtInfo\": {},\n         \"time\": 1675865290069\n     }",
          "{\n         \"retCode\": 0,\n         \"retMsg\": \"OK\",\n         \"result\": {\n             \"list\": [\n                 {\n                     \"totalEquity\": \"18070.32797922\",\n                     \"accountIMRate\": \"0.0101\",\n                     \"totalMarginBalance\": \"18070.32797922\",\n                     \"totalInitialMargin\": \"182.60183684\",\n                     \"accountType\": \"UNIFIED\",\n                     \"totalAvailableBalance\": \"17887.72614237\",\n                     \"accountMMRate\": \"0\",\n                     \"totalPerpUPL\": \"-0.11001349\",\n                     \"totalWalletBalance\": \"18070.43799271\",\n                     \"accountLTV\": \"0.017\",\n                     \"totalMaintenanceMargin\": \"0.38106773\",\n                     \"coin\": [\n                         {\n                             \"availableToBorrow\": \"2.5\",\n                             \"bonus\": \"0\",\n                             \"accruedInterest\": \"0\",\n                             \"availableToWithdraw\": \"0.805994\",\n                             \"totalOrderIM\": \"0\",\n                             \"equity\": \"0.805994\",\n                             \"totalPositionMM\": \"0\",\n                             \"usdValue\": \"12920.95352538\",\n                             \"unrealisedPnl\": \"0\",\n                             \"borrowAmount\": \"0\",\n                             \"totalPositionIM\": \"0\",\n                             \"walletBalance\": \"0.805994\",\n                             \"cumRealisedPnl\": \"0\",\n                             \"coin\": \"BTC\"\n                         }\n                     ]\n                 }\n             ]\n         },\n         \"retExtInfo\": {},\n         \"time\": 1672125441042\n     }",
          "account['used'] = this.safeString (coinEntry, 'locked');"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // cross\n        //     {\n        //         \"retCode\": 0,\n        //         \"retMsg\": \"success\",\n        //         \"result\": {\n        //             \"acctBalanceSum\": \"0.122995614474732872\",\n        //             \"debtBalanceSum\": \"0.011734191124529754\",\n        //             \"loanAccountList\": [\n        //                 {\n        //                     \"free\": \"0.001143855\",\n        //                     \"interest\": \"0\",\n        //                     \"loan\": \"0\",\n        //                     \"locked\": \"0\",\n        //                     \"tokenId\": \"BTC\",\n        //                     \"total\": \"0.001143855\"\n        //                 },\n        //                 {\n        //                     \"free\": \"200.00005568\",\n        //                     \"interest\": \"0.0008391\",\n        //                     \"loan\": \"200\",\n        //                     \"locked\": \"0\",\n        //                     \"tokenId\": \"USDT\",\n        //                     \"total\": \"200.00005568\"\n        //                 },\n        //             ],\n        //             \"riskRate\": \"0.0954\",\n        //             \"status\": 1\n        //         },\n        //         \"retExtInfo\": {},\n        //         \"time\": 1669843584123\n        //     }\n        //\n        // funding\n        //     {\n        //         \"retCode\": 0,\n        //         \"retMsg\": \"success\",\n        //         \"result\": {\n        //             \"memberId\": \"533285\",\n        //             \"accountType\": \"FUND\",\n        //             \"balance\": [\n        //                 {\n        //                     \"coin\": \"USDT\",\n        //                     \"transferBalance\": \"1010\",\n        //                     \"walletBalance\": \"1010\",\n        //                     \"bonus\": \"\"\n        //                 },\n        //                 {\n        //                     \"coin\": \"USDC\",\n        //                     \"transferBalance\": \"0\",\n        //                     \"walletBalance\": \"0\",\n        //                     \"bonus\": \"\"\n        //                 }\n        //             ]\n        //         },\n        //         \"retExtInfo\": {},\n        //         \"time\": 1675865290069\n        //     }\n        //\n        //  spot & swap\n        //     {\n        //         \"retCode\": 0,\n        //         \"retMsg\": \"OK\",\n        //         \"result\": {\n        //             \"list\": [\n        //                 {\n        //                     \"totalEquity\": \"18070.32797922\",\n        //                     \"accountIMRate\": \"0.0101\",\n        //                     \"totalMarginBalance\": \"18070.32797922\",\n        //                     \"totalInitialMargin\": \"182.60183684\",\n        //                     \"accountType\": \"UNIFIED\",\n        //                     \"totalAvailableBalance\": \"17887.72614237\",\n        //                     \"accountMMRate\": \"0\",\n        //                     \"totalPerpUPL\": \"-0.11001349\",\n        //                     \"totalWalletBalance\": \"18070.43799271\",\n        //                     \"accountLTV\": \"0.017\",\n        //                     \"totalMaintenanceMargin\": \"0.38106773\",\n        //                     \"coin\": [\n        //                         {\n        //                             \"availableToBorrow\": \"2.5\",\n        //                             \"bonus\": \"0\",\n        //                             \"accruedInterest\": \"0\",\n        //                             \"availableToWithdraw\": \"0.805994\",\n        //                             \"totalOrderIM\": \"0\",\n        //                             \"equity\": \"0.805994\",\n        //                             \"totalPositionMM\": \"0\",\n        //                             \"usdValue\": \"12920.95352538\",\n        //                             \"unrealisedPnl\": \"0\",\n        //                             \"borrowAmount\": \"0\",\n        //                             \"totalPositionIM\": \"0\",\n        //                             \"walletBalance\": \"0.805994\",\n        //                             \"cumRealisedPnl\": \"0\",\n        //                             \"coin\": \"BTC\"\n        //                         }\n        //                     ]\n        //                 }\n        //             ]\n        //         },\n        //         \"retExtInfo\": {},\n        //         \"time\": 1672125441042\n        //     }\n        //\n        const timestamp = this.safeInteger (response, 'time');\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const responseResult = this.safeDict (response, 'result', {});\n        const currencyList = this.safeListN (responseResult, [ 'loanAccountList', 'list', 'balance' ]);\n        if (currencyList === undefined) {\n            // usdc wallet\n            const code = 'USDC';\n            const account = this.account ();\n            account['free'] = this.safeString (responseResult, 'availableBalance');\n            account['total'] = this.safeString (responseResult, 'walletBalance');\n            result[code] = account;\n        } else {\n            for (let i = 0; i < currencyList.length; i++) {\n                const entry = currencyList[i];\n                const accountType = this.safeString (entry, 'accountType');\n                if (accountType === 'UNIFIED' || accountType === 'CONTRACT' || accountType === 'SPOT') {\n                    const coins = this.safeList (entry, 'coin');\n                    for (let j = 0; j < coins.length; j++) {\n                        const account = this.account ();\n                        const coinEntry = coins[j];\n                        const loan = this.safeString (coinEntry, 'borrowAmount');\n                        const interest = this.safeString (coinEntry, 'accruedInterest');\n                        if ((loan !== undefined) && (interest !== undefined)) {\n                            account['debt'] = Precise.stringAdd (loan, interest);\n                        }\n                        account['total'] = this.safeString (coinEntry, 'walletBalance');\n                        const free = this.safeString2 (coinEntry, 'availableToWithdraw', 'free');\n                        if (free !== undefined) {\n                            account['free'] = free;\n                        } else {\n                            const locked = this.safeString (coinEntry, 'locked', '0');\n                            const totalPositionIm = this.safeString (coinEntry, 'totalPositionIM', '0');\n                            const totalOrderIm = this.safeString (coinEntry, 'totalOrderIM', '0');\n                            let totalUsed = Precise.stringAdd (locked, totalPositionIm);\n                            totalUsed = Precise.stringAdd (totalUsed, totalOrderIm);\n                            account['used'] = totalUsed;\n                        }\n                        // account['used'] = this.safeString (coinEntry, 'locked');\n                        const currencyId = this.safeString (coinEntry, 'coin');\n                        const code = this.safeCurrencyCode (currencyId);\n                        result[code] = account;\n                    }\n                } else {\n                    const account = this.account ();\n                    const loan = this.safeString (entry, 'loan');\n                    const interest = this.safeString (entry, 'interest');\n                    if ((loan !== undefined) && (interest !== undefined)) {\n                        account['debt'] = Precise.stringAdd (loan, interest);\n                    }\n                    account['total'] = this.safeString2 (entry, 'total', 'walletBalance');\n                    account['free'] = this.safeStringN (entry, [ 'free', 'availableBalanceWithoutConvert', 'availableBalance', 'transferBalance' ]);\n                    account['used'] = this.safeString (entry, 'locked');\n                    const currencyId = this.safeStringN (entry, [ 'tokenId', 'coin', 'currencyCoin' ]);\n                    const code = this.safeCurrencyCode (currencyId);\n                    result[code] = account;\n                }\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 7418,
        "line_end": 7440,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'tokenId'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'loan')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'cross'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tokenId\": \"BTC\",\n         \"total\": \"0.00048621\",\n         \"locked\": \"0\",\n         \"loan\": \"0\",\n         \"interest\": \"0\",\n         \"free\": \"0.00048621\"\n     },"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        //     {\n        //         \"tokenId\": \"BTC\",\n        //         \"total\": \"0.00048621\",\n        //         \"locked\": \"0\",\n        //         \"loan\": \"0\",\n        //         \"interest\": \"0\",\n        //         \"free\": \"0.00048621\"\n        //     },\n        //\n        return {\n            'info': info,\n            'symbol': undefined,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'tokenId')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': undefined,\n            'amountBorrowed': this.safeNumber (info, 'loan'),\n            'marginMode': 'cross',\n            'timestamp': undefined,\n            'datetime': undefined,\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 7287,
        "line_end": 7317,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (info, 'interestRate', hourlyBorrowRate)",
            "comment": null
          },
          {
            "key": "period",
            "value": "period",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"USDT\",\n         \"interestRate\": \"0.000107000000\",\n         \"loanAbleAmount\": \"\",\n         \"maxLoanAmount\": \"79999.999\",\n         \"timestamp\": 1666734490778\n     }",
          "{\n         \"timestamp\": 1721469600000,\n         \"currency\": \"USDC\",\n         \"hourlyBorrowRate\": \"0.000014621596\",\n         \"vipLevel\": \"No VIP\"\n     }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"interestRate\": \"0.000107000000\",\n        //         \"loanAbleAmount\": \"\",\n        //         \"maxLoanAmount\": \"79999.999\",\n        //         \"timestamp\": 1666734490778\n        //     }\n        //\n        // fetchBorrowRateHistory\n        //     {\n        //         \"timestamp\": 1721469600000,\n        //         \"currency\": \"USDC\",\n        //         \"hourlyBorrowRate\": \"0.000014621596\",\n        //         \"vipLevel\": \"No VIP\"\n        //     }\n        //\n        const timestamp = this.safeInteger (info, 'timestamp');\n        const currencyId = this.safeString2 (info, 'coin', 'currency');\n        const hourlyBorrowRate = this.safeNumber (info, 'hourlyBorrowRate');\n        const period = (hourlyBorrowRate !== undefined) ? 3600000 : 86400000; // 1h or 1d\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber (info, 'interestRate', hourlyBorrowRate),\n            'period': period, // Daily\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 9331,
        "line_end": 9390,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (conversion, 'quoteTxId', 'exchangeTxId')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber (conversion, 'fromAmount')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber (conversion, 'toAmount')",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quoteTxId\": \"1010020692439481682687668224\",\n         \"exchangeRate\": \"0.000015330836780000\",\n         \"fromCoin\": \"USDT\",\n         \"fromCoinType\": \"crypto\",\n         \"toCoin\": \"BTC\",\n         \"toCoinType\": \"crypto\",\n         \"fromAmount\": \"10\",\n         \"toAmount\": \"0.000153308367800000\",\n         \"expiredTime\": \"1727257413353\",\n         \"requestId\": \"\"\n     }",
          "{\n         \"exchangeStatus\": \"processing\",\n         \"quoteTxId\": \"1010020692439483803499737088\"\n     }",
          "{\n         \"accountType\": \"eb_convert_uta\",\n         \"exchangeTxId\": \"1010020692439483803499737088\",\n         \"userId\": \"100406395\",\n         \"fromCoin\": \"USDT\",\n         \"fromCoinType\": \"crypto\",\n         \"fromAmount\": \"10\",\n         \"toCoin\": \"BTC\",\n         \"toCoinType\": \"crypto\",\n         \"toAmount\": \"0.00015344889\",\n         \"exchangeStatus\": \"success\",\n         \"extInfo\": {},\n         \"convertRate\": \"0.000015344889\",\n         \"createdAt\": \"1727257904726\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"quoteTxId\": \"1010020692439481682687668224\",\n        //         \"exchangeRate\": \"0.000015330836780000\",\n        //         \"fromCoin\": \"USDT\",\n        //         \"fromCoinType\": \"crypto\",\n        //         \"toCoin\": \"BTC\",\n        //         \"toCoinType\": \"crypto\",\n        //         \"fromAmount\": \"10\",\n        //         \"toAmount\": \"0.000153308367800000\",\n        //         \"expiredTime\": \"1727257413353\",\n        //         \"requestId\": \"\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"exchangeStatus\": \"processing\",\n        //         \"quoteTxId\": \"1010020692439483803499737088\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory\n        //\n        //     {\n        //         \"accountType\": \"eb_convert_uta\",\n        //         \"exchangeTxId\": \"1010020692439483803499737088\",\n        //         \"userId\": \"100406395\",\n        //         \"fromCoin\": \"USDT\",\n        //         \"fromCoinType\": \"crypto\",\n        //         \"fromAmount\": \"10\",\n        //         \"toCoin\": \"BTC\",\n        //         \"toCoinType\": \"crypto\",\n        //         \"toAmount\": \"0.00015344889\",\n        //         \"exchangeStatus\": \"success\",\n        //         \"extInfo\": {},\n        //         \"convertRate\": \"0.000015344889\",\n        //         \"createdAt\": \"1727257904726\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (conversion, 'expiredTime', 'createdAt');\n        const fromCoin = this.safeString (conversion, 'fromCoin');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'toCoin');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString2 (conversion, 'quoteTxId', 'exchangeTxId'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber (conversion, 'fromAmount'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber (conversion, 'toAmount'),\n            'price': undefined,\n            'fee': undefined,\n        } as Conversion;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 5744,
        "line_end": 5764,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (depositAddress, 'chain'), code)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"chainType\": \"ERC20\",\n         \"addressDeposit\": \"0xf56297c6717c1d1c42c30324468ed50a9b7402ee\",\n         \"tagDeposit\": '',\n         \"chain\": \"ETH\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"chainType\": \"ERC20\",\n        //         \"addressDeposit\": \"0xf56297c6717c1d1c42c30324468ed50a9b7402ee\",\n        //         \"tagDeposit\": '',\n        //         \"chain\": \"ETH\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'addressDeposit');\n        const tag = this.safeString (depositAddress, 'tagDeposit');\n        const code = this.safeString (currency, 'code');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': this.networkIdToCode (this.safeString (depositAddress, 'chain'), code),\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined): any",
        "line_start": 7871,
        "line_end": 7923,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': this.safeNumber (chain, 'withdrawFee'), 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"name\": \"BTC\",\n        \"coin\": \"BTC\",\n        \"remainAmount\": \"150\",\n        \"chains\": [\n            {\n                \"chainType\": \"BTC\",\n                \"confirmation\": \"10000\",\n                \"withdrawFee\": \"0.0005\",\n                \"depositMin\": \"0.0005\",\n                \"withdrawMin\": \"0.001\",\n                \"chain\": \"BTC\",\n                \"chainDeposit\": \"1\",\n                \"chainWithdraw\": \"1\",\n                \"minAccuracy\": \"8\"\n            }\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined): any {\n        //\n        //    {\n        //        \"name\": \"BTC\",\n        //        \"coin\": \"BTC\",\n        //        \"remainAmount\": \"150\",\n        //        \"chains\": [\n        //            {\n        //                \"chainType\": \"BTC\",\n        //                \"confirmation\": \"10000\",\n        //                \"withdrawFee\": \"0.0005\",\n        //                \"depositMin\": \"0.0005\",\n        //                \"withdrawMin\": \"0.001\",\n        //                \"chain\": \"BTC\",\n        //                \"chainDeposit\": \"1\",\n        //                \"chainWithdraw\": \"1\",\n        //                \"minAccuracy\": \"8\"\n        //            }\n        //        ]\n        //    }\n        //\n        const chains = this.safeList (fee, 'chains', []);\n        const chainsLength = chains.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        if (chainsLength !== 0) {\n            for (let i = 0; i < chainsLength; i++) {\n                const chain = chains[i];\n                const networkId = this.safeString (chain, 'chain');\n                const currencyCode = this.safeString (currency, 'code');\n                const networkCode = this.networkIdToCode (networkId, currencyCode);\n                result['networks'][networkCode] = {\n                    'deposit': { 'fee': undefined, 'percentage': undefined },\n                    'withdraw': { 'fee': this.safeNumber (chain, 'withdrawFee'), 'percentage': false },\n                };\n                if (chainsLength === 1) {\n                    result['withdraw']['fee'] = this.safeNumber (chain, 'withdrawFee');\n                    result['withdraw']['percentage'] = false;\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (ticker, market: Market = undefined): FundingRate",
        "line_start": 2748,
        "line_end": 2809,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"bidPrice\": \"19255\",\n         \"askPrice\": \"19255.5\",\n         \"lastPrice\": \"19255.50\",\n         \"lastTickDirection\": \"ZeroPlusTick\",\n         \"prevPrice24h\": \"18634.50\",\n         \"price24hPcnt\": \"0.033325\",\n         \"highPrice24h\": \"19675.00\",\n         \"lowPrice24h\": \"18610.00\",\n         \"prevPrice1h\": \"19278.00\",\n         \"markPrice\": \"19255.00\",\n         \"indexPrice\": \"19260.68\",\n         \"openInterest\": \"48069.549\",\n         \"turnover24h\": \"4686694853.047006\",\n         \"volume24h\": \"243730.252\",\n         \"fundingRate\": \"0.0001\",\n         \"nextFundingTime\": \"1663689600000\",\n         \"predictedDeliveryPrice\": \"\",\n         \"basisRate\": \"\",\n         \"deliveryFeeRate\": \"\",\n         \"deliveryTime\": \"0\"\n     }"
        ],
        "source": "parseFundingRate (ticker, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"bidPrice\": \"19255\",\n        //         \"askPrice\": \"19255.5\",\n        //         \"lastPrice\": \"19255.50\",\n        //         \"lastTickDirection\": \"ZeroPlusTick\",\n        //         \"prevPrice24h\": \"18634.50\",\n        //         \"price24hPcnt\": \"0.033325\",\n        //         \"highPrice24h\": \"19675.00\",\n        //         \"lowPrice24h\": \"18610.00\",\n        //         \"prevPrice1h\": \"19278.00\",\n        //         \"markPrice\": \"19255.00\",\n        //         \"indexPrice\": \"19260.68\",\n        //         \"openInterest\": \"48069.549\",\n        //         \"turnover24h\": \"4686694853.047006\",\n        //         \"volume24h\": \"243730.252\",\n        //         \"fundingRate\": \"0.0001\",\n        //         \"nextFundingTime\": \"1663689600000\",\n        //         \"predictedDeliveryPrice\": \"\",\n        //         \"basisRate\": \"\",\n        //         \"deliveryFeeRate\": \"\",\n        //         \"deliveryTime\": \"0\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'timestamp'); // added artificially to avoid changing the signature\n        ticker = this.omit (ticker, 'timestamp');\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'swap');\n        const fundingRate = this.safeNumber (ticker, 'fundingRate');\n        const fundingTimestamp = this.safeInteger (ticker, 'nextFundingTime');\n        const markPrice = this.safeNumber (ticker, 'markPrice');\n        const indexPrice = this.safeNumber (ticker, 'indexPrice');\n        const info = this.safeDict (this.safeMarket (marketId, market, undefined, 'swap'), 'info');\n        const fundingInterval = this.safeInteger (info, 'fundingInterval');\n        let intervalString = undefined;\n        if (fundingInterval !== undefined) {\n            const interval = this.parseToInt (fundingInterval / 60);\n            intervalString = interval.toString () + 'h';\n        }\n        return {\n            'info': ticker,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 8357,
        "line_end": 8410,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "this.safeNumber (greeks, 'bid1Size')",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "this.safeNumber (greeks, 'ask1Size')",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bid1Iv')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'ask1Iv')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markIv')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (greeks, 'bid1Price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (greeks, 'ask1Price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (greeks, 'lastPrice')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (greeks, 'underlyingPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-26JAN24-39000-C\",\n         \"bid1Price\": \"3205\",\n         \"bid1Size\": \"7.1\",\n         \"bid1Iv\": \"0.5478\",\n         \"ask1Price\": \"3315\",\n         \"ask1Size\": \"1.98\",\n         \"ask1Iv\": \"0.5638\",\n         \"lastPrice\": \"3230\",\n         \"highPrice24h\": \"3255\",\n         \"lowPrice24h\": \"3200\",\n         \"markPrice\": \"3273.02263032\",\n         \"indexPrice\": \"36790.96\",\n         \"markIv\": \"0.5577\",\n         \"underlyingPrice\": \"37649.67254894\",\n         \"openInterest\": \"19.67\",\n         \"turnover24h\": \"170140.33875912\",\n         \"volume24h\": \"4.56\",\n         \"totalVolume\": \"22\",\n         \"totalTurnover\": \"789305\",\n         \"delta\": \"0.49640971\",\n         \"gamma\": \"0.00004131\",\n         \"vega\": \"69.08651675\",\n         \"theta\": \"-24.9443226\",\n         \"predictedDeliveryPrice\": \"0\",\n         \"change24h\": \"0.18532111\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"symbol\": \"BTC-26JAN24-39000-C\",\n        //         \"bid1Price\": \"3205\",\n        //         \"bid1Size\": \"7.1\",\n        //         \"bid1Iv\": \"0.5478\",\n        //         \"ask1Price\": \"3315\",\n        //         \"ask1Size\": \"1.98\",\n        //         \"ask1Iv\": \"0.5638\",\n        //         \"lastPrice\": \"3230\",\n        //         \"highPrice24h\": \"3255\",\n        //         \"lowPrice24h\": \"3200\",\n        //         \"markPrice\": \"3273.02263032\",\n        //         \"indexPrice\": \"36790.96\",\n        //         \"markIv\": \"0.5577\",\n        //         \"underlyingPrice\": \"37649.67254894\",\n        //         \"openInterest\": \"19.67\",\n        //         \"turnover24h\": \"170140.33875912\",\n        //         \"volume24h\": \"4.56\",\n        //         \"totalVolume\": \"22\",\n        //         \"totalTurnover\": \"789305\",\n        //         \"delta\": \"0.49640971\",\n        //         \"gamma\": \"0.00004131\",\n        //         \"vega\": \"69.08651675\",\n        //         \"theta\": \"-24.9443226\",\n        //         \"predictedDeliveryPrice\": \"0\",\n        //         \"change24h\": \"0.18532111\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': this.safeNumber (greeks, 'bid1Size'),\n            'askSize': this.safeNumber (greeks, 'ask1Size'),\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bid1Iv'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'ask1Iv'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markIv'),\n            'bidPrice': this.safeNumber (greeks, 'bid1Price'),\n            'askPrice': this.safeNumber (greeks, 'ask1Price'),\n            'markPrice': this.safeNumber (greeks, 'markPrice'),\n            'lastPrice': this.safeNumber (greeks, 'lastPrice'),\n            'underlyingPrice': this.safeNumber (greeks, 'underlyingPrice'),\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined): object",
        "line_start": 8719,
        "line_end": 8771,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-', 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'execId')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'execFee')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber (income, 'feeRate')",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"XMRUSDT\",\n     \"orderType\": \"UNKNOWN\",\n     \"underlyingPrice\": \"\",\n     \"orderLinkId\": \"\",\n     \"orderId\": \"a11e5fe2-1dbf-4bab-a9b2-af80a14efc5d\",\n     \"stopOrderType\": \"UNKNOWN\",\n     \"execTime\": \"1710950400000\",\n     \"feeCurrency\": \"\",\n     \"createType\": \"\",\n     \"feeRate\": \"-0.000761\",\n     \"tradeIv\": \"\",\n     \"blockTradeId\": \"\",\n     \"markPrice\": \"136.79\",\n     \"execPrice\": \"137.11\",\n     \"markIv\": \"\",\n     \"orderQty\": \"0\",\n     \"orderPrice\": \"0\",\n     \"execValue\": \"134.3678\",\n     \"closedSize\": \"0\",\n     \"execType\": \"Funding\",\n     \"seq\": \"28097658790\",\n     \"side\": \"Sell\",\n     \"indexPrice\": \"\",\n     \"leavesQty\": \"0\",\n     \"isMaker\": false,\n     \"execFee\": \"-0.10232512\",\n     \"execId\": \"8d1ef156-4ec6-4445-9a6c-1c0c24dbd046\",\n     \"marketUnit\": \"\",\n     \"execQty\": \"0.98\",\n     \"nextPageCursor\": \"5774437%3A0%2C5771289%3A0\"\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined): object {\n        //\n        // {\n        //     \"symbol\": \"XMRUSDT\",\n        //     \"orderType\": \"UNKNOWN\",\n        //     \"underlyingPrice\": \"\",\n        //     \"orderLinkId\": \"\",\n        //     \"orderId\": \"a11e5fe2-1dbf-4bab-a9b2-af80a14efc5d\",\n        //     \"stopOrderType\": \"UNKNOWN\",\n        //     \"execTime\": \"1710950400000\",\n        //     \"feeCurrency\": \"\",\n        //     \"createType\": \"\",\n        //     \"feeRate\": \"-0.000761\",\n        //     \"tradeIv\": \"\",\n        //     \"blockTradeId\": \"\",\n        //     \"markPrice\": \"136.79\",\n        //     \"execPrice\": \"137.11\",\n        //     \"markIv\": \"\",\n        //     \"orderQty\": \"0\",\n        //     \"orderPrice\": \"0\",\n        //     \"execValue\": \"134.3678\",\n        //     \"closedSize\": \"0\",\n        //     \"execType\": \"Funding\",\n        //     \"seq\": \"28097658790\",\n        //     \"side\": \"Sell\",\n        //     \"indexPrice\": \"\",\n        //     \"leavesQty\": \"0\",\n        //     \"isMaker\": false,\n        //     \"execFee\": \"-0.10232512\",\n        //     \"execId\": \"8d1ef156-4ec6-4445-9a6c-1c0c24dbd046\",\n        //     \"marketUnit\": \"\",\n        //     \"execQty\": \"0.98\",\n        //     \"nextPageCursor\": \"5774437%3A0%2C5771289%3A0\"\n        // }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        let code = 'USDT';\n        if (market['inverse']) {\n            code = market['quote'];\n        }\n        const timestamp = this.safeInteger (income, 'execTime');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, '-', 'swap'),\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'execId'),\n            'amount': this.safeNumber (income, 'execFee'),\n            'rate': this.safeNumber (income, 'feeRate'),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 6268,
        "line_end": 6344,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'wallet_id')",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tx_id')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "before",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.safeNumber (item, 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (item, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 234467,\n         \"user_id\": 1,\n         \"coin\": \"BTC\",\n         \"wallet_id\": 27913,\n         \"type\": \"Realized P&L\",\n         \"amount\": \"-0.00000006\",\n         \"tx_id\": \"\",\n         \"address\": \"BTCUSD\",\n         \"wallet_balance\": \"0.03000330\",\n         \"exec_time\": \"2019-12-09T00:00:25.000Z\",\n         \"cross_seq\": 0\n     }",
          "{\n         \"symbol\": \"XRPUSDT\",\n         \"side\": \"Buy\",\n         \"funding\": \"\",\n         \"orderLinkId\": \"linear-order\",\n         \"orderId\": \"592b7e41-78fd-42e2-9aa3-91e1835ef3e1\",\n         \"fee\": \"0.00260280\",\n         \"change\": \"-0.0026028\",\n         \"cashFlow\": \"0\",\n         \"transactionTime\": \"1672121182224\",\n         \"type\": \"TRADE\",\n         \"feeRate\": \"0.0006\",\n         \"size\": \"12\",\n         \"qty\": \"12\",\n         \"cashBalance\": \"5086.58101322\",\n         \"currency\": \"USDT\",\n         \"category\": \"linear\",\n         \"tradePrice\": \"0.3615\",\n         \"tradeId\": \"8569c10f-5061-5891-81c4-a54929847eb3\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"id\": 234467,\n        //         \"user_id\": 1,\n        //         \"coin\": \"BTC\",\n        //         \"wallet_id\": 27913,\n        //         \"type\": \"Realized P&L\",\n        //         \"amount\": \"-0.00000006\",\n        //         \"tx_id\": \"\",\n        //         \"address\": \"BTCUSD\",\n        //         \"wallet_balance\": \"0.03000330\",\n        //         \"exec_time\": \"2019-12-09T00:00:25.000Z\",\n        //         \"cross_seq\": 0\n        //     }\n        //\n        //     {\n        //         \"symbol\": \"XRPUSDT\",\n        //         \"side\": \"Buy\",\n        //         \"funding\": \"\",\n        //         \"orderLinkId\": \"linear-order\",\n        //         \"orderId\": \"592b7e41-78fd-42e2-9aa3-91e1835ef3e1\",\n        //         \"fee\": \"0.00260280\",\n        //         \"change\": \"-0.0026028\",\n        //         \"cashFlow\": \"0\",\n        //         \"transactionTime\": \"1672121182224\",\n        //         \"type\": \"TRADE\",\n        //         \"feeRate\": \"0.0006\",\n        //         \"size\": \"12\",\n        //         \"qty\": \"12\",\n        //         \"cashBalance\": \"5086.58101322\",\n        //         \"currency\": \"USDT\",\n        //         \"category\": \"linear\",\n        //         \"tradePrice\": \"0.3615\",\n        //         \"tradeId\": \"8569c10f-5061-5891-81c4-a54929847eb3\"\n        //     }\n        //\n        const currencyId = this.safeString2 (item, 'coin', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amountString = this.safeString2 (item, 'amount', 'change');\n        const afterString = this.safeString2 (item, 'wallet_balance', 'cashBalance');\n        const direction = Precise.stringLt (amountString, '0') ? 'out' : 'in';\n        let before = undefined;\n        let after = undefined;\n        let amount = undefined;\n        if (afterString !== undefined && amountString !== undefined) {\n            const difference = (direction === 'out') ? amountString : Precise.stringNeg (amountString);\n            before = this.parseToNumeric (Precise.stringAdd (afterString, difference));\n            after = this.parseToNumeric (afterString);\n            amount = this.parseToNumeric (Precise.stringAbs (amountString));\n        }\n        let timestamp = this.parse8601 (this.safeString (item, 'exec_time'));\n        if (timestamp === undefined) {\n            timestamp = this.safeInteger (item, 'transactionTime');\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'direction': direction,\n            'account': this.safeString (item, 'wallet_id'),\n            'referenceId': this.safeString (item, 'tx_id'),\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': code,\n            'amount': amount,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': before,\n            'after': after,\n            'status': 'ok',\n            'fee': {\n                'currency': code,\n                'cost': this.safeNumber (item, 'fee'),\n            },\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 6346,
        "line_end": 6370,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'Deposit': 'transaction',\n            'Withdraw': 'transaction',\n            'RealisedPNL': 'trade',\n            'Commission': 'fee',\n            'Refund': 'cashback',\n            'Prize': 'prize', // ?\n            'ExchangeOrderWithdraw': 'transaction',\n            'ExchangeOrderDeposit': 'transaction',\n            // v5\n            'TRANSFER_IN': 'transaction',\n            'TRANSFER_OUT': 'transaction',\n            'TRADE': 'trade',\n            'SETTLEMENT': 'trade',\n            'DELIVERY': 'trade',\n            'LIQUIDATION': 'trade',\n            'BONUS': 'Prize',\n            'FEE_REFUND': 'cashback',\n            'INTEREST': 'transaction',\n            'CURRENCY_BUY': 'trade',\n            'CURRENCY_SELL': 'trade',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 6875,
        "line_end": 6885,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'marginMode')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'marginMode'),\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLeverageTiers",
        "signature": "parseLeverageTiers (response, symbols: Strings = undefined, marketIdKey = undefined): LeverageTiers",
        "line_start": 8602,
        "line_end": 8633,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n      {\n          \"id\": 1,\n          \"symbol\": \"BTCUSD\",\n          \"riskLimitValue\": \"150\",\n          \"maintenanceMargin\": \"0.5\",\n          \"initialMargin\": \"1\",\n          \"isLowestRisk\": 1,\n          \"maxLeverage\": \"100.00\"\n      }\n  ]"
        ],
        "source": "parseLeverageTiers (response, symbols: Strings = undefined, marketIdKey = undefined): LeverageTiers {\n        //\n        //  [\n        //      {\n        //          \"id\": 1,\n        //          \"symbol\": \"BTCUSD\",\n        //          \"riskLimitValue\": \"150\",\n        //          \"maintenanceMargin\": \"0.5\",\n        //          \"initialMargin\": \"1\",\n        //          \"isLowestRisk\": 1,\n        //          \"maxLeverage\": \"100.00\"\n        //      }\n        //  ]\n        //\n        const tiers: Dict = {};\n        const marketIds = this.marketIds (symbols);\n        const filteredResults = this.filterByArray (response, marketIdKey, marketIds, false);\n        const grouped = this.groupBy (filteredResults, marketIdKey);\n        const keys = Object.keys (grouped);\n        for (let i = 0; i < keys.length; i++) {\n            const marketId = keys[i];\n            const entry = grouped[marketId];\n            for (let j = 0; j < entry.length; j++) {\n                const id = this.safeInteger (entry[j], 'id');\n                entry[j]['id'] = id;\n            }\n            const market = this.safeMarket (marketId, undefined, undefined, 'contract');\n            const symbol = market['symbol'];\n            tiers[symbol] = this.parseMarketLeverageTiers (this.sortBy (entry, 'id'), market);\n        }\n        return tiers as LeverageTiers;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined): Liquidation",
        "line_start": 8496,
        "line_end": 8543,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contractsString)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSizeString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (priceString)",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.parseNumber (baseValueString)",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (quoteValueString)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHPERP\",\n         \"orderType\": \"Market\",\n         \"underlyingPrice\": \"\",\n         \"orderLinkId\": \"\",\n         \"side\": \"Buy\",\n         \"indexPrice\": \"\",\n         \"orderId\": \"8c065341-7b52-4ca9-ac2c-37e31ac55c94\",\n         \"stopOrderType\": \"UNKNOWN\",\n         \"leavesQty\": \"0\",\n         \"execTime\": \"1672282722429\",\n         \"isMaker\": false,\n         \"execFee\": \"0.071409\",\n         \"feeRate\": \"0.0006\",\n         \"execId\": \"e0cbe81d-0f18-5866-9415-cf319b5dab3b\",\n         \"tradeIv\": \"\",\n         \"blockTradeId\": \"\",\n         \"markPrice\": \"1183.54\",\n         \"execPrice\": \"1190.15\",\n         \"markIv\": \"\",\n         \"orderQty\": \"0.1\",\n         \"orderPrice\": \"1236.9\",\n         \"execValue\": \"119.015\",\n         \"execType\": \"Trade\",\n         \"execQty\": \"0.1\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined): Liquidation {\n        //\n        //     {\n        //         \"symbol\": \"ETHPERP\",\n        //         \"orderType\": \"Market\",\n        //         \"underlyingPrice\": \"\",\n        //         \"orderLinkId\": \"\",\n        //         \"side\": \"Buy\",\n        //         \"indexPrice\": \"\",\n        //         \"orderId\": \"8c065341-7b52-4ca9-ac2c-37e31ac55c94\",\n        //         \"stopOrderType\": \"UNKNOWN\",\n        //         \"leavesQty\": \"0\",\n        //         \"execTime\": \"1672282722429\",\n        //         \"isMaker\": false,\n        //         \"execFee\": \"0.071409\",\n        //         \"feeRate\": \"0.0006\",\n        //         \"execId\": \"e0cbe81d-0f18-5866-9415-cf319b5dab3b\",\n        //         \"tradeIv\": \"\",\n        //         \"blockTradeId\": \"\",\n        //         \"markPrice\": \"1183.54\",\n        //         \"execPrice\": \"1190.15\",\n        //         \"markIv\": \"\",\n        //         \"orderQty\": \"0.1\",\n        //         \"orderPrice\": \"1236.9\",\n        //         \"execValue\": \"119.015\",\n        //         \"execType\": \"Trade\",\n        //         \"execQty\": \"0.1\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'symbol');\n        const timestamp = this.safeInteger (liquidation, 'execTime');\n        const contractsString = this.safeString (liquidation, 'execQty');\n        const contractSizeString = this.safeString (market, 'contractSize');\n        const priceString = this.safeString (liquidation, 'execPrice');\n        const baseValueString = Precise.stringMul (contractsString, contractSizeString);\n        const quoteValueString = Precise.stringMul (baseValueString, priceString);\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'contracts': this.parseNumber (contractsString),\n            'contractSize': this.parseNumber (contractSizeString),\n            'price': this.parseNumber (priceString),\n            'baseValue': this.parseNumber (baseValueString),\n            'quoteValue': this.parseNumber (quoteValueString),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 9447,
        "line_end": 9468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.parseToNumeric (Precise.stringDiv (longString, shortString))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"buyRatio\": \"0.5707\",\n         \"sellRatio\": \"0.4293\",\n         \"timestamp\": \"1729123200000\"\n     }"
        ],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"buyRatio\": \"0.5707\",\n        //         \"sellRatio\": \"0.4293\",\n        //         \"timestamp\": \"1729123200000\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeIntegerOmitZero (info, 'timestamp');\n        const longString = this.safeString (info, 'buyRatio');\n        const shortString = this.safeString (info, 'sellRatio');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.parseToNumeric (Precise.stringDiv (longString, shortString)),\n        } as LongShortRatio;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined): Dict",
        "line_start": 7626,
        "line_end": 7651,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"BTC\",\n         \"amount\": \"0.001\"\n     }",
          "{\n         \"resultStatus\": \"SU\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined): Dict {\n        //\n        // borrowCrossMargin\n        //\n        //     {\n        //         \"coin\": \"BTC\",\n        //         \"amount\": \"0.001\"\n        //     }\n        //\n        // repayCrossMargin\n        //\n        //     {\n        //         \"resultStatus\": \"SU\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'coin');\n        return {\n            'id': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeString (info, 'amount'),\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 9638,
        "line_end": 9645,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.parseMarginModeType (marginType)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marginType = this.safeString (marginMode, 'marginMode');\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (undefined, market),\n            'marginMode': this.parseMarginModeType (marginType),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModeType",
        "signature": "parseMarginModeType (marginMode: Str): Str",
        "line_start": 9647,
        "line_end": 9654,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarginModeType (marginMode: Str): Str {\n        const marginModes: Dict = {\n            'ISOLATED_MARGIN': 'isolated',\n            'REGULAR_MARGIN': 'cross',\n            'PORTFOLIO_MARGIN': 'portfolio',\n        };\n        return this.safeString (marginModes, marginMode, marginMode);\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 8635,
        "line_end": 8670,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (tier, 'id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'riskLimitValue')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintenanceMargin')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'maxLeverage')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "[\n      {\n          \"id\": 1,\n          \"symbol\": \"BTCUSD\",\n          \"riskLimitValue\": \"150\",\n          \"maintenanceMargin\": \"0.5\",\n          \"initialMargin\": \"1\",\n          \"isLowestRisk\": 1,\n          \"maxLeverage\": \"100.00\"\n      }\n  ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //  [\n        //      {\n        //          \"id\": 1,\n        //          \"symbol\": \"BTCUSD\",\n        //          \"riskLimitValue\": \"150\",\n        //          \"maintenanceMargin\": \"0.5\",\n        //          \"initialMargin\": \"1\",\n        //          \"isLowestRisk\": 1,\n        //          \"maxLeverage\": \"100.00\"\n        //      }\n        //  ]\n        //\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const tier = info[i];\n            const marketId = this.safeString (info, 'symbol');\n            market = this.safeMarket (marketId);\n            let minNotional = this.parseNumber ('0');\n            if (i !== 0) {\n                minNotional = this.safeNumber (info[i - 1], 'riskLimitValue');\n            }\n            tiers.push ({\n                'tier': this.safeInteger (tier, 'id'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['settle'],\n                'minNotional': minNotional,\n                'maxNotional': this.safeNumber (tier, 'riskLimitValue'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintenanceMargin'),\n                'maxLeverage': this.safeNumber (tier, 'maxLeverage'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2613,
        "line_end": 2634,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1621162800\",\n         \"49592.43\",\n         \"49644.91\",\n         \"49342.37\",\n         \"49349.42\",\n         \"1451.59\",\n         \"2.4343353100000003\"\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1621162800\",\n        //         \"49592.43\",\n        //         \"49644.91\",\n        //         \"49342.37\",\n        //         \"49349.42\",\n        //         \"1451.59\",\n        //         \"2.4343353100000003\"\n        //     ]\n        //\n        const volumeIndex = (market['inverse']) ? 6 : 5;\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, volumeIndex),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 7229,
        "line_end": 7249,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"openInterest\": 64757.62400000,\n        \"timestamp\": 1665784800000,\n    }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //    {\n        //        \"openInterest\": 64757.62400000,\n        //        \"timestamp\": 1665784800000,\n        //    }\n        //\n        const timestamp = this.safeInteger (interest, 'timestamp');\n        const openInterest = this.safeNumber2 (interest, 'open_interest', 'openInterest');\n        // the openInterest is in the base asset for linear and quote asset for inverse\n        const amount = market['linear'] ? openInterest : undefined;\n        const value = market['inverse'] ? openInterest : undefined;\n        return this.safeOpenInterest ({\n            'symbol': market['symbol'],\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 8898,
        "line_end": 8949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "this.safeNumber (chain, 'markIv')",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "this.safeNumber (chain, 'openInterest')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bid1Price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'ask1Price')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (chain, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'lastPrice')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'underlyingPrice')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (chain, 'change24h')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'totalVolume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-27DEC24-55000-P\",\n         \"bid1Price\": \"0\",\n         \"bid1Size\": \"0\",\n         \"bid1Iv\": \"0\",\n         \"ask1Price\": \"0\",\n         \"ask1Size\": \"0\",\n         \"ask1Iv\": \"0\",\n         \"lastPrice\": \"10980\",\n         \"highPrice24h\": \"0\",\n         \"lowPrice24h\": \"0\",\n         \"markPrice\": \"11814.66756236\",\n         \"indexPrice\": \"63838.92\",\n         \"markIv\": \"0.8866\",\n         \"underlyingPrice\": \"71690.55303594\",\n         \"openInterest\": \"0.01\",\n         \"turnover24h\": \"0\",\n         \"volume24h\": \"0\",\n         \"totalVolume\": \"2\",\n         \"totalTurnover\": \"78719\",\n         \"delta\": \"-0.23284954\",\n         \"gamma\": \"0.0000055\",\n         \"vega\": \"191.70757975\",\n         \"theta\": \"-30.43617927\",\n         \"predictedDeliveryPrice\": \"0\",\n         \"change24h\": \"0\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"symbol\": \"BTC-27DEC24-55000-P\",\n        //         \"bid1Price\": \"0\",\n        //         \"bid1Size\": \"0\",\n        //         \"bid1Iv\": \"0\",\n        //         \"ask1Price\": \"0\",\n        //         \"ask1Size\": \"0\",\n        //         \"ask1Iv\": \"0\",\n        //         \"lastPrice\": \"10980\",\n        //         \"highPrice24h\": \"0\",\n        //         \"lowPrice24h\": \"0\",\n        //         \"markPrice\": \"11814.66756236\",\n        //         \"indexPrice\": \"63838.92\",\n        //         \"markIv\": \"0.8866\",\n        //         \"underlyingPrice\": \"71690.55303594\",\n        //         \"openInterest\": \"0.01\",\n        //         \"turnover24h\": \"0\",\n        //         \"volume24h\": \"0\",\n        //         \"totalVolume\": \"2\",\n        //         \"totalTurnover\": \"78719\",\n        //         \"delta\": \"-0.23284954\",\n        //         \"gamma\": \"0.0000055\",\n        //         \"vega\": \"191.70757975\",\n        //         \"theta\": \"-30.43617927\",\n        //         \"predictedDeliveryPrice\": \"0\",\n        //         \"change24h\": \"0\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'impliedVolatility': this.safeNumber (chain, 'markIv'),\n            'openInterest': this.safeNumber (chain, 'openInterest'),\n            'bidPrice': this.safeNumber (chain, 'bid1Price'),\n            'askPrice': this.safeNumber (chain, 'ask1Price'),\n            'midPrice': undefined,\n            'markPrice': this.safeNumber (chain, 'markPrice'),\n            'lastPrice': this.safeNumber (chain, 'lastPrice'),\n            'underlyingPrice': this.safeNumber (chain, 'underlyingPrice'),\n            'change': this.safeNumber (chain, 'change24h'),\n            'percentage': undefined,\n            'baseVolume': this.safeNumber (chain, 'totalVolume'),\n            'quoteVolume': undefined,\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3724,
        "line_end": 3942,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'orderLinkId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (order, 'symbol'), undefined, undefined, inferredMarketType)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "avgPrice",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCPERP\",\n         \"orderType\": \"Market\",\n         \"orderLinkId\": \"\",\n         \"orderId\": \"36190ad3-de08-4b83-9ad3-56942f684b79\",\n         \"cancelType\": \"UNKNOWN\",\n         \"stopOrderType\": \"UNKNOWN\",\n         \"orderStatus\": \"Filled\",\n         \"updateTimeStamp\": \"1692769133267\",\n         \"takeProfit\": \"0.0000\",\n         \"cumExecValue\": \"259.6830\",\n         \"createdAt\": \"1692769133261\",\n         \"blockTradeId\": \"\",\n         \"orderPnl\": \"\",\n         \"price\": \"24674.7\",\n         \"tpTriggerBy\": \"UNKNOWN\",\n         \"timeInForce\": \"ImmediateOrCancel\",\n         \"updatedAt\": \"1692769133267\",\n         \"basePrice\": \"0.0\",\n         \"realisedPnl\": \"0.0000\",\n         \"side\": \"Sell\",\n         \"triggerPrice\": \"0.0\",\n         \"cumExecFee\": \"0.1429\",\n         \"leavesQty\": \"0.000\",\n         \"cashFlow\": \"\",\n         \"slTriggerBy\": \"UNKNOWN\",\n         \"iv\": \"\",\n         \"closeOnTrigger\": \"UNKNOWN\",\n         \"cumExecQty\": \"0.010\",\n         \"reduceOnly\": 0,\n         \"qty\": \"0.010\",\n         \"stopLoss\": \"0.0000\",\n         \"triggerBy\": \"UNKNOWN\",\n         \"orderIM\": \"\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderType\": \"Market\",\n         \"orderLinkId\": \"\",\n         \"slLimitPrice\": \"0\",\n         \"orderId\": \"f5f2d355-9a11-4af3-9b83-aa1d6ab6ddfe\",\n         \"cancelType\": \"UNKNOWN\",\n         \"avgPrice\": \"122529.9\",\n         \"stopOrderType\": \"\",\n         \"lastPriceOnCreated\": \"123747.9\",\n         \"orderStatus\": \"Filled\",\n         \"createType\": \"CreateByUser\",\n         \"takeProfit\": \"\",\n         \"cumExecValue\": \"122.5299\",\n         \"tpslMode\": \"\",\n         \"smpType\": \"None\",\n         \"triggerDirection\": 0,\n         \"blockTradeId\": \"\",\n         \"cumFeeDetail\": {\n             \"USDT\": \"0.06739145\"\n         },\n         \"rejectReason\": \"EC_NoError\",\n         \"isLeverage\": \"\",\n         \"price\": \"120518\",\n         \"orderIv\": \"\",\n         \"createdTime\": \"1757837618905\",\n         \"tpTriggerBy\": \"\",\n         \"positionIdx\": 0,\n         \"timeInForce\": \"IOC\",\n         \"leavesValue\": \"0\",\n         \"updatedTime\": \"1757837618909\",\n         \"side\": \"Sell\",\n         \"smpGroup\": 0,\n         \"triggerPrice\": \"\",\n         \"tpLimitPrice\": \"0\",\n         \"cumExecFee\": \"0.06739145\",\n         \"slTriggerBy\": \"\",\n         \"leavesQty\": \"0\",\n         \"closeOnTrigger\": false,\n         \"slippageToleranceType\": \"UNKNOWN\",\n         \"placeType\": \"\",\n         \"cumExecQty\": \"0.001\",\n         \"reduceOnly\": true,\n         \"qty\": \"0.001\",\n         \"stopLoss\": \"\",\n         \"smpOrderId\": \"\",\n         \"slippageTolerance\": \"0\",\n         \"triggerBy\": \"\",\n         \"extraFees\": \"\"\n     }",
          "{\n        \"category\": \"linear\",\n        \"symbol\": \"LTCUSDT\",\n        \"orderId\": '',\n        \"orderLinkId\": '',\n        \"createAt\": '',\n        \"code\": \"10001\",\n        \"msg\": \"The number of contracts exceeds maximum limit allowed: too large\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // v1 for usdc normal account\n        //     {\n        //         \"symbol\": \"BTCPERP\",\n        //         \"orderType\": \"Market\",\n        //         \"orderLinkId\": \"\",\n        //         \"orderId\": \"36190ad3-de08-4b83-9ad3-56942f684b79\",\n        //         \"cancelType\": \"UNKNOWN\",\n        //         \"stopOrderType\": \"UNKNOWN\",\n        //         \"orderStatus\": \"Filled\",\n        //         \"updateTimeStamp\": \"1692769133267\",\n        //         \"takeProfit\": \"0.0000\",\n        //         \"cumExecValue\": \"259.6830\",\n        //         \"createdAt\": \"1692769133261\",\n        //         \"blockTradeId\": \"\",\n        //         \"orderPnl\": \"\",\n        //         \"price\": \"24674.7\",\n        //         \"tpTriggerBy\": \"UNKNOWN\",\n        //         \"timeInForce\": \"ImmediateOrCancel\",\n        //         \"updatedAt\": \"1692769133267\",\n        //         \"basePrice\": \"0.0\",\n        //         \"realisedPnl\": \"0.0000\",\n        //         \"side\": \"Sell\",\n        //         \"triggerPrice\": \"0.0\",\n        //         \"cumExecFee\": \"0.1429\",\n        //         \"leavesQty\": \"0.000\",\n        //         \"cashFlow\": \"\",\n        //         \"slTriggerBy\": \"UNKNOWN\",\n        //         \"iv\": \"\",\n        //         \"closeOnTrigger\": \"UNKNOWN\",\n        //         \"cumExecQty\": \"0.010\",\n        //         \"reduceOnly\": 0,\n        //         \"qty\": \"0.010\",\n        //         \"stopLoss\": \"0.0000\",\n        //         \"triggerBy\": \"UNKNOWN\",\n        //         \"orderIM\": \"\"\n        //     }\n        //\n        // v5\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderType\": \"Market\",\n        //         \"orderLinkId\": \"\",\n        //         \"slLimitPrice\": \"0\",\n        //         \"orderId\": \"f5f2d355-9a11-4af3-9b83-aa1d6ab6ddfe\",\n        //         \"cancelType\": \"UNKNOWN\",\n        //         \"avgPrice\": \"122529.9\",\n        //         \"stopOrderType\": \"\",\n        //         \"lastPriceOnCreated\": \"123747.9\",\n        //         \"orderStatus\": \"Filled\",\n        //         \"createType\": \"CreateByUser\",\n        //         \"takeProfit\": \"\",\n        //         \"cumExecValue\": \"122.5299\",\n        //         \"tpslMode\": \"\",\n        //         \"smpType\": \"None\",\n        //         \"triggerDirection\": 0,\n        //         \"blockTradeId\": \"\",\n        //         \"cumFeeDetail\": {\n        //             \"USDT\": \"0.06739145\"\n        //         },\n        //         \"rejectReason\": \"EC_NoError\",\n        //         \"isLeverage\": \"\",\n        //         \"price\": \"120518\",\n        //         \"orderIv\": \"\",\n        //         \"createdTime\": \"1757837618905\",\n        //         \"tpTriggerBy\": \"\",\n        //         \"positionIdx\": 0,\n        //         \"timeInForce\": \"IOC\",\n        //         \"leavesValue\": \"0\",\n        //         \"updatedTime\": \"1757837618909\",\n        //         \"side\": \"Sell\",\n        //         \"smpGroup\": 0,\n        //         \"triggerPrice\": \"\",\n        //         \"tpLimitPrice\": \"0\",\n        //         \"cumExecFee\": \"0.06739145\",\n        //         \"slTriggerBy\": \"\",\n        //         \"leavesQty\": \"0\",\n        //         \"closeOnTrigger\": false,\n        //         \"slippageToleranceType\": \"UNKNOWN\",\n        //         \"placeType\": \"\",\n        //         \"cumExecQty\": \"0.001\",\n        //         \"reduceOnly\": true,\n        //         \"qty\": \"0.001\",\n        //         \"stopLoss\": \"\",\n        //         \"smpOrderId\": \"\",\n        //         \"slippageTolerance\": \"0\",\n        //         \"triggerBy\": \"\",\n        //         \"extraFees\": \"\"\n        //     }\n        //\n        // createOrders failed order\n        //    {\n        //        \"category\": \"linear\",\n        //        \"symbol\": \"LTCUSDT\",\n        //        \"orderId\": '',\n        //        \"orderLinkId\": '',\n        //        \"createAt\": '',\n        //        \"code\": \"10001\",\n        //        \"msg\": \"The number of contracts exceeds maximum limit allowed: too large\"\n        //    }\n        //\n        const code = this.safeString (order, 'code');\n        if (code !== undefined) {\n            if (code !== '0') {\n                const category = this.safeString (order, 'category');\n                const inferredMarketType = (category === 'spot') ? 'spot' : 'contract';\n                return this.safeOrder ({\n                    'info': order,\n                    'status': 'rejected',\n                    'id': this.safeString (order, 'orderId'),\n                    'clientOrderId': this.safeString (order, 'orderLinkId'),\n                    'symbol': this.safeSymbol (this.safeString (order, 'symbol'), undefined, undefined, inferredMarketType),\n                });\n            }\n        }\n        const marketId = this.safeString (order, 'symbol');\n        const isContract = ('tpslMode' in order);\n        let marketType = undefined;\n        if (market !== undefined) {\n            marketType = market['type'];\n        } else {\n            marketType = isContract ? 'contract' : 'spot';\n        }\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger2 (order, 'createdTime', 'createdAt');\n        const marketUnit = this.safeString (order, 'marketUnit', 'baseCoin');\n        const id = this.safeString (order, 'orderId');\n        const type = this.safeStringLower (order, 'orderType');\n        const price = this.safeString (order, 'price');\n        let amount: Str = undefined;\n        let cost: Str = undefined;\n        if (marketUnit === 'baseCoin') {\n            amount = this.safeString (order, 'qty');\n            cost = this.safeString (order, 'cumExecValue');\n        } else {\n            cost = this.safeString (order, 'cumExecValue');\n        }\n        const filled = this.safeString (order, 'cumExecQty');\n        const remaining = this.safeString (order, 'leavesQty');\n        const lastTradeTimestamp = this.safeInteger2 (order, 'updatedTime', 'updatedAt');\n        const rawStatus = this.safeString (order, 'orderStatus');\n        const status = this.parseOrderStatus (rawStatus);\n        const side = this.safeStringLower (order, 'side');\n        let fee = undefined;\n        const cumFeeDetail = this.safeDict (order, 'cumFeeDetail', {});\n        const feeCoins = Object.keys (cumFeeDetail);\n        const feeCoinId = this.safeString (feeCoins, 0);\n        if (feeCoinId !== undefined) {\n            fee = {\n                'cost': this.safeNumber (cumFeeDetail, feeCoinId),\n                'currency': feeCoinId,\n            };\n        }\n        let clientOrderId = this.safeString (order, 'orderLinkId');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined;\n        }\n        const avgPrice = this.omitZero (this.safeString (order, 'avgPrice'));\n        const rawTimeInForce = this.safeString (order, 'timeInForce');\n        const timeInForce = this.parseTimeInForce (rawTimeInForce);\n        const triggerPrice = this.omitZero (this.safeString (order, 'triggerPrice'));\n        const reduceOnly = this.safeBool (order, 'reduceOnly');\n        let takeProfitPrice = this.omitZero (this.safeString (order, 'takeProfit'));\n        let stopLossPrice = this.omitZero (this.safeString (order, 'stopLoss'));\n        const triggerDirection = this.safeString (order, 'triggerDirection');\n        const isAscending = (triggerDirection === '1');\n        const isStopOrderType2 = (triggerPrice !== undefined) && reduceOnly;\n        if ((stopLossPrice === undefined) && isStopOrderType2) {\n            // check if order is stop order type 2 - stopLossPrice\n            if (isAscending && (side === 'buy')) {\n                // stopLoss order against short position\n                stopLossPrice = triggerPrice;\n            }\n            if (!isAscending && (side === 'sell')) {\n                // stopLoss order against a long position\n                stopLossPrice = triggerPrice;\n            }\n        }\n        if ((takeProfitPrice === undefined) && isStopOrderType2) {\n            // check if order is stop order type 2 - takeProfitPrice\n            if (isAscending && (side === 'sell')) {\n                // takeprofit order against a long position\n                takeProfitPrice = triggerPrice;\n            }\n            if (!isAscending && (side === 'buy')) {\n                // takeprofit order against a short position\n                takeProfitPrice = triggerPrice;\n            }\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': undefined,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': avgPrice,\n            'filled': filled,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3685,
        "line_end": 3712,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            // v3 spot\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'PENDING_CANCEL': 'open',\n            'PENDING_NEW': 'open',\n            'REJECTED': 'rejected',\n            'PARTIALLY_FILLED_CANCELLED': 'closed', // context: https://github.com/ccxt/ccxt/issues/18685\n            // v3 contract / unified margin / unified account\n            'Created': 'open',\n            'New': 'open',\n            'Rejected': 'rejected', // order is triggered but failed upon being placed\n            'PartiallyFilled': 'open',\n            'PartiallyFilledCanceled': 'closed', // context: https://github.com/ccxt/ccxt/issues/18685\n            'Filled': 'closed',\n            'PendingCancel': 'open',\n            'Cancelled': 'canceled',\n            // below this line the status only pertains to conditional orders\n            'Untriggered': 'open',\n            'Deactivated': 'canceled',\n            'Triggered': 'open',\n            'Active': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined): Position",
        "line_start": 6613,
        "line_end": 6857,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (Precise.stringDiv (initialMarginString, notional))",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMarginString)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceMarginPercentage)",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPrice)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber2 (position, 'curRealisedPnl', 'closedPnl')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.parseNumber (marginRatio)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.parseNumber (liquidationPrice)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPrice)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (position, 'avgExitPrice')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateralString)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeNumber2 (position, 'stop_loss', 'stopLoss')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeNumber2 (position, 'take_profit', 'takeProfit')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"positionIdx\": 0,\n         \"riskId\": \"11\",\n         \"symbol\": \"ETHUSDT\",\n         \"side\": \"Buy\",\n         \"size\": \"0.10\",\n         \"positionValue\": \"119.845\",\n         \"entryPrice\": \"1198.45\",\n         \"tradeMode\": 1,\n         \"autoAddMargin\": 0,\n         \"leverage\": \"4.2\",\n         \"positionBalance\": \"28.58931118\",\n         \"liqPrice\": \"919.10\",\n         \"bustPrice\": \"913.15\",\n         \"takeProfit\": \"0.00\",\n         \"stopLoss\": \"0.00\",\n         \"trailingStop\": \"0.00\",\n         \"unrealisedPnl\": \"0.083\",\n         \"createdTime\": \"1669097244192\",\n         \"updatedTime\": \"1669413126190\",\n         \"tpSlMode\": \"Full\",\n         \"riskLimitValue\": \"900000\",\n         \"activePrice\": \"0.00\"\n     }",
          "{\n       \"symbol\":\"BTCPERP\",\n       \"leverage\":\"1.00\",\n       \"occClosingFee\":\"0.0000\",\n       \"liqPrice\":\"\",\n       \"positionValue\":\"30.8100\",\n       \"takeProfit\":\"0.0\",\n       \"riskId\":\"10001\",\n       \"trailingStop\":\"0.0000\",\n       \"unrealisedPnl\":\"0.0000\",\n       \"createdAt\":\"1652451795305\",\n       \"markPrice\":\"30809.41\",\n       \"cumRealisedPnl\":\"0.0000\",\n       \"positionMM\":\"0.1541\",\n       \"positionIM\":\"30.8100\",\n       \"updatedAt\":\"1652451795305\",\n       \"tpSLMode\":\"UNKNOWN\",\n       \"side\":\"Buy\",\n       \"bustPrice\":\"\",\n       \"deleverageIndicator\":\"0\",\n       \"entryPrice\":\"30810.0\",\n       \"size\":\"0.001\",\n       \"sessionRPL\":\"0.0000\",\n       \"positionStatus\":\"NORMAL\",\n       \"sessionUPL\":\"-0.0006\",\n       \"stopLoss\":\"0.0\",\n       \"orderMargin\":\"0.0000\",\n       \"sessionAvgPrice\":\"30810.0\"\n    }",
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"leverage\": \"10\",\n         \"updatedTime\": 1657711949945,\n         \"side\": \"Buy\",\n         \"positionValue\": \"536.92500000\",\n         \"takeProfit\": \"\",\n         \"tpslMode\": \"Full\",\n         \"riskId\": 11,\n         \"trailingStop\": \"\",\n         \"entryPrice\": \"1073.85000000\",\n         \"unrealisedPnl\": \"\",\n         \"markPrice\": \"1080.65000000\",\n         \"size\": \"0.5000\",\n         \"positionStatus\": \"normal\",\n         \"stopLoss\": \"\",\n         \"cumRealisedPnl\": \"-0.32215500\",\n         \"positionMM\": \"2.97456450\",\n         \"createdTime\": 1657711949928,\n         \"positionIdx\": 0,\n         \"positionIM\": \"53.98243950\"\n     }",
          "{\n         \"symbol\": \"XRPUSDT\",\n         \"leverage\": \"10\",\n         \"avgPrice\": \"0.3615\",\n         \"liqPrice\": \"0.0001\",\n         \"riskLimitValue\": \"200000\",\n         \"takeProfit\": \"\",\n         \"positionValue\": \"36.15\",\n         \"tpslMode\": \"Full\",\n         \"riskId\": 41,\n         \"trailingStop\": \"0\",\n         \"unrealisedPnl\": \"-1.83\",\n         \"markPrice\": \"0.3432\",\n         \"cumRealisedPnl\": \"0.48805876\",\n         \"positionMM\": \"0.381021\",\n         \"createdTime\": \"1672121182216\",\n         \"positionIdx\": 0,\n         \"positionIM\": \"3.634521\",\n         \"updatedTime\": \"1672279322668\",\n         \"side\": \"Buy\",\n         \"bustPrice\": \"\",\n         \"size\": \"100\",\n         \"positionStatus\": \"Normal\",\n         \"stopLoss\": \"\",\n         \"tradeMode\": 0\n     }",
          "{\n        symbol: 'XRPUSDT',\n        orderType: 'Market',\n        leverage: '10',\n        updatedTime: '1712717265572',\n        side: 'Sell',\n        orderId: '071749f3-a9fa-427b-b5ca-27b2f52b81de',\n        closedPnl: '-0.00049568',\n        avgEntryPrice: '0.6045',\n        qty: '3',\n        cumEntryValue: '1.8135',\n        createdTime: '1712717265566',\n        orderPrice: '0.5744',\n        closedSize: '3',\n        avgExitPrice: '0.605',\n        execType: 'Trade',\n        fillCount: '1',\n        cumExitValue: '1.815'\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined): Position {\n        //\n        // linear swap\n        //\n        //     {\n        //         \"positionIdx\": 0,\n        //         \"riskId\": \"11\",\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"side\": \"Buy\",\n        //         \"size\": \"0.10\",\n        //         \"positionValue\": \"119.845\",\n        //         \"entryPrice\": \"1198.45\",\n        //         \"tradeMode\": 1,\n        //         \"autoAddMargin\": 0,\n        //         \"leverage\": \"4.2\",\n        //         \"positionBalance\": \"28.58931118\",\n        //         \"liqPrice\": \"919.10\",\n        //         \"bustPrice\": \"913.15\",\n        //         \"takeProfit\": \"0.00\",\n        //         \"stopLoss\": \"0.00\",\n        //         \"trailingStop\": \"0.00\",\n        //         \"unrealisedPnl\": \"0.083\",\n        //         \"createdTime\": \"1669097244192\",\n        //         \"updatedTime\": \"1669413126190\",\n        //         \"tpSlMode\": \"Full\",\n        //         \"riskLimitValue\": \"900000\",\n        //         \"activePrice\": \"0.00\"\n        //     }\n        //\n        // usdc\n        //    {\n        //       \"symbol\":\"BTCPERP\",\n        //       \"leverage\":\"1.00\",\n        //       \"occClosingFee\":\"0.0000\",\n        //       \"liqPrice\":\"\",\n        //       \"positionValue\":\"30.8100\",\n        //       \"takeProfit\":\"0.0\",\n        //       \"riskId\":\"10001\",\n        //       \"trailingStop\":\"0.0000\",\n        //       \"unrealisedPnl\":\"0.0000\",\n        //       \"createdAt\":\"1652451795305\",\n        //       \"markPrice\":\"30809.41\",\n        //       \"cumRealisedPnl\":\"0.0000\",\n        //       \"positionMM\":\"0.1541\",\n        //       \"positionIM\":\"30.8100\",\n        //       \"updatedAt\":\"1652451795305\",\n        //       \"tpSLMode\":\"UNKNOWN\",\n        //       \"side\":\"Buy\",\n        //       \"bustPrice\":\"\",\n        //       \"deleverageIndicator\":\"0\",\n        //       \"entryPrice\":\"30810.0\",\n        //       \"size\":\"0.001\",\n        //       \"sessionRPL\":\"0.0000\",\n        //       \"positionStatus\":\"NORMAL\",\n        //       \"sessionUPL\":\"-0.0006\",\n        //       \"stopLoss\":\"0.0\",\n        //       \"orderMargin\":\"0.0000\",\n        //       \"sessionAvgPrice\":\"30810.0\"\n        //    }\n        //\n        // unified margin\n        //\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"leverage\": \"10\",\n        //         \"updatedTime\": 1657711949945,\n        //         \"side\": \"Buy\",\n        //         \"positionValue\": \"536.92500000\",\n        //         \"takeProfit\": \"\",\n        //         \"tpslMode\": \"Full\",\n        //         \"riskId\": 11,\n        //         \"trailingStop\": \"\",\n        //         \"entryPrice\": \"1073.85000000\",\n        //         \"unrealisedPnl\": \"\",\n        //         \"markPrice\": \"1080.65000000\",\n        //         \"size\": \"0.5000\",\n        //         \"positionStatus\": \"normal\",\n        //         \"stopLoss\": \"\",\n        //         \"cumRealisedPnl\": \"-0.32215500\",\n        //         \"positionMM\": \"2.97456450\",\n        //         \"createdTime\": 1657711949928,\n        //         \"positionIdx\": 0,\n        //         \"positionIM\": \"53.98243950\"\n        //     }\n        //\n        // unified account\n        //\n        //     {\n        //         \"symbol\": \"XRPUSDT\",\n        //         \"leverage\": \"10\",\n        //         \"avgPrice\": \"0.3615\",\n        //         \"liqPrice\": \"0.0001\",\n        //         \"riskLimitValue\": \"200000\",\n        //         \"takeProfit\": \"\",\n        //         \"positionValue\": \"36.15\",\n        //         \"tpslMode\": \"Full\",\n        //         \"riskId\": 41,\n        //         \"trailingStop\": \"0\",\n        //         \"unrealisedPnl\": \"-1.83\",\n        //         \"markPrice\": \"0.3432\",\n        //         \"cumRealisedPnl\": \"0.48805876\",\n        //         \"positionMM\": \"0.381021\",\n        //         \"createdTime\": \"1672121182216\",\n        //         \"positionIdx\": 0,\n        //         \"positionIM\": \"3.634521\",\n        //         \"updatedTime\": \"1672279322668\",\n        //         \"side\": \"Buy\",\n        //         \"bustPrice\": \"\",\n        //         \"size\": \"100\",\n        //         \"positionStatus\": \"Normal\",\n        //         \"stopLoss\": \"\",\n        //         \"tradeMode\": 0\n        //     }\n        //\n        // fetchPositionsHistory\n        //\n        //    {\n        //        symbol: 'XRPUSDT',\n        //        orderType: 'Market',\n        //        leverage: '10',\n        //        updatedTime: '1712717265572',\n        //        side: 'Sell',\n        //        orderId: '071749f3-a9fa-427b-b5ca-27b2f52b81de',\n        //        closedPnl: '-0.00049568',\n        //        avgEntryPrice: '0.6045',\n        //        qty: '3',\n        //        cumEntryValue: '1.8135',\n        //        createdTime: '1712717265566',\n        //        orderPrice: '0.5744',\n        //        closedSize: '3',\n        //        avgExitPrice: '0.605',\n        //        execType: 'Trade',\n        //        fillCount: '1',\n        //        cumExitValue: '1.815'\n        //    }\n        //\n        const closedSize = this.safeString (position, 'closedSize');\n        const isHistory = (closedSize !== undefined);\n        const contract = this.safeString (position, 'symbol');\n        market = this.safeMarket (contract, market, undefined, 'contract');\n        const size = Precise.stringAbs (this.safeString2 (position, 'size', 'qty'));\n        let side = this.safeString (position, 'side');\n        const positionIdx = this.safeString (position, 'positionIdx');\n        let hedged = undefined;\n        if (positionIdx !== undefined) {\n            hedged = (positionIdx !== '0');\n        }\n        if ((hedged !== undefined) && hedged) {\n            side = (positionIdx === '1') ? 'long' : 'short';\n        } else if (side !== undefined) {\n            if (side === 'Buy') {\n                side = isHistory ? 'short' : 'long';\n            } else if (side === 'Sell') {\n                side = isHistory ? 'long' : 'short';\n            } else {\n                side = undefined;\n            }\n        }\n        let notional = undefined;\n        const contractSize = this.safeString (market, 'contractSize');\n        const markPrice = this.safeString (position, 'markPrice');\n        if (market['inverse']) {\n            notional = Precise.stringDiv (Precise.stringMul (size, contractSize), markPrice);\n        } else {\n            notional = this.safeString2 (position, 'positionValue', 'cumExitValue');\n        }\n        const unrealisedPnl = this.omitZero (this.safeString (position, 'unrealisedPnl'));\n        let initialMarginString = this.safeString2 (position, 'positionIM', 'cumEntryValue');\n        let maintenanceMarginString = this.safeString (position, 'positionMM');\n        const timestamp = this.safeIntegerN (position, [ 'createdTime', 'createdAt' ]);\n        let lastUpdateTimestamp = this.parse8601 (this.safeString (position, 'updated_at'));\n        if (lastUpdateTimestamp === undefined) {\n            lastUpdateTimestamp = this.safeIntegerN (position, [ 'updatedTime', 'updatedAt', 'updatedTime' ]);\n        }\n        let collateralString = this.safeString (position, 'positionBalance');\n        const entryPrice = this.omitZero (this.safeStringN (position, [ 'entryPrice', 'avgPrice', 'avgEntryPrice' ]));\n        const liquidationPrice = this.omitZero (this.safeString (position, 'liqPrice'));\n        const leverage = this.safeString (position, 'leverage');\n        if (liquidationPrice !== undefined) {\n            if (market['settle'] === 'USDC') {\n                //  (Entry price - Liq price) * Contracts + Maintenance Margin + (unrealised pnl) = Collateral\n                const price = this.safeBool (this.options, 'useMarkPriceForPositionCollateral', false) ? markPrice : entryPrice;\n                const difference = Precise.stringAbs (Precise.stringSub (price, liquidationPrice));\n                collateralString = Precise.stringAdd (Precise.stringAdd (Precise.stringMul (difference, size), maintenanceMarginString), unrealisedPnl);\n            } else {\n                const bustPrice = this.safeString (position, 'bustPrice');\n                if (market['linear']) {\n                    // derived from the following formulas\n                    //  (Entry price - Bust price) * Contracts = Collateral\n                    //  (Entry price - Liq price) * Contracts = Collateral - Maintenance Margin\n                    // Maintenance Margin = (Bust price - Liq price) x Contracts\n                    const maintenanceMarginPriceDifference = Precise.stringAbs (Precise.stringSub (liquidationPrice, bustPrice));\n                    maintenanceMarginString = Precise.stringMul (maintenanceMarginPriceDifference, size);\n                    // Initial Margin = Contracts x Entry Price / Leverage\n                    if ((entryPrice !== undefined) && (initialMarginString === undefined)) {\n                        initialMarginString = Precise.stringDiv (Precise.stringMul (size, entryPrice), leverage);\n                    }\n                } else {\n                    // Contracts * (1 / Entry price - 1 / Bust price) = Collateral\n                    // Contracts * (1 / Entry price - 1 / Liq price) = Collateral - Maintenance Margin\n                    // Maintenance Margin = Contracts * (1 / Liq price - 1 / Bust price)\n                    // Maintenance Margin = Contracts * (Bust price - Liq price) / (Liq price x Bust price)\n                    const difference = Precise.stringAbs (Precise.stringSub (bustPrice, liquidationPrice));\n                    const multiply = Precise.stringMul (bustPrice, liquidationPrice);\n                    maintenanceMarginString = Precise.stringDiv (Precise.stringMul (size, difference), multiply);\n                    // Initial Margin = Leverage x Contracts / EntryPrice\n                    if ((entryPrice !== undefined) && (initialMarginString === undefined)) {\n                        initialMarginString = Precise.stringDiv (size, Precise.stringMul (entryPrice, leverage));\n                    }\n                }\n            }\n        }\n        const maintenanceMarginPercentage = Precise.stringDiv (maintenanceMarginString, notional);\n        const marginRatio = Precise.stringDiv (maintenanceMarginString, collateralString, 4);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (Precise.stringDiv (initialMarginString, notional)),\n            'maintenanceMargin': this.parseNumber (maintenanceMarginString),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceMarginPercentage),\n            'entryPrice': this.parseNumber (entryPrice),\n            'notional': this.parseNumber (notional),\n            'leverage': this.parseNumber (leverage),\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'realizedPnl': this.safeNumber2 (position, 'curRealisedPnl', 'closedPnl'),\n            'contracts': this.parseNumber (size), // in USD for inverse swaps\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'marginRatio': this.parseNumber (marginRatio),\n            'liquidationPrice': this.parseNumber (liquidationPrice),\n            'markPrice': this.parseNumber (markPrice),\n            'lastPrice': this.safeNumber (position, 'avgExitPrice'),\n            'collateral': this.parseNumber (collateralString),\n            'marginMode': undefined, // tradeMode was deprecated\n            'side': side,\n            'percentage': undefined,\n            'stopLossPrice': this.safeNumber2 (position, 'stop_loss', 'stopLoss'),\n            'takeProfitPrice': this.safeNumber2 (position, 'take_profit', 'takeProfit'),\n            'hedged': hedged,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 8092,
        "line_end": 8124,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'deliveryPrice')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"SOL-27JUN23-20-C\",\n         \"deliveryPrice\": \"16.62258889\",\n         \"deliveryTime\": \"1687852800000\"\n     }",
          "{\n         \"symbol\": \"SOL-27JUN23-20-C\",\n         \"deliveryPrice\": \"16.62258889\",\n         \"deliveryTime\": \"1687852800000\",\n         \"side\": \"Buy\",\n         \"strike\": \"20\",\n         \"fee\": \"0.00000000\",\n         \"position\": \"0.01\",\n         \"deliveryRpl\": \"3.5\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"symbol\": \"SOL-27JUN23-20-C\",\n        //         \"deliveryPrice\": \"16.62258889\",\n        //         \"deliveryTime\": \"1687852800000\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"symbol\": \"SOL-27JUN23-20-C\",\n        //         \"deliveryPrice\": \"16.62258889\",\n        //         \"deliveryTime\": \"1687852800000\",\n        //         \"side\": \"Buy\",\n        //         \"strike\": \"20\",\n        //         \"fee\": \"0.00000000\",\n        //         \"position\": \"0.01\",\n        //         \"deliveryRpl\": \"3.5\"\n        //     }\n        //\n        const timestamp = this.safeInteger (settlement, 'deliveryTime');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'deliveryPrice'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 8126,
        "line_end": 8158,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"symbol\": \"SOL-27JUN23-20-C\",\n             \"deliveryPrice\": \"16.62258889\",\n             \"deliveryTime\": \"1687852800000\"\n         }\n     ]",
          "[\n         {\n             \"symbol\": \"SOL-27JUN23-20-C\",\n             \"deliveryPrice\": \"16.62258889\",\n             \"deliveryTime\": \"1687852800000\",\n             \"side\": \"Buy\",\n             \"strike\": \"20\",\n             \"fee\": \"0.00000000\",\n             \"position\": \"0.01\",\n             \"deliveryRpl\": \"3.5\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"SOL-27JUN23-20-C\",\n        //             \"deliveryPrice\": \"16.62258889\",\n        //             \"deliveryTime\": \"1687852800000\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"SOL-27JUN23-20-C\",\n        //             \"deliveryPrice\": \"16.62258889\",\n        //             \"deliveryTime\": \"1687852800000\",\n        //             \"side\": \"Buy\",\n        //             \"strike\": \"20\",\n        //             \"fee\": \"0.00000000\",\n        //             \"position\": \"0.01\",\n        //             \"deliveryRpl\": \"3.5\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2302,
        "line_end": 2420,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString2 (ticker, 'bidSize', 'bid1Size')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString2 (ticker, 'askSize', 'ask1Size')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"bid1Price\": \"20517.96\",\n         \"bid1Size\": \"2\",\n         \"ask1Price\": \"20527.77\",\n         \"ask1Size\": \"1.862172\",\n         \"lastPrice\": \"20533.13\",\n         \"prevPrice24h\": \"20393.48\",\n         \"price24hPcnt\": \"0.0068\",\n         \"highPrice24h\": \"21128.12\",\n         \"lowPrice24h\": \"20318.89\",\n         \"turnover24h\": \"243765620.65899866\",\n         \"volume24h\": \"11801.27771\",\n         \"usdIndexPrice\": \"20784.12009279\"\n     }",
          "{\n         \"symbol\": \"BTCUSD\",\n         \"lastPrice\": \"16597.00\",\n         \"indexPrice\": \"16598.54\",\n         \"markPrice\": \"16596.00\",\n         \"prevPrice24h\": \"16464.50\",\n         \"price24hPcnt\": \"0.008047\",\n         \"highPrice24h\": \"30912.50\",\n         \"lowPrice24h\": \"15700.00\",\n         \"prevPrice1h\": \"16595.50\",\n         \"openInterest\": \"373504107\",\n         \"openInterestValue\": \"22505.67\",\n         \"turnover24h\": \"2352.94950046\",\n         \"volume24h\": \"49337318\",\n         \"fundingRate\": \"-0.001034\",\n         \"nextFundingTime\": \"1672387200000\",\n         \"predictedDeliveryPrice\": \"\",\n         \"basisRate\": \"\",\n         \"deliveryFeeRate\": \"\",\n         \"deliveryTime\": \"0\",\n         \"ask1Size\": \"1\",\n         \"bid1Price\": \"16596.00\",\n         \"ask1Price\": \"16597.50\",\n         \"bid1Size\": \"1\"\n     }",
          "{\n         \"symbol\": \"BTC-30DEC22-18000-C\",\n         \"bid1Price\": \"0\",\n         \"bid1Size\": \"0\",\n         \"bid1Iv\": \"0\",\n         \"ask1Price\": \"435\",\n         \"ask1Size\": \"0.66\",\n         \"ask1Iv\": \"5\",\n         \"lastPrice\": \"435\",\n         \"highPrice24h\": \"435\",\n         \"lowPrice24h\": \"165\",\n         \"markPrice\": \"0.00000009\",\n         \"indexPrice\": \"16600.55\",\n         \"markIv\": \"0.7567\",\n         \"underlyingPrice\": \"16590.42\",\n         \"openInterest\": \"6.3\",\n         \"turnover24h\": \"2482.73\",\n         \"volume24h\": \"0.15\",\n         \"totalVolume\": \"99\",\n         \"totalTurnover\": \"1967653\",\n         \"delta\": \"0.00000001\",\n         \"gamma\": \"0.00000001\",\n         \"vega\": \"0.00000004\",\n         \"theta\": \"-0.00000152\",\n         \"predictedDeliveryPrice\": \"0\",\n         \"change24h\": \"86\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"bid1Price\": \"20517.96\",\n        //         \"bid1Size\": \"2\",\n        //         \"ask1Price\": \"20527.77\",\n        //         \"ask1Size\": \"1.862172\",\n        //         \"lastPrice\": \"20533.13\",\n        //         \"prevPrice24h\": \"20393.48\",\n        //         \"price24hPcnt\": \"0.0068\",\n        //         \"highPrice24h\": \"21128.12\",\n        //         \"lowPrice24h\": \"20318.89\",\n        //         \"turnover24h\": \"243765620.65899866\",\n        //         \"volume24h\": \"11801.27771\",\n        //         \"usdIndexPrice\": \"20784.12009279\"\n        //     }\n        //\n        // linear/inverse\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD\",\n        //         \"lastPrice\": \"16597.00\",\n        //         \"indexPrice\": \"16598.54\",\n        //         \"markPrice\": \"16596.00\",\n        //         \"prevPrice24h\": \"16464.50\",\n        //         \"price24hPcnt\": \"0.008047\",\n        //         \"highPrice24h\": \"30912.50\",\n        //         \"lowPrice24h\": \"15700.00\",\n        //         \"prevPrice1h\": \"16595.50\",\n        //         \"openInterest\": \"373504107\",\n        //         \"openInterestValue\": \"22505.67\",\n        //         \"turnover24h\": \"2352.94950046\",\n        //         \"volume24h\": \"49337318\",\n        //         \"fundingRate\": \"-0.001034\",\n        //         \"nextFundingTime\": \"1672387200000\",\n        //         \"predictedDeliveryPrice\": \"\",\n        //         \"basisRate\": \"\",\n        //         \"deliveryFeeRate\": \"\",\n        //         \"deliveryTime\": \"0\",\n        //         \"ask1Size\": \"1\",\n        //         \"bid1Price\": \"16596.00\",\n        //         \"ask1Price\": \"16597.50\",\n        //         \"bid1Size\": \"1\"\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"symbol\": \"BTC-30DEC22-18000-C\",\n        //         \"bid1Price\": \"0\",\n        //         \"bid1Size\": \"0\",\n        //         \"bid1Iv\": \"0\",\n        //         \"ask1Price\": \"435\",\n        //         \"ask1Size\": \"0.66\",\n        //         \"ask1Iv\": \"5\",\n        //         \"lastPrice\": \"435\",\n        //         \"highPrice24h\": \"435\",\n        //         \"lowPrice24h\": \"165\",\n        //         \"markPrice\": \"0.00000009\",\n        //         \"indexPrice\": \"16600.55\",\n        //         \"markIv\": \"0.7567\",\n        //         \"underlyingPrice\": \"16590.42\",\n        //         \"openInterest\": \"6.3\",\n        //         \"turnover24h\": \"2482.73\",\n        //         \"volume24h\": \"0.15\",\n        //         \"totalVolume\": \"99\",\n        //         \"totalTurnover\": \"1967653\",\n        //         \"delta\": \"0.00000001\",\n        //         \"gamma\": \"0.00000001\",\n        //         \"vega\": \"0.00000004\",\n        //         \"theta\": \"-0.00000152\",\n        //         \"predictedDeliveryPrice\": \"0\",\n        //         \"change24h\": \"86\"\n        //     }\n        //\n        const isSpot = this.safeString (ticker, 'openInterestValue') === undefined;\n        const timestamp = this.safeInteger (ticker, 'time');\n        const marketId = this.safeString (ticker, 'symbol');\n        const type = isSpot ? 'spot' : 'contract';\n        market = this.safeMarket (marketId, market, undefined, type);\n        const symbol = this.safeSymbol (marketId, market, undefined, type);\n        const last = this.safeString (ticker, 'lastPrice');\n        const open = this.safeString (ticker, 'prevPrice24h');\n        let percentage = this.safeString (ticker, 'price24hPcnt');\n        percentage = Precise.stringMul (percentage, '100');\n        const quoteVolume = this.safeString (ticker, 'turnover24h');\n        const baseVolume = this.safeString (ticker, 'volume24h');\n        const bid = this.safeString (ticker, 'bid1Price');\n        const ask = this.safeString (ticker, 'ask1Price');\n        const high = this.safeString (ticker, 'highPrice24h');\n        const low = this.safeString (ticker, 'lowPrice24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': this.safeString2 (ticker, 'bidSize', 'bid1Size'),\n            'ask': ask,\n            'askVolume': this.safeString2 (ticker, 'askSize', 'ask1Size'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 3714,
        "line_end": 3722,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GoodTillCancel': 'GTC',\n            'ImmediateOrCancel': 'IOC',\n            'FillOrKill': 'FOK',\n            'PostOnly': 'PO',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2985,
        "line_end": 3220,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"execId\": \"666042b4-50c6-58f3-bd9c-89b2088663ff\",\n         \"symbol\": \"ETHUSD\",\n         \"price\": \"1162.95\",\n         \"size\": \"1\",\n         \"side\": \"Sell\",\n         \"time\": \"1669191277315\",\n         \"isBlockTrade\": false\n     }",
          "{\n         \"symbol\": \"QNTUSDT\",\n         \"orderId\": \"1538686353240339712\",\n         \"orderLinkId\": \"\",\n         \"side\": \"Sell\",\n         \"orderPrice\": \"\",\n         \"orderQty\": \"\",\n         \"leavesQty\": \"\",\n         \"orderType\": \"Limit\",\n         \"stopOrderType\": \"\",\n         \"execFee\": \"0.040919\",\n         \"execId\": \"2210000000097330907\",\n         \"execPrice\": \"98.6\",\n         \"execQty\": \"0.415\",\n         \"execType\": \"\",\n         \"execValue\": \"\",\n         \"execTime\": \"1698161716634\",\n         \"isMaker\": true,\n         \"feeRate\": \"\",\n         \"tradeIv\": \"\",\n         \"markIv\": \"\",\n         \"markPrice\": \"\",\n         \"indexPrice\": \"\",\n         \"underlyingPrice\": \"\",\n         \"blockTradeId\": \"\"\n     }",
          "{\n         \"symbol\": \"QNTUSDT\",\n         \"orderType\": \"Limit\",\n         \"underlyingPrice\": \"\",\n         \"orderLinkId\": \"1549452573428424449\",\n         \"orderId\": \"1549452573428424448\",\n         \"stopOrderType\": \"\",\n         \"execTime\": \"1699445151998\",\n         \"feeRate\": \"0.00025\",\n         \"tradeIv\": \"\",\n         \"blockTradeId\": \"\",\n         \"markPrice\": \"\",\n         \"execPrice\": \"102.8\",\n         \"markIv\": \"\",\n         \"orderQty\": \"3.652\",\n         \"orderPrice\": \"102.8\",\n         \"execValue\": \"1.028\",\n         \"closedSize\": \"\",\n         \"execType\": \"Trade\",\n         \"seq\": \"19157444346\",\n         \"side\": \"Buy\",\n         \"indexPrice\": \"\",\n         \"leavesQty\": \"3.642\",\n         \"isMaker\": true,\n         \"execFee\": \"0.0000025\",\n         \"execId\": \"2210000000101610464\",\n         \"execQty\": \"0.01\",\n         \"nextPageCursor\": \"267951%3A0%2C38567%3A0\"\n     },",
          "{\n         \"symbol\": \"ETHPERP\",\n         \"orderLinkId\": \"\",\n         \"side\": \"Buy\",\n         \"orderId\": \"aad0ee44-ce12-4112-aeee-b7829f6c3a26\",\n         \"execFee\": \"0.0210\",\n         \"feeRate\": \"0.000600\",\n         \"blockTradeId\": \"\",\n         \"tradeTime\": \"1669196417930\",\n         \"execPrice\": \"1162.15\",\n         \"lastLiquidityInd\": \"TAKER\",\n         \"execValue\": \"34.8645\",\n         \"execType\": \"Trade\",\n         \"execQty\": \"0.030\",\n         \"tradeId\": \"0e94eaf5-b08e-5505-b43f-7f1f30b1ca80\"\n     }",
          "{\n         \"category\": \"linear\",\n         \"symbol\": \"ICPUSDT\",\n         \"execId\": \"3510f361-0add-5c7b-a2e7-9679810944fc\",\n         \"execPrice\": \"12.015\",\n         \"execQty\": \"3000\",\n         \"orderId\": \"443d63fa-b4c3-4297-b7b1-23bca88b04dc\",\n         \"isMaker\": false,\n         \"orderLinkId\": \"test-00001\",\n         \"side\": \"Sell\",\n         \"execTime\": \"1716800399334\",\n         \"seq\": 34771365464\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public https://bybit-exchange.github.io/docs/v5/market/recent-trade\n        //\n        //     {\n        //         \"execId\": \"666042b4-50c6-58f3-bd9c-89b2088663ff\",\n        //         \"symbol\": \"ETHUSD\",\n        //         \"price\": \"1162.95\",\n        //         \"size\": \"1\",\n        //         \"side\": \"Sell\",\n        //         \"time\": \"1669191277315\",\n        //         \"isBlockTrade\": false\n        //     }\n        //\n        // private trades classic spot https://bybit-exchange.github.io/docs/v5/position/execution\n        //\n        //     {\n        //         \"symbol\": \"QNTUSDT\",\n        //         \"orderId\": \"1538686353240339712\",\n        //         \"orderLinkId\": \"\",\n        //         \"side\": \"Sell\",\n        //         \"orderPrice\": \"\",\n        //         \"orderQty\": \"\",\n        //         \"leavesQty\": \"\",\n        //         \"orderType\": \"Limit\",\n        //         \"stopOrderType\": \"\",\n        //         \"execFee\": \"0.040919\",\n        //         \"execId\": \"2210000000097330907\",\n        //         \"execPrice\": \"98.6\",\n        //         \"execQty\": \"0.415\",\n        //         \"execType\": \"\",\n        //         \"execValue\": \"\",\n        //         \"execTime\": \"1698161716634\",\n        //         \"isMaker\": true,\n        //         \"feeRate\": \"\",\n        //         \"tradeIv\": \"\",\n        //         \"markIv\": \"\",\n        //         \"markPrice\": \"\",\n        //         \"indexPrice\": \"\",\n        //         \"underlyingPrice\": \"\",\n        //         \"blockTradeId\": \"\"\n        //     }\n        //\n        // private trades unified https://bybit-exchange.github.io/docs/v5/position/execution\n        //\n        //     {\n        //         \"symbol\": \"QNTUSDT\",\n        //         \"orderType\": \"Limit\",\n        //         \"underlyingPrice\": \"\",\n        //         \"orderLinkId\": \"1549452573428424449\",\n        //         \"orderId\": \"1549452573428424448\",\n        //         \"stopOrderType\": \"\",\n        //         \"execTime\": \"1699445151998\",\n        //         \"feeRate\": \"0.00025\",\n        //         \"tradeIv\": \"\",\n        //         \"blockTradeId\": \"\",\n        //         \"markPrice\": \"\",\n        //         \"execPrice\": \"102.8\",\n        //         \"markIv\": \"\",\n        //         \"orderQty\": \"3.652\",\n        //         \"orderPrice\": \"102.8\",\n        //         \"execValue\": \"1.028\",\n        //         \"closedSize\": \"\",\n        //         \"execType\": \"Trade\",\n        //         \"seq\": \"19157444346\",\n        //         \"side\": \"Buy\",\n        //         \"indexPrice\": \"\",\n        //         \"leavesQty\": \"3.642\",\n        //         \"isMaker\": true,\n        //         \"execFee\": \"0.0000025\",\n        //         \"execId\": \"2210000000101610464\",\n        //         \"execQty\": \"0.01\",\n        //         \"nextPageCursor\": \"267951%3A0%2C38567%3A0\"\n        //     },\n        //\n        // private USDC settled trades\n        //\n        //     {\n        //         \"symbol\": \"ETHPERP\",\n        //         \"orderLinkId\": \"\",\n        //         \"side\": \"Buy\",\n        //         \"orderId\": \"aad0ee44-ce12-4112-aeee-b7829f6c3a26\",\n        //         \"execFee\": \"0.0210\",\n        //         \"feeRate\": \"0.000600\",\n        //         \"blockTradeId\": \"\",\n        //         \"tradeTime\": \"1669196417930\",\n        //         \"execPrice\": \"1162.15\",\n        //         \"lastLiquidityInd\": \"TAKER\",\n        //         \"execValue\": \"34.8645\",\n        //         \"execType\": \"Trade\",\n        //         \"execQty\": \"0.030\",\n        //         \"tradeId\": \"0e94eaf5-b08e-5505-b43f-7f1f30b1ca80\"\n        //     }\n        //\n        // watchMyTrades execution.fast\n        //\n        //     {\n        //         \"category\": \"linear\",\n        //         \"symbol\": \"ICPUSDT\",\n        //         \"execId\": \"3510f361-0add-5c7b-a2e7-9679810944fc\",\n        //         \"execPrice\": \"12.015\",\n        //         \"execQty\": \"3000\",\n        //         \"orderId\": \"443d63fa-b4c3-4297-b7b1-23bca88b04dc\",\n        //         \"isMaker\": false,\n        //         \"orderLinkId\": \"test-00001\",\n        //         \"side\": \"Sell\",\n        //         \"execTime\": \"1716800399334\",\n        //         \"seq\": 34771365464\n        //     }\n        //\n        // watchMyTrades execution\n        //\n        //     {\n        //         \"category\": \"linear\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"closedSize\": \"0\",\n        //         \"execFee\": \"0.0679239\",\n        //         \"execId\": \"135dbae5-cbed-5275-9290-3956bb2ed907\",\n        //         \"execPrice\": \"123498\",\n        //         \"execQty\": \"0.001\",\n        //         \"execType\": \"Trade\",\n        //         \"execValue\": \"123.498\",\n        //         \"feeRate\": \"0.00055\",\n        //         \"tradeIv\": \"\",\n        //         \"markIv\": \"\",\n        //         \"blockTradeId\": \"\",\n        //         \"markPrice\": \"122392\",\n        //         \"indexPrice\": \"\",\n        //         \"underlyingPrice\": \"\",\n        //         \"leavesQty\": \"0\",\n        //         \"orderId\": \"aee7453a-a100-465f-857a-3db780e9329a\",\n        //         \"orderLinkId\": \"\",\n        //         \"orderPrice\": \"123615.9\",\n        //         \"orderQty\": \"0.001\",\n        //         \"orderType\": \"Market\",\n        //         \"stopOrderType\": \"UNKNOWN\",\n        //         \"side\": \"Buy\",\n        //         \"execTime\": \"1757837580469\",\n        //         \"isLeverage\": \"0\",\n        //         \"isMaker\": false,\n        //         \"seq\": 9517074055,\n        //         \"marketUnit\": \"\",\n        //         \"execPnl\": \"0\",\n        //         \"createType\": \"CreateByUser\",\n        //         \"extraFees\": [],\n        //         \"feeCoin\": \"USDT\"\n        //  }\n        //\n        const id = this.safeStringN (trade, [ 'execId', 'id', 'tradeId' ]);\n        const marketId = this.safeString (trade, 'symbol');\n        let marketType = ('createType' in trade) ? 'contract' : 'spot';\n        const category = this.safeString (trade, 'category');\n        if (category !== undefined) {\n            marketType = (category === 'spot') ? 'spot' : 'contract';\n        }\n        if (market !== undefined) {\n            marketType = market['type'];\n        }\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = market['symbol'];\n        const amountString = this.safeStringN (trade, [ 'execQty', 'orderQty', 'size' ]);\n        const priceString = this.safeStringN (trade, [ 'execPrice', 'orderPrice', 'price' ]);\n        const costString = this.safeString (trade, 'execValue');\n        const timestamp = this.safeIntegerN (trade, [ 'time', 'execTime', 'tradeTime' ]);\n        let side = this.safeStringLower (trade, 'side');\n        if (side === undefined) {\n            const isBuyer = this.safeInteger (trade, 'isBuyer');\n            if (isBuyer !== undefined) {\n                side = isBuyer ? 'buy' : 'sell';\n            }\n        }\n        const isMaker = this.safeBool (trade, 'isMaker');\n        let takerOrMaker = undefined;\n        if (isMaker !== undefined) {\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        } else {\n            let lastLiquidityInd = this.safeString (trade, 'lastLiquidityInd');\n            if (lastLiquidityInd === 'UNKNOWN') {\n                lastLiquidityInd = undefined;\n            }\n            if (lastLiquidityInd !== undefined) {\n                if ((lastLiquidityInd === 'TAKER') || (lastLiquidityInd === 'MAKER')) {\n                    takerOrMaker = lastLiquidityInd.toLowerCase ();\n                } else {\n                    takerOrMaker = (lastLiquidityInd === 'AddedLiquidity') ? 'maker' : 'taker';\n                }\n            }\n        }\n        let orderType = this.safeStringLower (trade, 'orderType');\n        if (orderType === 'unknown') {\n            orderType = undefined;\n        }\n        const feeCostString = this.safeString (trade, 'execFee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeRateString = this.safeString (trade, 'feeRate');\n            let feeCurrencyCode = undefined;\n            if (market['spot']) {\n                if (Precise.stringGt (feeCostString, '0')) {\n                    if (side === 'buy') {\n                        feeCurrencyCode = market['base'];\n                    } else {\n                        feeCurrencyCode = market['quote'];\n                    }\n                } else {\n                    if (side === 'buy') {\n                        feeCurrencyCode = market['quote'];\n                    } else {\n                        feeCurrencyCode = market['base'];\n                    }\n                }\n            } else {\n                feeCurrencyCode = market['inverse'] ? market['base'] : market['settle'];\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': this.safeString (trade, 'feeCoin', feeCurrencyCode),\n                'rate': feeRateString,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': this.safeString (trade, 'orderId'),\n            'type': orderType,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 7763,
        "line_end": 7782,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'makerFeeRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'takerFeeRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"makerFeeRate\": 0.001,\n         \"takerFeeRate\": 0.001\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"makerFeeRate\": 0.001,\n        //         \"takerFeeRate\": 0.001\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const defaultType = (market !== undefined) ? market['type'] : 'contract';\n        const symbol = this.safeSymbol (marketId, market, undefined, defaultType);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'makerFeeRate'),\n            'taker': this.safeNumber (fee, 'takerFeeRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 6008,
        "line_end": 6086,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'withdrawId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txID')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'chain'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "toAddress",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'tag')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"USDT\",\n         \"chain\": \"TRX\",\n         \"amount\": \"12.34\",\n         \"txID\": \"de5ea0a2f2e59dc9a714837dd3ddc6d5e151b56ec5d786d351c4f52336f80d3c\",\n         \"status\": \"success\",\n         \"toAddress\": \"TQdmFKUoe1Lk2iwZuwRJEHJreTUBoN3BAw\",\n         \"tag\": \"\",\n         \"withdrawFee\": \"0.5\",\n         \"createTime\": \"1665144183000\",\n         \"updateTime\": \"1665144256000\",\n         \"withdrawId\": \"8839035\"\n     }",
          "{\n         \"coin\": \"USDT\",\n         \"chain\": \"TRX\",\n         \"amount\": \"44\",\n         \"txID\": \"0b038ea12fa1575e2d66693db3c346b700d4b28347afc39f80321cf089acc960\",\n         \"status\": \"3\",\n         \"toAddress\": \"TC6NCAC5WSVCCiaD3kWZXyW91ZKKhLm53b\",\n         \"tag\": \"\",\n         \"depositFee\": \"\",\n         \"successAt\": \"1665142507000\",\n         \"confirmations\": \"100\",\n         \"txIndex\": \"0\",\n         \"blockHash\": \"0000000002ac3b1064aee94bca1bd0b58c4c09c65813b084b87a2063d961129e\"\n     }",
          "{\n         \"id\": \"9377266\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"chain\": \"TRX\",\n        //         \"amount\": \"12.34\",\n        //         \"txID\": \"de5ea0a2f2e59dc9a714837dd3ddc6d5e151b56ec5d786d351c4f52336f80d3c\",\n        //         \"status\": \"success\",\n        //         \"toAddress\": \"TQdmFKUoe1Lk2iwZuwRJEHJreTUBoN3BAw\",\n        //         \"tag\": \"\",\n        //         \"withdrawFee\": \"0.5\",\n        //         \"createTime\": \"1665144183000\",\n        //         \"updateTime\": \"1665144256000\",\n        //         \"withdrawId\": \"8839035\"\n        //     }\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"chain\": \"TRX\",\n        //         \"amount\": \"44\",\n        //         \"txID\": \"0b038ea12fa1575e2d66693db3c346b700d4b28347afc39f80321cf089acc960\",\n        //         \"status\": \"3\",\n        //         \"toAddress\": \"TC6NCAC5WSVCCiaD3kWZXyW91ZKKhLm53b\",\n        //         \"tag\": \"\",\n        //         \"depositFee\": \"\",\n        //         \"successAt\": \"1665142507000\",\n        //         \"confirmations\": \"100\",\n        //         \"txIndex\": \"0\",\n        //         \"blockHash\": \"0000000002ac3b1064aee94bca1bd0b58c4c09c65813b084b87a2063d961129e\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": \"9377266\"\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger2 (transaction, 'createTime', 'successAt');\n        const updated = this.safeInteger (transaction, 'updateTime');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const feeCost = this.safeNumber2 (transaction, 'depositFee', 'withdrawFee');\n        const type = ('depositFee' in transaction) ? 'deposit' : 'withdrawal';\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        const toAddress = this.safeString (transaction, 'toAddress');\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'withdrawId'),\n            'txid': this.safeString (transaction, 'txID'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (this.safeString (transaction, 'chain')),\n            'address': undefined,\n            'addressTo': toAddress,\n            'addressFrom': undefined,\n            'tag': this.safeString (transaction, 'tag'),\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'fee': fee,\n            'internal': undefined,\n            'comment': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 5988,
        "line_end": 6006,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // v3 deposit status\n            '0': 'unknown',\n            '1': 'pending',\n            '2': 'processing',\n            '3': 'ok',\n            '4': 'fail',\n            // v3 withdrawal status\n            'SecurityCheck': 'pending',\n            'Pending': 'pending',\n            'success': 'ok',\n            'CancelByUser': 'canceled',\n            'Reject': 'rejected',\n            'Fail': 'failed',\n            'BlockchainConfirmed': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 7662,
        "line_end": 7700,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'transferId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'status'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transferId\": \"22c2bc11-ed5b-49a4-8647-c4e0f5f6f2b2\"\n     }",
          "{\n         \"transferId\": \"e9c421c4-b010-4b16-abd6-106179f27702\",\n         \"coin\": \"USDT\",\n         \"amount\": \"8\",\n         \"fromAccountType\": \"FUND\",\n         \"toAccountType\": \"SPOT\",\n         \"timestamp\": \"1666879426000\",\n         \"status\": \"SUCCESS\"\n      }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"transferId\": \"22c2bc11-ed5b-49a4-8647-c4e0f5f6f2b2\"\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"transferId\": \"e9c421c4-b010-4b16-abd6-106179f27702\",\n        //         \"coin\": \"USDT\",\n        //         \"amount\": \"8\",\n        //         \"fromAccountType\": \"FUND\",\n        //         \"toAccountType\": \"SPOT\",\n        //         \"timestamp\": \"1666879426000\",\n        //         \"status\": \"SUCCESS\"\n        //      }\n        //\n        const currencyId = this.safeString (transfer, 'coin');\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        const fromAccountId = this.safeString (transfer, 'fromAccountType');\n        const toAccountId = this.safeString (transfer, 'toAccountType');\n        const accountIds = this.safeDict (this.options, 'accountsById', {});\n        const fromAccount = this.safeString (accountIds, fromAccountId, fromAccountId);\n        const toAccount = this.safeString (accountIds, toAccountId, toAccountId);\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'transferId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': this.parseTransferStatus (this.safeString (transfer, 'status')),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 7653,
        "line_end": 7660,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            '0': 'ok',\n            'OK': 'ok',\n            'SUCCESS': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseVolatilityHistory",
        "signature": "parseVolatilityHistory (volatility)",
        "line_start": 8196,
        "line_end": 8216,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "volatility",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "volatility",
            "value": "this.safeNumber (entry, 'value')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"period\": 7,\n         \"value\": \"0.23854072\",\n         \"time\": \"1690574400000\"\n     }"
        ],
        "source": "parseVolatilityHistory (volatility) {\n        //\n        //     {\n        //         \"period\": 7,\n        //         \"value\": \"0.23854072\",\n        //         \"time\": \"1690574400000\"\n        //     }\n        //\n        const result = [];\n        for (let i = 0; i < volatility.length; i++) {\n            const entry = volatility[i];\n            const timestamp = this.safeInteger (entry, 'time');\n            result.push ({\n                'info': volatility,\n                'timestamp': timestamp,\n                'datetime': this.iso8601 (timestamp),\n                'volatility': this.safeNumber (entry, 'value'),\n            });\n        }\n        return result;\n    }"
      }
    ],
    "bydfi": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2525,
        "line_end": 2542,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const timestamp = this.milliseconds ();\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const symbol = this.safeString (balance, 'asset');\n            const code = this.safeCurrencyCode (symbol);\n            const account = this.account ();\n            account['total'] = this.safeString2 (balance, 'total', 'balance');\n            account['free'] = this.safeString2 (balance, 'available', 'availableBalance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1040,
        "line_end": 1073,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'lastFundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USDT\",\n         \"lastFundingRate\": \"0.0001\",\n         \"nextFundingTime\": \"1766188800000\",\n         \"time\": \"1766170665007\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"lastFundingRate\": \"0.0001\",\n        //         \"nextFundingTime\": \"1766188800000\",\n        //         \"time\": \"1766170665007\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.safeInteger (contract, 'time');\n        const nextFundingTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 'lastFundingRate'),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 1127,
        "line_end": 1145,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH-USDT\",\n         \"fundingRate\": \"0.00000025\",\n         \"fundingTime\": \"1765584000000\",\n         \"markPrice\": \"3083.2\"\n     }"
        ],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"ETH-USDT\",\n        //         \"fundingRate\": \"0.00000025\",\n        //         \"fundingTime\": \"1765584000000\",\n        //         \"markPrice\": \"3083.2\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 1965,
        "line_end": 1974,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "this.safeInteger (leverage, 'leverage')",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "this.safeInteger (leverage, 'leverage')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': undefined,\n            'longLeverage': this.safeInteger (leverage, 'leverage'),\n            'shortLeverage': this.safeInteger (leverage, 'leverage'),\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market: Market = undefined): MarginMode",
        "line_start": 2307,
        "line_end": 2314,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (marginMode, 'marginType')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market: Market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (marginMode, 'marginType'),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 449,
        "line_end": 557,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "status === 'NORMAL'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "!inverse",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (amountPrecision),\n                'price': this.parseNumber (pricePrecision),\n                'base': this.parseNumber (basePrecision),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': maxLeverage,\n                },\n                'amount': {\n                    'min': this.parseNumber (minAmountString),\n                    'max': this.parseNumber (maxAmountString),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.parse8601 (this.safeString (market, 'createdAt'))",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"CLANKER-USDT\",\n         \"baseAsset\": \"CLANKER\",\n         \"marginAsset\": \"USDT\",\n         \"quoteAsset\": \"USDT\",\n         \"contractFactor\": \"0.01\",\n         \"limitMaxQty\": \"50000\",\n         \"limitMinQty\": \"1\",\n         \"marketMaxQty\": \"10000\",\n         \"marketMinQty\": \"1\",\n         \"pricePrecision\": \"8\",\n         \"basePrecision\": \"8\",\n         \"feeRateTaker\": \"0.0006\",\n         \"feeRateMaker\": \"0.0002\",\n         \"liqFeeRate\": \"0.0006\",\n         \"openBuyLimitRateMax\": \"0.05\",\n         \"openSellLimitRateMax\": \"100\",\n         \"openBuyLimitRateMin\": \"0.98\",\n         \"openSellLimitRateMin\": \"0.05\",\n         \"priceOrderPrecision\": \"2\",\n         \"baseShowPrecision\": \"2\",\n         \"maxLeverageLevel\": \"20\",\n         \"volumePrecision\": \"2\",\n         \"maxLimitOrderNum\": \"200\",\n         \"maxPlanOrderNum\": \"10\",\n         \"reverse\": false,\n         \"onboardTime\": \"1763373600000\",\n         \"status\": \"NORMAL\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"symbol\": \"CLANKER-USDT\",\n        //         \"baseAsset\": \"CLANKER\",\n        //         \"marginAsset\": \"USDT\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"contractFactor\": \"0.01\",\n        //         \"limitMaxQty\": \"50000\",\n        //         \"limitMinQty\": \"1\",\n        //         \"marketMaxQty\": \"10000\",\n        //         \"marketMinQty\": \"1\",\n        //         \"pricePrecision\": \"8\",\n        //         \"basePrecision\": \"8\",\n        //         \"feeRateTaker\": \"0.0006\",\n        //         \"feeRateMaker\": \"0.0002\",\n        //         \"liqFeeRate\": \"0.0006\",\n        //         \"openBuyLimitRateMax\": \"0.05\",\n        //         \"openSellLimitRateMax\": \"100\",\n        //         \"openBuyLimitRateMin\": \"0.98\",\n        //         \"openSellLimitRateMin\": \"0.05\",\n        //         \"priceOrderPrecision\": \"2\",\n        //         \"baseShowPrecision\": \"2\",\n        //         \"maxLeverageLevel\": \"20\",\n        //         \"volumePrecision\": \"2\",\n        //         \"maxLimitOrderNum\": \"200\",\n        //         \"maxPlanOrderNum\": \"10\",\n        //         \"reverse\": false,\n        //         \"onboardTime\": \"1763373600000\",\n        //         \"status\": \"NORMAL\"\n        //     }\n        //\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'baseAsset');\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const settleId = this.safeString (market, 'marginAsset');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settle = this.safeCurrencyCode (settleId);\n        const symbol = base + '/' + quote + ':' + settle;\n        const inverse = this.safeBool (market, 'reverse');\n        const limitMaxQty = this.safeString (market, 'limitMaxQty');\n        const marketMaxQty = this.safeString (market, 'marketMaxQty');\n        const maxAmountString = Precise.stringMax (limitMaxQty, marketMaxQty);\n        const marketMinQty = this.safeString (market, 'marketMinQty');\n        const limitMinQty = this.safeString (market, 'limitMinQty');\n        const minAmountString = Precise.stringMin (marketMinQty, limitMinQty);\n        const contractSize = this.safeString (market, 'contractFactor');\n        const pricePrecision = this.parsePrecision (this.safeString (market, 'priceOrderPrecision'));\n        const rawAmountPrecision = this.parsePrecision (this.safeString (market, 'volumePrecision'));\n        const amountPrecision = Precise.stringDiv (rawAmountPrecision, contractSize);\n        const basePrecision = this.parsePrecision (this.safeString (market, 'basePrecision'));\n        const taker = this.safeNumber (market, 'feeRateTaker');\n        const maker = this.safeNumber (market, 'feeRateMaker');\n        const maxLeverage = this.safeNumber (market, 'maxLeverageLevel');\n        const status = this.safeString (market, 'status');\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': 'swap',\n            'spot': false,\n            'margin': undefined,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': status === 'NORMAL',\n            'contract': true,\n            'linear': !inverse,\n            'inverse': inverse,\n            'taker': taker,\n            'maker': maker,\n            'contractSize': this.parseNumber (contractSize),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (amountPrecision),\n                'price': this.parseNumber (pricePrecision),\n                'base': this.parseNumber (basePrecision),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': maxLeverage,\n                },\n                'amount': {\n                    'min': this.parseNumber (minAmountString),\n                    'max': this.parseNumber (maxAmountString),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': this.parse8601 (this.safeString (market, 'createdAt')),\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 887,
        "line_end": 907,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"s\": \"ETH-USDT\",\n         \"t\": \"1766166000000\",\n         \"c\": \"2964.990000000000000000\",\n         \"o\": \"2967.830000000000000000\",\n         \"h\": \"2967.830000000000000000\",\n         \"l\": \"2964.130000000000000000\",\n         \"v\": \"20358.000000000000000000\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"s\": \"ETH-USDT\",\n        //         \"t\": \"1766166000000\",\n        //         \"c\": \"2964.990000000000000000\",\n        //         \"o\": \"2967.830000000000000000\",\n        //         \"h\": \"2967.830000000000000000\",\n        //         \"l\": \"2964.130000000000000000\",\n        //         \"v\": \"20358.000000000000000000\"\n        //     }\n        //\n        return [\n            this.safeInteger (ohlcv, 't'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber (ohlcv, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1745,
        "line_end": 1857,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger2 (order, 'updateTime', 'mtime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (rawType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "stopPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "isStopLossOrder ? stopPrice : undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "isTakeProfitOrder ? stopPrice : undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'origQty')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'executedQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.omitZero (this.safeString (order, 'avgPrice'))",
            "comment": null
          },
          {
            "key": "cost",
            "value": "quoteFee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"wallet\": \"W001\",\n         \"symbol\": \"ETH-USDT\",\n         \"orderId\": \"7408875768086683648\",\n         \"clientOrderId\": \"7408875768086683648\",\n         \"price\": \"1000\",\n         \"origQty\": \"10\",\n         \"avgPrice\": \"0\",\n         \"executedQty\": \"0\",\n         \"orderType\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"status\": \"CANCELED\",\n         \"stopPrice\": null,\n         \"activatePrice\": null,\n         \"timeInForce\": null,\n         \"workingType\": \"CONTRACT_PRICE\",\n         \"positionSide\": \"BOTH\",\n         \"priceProtect\": false,\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"createTime\": \"1766413633367\",\n         \"updateTime\": \"1766413633370\"\n     }",
          "{\n         \"orderId\": \"7408919189505597440\",\n         \"orderType\": \"MARKET\",\n         \"symbol\": \"ETH-USDC\",\n         \"origQty\": \"1\",\n         \"side\": \"BUY\",\n         \"positionSide\": \"BOTH\",\n         \"positionAvgPrice\": null,\n         \"positionVolume\": null,\n         \"positionType\": null,\n         \"reduceOnly\": false,\n         \"closePosition\": false,\n         \"action\": null,\n         \"price\": \"3032.45\",\n         \"avgPrice\": \"3032.45\",\n         \"brkPrice\": null,\n         \"dealVolume\": null,\n         \"status\": \"2\",\n         \"wallet\": \"W001\",\n         \"alias\": null,\n         \"contractId\": null,\n         \"mtime\": \"1766423985842\",\n         \"ctime\": \"1766423985840\",\n         \"fixedPrice\": null,\n         \"direction\": null,\n         \"triggerPrice\": null,\n         \"priceType\": null,\n         \"basePrecision\": \"8\",\n         \"baseShowPrecision\": \"2\",\n         \"strategyType\": null,\n         \"leverageLevel\": 1,\n         \"marginType\": \"CROSS\",\n         \"remark\": null,\n         \"callbackRate\": null,\n         \"activationPrice\": null\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, fetchOpenOrders, fetchOpenOrder\n        //     {\n        //         \"wallet\": \"W001\",\n        //         \"symbol\": \"ETH-USDT\",\n        //         \"orderId\": \"7408875768086683648\",\n        //         \"clientOrderId\": \"7408875768086683648\",\n        //         \"price\": \"1000\",\n        //         \"origQty\": \"10\",\n        //         \"avgPrice\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"orderType\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"status\": \"CANCELED\",\n        //         \"stopPrice\": null,\n        //         \"activatePrice\": null,\n        //         \"timeInForce\": null,\n        //         \"workingType\": \"CONTRACT_PRICE\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"priceProtect\": false,\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"createTime\": \"1766413633367\",\n        //         \"updateTime\": \"1766413633370\"\n        //     }\n        //\n        // fetchCanceledAndClosedOrders\n        //     {\n        //         \"orderId\": \"7408919189505597440\",\n        //         \"orderType\": \"MARKET\",\n        //         \"symbol\": \"ETH-USDC\",\n        //         \"origQty\": \"1\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"positionAvgPrice\": null,\n        //         \"positionVolume\": null,\n        //         \"positionType\": null,\n        //         \"reduceOnly\": false,\n        //         \"closePosition\": false,\n        //         \"action\": null,\n        //         \"price\": \"3032.45\",\n        //         \"avgPrice\": \"3032.45\",\n        //         \"brkPrice\": null,\n        //         \"dealVolume\": null,\n        //         \"status\": \"2\",\n        //         \"wallet\": \"W001\",\n        //         \"alias\": null,\n        //         \"contractId\": null,\n        //         \"mtime\": \"1766423985842\",\n        //         \"ctime\": \"1766423985840\",\n        //         \"fixedPrice\": null,\n        //         \"direction\": null,\n        //         \"triggerPrice\": null,\n        //         \"priceType\": null,\n        //         \"basePrecision\": \"8\",\n        //         \"baseShowPrecision\": \"2\",\n        //         \"strategyType\": null,\n        //         \"leverageLevel\": 1,\n        //         \"marginType\": \"CROSS\",\n        //         \"remark\": null,\n        //         \"callbackRate\": null,\n        //         \"activationPrice\": null\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger2 (order, 'createTime', 'ctime');\n        const rawType = this.safeString (order, 'orderType');\n        const stopPrice = this.safeStringN (order, [ 'stopPrice', 'activatePrice', 'triggerPrice' ]);\n        const isStopLossOrder = (rawType === 'STOP') || (rawType === 'STOP_MARKET') || (rawType === 'TRAILING_STOP_MARKET');\n        const isTakeProfitOrder = (rawType === 'TAKE_PROFIT') || (rawType === 'TAKE_PROFIT_MARKET');\n        const rawTimeInForce = this.safeString (order, 'timeInForce');\n        const timeInForce = this.parseOrderTimeInForce (rawTimeInForce);\n        let postOnly = undefined;\n        if (timeInForce === 'PO') {\n            postOnly = true;\n        }\n        const rawStatus = this.safeString (order, 'status');\n        const fee = {};\n        const quoteFee = this.safeNumber (order, 'quoteFee');\n        if (quoteFee !== undefined) {\n            fee['cost'] = quoteFee;\n            fee['currency'] = market['quote'];\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger2 (order, 'updateTime', 'mtime'),\n            'status': this.parseOrderStatus (rawStatus),\n            'symbol': market['symbol'],\n            'type': this.parseOrderType (rawType),\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': this.safeStringLower (order, 'side'),\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': stopPrice,\n            'stopLossPrice': isStopLossOrder ? stopPrice : undefined,\n            'takeProfitPrice': isTakeProfitOrder ? stopPrice : undefined,\n            'amount': this.safeString (order, 'origQty'),\n            'filled': this.safeString (order, 'executedQty'),\n            'remaining': undefined,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': fee,\n            'average': this.omitZero (this.safeString (order, 'avgPrice')),\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str): Str",
        "line_start": 1883,
        "line_end": 1895,
        "comment": null,
        "mappings": [
          {
            "key": "NEW",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "PARTIALLY_FILLED",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "FILLED",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "EXPIRED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "PART_FILLED_CANCELLED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "2",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "4",
            "value": "'canceled'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status: Str): Str {\n        const statuses = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'EXPIRED': 'canceled',\n            'PART_FILLED_CANCELLED': 'canceled',\n            'CANCELED': 'canceled',\n            '2': 'closed',\n            '4': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (timeInForce: Str): Str",
        "line_start": 1872,
        "line_end": 1881,
        "comment": null,
        "mappings": [
          {
            "key": "GTC",
            "value": "'GTC'",
            "comment": null
          },
          {
            "key": "FOK",
            "value": "'FOK'",
            "comment": null
          },
          {
            "key": "IOC",
            "value": "'IOC'",
            "comment": null
          },
          {
            "key": "POST_ONLY",
            "value": "'PO'",
            "comment": null
          },
          {
            "key": "TRAILING_STOP",
            "value": "'IOC'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderTimeInForce (timeInForce: Str): Str {\n        const timeInForces = {\n            'GTC': 'GTC',\n            'FOK': 'FOK',\n            'IOC': 'IOC',\n            'POST_ONLY': 'PO',\n            'TRAILING_STOP': 'IOC',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str): Str",
        "line_start": 1859,
        "line_end": 1870,
        "comment": null,
        "mappings": [
          {
            "key": "LIMIT",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "MARKET",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "STOP",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "STOP_MARKET",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "TAKE_PROFIT",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "TAKE_PROFIT_MARKET",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "TRAILING_STOP_MARKET",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type: Str): Str {\n        const types = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n            'STOP': 'limit',\n            'STOP_MARKET': 'market',\n            'TAKE_PROFIT': 'limit',\n            'TAKE_PROFIT_MARKET': 'market',\n            'TRAILING_STOP_MARKET': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2046,
        "line_end": 2149,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (this.safeString2 (position, 'avgOpenPositionPrice', 'avgPrice'))",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (this.safeString (position, 'markPrice'))",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.parseNumber (this.safeString (position, 'avgClosePositionPrice'))",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (this.safeString (position, 'closePositionCost'))",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (this.safeString (position, 'unPnl'))",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.parseNumber (this.safeString (position, 'positionProfits'))",
            "comment": null
          },
          {
            "key": "side",
            "value": "positionSide",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contracts)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'updateTime')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (this.safeString (position, 'mm'))",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (this.safeString (position, 'im'))",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (this.safeString (position, 'leverage'))",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.parseNumber (this.safeString (position, 'liqPrice'))",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH-USDC\",\n         \"side\": \"BUY\",\n         \"volume\": \"0.001\",\n         \"avgPrice\": \"3032.45\",\n         \"liqPrice\": \"0\",\n         \"markPrice\": \"3032.37\",\n         \"unPnl\": \"-0.00008\",\n         \"positionMargin\": \"0\",\n         \"settleCoin\": \"USDC\",\n         \"im\": \"3.03245\",\n         \"mm\": \"0.007581125\"\n     }",
          "{\n         \"id\": \"16788366\",\n         \"wallet\": \"W001\",\n         \"currency\": \"USDC\",\n         \"symbol\": \"ETH-USDC\",\n         \"side\": \"BUY\",\n         \"positionSide\": \"BOTH\",\n         \"leverage\": 1,\n         \"avgOpenPositionPrice\": \"3032.45\",\n         \"openPositionVolume\": \"1\",\n         \"openCount\": 1,\n         \"highPrice\": \"3032.45\",\n         \"lowPrice\": \"2953.67\",\n         \"avgClosePositionPrice\": \"2953.67\",\n         \"closePositionVolume\": \"1\",\n         \"closePositionCost\": \"2.95367\",\n         \"closeCount\": 1,\n         \"positionProfits\": \"-0.07878\",\n         \"lossBonus\": \"0\",\n         \"capitalFeeTotal\": \"-0.00026361\",\n         \"capitalFeeOutCash\": \"-0.00026361\",\n         \"capitalFeeInCash\": \"0\",\n         \"capitalFeeBonus\": \"0\",\n         \"openFeeTotal\": \"-0.00181947\",\n         \"openFeeBonus\": \"0\",\n         \"closeFeeTotal\": \"-0.00177221\",\n         \"closeFeeBonus\": \"0\",\n         \"liqLoss\": \"0\",\n         \"liqClosed\": false,\n         \"sequence\": \"53685341336\",\n         \"updateTime\": \"1766494929423\",\n         \"createTime\": \"1766423985842\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // fetchPositions, fetchPositionsForSymbol\n        //     {\n        //         \"symbol\": \"ETH-USDC\",\n        //         \"side\": \"BUY\",\n        //         \"volume\": \"0.001\",\n        //         \"avgPrice\": \"3032.45\",\n        //         \"liqPrice\": \"0\",\n        //         \"markPrice\": \"3032.37\",\n        //         \"unPnl\": \"-0.00008\",\n        //         \"positionMargin\": \"0\",\n        //         \"settleCoin\": \"USDC\",\n        //         \"im\": \"3.03245\",\n        //         \"mm\": \"0.007581125\"\n        //     }\n        //\n        // fetchPositionsHistory\n        //     {\n        //         \"id\": \"16788366\",\n        //         \"wallet\": \"W001\",\n        //         \"currency\": \"USDC\",\n        //         \"symbol\": \"ETH-USDC\",\n        //         \"side\": \"BUY\",\n        //         \"positionSide\": \"BOTH\",\n        //         \"leverage\": 1,\n        //         \"avgOpenPositionPrice\": \"3032.45\",\n        //         \"openPositionVolume\": \"1\",\n        //         \"openCount\": 1,\n        //         \"highPrice\": \"3032.45\",\n        //         \"lowPrice\": \"2953.67\",\n        //         \"avgClosePositionPrice\": \"2953.67\",\n        //         \"closePositionVolume\": \"1\",\n        //         \"closePositionCost\": \"2.95367\",\n        //         \"closeCount\": 1,\n        //         \"positionProfits\": \"-0.07878\",\n        //         \"lossBonus\": \"0\",\n        //         \"capitalFeeTotal\": \"-0.00026361\",\n        //         \"capitalFeeOutCash\": \"-0.00026361\",\n        //         \"capitalFeeInCash\": \"0\",\n        //         \"capitalFeeBonus\": \"0\",\n        //         \"openFeeTotal\": \"-0.00181947\",\n        //         \"openFeeBonus\": \"0\",\n        //         \"closeFeeTotal\": \"-0.00177221\",\n        //         \"closeFeeBonus\": \"0\",\n        //         \"liqLoss\": \"0\",\n        //         \"liqClosed\": false,\n        //         \"sequence\": \"53685341336\",\n        //         \"updateTime\": \"1766494929423\",\n        //         \"createTime\": \"1766423985842\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const buyOrSell = this.safeString (position, 'side');\n        const rawPositionSide = this.safeStringLower (position, 'positionSide');\n        let positionSide = this.parsePositionSide (buyOrSell);\n        let hedged = undefined;\n        let isFetchPositionsHistory = false;\n        if (rawPositionSide !== undefined) {\n            isFetchPositionsHistory = true;\n            if (rawPositionSide !== 'both') {\n                positionSide = rawPositionSide;\n                hedged = true;\n            } else {\n                hedged = false;\n            }\n        }\n        const contractSize = this.safeString (market, 'contractSize');\n        let contracts = this.safeString2 (position, 'volume', 'openPositionVolume');\n        if (!isFetchPositionsHistory) {\n            // in fetchPositions, the 'volume' is in base currency units, need to convert to contracts\n            contracts = Precise.stringDiv (contracts, contractSize);\n        }\n        const timestamp = this.safeInteger (position, 'createTime');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'id'),\n            'symbol': market['symbol'],\n            'entryPrice': this.parseNumber (this.safeString2 (position, 'avgOpenPositionPrice', 'avgPrice')),\n            'markPrice': this.parseNumber (this.safeString (position, 'markPrice')),\n            'lastPrice': this.parseNumber (this.safeString (position, 'avgClosePositionPrice')),\n            'notional': this.parseNumber (this.safeString (position, 'closePositionCost')),\n            'collateral': undefined,\n            'unrealizedPnl': this.parseNumber (this.safeString (position, 'unPnl')),\n            'realizedPnl': this.parseNumber (this.safeString (position, 'positionProfits')),\n            'side': positionSide,\n            'contracts': this.parseNumber (contracts),\n            'contractSize': this.parseNumber (contractSize),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'updateTime'),\n            'hedged': hedged,\n            'maintenanceMargin': this.parseNumber (this.safeString (position, 'mm')),\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': this.parseNumber (this.safeString (position, 'im')),\n            'initialMarginPercentage': undefined,\n            'leverage': this.parseNumber (this.safeString (position, 'leverage')),\n            'liquidationPrice': this.parseNumber (this.safeString (position, 'liqPrice')),\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parsePositionSide",
        "signature": "parsePositionSide (side: Str): Str",
        "line_start": 2151,
        "line_end": 2157,
        "comment": null,
        "mappings": [
          {
            "key": "BUY",
            "value": "'long'",
            "comment": null
          },
          {
            "key": "SELL",
            "value": "'short'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePositionSide (side: Str): Str {\n        const sides = {\n            'BUY': 'long',\n            'SELL': 'short',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 964,
        "line_end": 1005,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'high', 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'low', 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'open', 'o')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'vol', 'v')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USDT\",\n         \"open\": \"86452.9\",\n         \"high\": \"89371.2\",\n         \"low\": \"84418.5\",\n         \"last\": \"87050.3\",\n         \"vol\": \"12938783\",\n         \"time\": 1766169423872\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker/fetchTickers\n        //     {\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"open\": \"86452.9\",\n        //         \"high\": \"89371.2\",\n        //         \"low\": \"84418.5\",\n        //         \"last\": \"87050.3\",\n        //         \"vol\": \"12938783\",\n        //         \"time\": 1766169423872\n        //     }\n        //\n        const marketId = this.safeString2 (ticker, 'symbol', 's');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger2 (ticker, 'time', 'E');\n        const last = this.safeString2 (ticker, 'last', 'c');\n        return this.safeTicker ({\n            'symbol': this.safeSymbol (marketId, market),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'high', 'h'),\n            'low': this.safeString2 (ticker, 'low', 'l'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString2 (ticker, 'open', 'o'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'vol', 'v'),\n            'quoteVolume': undefined,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 738,
        "line_end": 802,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseTradeType (rawType)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'price', 'dealPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString2 (trade, 'quantity', 'dealVolume')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"7407825178362667008\",\n         \"symbol\": \"ETH-USDT\",\n         \"price\": \"2970.49\",\n         \"quantity\": \"63\",\n         \"side\": \"SELL\",\n         \"time\": 1766163153218\n     }",
          "{\n         \"orderId\": \"7408919189505597440\",\n         \"wallet\": \"W001\",\n         \"symbol\": \"ETH-USDC\",\n         \"time\": \"1766423985842\",\n         \"dealPrice\": \"3032.45\",\n         \"dealVolume\": \"1\",\n         \"fee\": \"0\",\n         \"side\": \"BUY\",\n         \"type\": \"2\",\n         \"liqPrice\": null,\n         \"basePrecision\": \"8\",\n         \"baseShowPrecision\": \"2\",\n         \"tradePnl\": \"0\",\n         \"marginType\": \"CROSS\",\n         \"leverageLevel\": 1\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //         \"id\": \"7407825178362667008\",\n        //         \"symbol\": \"ETH-USDT\",\n        //         \"price\": \"2970.49\",\n        //         \"quantity\": \"63\",\n        //         \"side\": \"SELL\",\n        //         \"time\": 1766163153218\n        //     }\n        //\n        // fetchMyTrades\n        //     {\n        //         \"orderId\": \"7408919189505597440\",\n        //         \"wallet\": \"W001\",\n        //         \"symbol\": \"ETH-USDC\",\n        //         \"time\": \"1766423985842\",\n        //         \"dealPrice\": \"3032.45\",\n        //         \"dealVolume\": \"1\",\n        //         \"fee\": \"0\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"2\",\n        //         \"liqPrice\": null,\n        //         \"basePrecision\": \"8\",\n        //         \"baseShowPrecision\": \"2\",\n        //         \"tradePnl\": \"0\",\n        //         \"marginType\": \"CROSS\",\n        //         \"leverageLevel\": 1\n        //     }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (trade, 'time');\n        let fee = undefined;\n        const rawType = this.safeString (trade, 'type');\n        const feeCost = this.safeString (trade, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': market['settle'],\n            };\n        }\n        const orderId = this.safeString (trade, 'orderId');\n        let side: Str = undefined; // fetchMyTrades always returns side BUY\n        if (orderId === undefined) {\n            // from fetchTrades\n            side = this.safeStringLower (trade, 'side');\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': this.safeString (trade, 'id'),\n            'order': orderId,\n            'type': this.parseTradeType (rawType),\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': this.safeString2 (trade, 'price', 'dealPrice'),\n            'amount': this.safeString2 (trade, 'quantity', 'dealVolume'),\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradeType",
        "signature": "parseTradeType (type: Str): Str",
        "line_start": 804,
        "line_end": 811,
        "comment": null,
        "mappings": [
          {
            "key": "1",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "2",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "3",
            "value": "'liquidation'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradeType (type: Str): Str {\n        const types = {\n            '1': 'limit',\n            '2': 'market',\n            '3': 'liquidation',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2822,
        "line_end": 2872,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'orderId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'network'))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'address')",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'addressTag')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'finishTime')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": \"1208864446987255809\",\n         \"asset\": \"USDC\",\n         \"amount\": \"200\",\n         \"status\": \"SUCCESS\",\n         \"txId\": \"0xd059a82a55ffc737722bd23c1ef3db2884ce8525b72ff0b3c038b430ce0c8ca5\",\n         \"network\": \"ETH\",\n         \"address\": \"0x8346b46f6aa9843c09f79f1c170a37aca83c8fcd\",\n         \"addressTag\": null,\n         \"finishTime\": 1766145475000,\n         \"createTime\": 1766145344000\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //     {\n        //         \"orderId\": \"1208864446987255809\",\n        //         \"asset\": \"USDC\",\n        //         \"amount\": \"200\",\n        //         \"status\": \"SUCCESS\",\n        //         \"txId\": \"0xd059a82a55ffc737722bd23c1ef3db2884ce8525b72ff0b3c038b430ce0c8ca5\",\n        //         \"network\": \"ETH\",\n        //         \"address\": \"0x8346b46f6aa9843c09f79f1c170a37aca83c8fcd\",\n        //         \"addressTag\": null,\n        //         \"finishTime\": 1766145475000,\n        //         \"createTime\": 1766145344000\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const rawStatus = this.safeStringLower (transaction, 'status');\n        const timestamp = this.safeInteger (transaction, 'createTime');\n        let fee = undefined;\n        const feeCost = this.safeNumber (transaction, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': undefined,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'orderId'),\n            'txid': this.safeString (transaction, 'txId'),\n            'type': undefined,\n            'currency': code,\n            'network': this.networkIdToCode (this.safeString (transaction, 'network')),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'status': this.parseTransactionStatus (rawStatus),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': this.safeString (transaction, 'address'),\n            'addressFrom': undefined,\n            'addressTo': undefined,\n            'tag': this.safeString (transaction, 'addressTag'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': this.safeInteger (transaction, 'finishTime'),\n            'comment': undefined,\n            'fee': fee,\n            'internal': false,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str): Str",
        "line_start": 2874,
        "line_end": 2881,
        "comment": null,
        "mappings": [
          {
            "key": "success",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "wait",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "failed",
            "value": "'failed'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransactionStatus (status: Str): Str {\n        const statuses = {\n            'success': 'ok',\n            'wait': 'pending',\n            'failed': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2657,
        "line_end": 2697,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'txId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.paraseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 200,\n         \"message\": \"success\",\n         \"success\": true\n     }",
          "{\n         \"orderId\": \"1209991065294581760\",\n         \"txId\": \"6km5fRK83Gwdp43HA479DW1Colh2pKyS\",\n         \"sourceWallet\": \"SPOT\",\n         \"targetWallet\": \"SWAP\",\n         \"asset\": \"USDC\",\n         \"amount\": \"100\",\n         \"status\": \"SUCCESS\",\n         \"timestamp\": 1766413950000\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //     {\n        //         \"code\": 200,\n        //         \"message\": \"success\",\n        //         \"success\": true\n        //     }\n        //\n        // fetchTransfers\n        //     {\n        //         \"orderId\": \"1209991065294581760\",\n        //         \"txId\": \"6km5fRK83Gwdp43HA479DW1Colh2pKyS\",\n        //         \"sourceWallet\": \"SPOT\",\n        //         \"targetWallet\": \"SWAP\",\n        //         \"asset\": \"USDC\",\n        //         \"amount\": \"100\",\n        //         \"status\": \"SUCCESS\",\n        //         \"timestamp\": 1766413950000\n        //     }\n        //\n        const status = this.safeStringUpper2 (transfer, 'message', 'status');\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        const fromId = this.safeStringUpper (transfer, 'sourceWallet');\n        const toId = this.safeStringUpper (transfer, 'targetWallet');\n        const fromAccount = this.safeString (accountsById, fromId, fromId);\n        const toAccount = this.safeString (accountsById, toId, toId);\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        const currencyId = this.safeString (transfer, 'asset');\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'txId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': this.paraseTransferStatus (status),\n        };\n    }"
      }
    ],
    "cex": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account: Dict): Account",
        "line_start": 921,
        "line_end": 928,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccount (account: Dict): Account {\n        return {\n            'id': undefined,\n            'type': undefined,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 983,
        "line_end": 999,
        "comment": null,
        "mappings": [
          {
            "key": "used",
            "value": "this.safeString (balance, 'balanceOnHold')",
            "comment": null
          },
          {
            "key": "total",
            "value": "this.safeString (balance, 'balance')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        const keys = Object.keys (response);\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const balance = this.safeDict (response, key, {});\n            const code = this.safeCurrencyCode (key);\n            const account: Dict = {\n                'used': this.safeString (balance, 'balanceOnHold'),\n                'total': this.safeString (balance, 'balance'),\n            };\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseCurrency",
        "signature": "parseCurrency (rawCurrency: Dict): Currency",
        "line_start": 366,
        "line_end": 425,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "name",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "this.safeBool (rawCurrency, 'walletDeposit')",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "this.safeBool (rawCurrency, 'walletWithdrawal')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "currencyPrecision",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'withdraw': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "networks",
            "comment": null
          },
          {
            "key": "info",
            "value": "rawCurrency",
            "comment": null
          },
          {
            "key": "id",
            "value": "networkId",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "deposit",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "withdraw",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (rawNetwork, 'withdrawalFee')",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                    'deposit': {\n                        'min': this.safeNumber (rawNetwork, 'minDeposit'),\n                        'max': undefined,\n                    },\n                    'withdraw': {\n                        'min': this.safeNumber (rawNetwork, 'minWithdrawal'),\n                        'max': undefined,\n                    },\n                }",
            "comment": null
          },
          {
            "key": "info",
            "value": "rawNetwork",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'min': this.safeNumber (rawNetwork, 'minDeposit'),\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                        'min': this.safeNumber (rawNetwork, 'minWithdrawal'),\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (rawNetwork, 'minWithdrawal')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCurrency (rawCurrency: Dict): Currency {\n        const id = this.safeString (rawCurrency, 'currency');\n        const code = this.safeCurrencyCode (id);\n        const type = this.safeBool (rawCurrency, 'fiat') ? 'fiat' : 'crypto';\n        const currencyPrecision = this.parseNumber (this.parsePrecision (this.safeString (rawCurrency, 'precision')));\n        const networks: Dict = {};\n        const rawNetworks = this.safeDict (rawCurrency, 'blockchains', {});\n        const keys = Object.keys (rawNetworks);\n        for (let j = 0; j < keys.length; j++) {\n            const networkId = keys[j];\n            const rawNetwork = rawNetworks[networkId];\n            const networkCode = this.networkIdToCode (networkId);\n            const deposit = this.safeString (rawNetwork, 'deposit') === 'enabled';\n            const withdraw = this.safeString (rawNetwork, 'withdrawal') === 'enabled';\n            networks[networkCode] = {\n                'id': networkId,\n                'network': networkCode,\n                'margin': undefined,\n                'deposit': deposit,\n                'withdraw': withdraw,\n                'active': undefined,\n                'fee': this.safeNumber (rawNetwork, 'withdrawalFee'),\n                'precision': currencyPrecision,\n                'limits': {\n                    'deposit': {\n                        'min': this.safeNumber (rawNetwork, 'minDeposit'),\n                        'max': undefined,\n                    },\n                    'withdraw': {\n                        'min': this.safeNumber (rawNetwork, 'minWithdrawal'),\n                        'max': undefined,\n                    },\n                },\n                'info': rawNetwork,\n            };\n        }\n        return this.safeCurrencyStructure ({\n            'id': id,\n            'code': code,\n            'name': undefined,\n            'type': type,\n            'active': undefined,\n            'deposit': this.safeBool (rawCurrency, 'walletDeposit'),\n            'withdraw': this.safeBool (rawCurrency, 'walletWithdrawal'),\n            'fee': undefined,\n            'precision': currencyPrecision,\n            'limits': {\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'withdraw': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'networks': networks,\n            'info': rawCurrency,\n        });\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1755,
        "line_end": 1767,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (depositAddress, 'blockchain'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        const address = this.safeString (depositAddress, 'address');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': currency['code'],\n            'network': this.networkIdToCode (this.safeString (depositAddress, 'blockchain')),\n            'address': address,\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1454,
        "line_end": 1486,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'transactionId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'accountId', '')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        let amount = this.safeString (item, 'amount');\n        let direction = undefined;\n        if (Precise.stringLe (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringMul ('-1', amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestampString = this.safeString (item, 'timestamp');\n        const timestamp = this.parse8601 (timestampString);\n        const type = this.safeString (item, 'type');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'transactionId'),\n            'direction': direction,\n            'account': this.safeString (item, 'accountId', ''),\n            'referenceAccount': undefined,\n            'referenceId': undefined,\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1488,
        "line_end": 1495,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'commission': 'fee',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 462,
        "line_end": 521,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (market, 'baseMin'),\n                    'max': this.safeNumber (market, 'baseMax'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'minPrice'),\n                    'max': this.safeNumber (market, 'maxPrice'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quoteMin'),\n                    'max': this.safeNumber (market, 'quoteMax'),\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeString (market, 'baseLotSize'),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision')))",
            "comment": "'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteLotSize'))), // buggy, doesn't reflect their documentation\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            }"
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'minPrice')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'maxPrice')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'quoteMin')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'quoteMax')",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const baseId = this.safeString (market, 'base');\n        const base = this.safeCurrencyCode (baseId);\n        const quoteId = this.safeString (market, 'quote');\n        const quote = this.safeCurrencyCode (quoteId);\n        const id = base + '-' + quote; // not actual id, but for this exchange we can use this abbreviation, because e.g. tickers have hyphen in between\n        const symbol = base + '/' + quote;\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'baseId': baseId,\n            'quote': quote,\n            'quoteId': quoteId,\n            'settle': undefined,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (market, 'baseMin'),\n                    'max': this.safeNumber (market, 'baseMax'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'minPrice'),\n                    'max': this.safeNumber (market, 'maxPrice'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quoteMin'),\n                    'max': this.safeNumber (market, 'quoteMax'),\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'precision': {\n                'amount': this.safeString (market, 'baseLotSize'),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision'))),\n                // 'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteLotSize'))), // buggy, doesn't reflect their documentation\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n            },\n            'active': undefined,\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 822,
        "line_end": 831,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1167,
        "line_end": 1246,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'lastUpdateTimestamp')",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (order, 'orderType')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "requestedBase",
            "comment": null
          },
          {
            "key": "cost",
            "value": "executedQuote",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber (order, 'averagePrice')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "executedBase",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCode",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeAmount",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //                \"orderId\": \"1313003\",\n        //                \"clientOrderId\": \"037F0AFEB93A\",\n        //                \"clientId\": \"up421412345\",\n        //                \"accountId\": null,\n        //                \"status\": \"FILLED\",\n        //                \"statusIsFinal\": true,\n        //                \"currency1\": \"AI\",\n        //                \"currency2\": \"USDT\",\n        //                \"side\": \"BUY\",\n        //                \"orderType\": \"Market\",\n        //                \"timeInForce\": \"IOC\",\n        //                \"comment\": null,\n        //                \"rejectCode\": null,\n        //                \"rejectReason\": null,\n        //                \"initialOnHoldAmountCcy1\": null,\n        //                \"initialOnHoldAmountCcy2\": \"10.23456700\",\n        //                \"executedAmountCcy1\": \"25.606429\",\n        //                \"executedAmountCcy2\": \"10.20904439\",\n        //                \"requestedAmountCcy1\": null,\n        //                \"requestedAmountCcy2\": \"10.20904439\",\n        //                \"originalAmountCcy2\": \"10.23456700\",\n        //                \"feeAmount\": \"0.02552261\",\n        //                \"feeCurrency\": \"USDT\",\n        //                \"price\": null,\n        //                \"averagePrice\": \"0.3986\",\n        //                \"clientCreateTimestamp\": \"1728474625320\",\n        //                \"serverCreateTimestamp\": \"1728474624956\",\n        //                \"lastUpdateTimestamp\": \"1728474628015\",\n        //                \"expireTime\": null,\n        //                \"effectiveTime\": null\n        //\n        const currency1 = this.safeString (order, 'currency1');\n        const currency2 = this.safeString (order, 'currency2');\n        let marketId = undefined;\n        if (currency1 !== undefined && currency2 !== undefined) {\n            marketId = currency1 + '-' + currency2;\n        }\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const fee = {};\n        const feeAmount = this.safeNumber (order, 'feeAmount');\n        if (feeAmount !== undefined) {\n            const currencyId = this.safeString (order, 'feeCurrency');\n            const feeCode = this.safeCurrencyCode (currencyId);\n            fee['currency'] = feeCode;\n            fee['cost'] = feeAmount;\n        }\n        const timestamp = this.safeInteger (order, 'serverCreateTimestamp');\n        const requestedBase = this.safeNumber (order, 'requestedAmountCcy1');\n        const executedBase = this.safeNumber (order, 'executedAmountCcy1');\n        // const requestedQuote = this.safeNumber (order, 'requestedAmountCcy2');\n        const executedQuote = this.safeNumber (order, 'executedAmountCcy2');\n        return this.safeOrder ({\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (order, 'lastUpdateTimestamp'),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': this.safeStringLower (order, 'orderType'),\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': undefined,\n            'side': this.safeStringLower (order, 'side'),\n            'price': this.safeNumber (order, 'price'),\n            'triggerPrice': this.safeNumber (order, 'stopPrice'),\n            'amount': requestedBase,\n            'cost': executedQuote,\n            'average': this.safeNumber (order, 'averagePrice'),\n            'filled': executedBase,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1153,
        "line_end": 1165,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'PENDING_NEW': 'open',\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'EXPIRED': 'expired',\n            'REJECTED': 'rejected',\n            'PENDING_CANCEL': 'canceling',\n            'CANCELLED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 607,
        "line_end": 631,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'bestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'bestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString (ticker, 'last')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (ticker, 'priceChange')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (ticker, 'priceChangePercentage')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quoteVolume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const marketId = this.safeString (ticker, 'id');\n        const symbol = this.safeSymbol (marketId, market);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeNumber (ticker, 'high'),\n            'low': this.safeNumber (ticker, 'low'),\n            'bid': this.safeNumber (ticker, 'bestBid'),\n            'bidVolume': undefined,\n            'ask': this.safeNumber (ticker, 'bestAsk'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': this.safeString (ticker, 'last'), // last indicative price per api docs (difference also seen here: https://github.com/ccxt/ccxt/actions/runs/14593899575/job/40935513901?pr=25767#step:11:456 )\n            'previousClose': undefined,\n            'change': this.safeNumber (ticker, 'priceChange'),\n            'percentage': this.safeNumber (ticker, 'priceChangePercentage'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 683,
        "line_end": 713,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'tradeId')",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (trade, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'amount')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n                    \"tradeId\": \"1728630559823-0\",\n                    \"dateISO\": \"2024-10-11T07:09:19.823Z\",\n                    \"side\": \"SELL\",\n                    \"price\": \"60879.5\",\n                    \"amount\": \"0.00165962\"\n                },"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //                {\n        //                    \"tradeId\": \"1728630559823-0\",\n        //                    \"dateISO\": \"2024-10-11T07:09:19.823Z\",\n        //                    \"side\": \"SELL\",\n        //                    \"price\": \"60879.5\",\n        //                    \"amount\": \"0.00165962\"\n        //                },\n        //\n        const dateStr = this.safeString (trade, 'dateISO');\n        const timestamp = this.parse8601 (dateStr);\n        market = this.safeMarket (undefined, market);\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': this.safeString (trade, 'tradeId'),\n            'order': undefined,\n            'type': undefined,\n            'takerOrMaker': undefined,\n            'side': this.safeStringLower (trade, 'side'),\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString (trade, 'amount'),\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 881,
        "line_end": 890,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'percent')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'percent')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        return {\n            'info': fee,\n            'symbol': this.safeString (market, 'symbol'),\n            'maker': this.safeNumber (fee, 'percent'),\n            'taker': this.safeNumber (fee, 'percent'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTradingFees",
        "signature": "parseTradingFees (response, useKeyAsId = false): TradingFees",
        "line_start": 859,
        "line_end": 879,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingFees (response, useKeyAsId = false): TradingFees {\n        const result: Dict = {};\n        const keys = Object.keys (response);\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            let market = undefined;\n            if (useKeyAsId) {\n                market = this.safeMarket (key);\n            }\n            const parsed = this.parseTradingFee (response[key], market);\n            result[parsed['symbol']] = parsed;\n        }\n        for (let i = 0; i < this.symbols.length; i++) {\n            const symbol = this.symbols[i];\n            if (!(symbol in result)) {\n                const market = this.market (symbol);\n                result[symbol] = this.parseTradingFee (response, market);\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1549,
        "line_end": 1581,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'txId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'commissionAmount'),\n            }",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (transaction, 'commissionAmount')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        const currencyId = this.safeString (transaction, 'currency');\n        const direction = this.safeString (transaction, 'direction');\n        const type = (direction === 'withdraw') ? 'withdrawal' : 'deposit';\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const updatedAt = this.safeString (transaction, 'updatedAt');\n        const timestamp = this.parse8601 (updatedAt);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'txId'),\n            'txid': undefined,\n            'type': type,\n            'currency': code,\n            'network': undefined,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': undefined,\n            'addressFrom': undefined,\n            'addressTo': undefined,\n            'tag': undefined,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'commissionAmount'),\n            },\n            'internal': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1583,
        "line_end": 1590,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'rejected': 'rejected',\n            'pending': 'pending',\n            'approved': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1676,
        "line_end": 1712,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transfer, 'transactionId', 'clientTxId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transfer, 'status'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"ok\": \"ok\",\n        \"data\": {\n            \"transactionId\": \"30225415\"\n        }\n    }",
          "{\n         \"ok\": \"ok\",\n         \"data\": {\n             \"accountId\": \"sub1\",\n             \"clientTxId\": \"27ba8284-67cf-4386-9ec7-80b3871abd45\",\n             \"currency\": \"USDT\",\n             \"status\": \"approved\"\n         }\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transferBetweenSubAccounts\n        //\n        //    {\n        //        \"ok\": \"ok\",\n        //        \"data\": {\n        //            \"transactionId\": \"30225415\"\n        //        }\n        //    }\n        //\n        // transfer between main/sub\n        //\n        //     {\n        //         \"ok\": \"ok\",\n        //         \"data\": {\n        //             \"accountId\": \"sub1\",\n        //             \"clientTxId\": \"27ba8284-67cf-4386-9ec7-80b3871abd45\",\n        //             \"currency\": \"USDT\",\n        //             \"status\": \"approved\"\n        //         }\n        //     }\n        //\n        const currencyId = this.safeString (transfer, 'currency');\n        const currencyCode = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': transfer,\n            'id': this.safeString2 (transfer, 'transactionId', 'clientTxId'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': currencyCode,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.parseTransactionStatus (this.safeString (transfer, 'status')),\n        };\n    }"
      }
    ],
    "coinbase": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 711,
        "line_end": 780,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (account, 'id', 'uuid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "(active !== undefined) ? this.safeStringLower (parts, 1) : typeV2",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"XLM\",\n         \"name\": \"XLM Wallet\",\n         \"primary\": false,\n         \"type\": \"wallet\",\n         \"currency\": {\n             \"code\": \"XLM\",\n             \"name\": \"Stellar Lumens\",\n             \"color\": \"#000000\",\n             \"sort_index\": 127,\n             \"exponent\": 7,\n             \"type\": \"crypto\",\n             \"address_regex\": \"^G[A-Z2-7]{55}$\",\n             \"asset_id\": \"13b83335-5ede-595b-821e-5bcdfa80560f\",\n             \"destination_tag_name\": \"XLM Memo ID\",\n             \"destination_tag_regex\": \"^[ -~]{1,28}$\"\n         },\n         \"balance\": {\n             \"amount\": \"0.0000000\",\n             \"currency\": \"XLM\"\n         },\n         \"created_at\": null,\n         \"updated_at\": null,\n         \"resource\": \"account\",\n         \"resource_path\": \"/v2/accounts/XLM\",\n         \"allow_deposits\": true,\n         \"allow_withdrawals\": true\n     }",
          "{\n         \"uuid\": \"11111111-1111-1111-1111-111111111111\",\n         \"name\": \"USDC Wallet\",\n         \"currency\": \"USDC\",\n         \"available_balance\": {\n             \"value\": \"0.0000000000000000\",\n             \"currency\": \"USDC\"\n         },\n         \"default\": true,\n         \"active\": true,\n         \"created_at\": \"2023-01-04T06:20:06.456Z\",\n         \"updated_at\": \"2023-01-04T06:20:07.181Z\",\n         \"deleted_at\": null,\n         \"type\": \"ACCOUNT_TYPE_CRYPTO\",\n         \"ready\": false,\n         \"hold\": {\n             \"value\": \"0.0000000000000000\",\n             \"currency\": \"USDC\"\n         }\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        // fetchAccountsV2\n        //\n        //     {\n        //         \"id\": \"XLM\",\n        //         \"name\": \"XLM Wallet\",\n        //         \"primary\": false,\n        //         \"type\": \"wallet\",\n        //         \"currency\": {\n        //             \"code\": \"XLM\",\n        //             \"name\": \"Stellar Lumens\",\n        //             \"color\": \"#000000\",\n        //             \"sort_index\": 127,\n        //             \"exponent\": 7,\n        //             \"type\": \"crypto\",\n        //             \"address_regex\": \"^G[A-Z2-7]{55}$\",\n        //             \"asset_id\": \"13b83335-5ede-595b-821e-5bcdfa80560f\",\n        //             \"destination_tag_name\": \"XLM Memo ID\",\n        //             \"destination_tag_regex\": \"^[ -~]{1,28}$\"\n        //         },\n        //         \"balance\": {\n        //             \"amount\": \"0.0000000\",\n        //             \"currency\": \"XLM\"\n        //         },\n        //         \"created_at\": null,\n        //         \"updated_at\": null,\n        //         \"resource\": \"account\",\n        //         \"resource_path\": \"/v2/accounts/XLM\",\n        //         \"allow_deposits\": true,\n        //         \"allow_withdrawals\": true\n        //     }\n        //\n        // fetchAccountsV3\n        //\n        //     {\n        //         \"uuid\": \"11111111-1111-1111-1111-111111111111\",\n        //         \"name\": \"USDC Wallet\",\n        //         \"currency\": \"USDC\",\n        //         \"available_balance\": {\n        //             \"value\": \"0.0000000000000000\",\n        //             \"currency\": \"USDC\"\n        //         },\n        //         \"default\": true,\n        //         \"active\": true,\n        //         \"created_at\": \"2023-01-04T06:20:06.456Z\",\n        //         \"updated_at\": \"2023-01-04T06:20:07.181Z\",\n        //         \"deleted_at\": null,\n        //         \"type\": \"ACCOUNT_TYPE_CRYPTO\",\n        //         \"ready\": false,\n        //         \"hold\": {\n        //             \"value\": \"0.0000000000000000\",\n        //             \"currency\": \"USDC\"\n        //         }\n        //     }\n        //\n        const active = this.safeBool (account, 'active');\n        const currencyIdV3 = this.safeString (account, 'currency');\n        const currency = this.safeDict (account, 'currency', {});\n        const currencyId = this.safeString (currency, 'code', currencyIdV3);\n        const typeV3 = this.safeString (account, 'name');\n        const typeV2 = this.safeString (account, 'type');\n        const parts = typeV3.split (' ');\n        return {\n            'id': this.safeString2 (account, 'id', 'uuid'),\n            'type': (active !== undefined) ? this.safeStringLower (parts, 1) : typeV2,\n            'code': this.safeCurrencyCode (currencyId),\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseContractMarket",
        "signature": "parseContractMarket (market, feeTier): MarketInterface",
        "line_start": 1672,
        "line_end": 1867,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isSwap",
            "comment": null
          },
          {
            "key": "future",
            "value": "!isSwap",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "!tradingDisabled",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expireTimestamp",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "expireDateTime",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n           \"product_id\":\"BIT-26APR24-CDE\",\n           \"price\":\"71145\",\n           \"price_percentage_change_24h\":\"-2.36722931247427\",\n           \"volume_24h\":\"108549\",\n           \"volume_percentage_change_24h\":\"155.78255337197794\",\n           \"base_increment\":\"1\",\n           \"quote_increment\":\"0.01\",\n           \"quote_min_size\":\"0\",\n           \"quote_max_size\":\"100000000\",\n           \"base_min_size\":\"1\",\n           \"base_max_size\":\"100000000\",\n           \"base_name\":\"\",\n           \"quote_name\":\"US Dollar\",\n           \"watched\":false,\n           \"is_disabled\":false,\n           \"new\":false,\n           \"status\":\"\",\n           \"cancel_only\":false,\n           \"limit_only\":false,\n           \"post_only\":false,\n           \"trading_disabled\":false,\n           \"auction_mode\":false,\n           \"product_type\":\"FUTURE\",\n           \"quote_currency_id\":\"USD\",\n           \"base_currency_id\":\"\",\n           \"fcm_trading_session_details\":{\n              \"is_session_open\":true,\n              \"open_time\":\"2024-04-08T22:00:00Z\",\n              \"close_time\":\"2024-04-09T21:00:00Z\"\n           },\n           \"mid_market_price\":\"71105\",\n           \"alias\":\"\",\n           \"alias_to\":[\n           ],\n           \"base_display_symbol\":\"\",\n           \"quote_display_symbol\":\"USD\",\n           \"view_only\":false,\n           \"price_increment\":\"5\",\n           \"display_name\":\"BTC 26 APR 24\",\n           \"product_venue\":\"FCM\",\n           \"future_product_details\":{\n              \"venue\":\"cde\",\n              \"contract_code\":\"BIT\",\n              \"contract_expiry\":\"2024-04-26T15:00:00Z\",\n              \"contract_size\":\"0.01\",\n              \"contract_root_unit\":\"BTC\",\n              \"group_description\":\"Nano Bitcoin Futures\",\n              \"contract_expiry_timezone\":\"Europe/London\",\n              \"group_short_description\":\"Nano BTC\",\n              \"risk_managed_by\":\"MANAGED_BY_FCM\",\n              \"contract_expiry_type\":\"EXPIRING\",\n              \"contract_display_name\":\"BTC 26 APR 24\"\n           }\n        }",
          "{\n           \"product_id\":\"ETH-PERP-INTX\",\n           \"price\":\"3630.98\",\n           \"price_percentage_change_24h\":\"0.65142426292038\",\n           \"volume_24h\":\"114020.1501\",\n           \"volume_percentage_change_24h\":\"63.33650787154869\",\n           \"base_increment\":\"0.0001\",\n           \"quote_increment\":\"0.01\",\n           \"quote_min_size\":\"10\",\n           \"quote_max_size\":\"50000000\",\n           \"base_min_size\":\"0.0001\",\n           \"base_max_size\":\"50000\",\n           \"base_name\":\"\",\n           \"quote_name\":\"USDC\",\n           \"watched\":false,\n           \"is_disabled\":false,\n           \"new\":false,\n           \"status\":\"\",\n           \"cancel_only\":false,\n           \"limit_only\":false,\n           \"post_only\":false,\n           \"trading_disabled\":false,\n           \"auction_mode\":false,\n           \"product_type\":\"FUTURE\",\n           \"quote_currency_id\":\"USDC\",\n           \"base_currency_id\":\"\",\n           \"fcm_trading_session_details\":null,\n           \"mid_market_price\":\"3630.975\",\n           \"alias\":\"\",\n           \"alias_to\":[],\n           \"base_display_symbol\":\"\",\n           \"quote_display_symbol\":\"USDC\",\n           \"view_only\":false,\n           \"price_increment\":\"0.01\",\n           \"display_name\":\"ETH PERP\",\n           \"product_venue\":\"INTX\",\n           \"future_product_details\":{\n              \"venue\":\"\",\n              \"contract_code\":\"ETH\",\n              \"contract_expiry\":null,\n              \"contract_size\":\"1\",\n              \"contract_root_unit\":\"ETH\",\n              \"group_description\":\"\",\n              \"contract_expiry_timezone\":\"\",\n              \"group_short_description\":\"\",\n              \"risk_managed_by\":\"MANAGED_BY_VENUE\",\n              \"contract_expiry_type\":\"PERPETUAL\",\n              \"perpetual_details\":{\n                 \"open_interest\":\"0\",\n                 \"funding_rate\":\"0.000016\",\n                 \"funding_time\":\"2024-04-09T09:00:00.000008Z\",\n                 \"max_leverage\":\"10\"\n              },\n              \"contract_display_name\":\"ETH PERPETUAL\"\n           }\n        }"
        ],
        "source": "parseContractMarket (market, feeTier): MarketInterface {\n        // expiring\n        //\n        //        {\n        //           \"product_id\":\"BIT-26APR24-CDE\",\n        //           \"price\":\"71145\",\n        //           \"price_percentage_change_24h\":\"-2.36722931247427\",\n        //           \"volume_24h\":\"108549\",\n        //           \"volume_percentage_change_24h\":\"155.78255337197794\",\n        //           \"base_increment\":\"1\",\n        //           \"quote_increment\":\"0.01\",\n        //           \"quote_min_size\":\"0\",\n        //           \"quote_max_size\":\"100000000\",\n        //           \"base_min_size\":\"1\",\n        //           \"base_max_size\":\"100000000\",\n        //           \"base_name\":\"\",\n        //           \"quote_name\":\"US Dollar\",\n        //           \"watched\":false,\n        //           \"is_disabled\":false,\n        //           \"new\":false,\n        //           \"status\":\"\",\n        //           \"cancel_only\":false,\n        //           \"limit_only\":false,\n        //           \"post_only\":false,\n        //           \"trading_disabled\":false,\n        //           \"auction_mode\":false,\n        //           \"product_type\":\"FUTURE\",\n        //           \"quote_currency_id\":\"USD\",\n        //           \"base_currency_id\":\"\",\n        //           \"fcm_trading_session_details\":{\n        //              \"is_session_open\":true,\n        //              \"open_time\":\"2024-04-08T22:00:00Z\",\n        //              \"close_time\":\"2024-04-09T21:00:00Z\"\n        //           },\n        //           \"mid_market_price\":\"71105\",\n        //           \"alias\":\"\",\n        //           \"alias_to\":[\n        //           ],\n        //           \"base_display_symbol\":\"\",\n        //           \"quote_display_symbol\":\"USD\",\n        //           \"view_only\":false,\n        //           \"price_increment\":\"5\",\n        //           \"display_name\":\"BTC 26 APR 24\",\n        //           \"product_venue\":\"FCM\",\n        //           \"future_product_details\":{\n        //              \"venue\":\"cde\",\n        //              \"contract_code\":\"BIT\",\n        //              \"contract_expiry\":\"2024-04-26T15:00:00Z\",\n        //              \"contract_size\":\"0.01\",\n        //              \"contract_root_unit\":\"BTC\",\n        //              \"group_description\":\"Nano Bitcoin Futures\",\n        //              \"contract_expiry_timezone\":\"Europe/London\",\n        //              \"group_short_description\":\"Nano BTC\",\n        //              \"risk_managed_by\":\"MANAGED_BY_FCM\",\n        //              \"contract_expiry_type\":\"EXPIRING\",\n        //              \"contract_display_name\":\"BTC 26 APR 24\"\n        //           }\n        //        }\n        //\n        // perpetual\n        //\n        //        {\n        //           \"product_id\":\"ETH-PERP-INTX\",\n        //           \"price\":\"3630.98\",\n        //           \"price_percentage_change_24h\":\"0.65142426292038\",\n        //           \"volume_24h\":\"114020.1501\",\n        //           \"volume_percentage_change_24h\":\"63.33650787154869\",\n        //           \"base_increment\":\"0.0001\",\n        //           \"quote_increment\":\"0.01\",\n        //           \"quote_min_size\":\"10\",\n        //           \"quote_max_size\":\"50000000\",\n        //           \"base_min_size\":\"0.0001\",\n        //           \"base_max_size\":\"50000\",\n        //           \"base_name\":\"\",\n        //           \"quote_name\":\"USDC\",\n        //           \"watched\":false,\n        //           \"is_disabled\":false,\n        //           \"new\":false,\n        //           \"status\":\"\",\n        //           \"cancel_only\":false,\n        //           \"limit_only\":false,\n        //           \"post_only\":false,\n        //           \"trading_disabled\":false,\n        //           \"auction_mode\":false,\n        //           \"product_type\":\"FUTURE\",\n        //           \"quote_currency_id\":\"USDC\",\n        //           \"base_currency_id\":\"\",\n        //           \"fcm_trading_session_details\":null,\n        //           \"mid_market_price\":\"3630.975\",\n        //           \"alias\":\"\",\n        //           \"alias_to\":[],\n        //           \"base_display_symbol\":\"\",\n        //           \"quote_display_symbol\":\"USDC\",\n        //           \"view_only\":false,\n        //           \"price_increment\":\"0.01\",\n        //           \"display_name\":\"ETH PERP\",\n        //           \"product_venue\":\"INTX\",\n        //           \"future_product_details\":{\n        //              \"venue\":\"\",\n        //              \"contract_code\":\"ETH\",\n        //              \"contract_expiry\":null,\n        //              \"contract_size\":\"1\",\n        //              \"contract_root_unit\":\"ETH\",\n        //              \"group_description\":\"\",\n        //              \"contract_expiry_timezone\":\"\",\n        //              \"group_short_description\":\"\",\n        //              \"risk_managed_by\":\"MANAGED_BY_VENUE\",\n        //              \"contract_expiry_type\":\"PERPETUAL\",\n        //              \"perpetual_details\":{\n        //                 \"open_interest\":\"0\",\n        //                 \"funding_rate\":\"0.000016\",\n        //                 \"funding_time\":\"2024-04-09T09:00:00.000008Z\",\n        //                 \"max_leverage\":\"10\"\n        //              },\n        //              \"contract_display_name\":\"ETH PERPETUAL\"\n        //           }\n        //        }\n        //\n        const id = this.safeString (market, 'product_id');\n        const futureProductDetails = this.safeDict (market, 'future_product_details', {});\n        const contractExpiryType = this.safeString (futureProductDetails, 'contract_expiry_type');\n        const contractSize = this.safeNumber (futureProductDetails, 'contract_size');\n        const contractExpire = this.safeString (futureProductDetails, 'contract_expiry');\n        const expireTimestamp = this.parse8601 (contractExpire);\n        const expireDateTime = this.iso8601 (expireTimestamp);\n        const isSwap = (contractExpiryType === 'PERPETUAL');\n        const baseId = this.safeString (futureProductDetails, 'contract_root_unit');\n        const quoteId = this.safeString (market, 'quote_currency_id');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const tradingDisabled = this.safeBool (market, 'is_disabled');\n        let symbol = base + '/' + quote;\n        let type = undefined;\n        if (isSwap) {\n            type = 'swap';\n            symbol = symbol + ':' + quote;\n        } else {\n            type = 'future';\n            symbol = symbol + ':' + quote + '-' + this.yymmdd (expireTimestamp);\n        }\n        const takerFeeRate = this.safeNumber (feeTier, 'taker_fee_rate');\n        const makerFeeRate = this.safeNumber (feeTier, 'maker_fee_rate');\n        const taker = takerFeeRate ? takerFeeRate : this.parseNumber ('0.06');\n        const maker = makerFeeRate ? makerFeeRate : this.parseNumber ('0.04');\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': quoteId,\n            'type': type,\n            'spot': false,\n            'margin': false,\n            'swap': isSwap,\n            'future': !isSwap,\n            'option': false,\n            'active': !tradingDisabled,\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'taker': taker,\n            'maker': maker,\n            'contractSize': contractSize,\n            'expiry': expireTimestamp,\n            'expiryDatetime': expireDateTime,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 4684,
        "line_end": 4704,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (conversion, 'id')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber (fromAmountStructure, 'value')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (feeAmountStructure, 'value')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        const fromCoin = this.safeString (conversion, 'source_currency');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'target_currency');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        const fromAmountStructure = this.safeDict (conversion, 'user_entered_amount');\n        const feeStructure = this.safeDict (conversion, 'total_fee');\n        const feeAmountStructure = this.safeDict (feeStructure, 'amount');\n        return {\n            'info': conversion,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'id': this.safeString (conversion, 'id'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber (fromAmountStructure, 'value'),\n            'toCurrency': toCode,\n            'toAmount': undefined,\n            'price': undefined,\n            'fee': this.safeNumber (feeAmountStructure, 'value'),\n        } as Conversion;\n    }"
      },
      {
        "name": "parseCustomBalance",
        "signature": "parseCustomBalance (response, params = {})",
        "line_start": 2373,
        "line_end": 2424,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCustomBalance (response, params = {}) {\n        const balances = this.safeList2 (response, 'data', 'accounts', []);\n        const accounts = this.safeList (params, 'type', this.options['accounts']);\n        const v3Accounts = this.safeList (params, 'type', this.options['v3Accounts']);\n        const result: Dict = { 'info': response };\n        for (let b = 0; b < balances.length; b++) {\n            const balance = balances[b];\n            const type = this.safeString (balance, 'type');\n            if (this.inArray (type, accounts)) {\n                const value = this.safeDict (balance, 'balance');\n                if (value !== undefined) {\n                    const currencyId = this.safeString (value, 'currency');\n                    const code = this.safeCurrencyCode (currencyId);\n                    const total = this.safeString (value, 'amount');\n                    const free = total;\n                    let account = this.safeDict (result, code);\n                    if (account === undefined) {\n                        account = this.account ();\n                        account['free'] = free;\n                        account['total'] = total;\n                    } else {\n                        account['free'] = Precise.stringAdd (account['free'], total);\n                        account['total'] = Precise.stringAdd (account['total'], total);\n                    }\n                    result[code] = account;\n                }\n            } else if (this.inArray (type, v3Accounts)) {\n                const available = this.safeDict (balance, 'available_balance');\n                const hold = this.safeDict (balance, 'hold');\n                if (available !== undefined && hold !== undefined) {\n                    const currencyId = this.safeString (available, 'currency');\n                    const code = this.safeCurrencyCode (currencyId);\n                    const used = this.safeString (hold, 'value');\n                    const free = this.safeString (available, 'value');\n                    const total = Precise.stringAdd (used, free);\n                    let account = this.safeDict (result, code);\n                    if (account === undefined) {\n                        account = this.account ();\n                        account['free'] = free;\n                        account['used'] = used;\n                        account['total'] = total;\n                    } else {\n                        account['free'] = Precise.stringAdd (account['free'], free);\n                        account['used'] = Precise.stringAdd (account['used'], used);\n                        account['total'] = Precise.stringAdd (account['total'], total);\n                    }\n                    result[code] = account;\n                }\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 4291,
        "line_end": 4368,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId, code)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (addressInfo, 'destination_tag')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n        address_info: {\n            address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',\n            destination_tag: '3722061866'\n        },\n        name: null,\n        created_at: '2023-05-29T21:12:12Z',\n        updated_at: '2023-05-29T21:12:12Z',\n        network: 'solana',\n        uri_scheme: 'solana',\n        resource: 'address',\n        resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        warnings: [\n            {\n            type: 'correct_address_warning',\n            title: 'This is an ERC20 USDC address.',\n            details: 'Only send ERC20 USD Coin (USDC) to this address.',\n            image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',\n            options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]\n            }\n        ],\n        qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',\n        address_label: 'USDC address (Solana)',\n        default_receive: true,\n        deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',\n        callback_url: null,\n        share_address_copy: {\n            line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n            line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'\n        },\n        receive_subtitle: 'ERC-20',\n        inline_warning: {\n            text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',\n            tooltip: {\n            title: 'USDC (Solana)',\n            subtitle: 'This address can only receive USDC-SPL from Solana network.'\n            }\n        }\n    }",
          "{\n     \"id\":\"3f2434234943-8c1c-50ef-a5a1-342213bbf45d\",\n     \"address\":\"0x123123126F5921XXXXX\",\n     \"currency\":\"USDC\",\n     \"name\":\"\",\n     \"network\":\"ethereum\",\n     \"created_at\":\"2022-03-17T09:20:17.002Z\",\n     \"updated_at\":\"2022-03-17T09:20:17.002Z\",\n     \"resource\":\"addresses\",\n     \"resource_path\":\"v2/accounts/b1091c6e-9ef2-5e4d-b352-665d0cf8f742/addresses/32fd0943-8c1c-50ef-a5a1-342213bbf45d\",\n     \"destination_tag\":\"\"\n }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        //        address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n        //        address_info: {\n        //            address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',\n        //            destination_tag: '3722061866'\n        //        },\n        //        name: null,\n        //        created_at: '2023-05-29T21:12:12Z',\n        //        updated_at: '2023-05-29T21:12:12Z',\n        //        network: 'solana',\n        //        uri_scheme: 'solana',\n        //        resource: 'address',\n        //        resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        //        warnings: [\n        //            {\n        //            type: 'correct_address_warning',\n        //            title: 'This is an ERC20 USDC address.',\n        //            details: 'Only send ERC20 USD Coin (USDC) to this address.',\n        //            image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',\n        //            options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]\n        //            }\n        //        ],\n        //        qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',\n        //        address_label: 'USDC address (Solana)',\n        //        default_receive: true,\n        //        deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',\n        //        callback_url: null,\n        //        share_address_copy: {\n        //            line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n        //            line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'\n        //        },\n        //        receive_subtitle: 'ERC-20',\n        //        inline_warning: {\n        //            text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',\n        //            tooltip: {\n        //            title: 'USDC (Solana)',\n        //            subtitle: 'This address can only receive USDC-SPL from Solana network.'\n        //            }\n        //        }\n        //    }\n        //\n        // {\n        //     \"id\":\"3f2434234943-8c1c-50ef-a5a1-342213bbf45d\",\n        //     \"address\":\"0x123123126F5921XXXXX\",\n        //     \"currency\":\"USDC\",\n        //     \"name\":\"\",\n        //     \"network\":\"ethereum\",\n        //     \"created_at\":\"2022-03-17T09:20:17.002Z\",\n        //     \"updated_at\":\"2022-03-17T09:20:17.002Z\",\n        //     \"resource\":\"addresses\",\n        //     \"resource_path\":\"v2/accounts/b1091c6e-9ef2-5e4d-b352-665d0cf8f742/addresses/32fd0943-8c1c-50ef-a5a1-342213bbf45d\",\n        //     \"destination_tag\":\"\"\n        // }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        const networkId = this.safeString (depositAddress, 'network');\n        const code = this.safeCurrencyCode (undefined, currency);\n        const addressLabel = this.safeString (depositAddress, 'address_label');\n        let currencyId = undefined;\n        if (addressLabel !== undefined) {\n            const splitAddressLabel = addressLabel.split (' ');\n            currencyId = this.safeString (splitAddressLabel, 0);\n        } else {\n            currencyId = this.safeString (depositAddress, 'currency');\n        }\n        const addressInfo = this.safeDict (depositAddress, 'address_info');\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'network': this.networkIdToCode (networkId, code),\n            'address': address,\n            'tag': this.safeString (addressInfo, 'destination_tag'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositMethodId",
        "signature": "parseDepositMethodId (depositId)",
        "line_start": 4593,
        "line_end": 4601,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositId",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (depositId, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (depositId, 'currency')",
            "comment": null
          },
          {
            "key": "verified",
            "value": "this.safeBool (depositId, 'verified')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositId, 'name')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositMethodId (depositId) {\n        return {\n            'info': depositId,\n            'id': this.safeString (depositId, 'id'),\n            'currency': this.safeString (depositId, 'currency'),\n            'verified': this.safeBool (depositId, 'verified'),\n            'tag': this.safeString (depositId, 'name'),\n        };\n    }"
      },
      {
        "name": "parseDepositMethodIds",
        "signature": "parseDepositMethodIds (ids, params = {})",
        "line_start": 4584,
        "line_end": 4591,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositMethodIds (ids, params = {}) {\n        const result = [];\n        for (let i = 0; i < ids.length; i++) {\n            const id = this.extend (this.parseDepositMethodId (ids[i]), params);\n            result.push (id);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2599,
        "line_end": 2907,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "accountId",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeAmount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n         \"type\": \"send\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"28.31976528\", currency: \"BCH\" },\n         \"native_amount\": { amount: \"2799.65\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-02-28T12:35:20Z\",\n         \"updated_at\": \"2019-02-28T12:43:24Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n         \"instant_exchange\": false,\n         \"network\": {\n             \"status\": \"confirmed\",\n             \"hash\": \"56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\",\n             \"transaction_url\": \"https://bch.btc.com/56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\"\n         },\n         \"from\": { resource: \"bitcoin_cash_network\", currency: \"BCH\" },\n         \"details\": { title: 'Received Bitcoin Cash', subtitle: \"From Bitcoin Cash address\" }\n     }",
          "{\n         \"id\": \"459aad99-2c41-5698-ac71-b6b81a05196c\",\n         \"type\": \"send\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"-0.36775642\", currency: \"BTC\" },\n         \"native_amount\": { amount: \"-1111.65\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-03-20T08:37:07Z\",\n         \"updated_at\": \"2019-03-20T08:49:33Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/459aad99-2c41-5698-ac71-b6b81a05196c\",\n         \"instant_exchange\": false,\n         \"network\": {\n             \"status\": \"confirmed\",\n             \"hash\": \"2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n             \"transaction_url\": \"https://blockchain.info/tx/2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n             \"transaction_fee\": { amount: \"0.00000000\", currency: \"BTC\" },\n             \"transaction_amount\": { amount: \"0.36775642\", currency: \"BTC\" },\n             \"confirmations\": 15682\n         },\n         \"to\": {\n             \"resource\": \"bitcoin_address\",\n             \"address\": \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\",\n             \"currency\": \"BTC\",\n             \"address_info\": { address: \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\" }\n         },\n         \"idem\": \"da0a2f14-a2af-4c5a-a37e-d4484caf582bsend\",\n         \"application\": {\n             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n             \"resource\": \"application\",\n             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n         },\n         \"details\": { title: 'Sent Bitcoin', subtitle: \"To Bitcoin address\" }\n     }",
          "{\n         \"id\": \"5b1b9fb8-5007-5393-b923-02903b973fdc\",\n         \"type\": \"pro_deposit\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"-0.00001111\", currency: \"BCH\" },\n         \"native_amount\": { amount: \"0.00\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-02-28T13:31:58Z\",\n         \"updated_at\": \"2019-02-28T13:31:58Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/5b1b9fb8-5007-5393-b923-02903b973fdc\",\n         \"instant_exchange\": false,\n         \"application\": {\n             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n             \"resource\": \"application\",\n             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n         },\n         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To Coinbase Pro\" }\n     }",
          "{\n         \"id\": \"badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n         \"type\": \"exchange_deposit\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"-0.43704149\", currency: \"BCH\" },\n         \"native_amount\": { amount: \"-51.90\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-03-19T10:30:40Z\",\n         \"updated_at\": \"2019-03-19T10:30:40Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n         \"instant_exchange\": false,\n         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To GDAX\" }\n     }",
          "{\n         \"id\": \"9c4b642c-8688-58bf-8962-13cef64097de\",\n         \"type\": \"exchange_withdrawal\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"0.57729420\", currency: \"BTC\" },\n         \"native_amount\": { amount: \"4418.72\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2018-02-17T11:33:33Z\",\n         \"updated_at\": \"2018-02-17T11:33:33Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/9c4b642c-8688-58bf-8962-13cef64097de\",\n         \"instant_exchange\": false,\n         \"details\": { title: 'Transferred Bitcoin', subtitle: \"From GDAX\" }\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // crypto deposit transaction\n        //\n        //     {\n        //         \"id\": \"34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n        //         \"type\": \"send\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"28.31976528\", currency: \"BCH\" },\n        //         \"native_amount\": { amount: \"2799.65\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-02-28T12:35:20Z\",\n        //         \"updated_at\": \"2019-02-28T12:43:24Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n        //         \"instant_exchange\": false,\n        //         \"network\": {\n        //             \"status\": \"confirmed\",\n        //             \"hash\": \"56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\",\n        //             \"transaction_url\": \"https://bch.btc.com/56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\"\n        //         },\n        //         \"from\": { resource: \"bitcoin_cash_network\", currency: \"BCH\" },\n        //         \"details\": { title: 'Received Bitcoin Cash', subtitle: \"From Bitcoin Cash address\" }\n        //     }\n        //\n        // crypto withdrawal transaction\n        //\n        //     {\n        //         \"id\": \"459aad99-2c41-5698-ac71-b6b81a05196c\",\n        //         \"type\": \"send\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-0.36775642\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"-1111.65\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-03-20T08:37:07Z\",\n        //         \"updated_at\": \"2019-03-20T08:49:33Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/459aad99-2c41-5698-ac71-b6b81a05196c\",\n        //         \"instant_exchange\": false,\n        //         \"network\": {\n        //             \"status\": \"confirmed\",\n        //             \"hash\": \"2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n        //             \"transaction_url\": \"https://blockchain.info/tx/2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n        //             \"transaction_fee\": { amount: \"0.00000000\", currency: \"BTC\" },\n        //             \"transaction_amount\": { amount: \"0.36775642\", currency: \"BTC\" },\n        //             \"confirmations\": 15682\n        //         },\n        //         \"to\": {\n        //             \"resource\": \"bitcoin_address\",\n        //             \"address\": \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\",\n        //             \"currency\": \"BTC\",\n        //             \"address_info\": { address: \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\" }\n        //         },\n        //         \"idem\": \"da0a2f14-a2af-4c5a-a37e-d4484caf582bsend\",\n        //         \"application\": {\n        //             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n        //             \"resource\": \"application\",\n        //             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n        //         },\n        //         \"details\": { title: 'Sent Bitcoin', subtitle: \"To Bitcoin address\" }\n        //     }\n        //\n        // withdrawal transaction from coinbase to coinbasepro\n        //\n        //     {\n        //         \"id\": \"5b1b9fb8-5007-5393-b923-02903b973fdc\",\n        //         \"type\": \"pro_deposit\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-0.00001111\", currency: \"BCH\" },\n        //         \"native_amount\": { amount: \"0.00\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-02-28T13:31:58Z\",\n        //         \"updated_at\": \"2019-02-28T13:31:58Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/5b1b9fb8-5007-5393-b923-02903b973fdc\",\n        //         \"instant_exchange\": false,\n        //         \"application\": {\n        //             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n        //             \"resource\": \"application\",\n        //             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n        //         },\n        //         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To Coinbase Pro\" }\n        //     }\n        //\n        // withdrawal transaction from coinbase to gdax\n        //\n        //     {\n        //         \"id\": \"badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n        //         \"type\": \"exchange_deposit\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-0.43704149\", currency: \"BCH\" },\n        //         \"native_amount\": { amount: \"-51.90\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-03-19T10:30:40Z\",\n        //         \"updated_at\": \"2019-03-19T10:30:40Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n        //         \"instant_exchange\": false,\n        //         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To GDAX\" }\n        //     }\n        //\n        // deposit transaction from gdax to coinbase\n        //\n        //     {\n        //         \"id\": \"9c4b642c-8688-58bf-8962-13cef64097de\",\n        //         \"type\": \"exchange_withdrawal\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"0.57729420\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"4418.72\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2018-02-17T11:33:33Z\",\n        //         \"updated_at\": \"2018-02-17T11:33:33Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/9c4b642c-8688-58bf-8962-13cef64097de\",\n        //         \"instant_exchange\": false,\n        //         \"details\": { title: 'Transferred Bitcoin', subtitle: \"From GDAX\" }\n        //     }\n        //\n        // deposit transaction from coinbasepro to coinbase\n        //\n        //     {\n        //         \"id\": \"8d6dd0b9-3416-568a-889d-8f112fae9e81\",\n        //         \"type\": \"pro_withdrawal\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"0.40555386\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"1140.27\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-03-04T19:41:58Z\",\n        //         \"updated_at\": \"2019-03-04T19:41:58Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/8d6dd0b9-3416-568a-889d-8f112fae9e81\",\n        //         \"instant_exchange\": false,\n        //         \"application\": {\n        //             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n        //             \"resource\": \"application\",\n        //             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n        //         },\n        //         \"details\": { title: 'Transferred Bitcoin', subtitle: \"From Coinbase Pro\" }\n        //     }\n        //\n        // sell trade\n        //\n        //     {\n        //         \"id\": \"a9409207-df64-585b-97ab-a50780d2149e\",\n        //         \"type\": \"sell\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-9.09922880\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"-7285.73\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-03-27T15:38:34Z\",\n        //         \"updated_at\": \"2017-03-27T15:38:34Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/a9409207-df64-585b-97ab-a50780d2149e\",\n        //         \"instant_exchange\": false,\n        //         \"sell\": {\n        //             \"id\": \"e3550b4d-8ae6-5de3-95fe-1fb01ba83051\",\n        //             \"resource\": \"sell\",\n        //             \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/sells/e3550b4d-8ae6-5de3-95fe-1fb01ba83051\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Sold Bitcoin\",\n        //             \"subtitle\": \"Using EUR Wallet\",\n        //             \"payment_method_name\": \"EUR Wallet\"\n        //         }\n        //     }\n        //\n        // buy trade\n        //\n        //     {\n        //         \"id\": \"63eeed67-9396-5912-86e9-73c4f10fe147\",\n        //         \"type\": \"buy\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"2.39605772\", currency: \"ETH\" },\n        //         \"native_amount\": { amount: \"98.31\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-03-27T09:07:56Z\",\n        //         \"updated_at\": \"2017-03-27T09:07:57Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/8902f85d-4a69-5d74-82fe-8e390201bda7/transactions/63eeed67-9396-5912-86e9-73c4f10fe147\",\n        //         \"instant_exchange\": false,\n        //         \"buy\": {\n        //             \"id\": \"20b25b36-76c6-5353-aa57-b06a29a39d82\",\n        //             \"resource\": \"buy\",\n        //             \"resource_path\": \"/v2/accounts/8902f85d-4a69-5d74-82fe-8e390201bda7/buys/20b25b36-76c6-5353-aa57-b06a29a39d82\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Bought Ethereum\",\n        //             \"subtitle\": \"Using EUR Wallet\",\n        //             \"payment_method_name\": \"EUR Wallet\"\n        //         }\n        //     }\n        //\n        // fiat deposit transaction\n        //\n        //     {\n        //         \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n        //         \"type\": \"fiat_deposit\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"114.02\", currency: \"EUR\" },\n        //         \"native_amount\": { amount: \"97.23\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-02-09T07:01:21Z\",\n        //         \"updated_at\": \"2017-02-09T07:01:22Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86-b1d2146977d0\",\n        //         \"instant_exchange\": false,\n        //         \"fiat_deposit\": {\n        //             \"id\": \"f34c19f3-b730-5e3d-9f72-96520448677a\",\n        //             \"resource\": \"fiat_deposit\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72-96520448677a\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Deposited funds\",\n        //             \"subtitle\": \"From SEPA Transfer (GB47 BARC 20..., reference CBADVI)\",\n        //             \"payment_method_name\": \"SEPA Transfer (GB47 BARC 20..., reference CBADVI)\"\n        //         }\n        //     }\n        //\n        // fiat withdrawal transaction\n        //\n        //     {\n        //         \"id\": \"957d98e2-f80e-5e2f-a28e-02945aa93079\",\n        //         \"type\": \"fiat_withdrawal\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-11000.00\", currency: \"EUR\" },\n        //         \"native_amount\": { amount: \"-9698.22\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-12-06T13:19:19Z\",\n        //         \"updated_at\": \"2017-12-06T13:19:19Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/957d98e2-f80e-5e2f-a28e-02945aa93079\",\n        //         \"instant_exchange\": false,\n        //         \"fiat_withdrawal\": {\n        //             \"id\": \"f4bf1fd9-ab3b-5de7-906d-ed3e23f7a4e7\",\n        //             \"resource\": \"fiat_withdrawal\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/f4bf1fd9-ab3b-5de7-906d-ed3e23f7a4e7\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Withdrew funds\",\n        //             \"subtitle\": \"To HSBC BANK PLC (GB74 MIDL...)\",\n        //             \"payment_method_name\": \"HSBC BANK PLC (GB74 MIDL...)\"\n        //         }\n        //     }\n        //\n        const amountInfo = this.safeDict (item, 'amount', {});\n        let amount = this.safeString (amountInfo, 'amount');\n        let direction = undefined;\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringNeg (amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (amountInfo, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        //\n        // the address and txid do not belong to the unified ledger structure\n        //\n        //     let address = undefined;\n        //     if (item['to']) {\n        //         address = this.safeString (item['to'], 'address');\n        //     }\n        //     let txid = undefined;\n        //\n        let fee = undefined;\n        const networkInfo = this.safeDict (item, 'network', {});\n        // txid = network['hash']; // txid does not belong to the unified ledger structure\n        const feeInfo = this.safeDict (networkInfo, 'transaction_fee');\n        if (feeInfo !== undefined) {\n            const feeCurrencyId = this.safeString (feeInfo, 'currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId, currency);\n            const feeAmount = this.safeNumber (feeInfo, 'amount');\n            fee = {\n                'cost': feeAmount,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const timestamp = this.parse8601 (this.safeString (item, 'created_at'));\n        const id = this.safeString (item, 'id');\n        const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n        const status = this.parseLedgerEntryStatus (this.safeString (item, 'status'));\n        const path = this.safeString (item, 'resource_path');\n        let accountId = undefined;\n        if (path !== undefined) {\n            const parts = path.split ('/');\n            const numParts = parts.length;\n            if (numParts > 3) {\n                accountId = parts[3];\n            }\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': accountId,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'before': undefined,\n            'after': undefined,\n            'status': status,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryStatus",
        "signature": "parseLedgerEntryStatus (status)",
        "line_start": 2577,
        "line_end": 2582,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryStatus (status) {\n        const types: Dict = {\n            'completed': 'ok',\n        };\n        return this.safeString (types, status, status);\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2584,
        "line_end": 2597,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'buy': 'trade',\n            'sell': 'trade',\n            'fiat_deposit': 'transaction',\n            'fiat_withdrawal': 'transaction',\n            'exchange_deposit': 'transaction', // fiat withdrawal (from coinbase to coinbasepro)\n            'exchange_withdrawal': 'transaction', // fiat deposit (to coinbase from coinbasepro)\n            'send': 'transaction', // crypto deposit OR withdrawal\n            'pro_deposit': 'transaction', // crypto withdrawal (from coinbase to coinbasepro)\n            'pro_withdrawal': 'transaction', // crypto deposit (to coinbase from coinbasepro)\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 3865,
        "line_end": 3886,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"start\": \"1673391780\",\n             \"low\": \"17414.36\",\n             \"high\": \"17417.99\",\n             \"open\": \"17417.74\",\n             \"close\": \"17417.38\",\n             \"volume\": \"1.87780853\"\n         },\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         {\n        //             \"start\": \"1673391780\",\n        //             \"low\": \"17414.36\",\n        //             \"high\": \"17417.99\",\n        //             \"open\": \"17417.74\",\n        //             \"close\": \"17417.38\",\n        //             \"volume\": \"1.87780853\"\n        //         },\n        //     ]\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'start'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3223,
        "line_end": 3357,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'order_id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (this.safeString (order, 'order_type'))",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'time_in_force'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'filled_size')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'average_filled_price')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeString (order, 'total_fees'),\n                'currency': currencyFee,\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'total_fees')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyFee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"52cfe5e2-0b29-4c19-a245-a6a773de5030\",\n         \"product_id\": \"LTC-BTC\",\n         \"side\": \"SELL\",\n         \"client_order_id\": \"4d760580-6fca-4094-a70b-ebcca8626288\"\n     }",
          "{\n         \"success\": true,\n         \"failure_reason\": \"UNKNOWN_CANCEL_FAILURE_REASON\",\n         \"order_id\": \"bb8851a3-4fda-4a2c-aa06-9048db0e0f0d\"\n     }",
          "{\n         \"order_id\": \"9bc1eb3b-5b46-4b71-9628-ae2ed0cca75b\",\n         \"product_id\": \"LTC-BTC\",\n         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n         \"order_configuration\": {\n             \"limit_limit_gtc\": {\n                 \"base_size\": \"0.2\",\n                 \"limit_price\": \"0.006\",\n                 \"post_only\": false\n             },\n             \"stop_limit_stop_limit_gtc\": {\n                 \"base_size\": \"48.54\",\n                 \"limit_price\": \"6.998\",\n                 \"stop_price\": \"7.0687\",\n                 \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\"\n             }\n         },\n         \"side\": \"SELL\",\n         \"client_order_id\": \"e5fe8482-05bb-428f-ad4d-dbc8ce39239c\",\n         \"status\": \"OPEN\",\n         \"time_in_force\": \"GOOD_UNTIL_CANCELLED\",\n         \"created_time\": \"2023-01-16T23:37:23.947030Z\",\n         \"completion_percentage\": \"0\",\n         \"filled_size\": \"0\",\n         \"average_filled_price\": \"0\",\n         \"fee\": \"\",\n         \"number_of_fills\": \"0\",\n         \"filled_value\": \"0\",\n         \"pending_cancel\": false,\n         \"size_in_quote\": false,\n         \"total_fees\": \"0\",\n         \"size_inclusive_of_fees\": false,\n         \"total_value_after_fees\": \"0\",\n         \"trigger_status\": \"INVALID_ORDER_TYPE\",\n         \"order_type\": \"LIMIT\",\n         \"reject_reason\": \"REJECT_REASON_UNSPECIFIED\",\n         \"settled\": false,\n         \"product_type\": \"SPOT\",\n         \"reject_message\": \"\",\n         \"cancel_message\": \"\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"order_id\": \"52cfe5e2-0b29-4c19-a245-a6a773de5030\",\n        //         \"product_id\": \"LTC-BTC\",\n        //         \"side\": \"SELL\",\n        //         \"client_order_id\": \"4d760580-6fca-4094-a70b-ebcca8626288\"\n        //     }\n        //\n        // cancelOrder, cancelOrders\n        //\n        //     {\n        //         \"success\": true,\n        //         \"failure_reason\": \"UNKNOWN_CANCEL_FAILURE_REASON\",\n        //         \"order_id\": \"bb8851a3-4fda-4a2c-aa06-9048db0e0f0d\"\n        //     }\n        //\n        // fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n        //\n        //     {\n        //         \"order_id\": \"9bc1eb3b-5b46-4b71-9628-ae2ed0cca75b\",\n        //         \"product_id\": \"LTC-BTC\",\n        //         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n        //         \"order_configuration\": {\n        //             \"limit_limit_gtc\": {\n        //                 \"base_size\": \"0.2\",\n        //                 \"limit_price\": \"0.006\",\n        //                 \"post_only\": false\n        //             },\n        //             \"stop_limit_stop_limit_gtc\": {\n        //                 \"base_size\": \"48.54\",\n        //                 \"limit_price\": \"6.998\",\n        //                 \"stop_price\": \"7.0687\",\n        //                 \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\"\n        //             }\n        //         },\n        //         \"side\": \"SELL\",\n        //         \"client_order_id\": \"e5fe8482-05bb-428f-ad4d-dbc8ce39239c\",\n        //         \"status\": \"OPEN\",\n        //         \"time_in_force\": \"GOOD_UNTIL_CANCELLED\",\n        //         \"created_time\": \"2023-01-16T23:37:23.947030Z\",\n        //         \"completion_percentage\": \"0\",\n        //         \"filled_size\": \"0\",\n        //         \"average_filled_price\": \"0\",\n        //         \"fee\": \"\",\n        //         \"number_of_fills\": \"0\",\n        //         \"filled_value\": \"0\",\n        //         \"pending_cancel\": false,\n        //         \"size_in_quote\": false,\n        //         \"total_fees\": \"0\",\n        //         \"size_inclusive_of_fees\": false,\n        //         \"total_value_after_fees\": \"0\",\n        //         \"trigger_status\": \"INVALID_ORDER_TYPE\",\n        //         \"order_type\": \"LIMIT\",\n        //         \"reject_reason\": \"REJECT_REASON_UNSPECIFIED\",\n        //         \"settled\": false,\n        //         \"product_type\": \"SPOT\",\n        //         \"reject_message\": \"\",\n        //         \"cancel_message\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'product_id');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        if (symbol !== undefined) {\n            market = this.safeMarket (symbol, market);\n        }\n        const orderConfiguration = this.safeDict (order, 'order_configuration', {});\n        const limitGTC = this.safeDict (orderConfiguration, 'limit_limit_gtc');\n        const limitGTD = this.safeDict (orderConfiguration, 'limit_limit_gtd');\n        const limitIOC = this.safeDict (orderConfiguration, 'sor_limit_ioc');\n        const stopLimitGTC = this.safeDict (orderConfiguration, 'stop_limit_stop_limit_gtc');\n        const stopLimitGTD = this.safeDict (orderConfiguration, 'stop_limit_stop_limit_gtd');\n        const marketIOC = this.safeDict (orderConfiguration, 'market_market_ioc');\n        const isLimit = ((limitGTC !== undefined) || (limitGTD !== undefined) || (limitIOC !== undefined));\n        const isStop = ((stopLimitGTC !== undefined) || (stopLimitGTD !== undefined));\n        let price = undefined;\n        let amount = undefined;\n        let postOnly = undefined;\n        let triggerPrice = undefined;\n        if (isLimit) {\n            let target = undefined;\n            if (limitGTC !== undefined) {\n                target = limitGTC;\n            } else if (limitGTD !== undefined) {\n                target = limitGTD;\n            } else {\n                target = limitIOC;\n            }\n            price = this.safeString (target, 'limit_price');\n            amount = this.safeString (target, 'base_size');\n            postOnly = this.safeBool (target, 'post_only');\n        } else if (isStop) {\n            const stopTarget = (stopLimitGTC !== undefined) ? stopLimitGTC : stopLimitGTD;\n            price = this.safeString (stopTarget, 'limit_price');\n            amount = this.safeString (stopTarget, 'base_size');\n            postOnly = this.safeBool (stopTarget, 'post_only');\n            triggerPrice = this.safeString (stopTarget, 'stop_price');\n        } else {\n            amount = this.safeString (marketIOC, 'base_size');\n        }\n        const datetime = this.safeString (order, 'created_time');\n        const totalFees = this.safeString (order, 'total_fees');\n        let currencyFee = undefined;\n        if ((totalFees !== undefined) && (market !== undefined)) {\n            currencyFee = market['quote'];\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'order_id'),\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': this.parseOrderType (this.safeString (order, 'order_type')),\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'time_in_force')),\n            'postOnly': postOnly,\n            'side': this.safeStringLower (order, 'side'),\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'filled': this.safeString (order, 'filled_size'),\n            'remaining': undefined,\n            'cost': undefined,\n            'average': this.safeString (order, 'average_filled_price'),\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'fee': {\n                'cost': this.safeString (order, 'total_fees'),\n                'currency': currencyFee,\n            },\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3359,
        "line_end": 3369,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'OPEN': 'open',\n            'FILLED': 'closed',\n            'CANCELLED': 'canceled',\n            'EXPIRED': 'canceled',\n            'FAILED': 'canceled',\n            'UNKNOWN_ORDER_STATUS': undefined,\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 3371,
        "line_end": 3382,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        if (type === 'UNKNOWN_ORDER_TYPE') {\n            return undefined;\n        }\n        const types: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'STOP': 'limit',\n            'STOP_LIMIT': 'limit',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePortfolioDetails",
        "signature": "parsePortfolioDetails (portfolioData: Dict)",
        "line_start": 5032,
        "line_end": 5078,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "available_balance",
            "value": "availableBalance",
            "comment": null
          },
          {
            "key": "hold_amount",
            "value": "holdAmount > 0 ? holdAmount : 0",
            "comment": null
          },
          {
            "key": "wallet_name",
            "value": "portfolioName",
            "comment": null
          },
          {
            "key": "account_id",
            "value": "portfolioUuid",
            "comment": null
          },
          {
            "key": "account_uuid",
            "value": "this.safeString (position, 'account_uuid', '')",
            "comment": null
          },
          {
            "key": "total_balance_fiat",
            "value": "totalBalanceFiat",
            "comment": null
          },
          {
            "key": "total_balance_crypto",
            "value": "this.parseNumber (this.safeString (position, 'total_balance_crypto', '0'))",
            "comment": null
          },
          {
            "key": "available_to_trade_fiat",
            "value": "this.parseNumber (this.safeString (position, 'available_to_trade_fiat', '0'))",
            "comment": null
          },
          {
            "key": "available_to_trade_crypto",
            "value": "this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0'))",
            "comment": null
          },
          {
            "key": "available_to_transfer_fiat",
            "value": "this.parseNumber (this.safeString (position, 'available_to_transfer_fiat', '0'))",
            "comment": null
          },
          {
            "key": "available_to_transfer_crypto",
            "value": "this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0'))",
            "comment": null
          },
          {
            "key": "allocation",
            "value": "this.parseNumber (this.safeString (position, 'allocation', '0'))",
            "comment": null
          },
          {
            "key": "cost_basis",
            "value": "this.parseNumber (costBasisStr)",
            "comment": null
          },
          {
            "key": "cost_basis_currency",
            "value": "this.safeString (costBasisDict, 'currency', 'USD')",
            "comment": null
          },
          {
            "key": "is_cash",
            "value": "this.safeBool (position, 'is_cash', false)",
            "comment": null
          },
          {
            "key": "average_entry_price",
            "value": "this.parseNumber (averageEntryPriceStr)",
            "comment": null
          },
          {
            "key": "average_entry_price_currency",
            "value": "this.safeString (averageEntryPriceDict, 'currency', 'USD')",
            "comment": null
          },
          {
            "key": "asset_uuid",
            "value": "this.safeString (position, 'asset_uuid', '')",
            "comment": null
          },
          {
            "key": "unrealized_pnl",
            "value": "this.parseNumber (this.safeString (position, 'unrealized_pnl', '0'))",
            "comment": null
          },
          {
            "key": "asset_color",
            "value": "this.safeString (position, 'asset_color', '')",
            "comment": null
          },
          {
            "key": "account_type",
            "value": "this.safeString (position, 'account_type', '')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePortfolioDetails (portfolioData: Dict) {\n        const breakdown = portfolioData['breakdown'];\n        const portfolioInfo = this.safeDict (breakdown, 'portfolio', {});\n        const portfolioName = this.safeString (portfolioInfo, 'name', 'Unknown');\n        const portfolioUuid = this.safeString (portfolioInfo, 'uuid', '');\n        const spotPositions = this.safeList (breakdown, 'spot_positions', []);\n        const parsedPositions = [];\n        for (let i = 0; i < spotPositions.length; i++) {\n            const position: Dict = spotPositions[i];\n            const currencyCode = this.safeString (position, 'asset', 'Unknown');\n            const availableBalanceStr = this.safeString (position, 'available_to_trade_fiat', '0');\n            const availableBalance = this.parseNumber (availableBalanceStr);\n            const totalBalanceFiatStr = this.safeString (position, 'total_balance_fiat', '0');\n            const totalBalanceFiat = this.parseNumber (totalBalanceFiatStr);\n            const holdAmount = totalBalanceFiat - availableBalance;\n            const costBasisDict = this.safeDict (position, 'cost_basis', {});\n            const costBasisStr = this.safeString (costBasisDict, 'value', '0');\n            const averageEntryPriceDict = this.safeDict (position, 'average_entry_price', {});\n            const averageEntryPriceStr = this.safeString (averageEntryPriceDict, 'value', '0');\n            const positionData: Dict = {\n                'currency': currencyCode,\n                'available_balance': availableBalance,\n                'hold_amount': holdAmount > 0 ? holdAmount : 0,\n                'wallet_name': portfolioName,\n                'account_id': portfolioUuid,\n                'account_uuid': this.safeString (position, 'account_uuid', ''),\n                'total_balance_fiat': totalBalanceFiat,\n                'total_balance_crypto': this.parseNumber (this.safeString (position, 'total_balance_crypto', '0')),\n                'available_to_trade_fiat': this.parseNumber (this.safeString (position, 'available_to_trade_fiat', '0')),\n                'available_to_trade_crypto': this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0')),\n                'available_to_transfer_fiat': this.parseNumber (this.safeString (position, 'available_to_transfer_fiat', '0')),\n                'available_to_transfer_crypto': this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0')),\n                'allocation': this.parseNumber (this.safeString (position, 'allocation', '0')),\n                'cost_basis': this.parseNumber (costBasisStr),\n                'cost_basis_currency': this.safeString (costBasisDict, 'currency', 'USD'),\n                'is_cash': this.safeBool (position, 'is_cash', false),\n                'average_entry_price': this.parseNumber (averageEntryPriceStr),\n                'average_entry_price_currency': this.safeString (averageEntryPriceDict, 'currency', 'USD'),\n                'asset_uuid': this.safeString (position, 'asset_uuid', ''),\n                'unrealized_pnl': this.parseNumber (this.safeString (position, 'unrealized_pnl', '0')),\n                'asset_color': this.safeString (position, 'asset_color', ''),\n                'account_type': this.safeString (position, 'account_type', ''),\n            };\n            parsedPositions.push (positionData);\n        }\n        return parsedPositions;\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 4814,
        "line_end": 4949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'product_id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (notionalObject, 'value')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (vwapObject, 'value')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (unrealizedPNLObject, 'value')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'net_size')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "market['contractSize']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (summaryObject, 'collateral')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"product_id\": \"1r4njf84-0-0\",\n     \"product_uuid\": \"cd34c18b-3665-4ed8-9305-3db277c49fc5\",\n     \"symbol\": \"ADA-PERP-INTX\",\n     \"vwap\": {\n        \"value\": \"0.6171\",\n        \"currency\": \"USDC\"\n     },\n     \"position_side\": \"POSITION_SIDE_LONG\",\n     \"net_size\": \"20\",\n     \"buy_order_size\": \"0\",\n     \"sell_order_size\": \"0\",\n     \"im_contribution\": \"0.1\",\n     \"unrealized_pnl\": {\n        \"value\": \"0.074\",\n        \"currency\": \"USDC\"\n     },\n     \"mark_price\": {\n        \"value\": \"0.6208\",\n        \"currency\": \"USDC\"\n     },\n     \"liquidation_price\": {\n        \"value\": \"0\",\n        \"currency\": \"USDC\"\n     },\n     \"leverage\": \"1\",\n     \"im_notional\": {\n        \"value\": \"12.342\",\n        \"currency\": \"USDC\"\n     },\n     \"mm_notional\": {\n        \"value\": \"0.814572\",\n        \"currency\": \"USDC\"\n     },\n     \"position_notional\": {\n        \"value\": \"12.342\",\n        \"currency\": \"USDC\"\n     },\n     \"margin_type\": \"MARGIN_TYPE_CROSS\",\n     \"liquidation_buffer\": \"19.677828\",\n     \"liquidation_percentage\": \"4689.3506\",\n     \"portfolio_summary\": {\n        \"portfolio_uuid\": \"018ebd63-1f6d-7c8e-ada9-0761c5a2235f\",\n        \"collateral\": \"20.4184\",\n        \"position_notional\": \"12.342\",\n        \"open_position_notional\": \"12.342\",\n        \"pending_fees\": \"0\",\n        \"borrow\": \"0\",\n        \"accrued_interest\": \"0\",\n        \"rolling_debt\": \"0\",\n        \"portfolio_initial_margin\": \"0.1\",\n        \"portfolio_im_notional\": {\n           \"value\": \"12.342\",\n           \"currency\": \"USDC\"\n        },\n        \"portfolio_maintenance_margin\": \"0.066\",\n        \"portfolio_mm_notional\": {\n           \"value\": \"0.814572\",\n           \"currency\": \"USDC\"\n        },\n        \"liquidation_percentage\": \"4689.3506\",\n        \"liquidation_buffer\": \"19.677828\",\n        \"margin_type\": \"MARGIN_TYPE_CROSS\",\n        \"margin_flags\": \"PORTFOLIO_MARGIN_FLAGS_UNSPECIFIED\",\n        \"liquidation_status\": \"PORTFOLIO_LIQUIDATION_STATUS_NOT_LIQUIDATING\",\n        \"unrealized_pnl\": {\n           \"value\": \"0.074\",\n           \"currency\": \"USDC\"\n        },\n        \"buying_power\": {\n           \"value\": \"8.1504\",\n           \"currency\": \"USDC\"\n        },\n        \"total_balance\": {\n           \"value\": \"20.4924\",\n           \"currency\": \"USDC\"\n        },\n        \"max_withdrawal\": {\n           \"value\": \"8.0764\",\n           \"currency\": \"USDC\"\n        }\n     },\n     \"entry_vwap\": {\n        \"value\": \"0.6091\",\n        \"currency\": \"USDC\"\n     }\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"product_id\": \"1r4njf84-0-0\",\n        //     \"product_uuid\": \"cd34c18b-3665-4ed8-9305-3db277c49fc5\",\n        //     \"symbol\": \"ADA-PERP-INTX\",\n        //     \"vwap\": {\n        //        \"value\": \"0.6171\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"position_side\": \"POSITION_SIDE_LONG\",\n        //     \"net_size\": \"20\",\n        //     \"buy_order_size\": \"0\",\n        //     \"sell_order_size\": \"0\",\n        //     \"im_contribution\": \"0.1\",\n        //     \"unrealized_pnl\": {\n        //        \"value\": \"0.074\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"mark_price\": {\n        //        \"value\": \"0.6208\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"liquidation_price\": {\n        //        \"value\": \"0\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"leverage\": \"1\",\n        //     \"im_notional\": {\n        //        \"value\": \"12.342\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"mm_notional\": {\n        //        \"value\": \"0.814572\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"position_notional\": {\n        //        \"value\": \"12.342\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"margin_type\": \"MARGIN_TYPE_CROSS\",\n        //     \"liquidation_buffer\": \"19.677828\",\n        //     \"liquidation_percentage\": \"4689.3506\",\n        //     \"portfolio_summary\": {\n        //        \"portfolio_uuid\": \"018ebd63-1f6d-7c8e-ada9-0761c5a2235f\",\n        //        \"collateral\": \"20.4184\",\n        //        \"position_notional\": \"12.342\",\n        //        \"open_position_notional\": \"12.342\",\n        //        \"pending_fees\": \"0\",\n        //        \"borrow\": \"0\",\n        //        \"accrued_interest\": \"0\",\n        //        \"rolling_debt\": \"0\",\n        //        \"portfolio_initial_margin\": \"0.1\",\n        //        \"portfolio_im_notional\": {\n        //           \"value\": \"12.342\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"portfolio_maintenance_margin\": \"0.066\",\n        //        \"portfolio_mm_notional\": {\n        //           \"value\": \"0.814572\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"liquidation_percentage\": \"4689.3506\",\n        //        \"liquidation_buffer\": \"19.677828\",\n        //        \"margin_type\": \"MARGIN_TYPE_CROSS\",\n        //        \"margin_flags\": \"PORTFOLIO_MARGIN_FLAGS_UNSPECIFIED\",\n        //        \"liquidation_status\": \"PORTFOLIO_LIQUIDATION_STATUS_NOT_LIQUIDATING\",\n        //        \"unrealized_pnl\": {\n        //           \"value\": \"0.074\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"buying_power\": {\n        //           \"value\": \"8.1504\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"total_balance\": {\n        //           \"value\": \"20.4924\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"max_withdrawal\": {\n        //           \"value\": \"8.0764\",\n        //           \"currency\": \"USDC\"\n        //        }\n        //     },\n        //     \"entry_vwap\": {\n        //        \"value\": \"0.6091\",\n        //        \"currency\": \"USDC\"\n        //     }\n        // }\n        //\n        const marketId = this.safeString (position, 'symbol', '');\n        market = this.safeMarket (marketId, market);\n        const rawMargin = this.safeString (position, 'margin_type');\n        let marginMode = undefined;\n        if (rawMargin !== undefined) {\n            marginMode = (rawMargin === 'MARGIN_TYPE_CROSS') ? 'cross' : 'isolated';\n        }\n        const notionalObject = this.safeDict (position, 'position_notional', {});\n        const positionSide = this.safeString (position, 'position_side');\n        const side = (positionSide === 'POSITION_SIDE_LONG') ? 'long' : 'short';\n        const unrealizedPNLObject = this.safeDict (position, 'unrealized_pnl', {});\n        const liquidationPriceObject = this.safeDict (position, 'liquidation_price', {});\n        const liquidationPrice = this.safeNumber (liquidationPriceObject, 'value');\n        const vwapObject = this.safeDict (position, 'vwap', {});\n        const summaryObject = this.safeDict (position, 'portfolio_summary', {});\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'product_id'),\n            'symbol': this.safeSymbol (marketId, market),\n            'notional': this.safeNumber (notionalObject, 'value'),\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.safeNumber (vwapObject, 'value'),\n            'unrealizedPnl': this.safeNumber (unrealizedPNLObject, 'value'),\n            'realizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'net_size'),\n            'contractSize': market['contractSize'],\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': side,\n            'hedged': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': this.safeNumber (summaryObject, 'collateral'),\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber (position, 'leverage'),\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSpotMarket",
        "signature": "parseSpotMarket (market, feeTier): MarketInterface",
        "line_start": 1575,
        "line_end": 1670,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "(marketType === 'spot')",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "!tradingDisabled",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "takerFee",
            "comment": null
          },
          {
            "key": "maker",
            "value": "makerFee",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"product_id\": \"TONE-USD\",\n             \"price\": \"0.01523\",\n             \"price_percentage_change_24h\": \"1.94109772423025\",\n             \"volume_24h\": \"19773129\",\n             \"volume_percentage_change_24h\": \"437.0170530929949\",\n             \"base_increment\": \"1\",\n             \"quote_increment\": \"0.00001\",\n             \"quote_min_size\": \"1\",\n             \"quote_max_size\": \"10000000\",\n             \"base_min_size\": \"26.7187147229469674\",\n             \"base_max_size\": \"267187147.2294696735908216\",\n             \"base_name\": \"TE-FOOD\",\n             \"quote_name\": \"US Dollar\",\n             \"watched\": false,\n             \"is_disabled\": false,\n             \"new\": false,\n             \"status\": \"online\",\n             \"cancel_only\": false,\n             \"limit_only\": false,\n             \"post_only\": false,\n             \"trading_disabled\": false,\n             \"auction_mode\": false,\n             \"product_type\": \"SPOT\",\n             \"quote_currency_id\": \"USD\",\n             \"base_currency_id\": \"TONE\",\n             \"fcm_trading_session_details\": null,\n             \"mid_market_price\": \"\"\n         }"
        ],
        "source": "parseSpotMarket (market, feeTier): MarketInterface {\n        //\n        //         {\n        //             \"product_id\": \"TONE-USD\",\n        //             \"price\": \"0.01523\",\n        //             \"price_percentage_change_24h\": \"1.94109772423025\",\n        //             \"volume_24h\": \"19773129\",\n        //             \"volume_percentage_change_24h\": \"437.0170530929949\",\n        //             \"base_increment\": \"1\",\n        //             \"quote_increment\": \"0.00001\",\n        //             \"quote_min_size\": \"1\",\n        //             \"quote_max_size\": \"10000000\",\n        //             \"base_min_size\": \"26.7187147229469674\",\n        //             \"base_max_size\": \"267187147.2294696735908216\",\n        //             \"base_name\": \"TE-FOOD\",\n        //             \"quote_name\": \"US Dollar\",\n        //             \"watched\": false,\n        //             \"is_disabled\": false,\n        //             \"new\": false,\n        //             \"status\": \"online\",\n        //             \"cancel_only\": false,\n        //             \"limit_only\": false,\n        //             \"post_only\": false,\n        //             \"trading_disabled\": false,\n        //             \"auction_mode\": false,\n        //             \"product_type\": \"SPOT\",\n        //             \"quote_currency_id\": \"USD\",\n        //             \"base_currency_id\": \"TONE\",\n        //             \"fcm_trading_session_details\": null,\n        //             \"mid_market_price\": \"\"\n        //         }\n        //\n        const id = this.safeString (market, 'product_id');\n        const baseId = this.safeString (market, 'base_currency_id');\n        const quoteId = this.safeString (market, 'quote_currency_id');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const marketType = this.safeStringLower (market, 'product_type');\n        const tradingDisabled = this.safeBool (market, 'trading_disabled');\n        const stablePairs = this.safeList (this.options, 'stablePairs', []);\n        const defaultTakerFee = this.safeNumber (this.fees['trading'], 'taker');\n        const defaultMakerFee = this.safeNumber (this.fees['trading'], 'maker');\n        const takerFee = this.inArray (id, stablePairs) ? 0.00001 : this.safeNumber (feeTier, 'taker_fee_rate', defaultTakerFee);\n        const makerFee = this.inArray (id, stablePairs) ? 0.0 : this.safeNumber (feeTier, 'maker_fee_rate', defaultMakerFee);\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': marketType,\n            'spot': (marketType === 'spot'),\n            'margin': undefined,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': !tradingDisabled,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': takerFee,\n            'maker': makerFee,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2240,
        "line_end": 2371,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (ticker, 'price_percentage_change_24h')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (ticker, 'volume_24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (ticker, 'approximate_quote_24h_volume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"bid\": 20713.37,\n         \"ask\": 20924.65,\n         \"price\": 20809.83\n     }",
          "{\n         \"trade_id\": \"10209805\",\n         \"product_id\": \"BTC-USDT\",\n         \"price\": \"19381.27\",\n         \"size\": \"0.1\",\n         \"time\": \"2023-01-13T20:35:41.865970Z\",\n         \"side\": \"BUY\",\n         \"bid\": \"\",\n         \"ask\": \"\"\n     }",
          "[\n        {\n            \"product_id\": \"ETH-USD\",\n            \"price\": \"4471.59\",\n            \"price_percentage_change_24h\": \"0.14243387238731\",\n            \"volume_24h\": \"87329.92990204\",\n            \"volume_percentage_change_24h\": \"-60.7789801794578\",\n            \"base_increment\": \"0.00000001\",\n            \"quote_increment\": \"0.01\",\n            \"quote_min_size\": \"1\",\n            \"quote_max_size\": \"150000000\",\n            \"base_min_size\": \"0.00000001\",\n            \"base_max_size\": \"42000\",\n            \"base_name\": \"Ethereum\",\n            \"quote_name\": \"US Dollar\",\n            \"watched\": false,\n            \"is_disabled\": false,\n            \"new\": false,\n            \"status\": \"online\",\n            \"cancel_only\": false,\n            \"limit_only\": false,\n            \"post_only\": false,\n            \"trading_disabled\": false,\n            \"auction_mode\": false,\n            \"product_type\": \"SPOT\",\n            \"quote_currency_id\": \"USD\",\n            \"base_currency_id\": \"ETH\",\n            \"fcm_trading_session_details\": null,\n            \"mid_market_price\": \"\",\n            \"alias\": \"\",\n            \"alias_to\": [ \"ETH-USDC\" ],\n            \"base_display_symbol\": \"ETH\",\n            \"quote_display_symbol\": \"USD\",\n            \"view_only\": false,\n            \"price_increment\": \"0.01\",\n            \"display_name\": \"ETH-USD\",\n            \"product_venue\": \"CBE\",\n            \"approximate_quote_24h_volume\": \"390503641.25\",\n            \"new_at\": \"2023-01-01T00:00:00Z\"\n         },\n         ...\n     ]",
          "{\n         \"product_id\": \"TRAC-EUR\",\n         \"bids\": [\n             {\n                 \"price\": \"0.2384\",\n                 \"size\": \"386.1\"\n             }\n         ],\n         \"asks\": [\n             {\n                 \"price\": \"0.2406\",\n                 \"size\": \"672\"\n             }\n         ],\n         \"time\": \"2023-06-30T07:15:24.656044Z\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTickerV2\n        //\n        //     {\n        //         \"bid\": 20713.37,\n        //         \"ask\": 20924.65,\n        //         \"price\": 20809.83\n        //     }\n        //\n        // fetchTickerV3\n        //\n        //     {\n        //         \"trade_id\": \"10209805\",\n        //         \"product_id\": \"BTC-USDT\",\n        //         \"price\": \"19381.27\",\n        //         \"size\": \"0.1\",\n        //         \"time\": \"2023-01-13T20:35:41.865970Z\",\n        //         \"side\": \"BUY\",\n        //         \"bid\": \"\",\n        //         \"ask\": \"\"\n        //     }\n        //\n        // fetchTickersV2\n        //\n        //     \"48691.23\"\n        //\n        // fetchTickersV3\n        //\n        //     [\n        //        {\n        //            \"product_id\": \"ETH-USD\",\n        //            \"price\": \"4471.59\",\n        //            \"price_percentage_change_24h\": \"0.14243387238731\",\n        //            \"volume_24h\": \"87329.92990204\",\n        //            \"volume_percentage_change_24h\": \"-60.7789801794578\",\n        //            \"base_increment\": \"0.00000001\",\n        //            \"quote_increment\": \"0.01\",\n        //            \"quote_min_size\": \"1\",\n        //            \"quote_max_size\": \"150000000\",\n        //            \"base_min_size\": \"0.00000001\",\n        //            \"base_max_size\": \"42000\",\n        //            \"base_name\": \"Ethereum\",\n        //            \"quote_name\": \"US Dollar\",\n        //            \"watched\": false,\n        //            \"is_disabled\": false,\n        //            \"new\": false,\n        //            \"status\": \"online\",\n        //            \"cancel_only\": false,\n        //            \"limit_only\": false,\n        //            \"post_only\": false,\n        //            \"trading_disabled\": false,\n        //            \"auction_mode\": false,\n        //            \"product_type\": \"SPOT\",\n        //            \"quote_currency_id\": \"USD\",\n        //            \"base_currency_id\": \"ETH\",\n        //            \"fcm_trading_session_details\": null,\n        //            \"mid_market_price\": \"\",\n        //            \"alias\": \"\",\n        //            \"alias_to\": [ \"ETH-USDC\" ],\n        //            \"base_display_symbol\": \"ETH\",\n        //            \"quote_display_symbol\": \"USD\",\n        //            \"view_only\": false,\n        //            \"price_increment\": \"0.01\",\n        //            \"display_name\": \"ETH-USD\",\n        //            \"product_venue\": \"CBE\",\n        //            \"approximate_quote_24h_volume\": \"390503641.25\",\n        //            \"new_at\": \"2023-01-01T00:00:00Z\"\n        //         },\n        //         ...\n        //     ]\n        //\n        // fetchBidsAsks\n        //\n        //     {\n        //         \"product_id\": \"TRAC-EUR\",\n        //         \"bids\": [\n        //             {\n        //                 \"price\": \"0.2384\",\n        //                 \"size\": \"386.1\"\n        //             }\n        //         ],\n        //         \"asks\": [\n        //             {\n        //                 \"price\": \"0.2406\",\n        //                 \"size\": \"672\"\n        //             }\n        //         ],\n        //         \"time\": \"2023-06-30T07:15:24.656044Z\"\n        //     }\n        //\n        let bid = this.safeNumber (ticker, 'bid');\n        let ask = this.safeNumber (ticker, 'ask');\n        let bidVolume = undefined;\n        let askVolume = undefined;\n        if (('bids' in ticker)) {\n            const bids = this.safeList (ticker, 'bids', []);\n            const asks = this.safeList (ticker, 'asks', []);\n            const firstBid = this.safeDict (bids, 0, {});\n            const firstAsk = this.safeDict (asks, 0, {});\n            bid = this.safeNumber (firstBid, 'price');\n            bidVolume = this.safeNumber (firstBid, 'size');\n            ask = this.safeNumber (firstAsk, 'price');\n            askVolume = this.safeNumber (firstAsk, 'size');\n        }\n        const marketId = this.safeString (ticker, 'product_id');\n        market = this.safeMarket (marketId, market);\n        const last = this.safeNumber (ticker, 'price');\n        const datetime = this.safeString (ticker, 'time');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'bid': bid,\n            'ask': ask,\n            'last': last,\n            'high': undefined,\n            'low': undefined,\n            'bidVolume': bidVolume,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeNumber (ticker, 'price_percentage_change_24h'),\n            'average': undefined,\n            'baseVolume': this.safeNumber (ticker, 'volume_24h'),\n            'quoteVolume': this.safeNumber (ticker, 'approximate_quote_24h_volume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 3384,
        "line_end": 3393,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GOOD_UNTIL_CANCELLED': 'GTC',\n            'GOOD_UNTIL_DATE_TIME': 'GTD',\n            'IMMEDIATE_OR_CANCEL': 'IOC',\n            'FILL_OR_KILL': 'FOK',\n            'UNKNOWN_TIME_IN_FORCE': undefined,\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1195,
        "line_end": 1325,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'id', 'trade_id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "(side === 'unknown_order_side') ? undefined : side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "(takerOrMaker === 'unknown_liquidity_indicator') ? undefined : takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"67e0eaec-07d7-54c4-a72c-2e92826897df\",\n         \"status\": \"completed\",\n         \"payment_method\": {\n             \"id\": \"83562370-3e5c-51db-87da-752af5ab9559\",\n             \"resource\": \"payment_method\",\n             \"resource_path\": \"/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559\"\n         },\n         \"transaction\": {\n             \"id\": \"441b9494-b3f0-5b98-b9b0-4d82c21c252a\",\n             \"resource\": \"transaction\",\n             \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a\"\n         },\n         \"amount\": { \"amount\": \"1.00000000\", \"currency\": \"BTC\" },\n         \"total\": { \"amount\": \"10.25\", \"currency\": \"USD\" },\n         \"subtotal\": { \"amount\": \"10.10\", \"currency\": \"USD\" },\n         \"created_at\": \"2015-01-31T20:49:02Z\",\n         \"updated_at\": \"2015-02-11T16:54:02-08:00\",\n         \"resource\": \"buy\",\n         \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/67e0eaec-07d7-54c4-a72c-2e92826897df\",\n         \"committed\": true,\n         \"instant\": false,\n         \"fee\": { \"amount\": \"0.15\", \"currency\": \"USD\" },\n         \"payout_at\": \"2015-02-18T16:54:00-08:00\"\n     }",
          "{\n         \"trade_id\": \"10092327\",\n         \"product_id\": \"BTC-USDT\",\n         \"price\": \"17488.12\",\n         \"size\": \"0.0000623\",\n         \"time\": \"2023-01-11T00:52:37.557001Z\",\n         \"side\": \"BUY\",\n         \"bid\": \"\",\n         \"ask\": \"\"\n     }",
          "{\n         \"entry_id\": \"b88b82cc89e326a2778874795102cbafd08dd979a2a7a3c69603fc4c23c2e010\",\n         \"trade_id\": \"cdc39e45-bbd3-44ec-bf02-61742dfb16a1\",\n         \"order_id\": \"813a53c5-3e39-47bb-863d-2faf685d22d8\",\n         \"trade_time\": \"2023-01-18T01:37:38.091377090Z\",\n         \"trade_type\": \"FILL\",\n         \"price\": \"21220.64\",\n         \"size\": \"0.0046830664333996\",\n         \"commission\": \"0.0000280983986004\",\n         \"product_id\": \"BTC-USDT\",\n         \"sequence_timestamp\": \"2023-01-18T01:37:38.092520Z\",\n         \"liquidity_indicator\": \"UNKNOWN_LIQUIDITY_INDICATOR\",\n         \"size_in_quote\": true,\n         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n         \"side\": \"BUY\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchMyBuys, fetchMySells\n        //\n        //     {\n        //         \"id\": \"67e0eaec-07d7-54c4-a72c-2e92826897df\",\n        //         \"status\": \"completed\",\n        //         \"payment_method\": {\n        //             \"id\": \"83562370-3e5c-51db-87da-752af5ab9559\",\n        //             \"resource\": \"payment_method\",\n        //             \"resource_path\": \"/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559\"\n        //         },\n        //         \"transaction\": {\n        //             \"id\": \"441b9494-b3f0-5b98-b9b0-4d82c21c252a\",\n        //             \"resource\": \"transaction\",\n        //             \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a\"\n        //         },\n        //         \"amount\": { \"amount\": \"1.00000000\", \"currency\": \"BTC\" },\n        //         \"total\": { \"amount\": \"10.25\", \"currency\": \"USD\" },\n        //         \"subtotal\": { \"amount\": \"10.10\", \"currency\": \"USD\" },\n        //         \"created_at\": \"2015-01-31T20:49:02Z\",\n        //         \"updated_at\": \"2015-02-11T16:54:02-08:00\",\n        //         \"resource\": \"buy\",\n        //         \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/67e0eaec-07d7-54c4-a72c-2e92826897df\",\n        //         \"committed\": true,\n        //         \"instant\": false,\n        //         \"fee\": { \"amount\": \"0.15\", \"currency\": \"USD\" },\n        //         \"payout_at\": \"2015-02-18T16:54:00-08:00\"\n        //     }\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"trade_id\": \"10092327\",\n        //         \"product_id\": \"BTC-USDT\",\n        //         \"price\": \"17488.12\",\n        //         \"size\": \"0.0000623\",\n        //         \"time\": \"2023-01-11T00:52:37.557001Z\",\n        //         \"side\": \"BUY\",\n        //         \"bid\": \"\",\n        //         \"ask\": \"\"\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"entry_id\": \"b88b82cc89e326a2778874795102cbafd08dd979a2a7a3c69603fc4c23c2e010\",\n        //         \"trade_id\": \"cdc39e45-bbd3-44ec-bf02-61742dfb16a1\",\n        //         \"order_id\": \"813a53c5-3e39-47bb-863d-2faf685d22d8\",\n        //         \"trade_time\": \"2023-01-18T01:37:38.091377090Z\",\n        //         \"trade_type\": \"FILL\",\n        //         \"price\": \"21220.64\",\n        //         \"size\": \"0.0046830664333996\",\n        //         \"commission\": \"0.0000280983986004\",\n        //         \"product_id\": \"BTC-USDT\",\n        //         \"sequence_timestamp\": \"2023-01-18T01:37:38.092520Z\",\n        //         \"liquidity_indicator\": \"UNKNOWN_LIQUIDITY_INDICATOR\",\n        //         \"size_in_quote\": true,\n        //         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n        //         \"side\": \"BUY\"\n        //     }\n        //\n        let symbol = undefined;\n        const totalObject = this.safeDict (trade, 'total', {});\n        const amountObject = this.safeDict (trade, 'amount', {});\n        const subtotalObject = this.safeDict (trade, 'subtotal', {});\n        const feeObject = this.safeDict (trade, 'fee', {});\n        const marketId = this.safeString (trade, 'product_id');\n        market = this.safeMarket (marketId, market, '-');\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        } else {\n            const baseId = this.safeString (amountObject, 'currency');\n            const quoteId = this.safeString (totalObject, 'currency');\n            if ((baseId !== undefined) && (quoteId !== undefined)) {\n                const base = this.safeCurrencyCode (baseId);\n                const quote = this.safeCurrencyCode (quoteId);\n                symbol = base + '/' + quote;\n            }\n        }\n        const sizeInQuote = this.safeBool (trade, 'size_in_quote');\n        const v3Price = this.safeString (trade, 'price');\n        let v3Cost = undefined;\n        let v3Amount = this.safeString (trade, 'size');\n        if (sizeInQuote) {\n            // calculate base size\n            v3Cost = v3Amount;\n            v3Amount = Precise.stringDiv (v3Amount, v3Price);\n        }\n        const v3FeeCost = this.safeString (trade, 'commission');\n        const amountString = this.safeString (amountObject, 'amount', v3Amount);\n        const costString = this.safeString (subtotalObject, 'amount', v3Cost);\n        let priceString = undefined;\n        let cost = undefined;\n        if ((costString !== undefined) && (amountString !== undefined)) {\n            priceString = Precise.stringDiv (costString, amountString);\n        } else {\n            priceString = v3Price;\n        }\n        if ((priceString !== undefined) && (amountString !== undefined)) {\n            cost = Precise.stringMul (priceString, amountString);\n        } else {\n            cost = costString;\n        }\n        let feeCurrencyId = this.safeString (feeObject, 'currency');\n        const feeCost = this.safeNumber (feeObject, 'amount', this.parseNumber (v3FeeCost));\n        if ((feeCurrencyId === undefined) && (market !== undefined) && (feeCost !== undefined)) {\n            feeCurrencyId = market['quote'];\n        }\n        const datetime = this.safeStringN (trade, [ 'created_at', 'trade_time', 'time' ]);\n        const side = this.safeStringLower2 (trade, 'resource', 'side');\n        const takerOrMaker = this.safeStringLower (trade, 'liquidity_indicator');\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'id', 'trade_id'),\n            'order': this.safeString (trade, 'order_id'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'symbol': symbol,\n            'type': undefined,\n            'side': (side === 'unknown_order_side') ? undefined : side,\n            'takerOrMaker': (takerOrMaker === 'unknown_liquidity_indicator') ? undefined : takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': cost,\n            'fee': {\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            },\n        });\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 979,
        "line_end": 1193,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (network, 'hash', id)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountStringAbs)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.parse8601 (this.safeString (transaction, 'updated_at'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (feeObject, 'amount'),\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (feeObject, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"f34c19f3-b730-5e3d-9f72\",\n         \"status\": \"completed\",\n         \"payment_method\": {\n             \"id\": \"a022b31d-f9c7-5043-98f2\",\n             \"resource\": \"payment_method\",\n             \"resource_path\": \"/v2/payment-methods/a022b31d-f9c7-5043-98f2\"\n         },\n         \"transaction\": {\n             \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n             \"resource\": \"transaction\",\n             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86\"\n         },\n         \"user_reference\": \"2VTYTH\",\n         \"created_at\": \"2017-02-09T07:01:18Z\",\n         \"updated_at\": \"2017-02-09T07:01:26Z\",\n         \"resource\": \"deposit\",\n         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72\",\n         \"committed\": true,\n         \"payout_at\": \"2017-02-12T07:01:17Z\",\n         \"instant\": false,\n         \"fee\": { \"amount\": \"0.00\", \"currency\": \"EUR\" },\n         \"amount\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n         \"subtotal\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n         \"hold_until\": null,\n         \"hold_days\": 0,\n         \"hold_business_days\": 0,\n         \"next_step\": null\n     }",
          "{\n         \"id\": \"cfcc3b4a-eeb6-5e8c-8058\",\n         \"status\": \"completed\",\n         \"payment_method\": {\n             \"id\": \"8b94cfa4-f7fd-5a12-a76a\",\n             \"resource\": \"payment_method\",\n             \"resource_path\": \"/v2/payment-methods/8b94cfa4-f7fd-5a12-a76a\"\n         },\n         \"transaction\": {\n             \"id\": \"fcc2550b-5104-5f83-a444\",\n             \"resource\": \"transaction\",\n             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/fcc2550b-5104-5f83-a444\"\n         },\n         \"user_reference\": \"MEUGK\",\n         \"created_at\": \"2018-07-26T08:55:12Z\",\n         \"updated_at\": \"2018-07-26T08:58:18Z\",\n         \"resource\": \"withdrawal\",\n         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/cfcc3b4a-eeb6-5e8c-8058\",\n         \"committed\": true,\n         \"payout_at\": \"2018-07-31T08:55:12Z\",\n         \"instant\": false,\n         \"fee\": { \"amount\": \"0.15\", \"currency\": \"EUR\" },\n         \"amount\": { \"amount\": \"13130.69\", \"currency\": \"EUR\" },\n         \"subtotal\": { \"amount\": \"13130.84\", \"currency\": \"EUR\" },\n         \"idem\": \"e549dee5-63ed-4e79-8a96\",\n         \"next_step\": null\n     }",
          "{\n         \"id\": \"a1794ecf-5693-55fa-70cf-ef731748ed82\",\n         \"type\": \"send\",\n         \"status\": \"pending\",\n         \"amount\": {\n             \"amount\": \"-14.008308\",\n             \"currency\": \"USDC\"\n         },\n         \"native_amount\": {\n             \"amount\": \"-18.74\",\n             \"currency\": \"CAD\"\n         },\n         \"description\": null,\n         \"created_at\": \"2024-01-12T01:27:31Z\",\n         \"updated_at\": \"2024-01-12T01:27:31Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82\",\n         \"instant_exchange\": false,\n         \"network\": {\n             \"status\": \"pending\",\n             \"status_description\": \"Pending (est. less than 10 minutes)\",\n             \"transaction_fee\": {\n                 \"amount\": \"4.008308\",\n                 \"currency\": \"USDC\"\n             },\n             \"transaction_amount\": {\n                 \"amount\": \"10.000000\",\n                 \"currency\": \"USDC\"\n             },\n             \"confirmations\": 0\n         },\n         \"to\": {\n             \"resource\": \"ethereum_address\",\n             \"address\": \"0x9...\",\n             \"currency\": \"USDC\",\n             \"address_info\": {\n                 \"address\": \"0x9...\"\n             }\n         },\n         \"idem\": \"748d8591-dg9a-7831-a45b-crd61dg78762\",\n         \"details\": {\n             \"title\": \"Sent USDC\",\n             \"subtitle\": \"To USDC address on Ethereum network\",\n             \"header\": \"Sent 14.008308 USDC ($18.74)\",\n             \"health\": \"warning\"\n         },\n         \"hide_native_amount\": false\n     }",
          "{\n        \"amount\": {\n            \"amount\": \"0.00014200\", (negative for withdrawal)\n            \"currency\": \"BTC\"\n        },\n        \"created_at\": \"2024-03-29T15:48:30Z\",\n        \"id\": \"0031a605-241d-514d-a97b-d4b99f3225d3\",\n        \"idem\": \"092a979b-017e-4403-940a-2ca57811f442\", // field present only in case of withdrawal\n        \"native_amount\": {\n            \"amount\": \"9.85\", (negative for withdrawal)\n            \"currency\": \"USD\"\n        },\n        \"network\": {\n            \"status\": \"pending\", // if status is `off_blockchain` then no more other fields are present in this object\n            \"hash\": \"5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE\",\n            \"network_name\": \"solana\",\n            \"transaction_fee\": {\n                \"amount\": \"0.000100000\",\n                \"currency\": \"SOL\"\n            }\n        },\n        \"resource\": \"transaction\",\n        \"resource_path\": \"/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3\",\n        \"status\": \"completed\",\n        \"type\": \"send\",\n        \"from\": { // in some cases, field might be present for deposit\n            \"id\": \"7fd10cd7-b091-5cee-ba41-c29e49a7cccf\",\n            \"name\": \"Coinbase\",\n            \"resource\": \"user\"\n        },\n        \"to\": { // field only present for withdrawal\n            \"address\": \"5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE\",\n            \"resource\": \"address\"\n        },\n        \"description\": \"C3 - One Time BTC Credit . Reference Case # 123.\", //  in some cases, field might be present for deposit\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fiat deposit\n        //\n        //     {\n        //         \"id\": \"f34c19f3-b730-5e3d-9f72\",\n        //         \"status\": \"completed\",\n        //         \"payment_method\": {\n        //             \"id\": \"a022b31d-f9c7-5043-98f2\",\n        //             \"resource\": \"payment_method\",\n        //             \"resource_path\": \"/v2/payment-methods/a022b31d-f9c7-5043-98f2\"\n        //         },\n        //         \"transaction\": {\n        //             \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n        //             \"resource\": \"transaction\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86\"\n        //         },\n        //         \"user_reference\": \"2VTYTH\",\n        //         \"created_at\": \"2017-02-09T07:01:18Z\",\n        //         \"updated_at\": \"2017-02-09T07:01:26Z\",\n        //         \"resource\": \"deposit\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72\",\n        //         \"committed\": true,\n        //         \"payout_at\": \"2017-02-12T07:01:17Z\",\n        //         \"instant\": false,\n        //         \"fee\": { \"amount\": \"0.00\", \"currency\": \"EUR\" },\n        //         \"amount\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n        //         \"subtotal\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n        //         \"hold_until\": null,\n        //         \"hold_days\": 0,\n        //         \"hold_business_days\": 0,\n        //         \"next_step\": null\n        //     }\n        //\n        // fiat_withdrawal\n        //\n        //     {\n        //         \"id\": \"cfcc3b4a-eeb6-5e8c-8058\",\n        //         \"status\": \"completed\",\n        //         \"payment_method\": {\n        //             \"id\": \"8b94cfa4-f7fd-5a12-a76a\",\n        //             \"resource\": \"payment_method\",\n        //             \"resource_path\": \"/v2/payment-methods/8b94cfa4-f7fd-5a12-a76a\"\n        //         },\n        //         \"transaction\": {\n        //             \"id\": \"fcc2550b-5104-5f83-a444\",\n        //             \"resource\": \"transaction\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/fcc2550b-5104-5f83-a444\"\n        //         },\n        //         \"user_reference\": \"MEUGK\",\n        //         \"created_at\": \"2018-07-26T08:55:12Z\",\n        //         \"updated_at\": \"2018-07-26T08:58:18Z\",\n        //         \"resource\": \"withdrawal\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/cfcc3b4a-eeb6-5e8c-8058\",\n        //         \"committed\": true,\n        //         \"payout_at\": \"2018-07-31T08:55:12Z\",\n        //         \"instant\": false,\n        //         \"fee\": { \"amount\": \"0.15\", \"currency\": \"EUR\" },\n        //         \"amount\": { \"amount\": \"13130.69\", \"currency\": \"EUR\" },\n        //         \"subtotal\": { \"amount\": \"13130.84\", \"currency\": \"EUR\" },\n        //         \"idem\": \"e549dee5-63ed-4e79-8a96\",\n        //         \"next_step\": null\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": \"a1794ecf-5693-55fa-70cf-ef731748ed82\",\n        //         \"type\": \"send\",\n        //         \"status\": \"pending\",\n        //         \"amount\": {\n        //             \"amount\": \"-14.008308\",\n        //             \"currency\": \"USDC\"\n        //         },\n        //         \"native_amount\": {\n        //             \"amount\": \"-18.74\",\n        //             \"currency\": \"CAD\"\n        //         },\n        //         \"description\": null,\n        //         \"created_at\": \"2024-01-12T01:27:31Z\",\n        //         \"updated_at\": \"2024-01-12T01:27:31Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82\",\n        //         \"instant_exchange\": false,\n        //         \"network\": {\n        //             \"status\": \"pending\",\n        //             \"status_description\": \"Pending (est. less than 10 minutes)\",\n        //             \"transaction_fee\": {\n        //                 \"amount\": \"4.008308\",\n        //                 \"currency\": \"USDC\"\n        //             },\n        //             \"transaction_amount\": {\n        //                 \"amount\": \"10.000000\",\n        //                 \"currency\": \"USDC\"\n        //             },\n        //             \"confirmations\": 0\n        //         },\n        //         \"to\": {\n        //             \"resource\": \"ethereum_address\",\n        //             \"address\": \"0x9...\",\n        //             \"currency\": \"USDC\",\n        //             \"address_info\": {\n        //                 \"address\": \"0x9...\"\n        //             }\n        //         },\n        //         \"idem\": \"748d8591-dg9a-7831-a45b-crd61dg78762\",\n        //         \"details\": {\n        //             \"title\": \"Sent USDC\",\n        //             \"subtitle\": \"To USDC address on Ethereum network\",\n        //             \"header\": \"Sent 14.008308 USDC ($18.74)\",\n        //             \"health\": \"warning\"\n        //         },\n        //         \"hide_native_amount\": false\n        //     }\n        //\n        //\n        // crypto deposit & withdrawal (using `/transactions` endpoint)\n        //    {\n        //        \"amount\": {\n        //            \"amount\": \"0.00014200\", (negative for withdrawal)\n        //            \"currency\": \"BTC\"\n        //        },\n        //        \"created_at\": \"2024-03-29T15:48:30Z\",\n        //        \"id\": \"0031a605-241d-514d-a97b-d4b99f3225d3\",\n        //        \"idem\": \"092a979b-017e-4403-940a-2ca57811f442\", // field present only in case of withdrawal\n        //        \"native_amount\": {\n        //            \"amount\": \"9.85\", (negative for withdrawal)\n        //            \"currency\": \"USD\"\n        //        },\n        //        \"network\": {\n        //            \"status\": \"pending\", // if status is `off_blockchain` then no more other fields are present in this object\n        //            \"hash\": \"5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE\",\n        //            \"network_name\": \"solana\",\n        //            \"transaction_fee\": {\n        //                \"amount\": \"0.000100000\",\n        //                \"currency\": \"SOL\"\n        //            }\n        //        },\n        //        \"resource\": \"transaction\",\n        //        \"resource_path\": \"/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3\",\n        //        \"status\": \"completed\",\n        //        \"type\": \"send\",\n        //        \"from\": { // in some cases, field might be present for deposit\n        //            \"id\": \"7fd10cd7-b091-5cee-ba41-c29e49a7cccf\",\n        //            \"name\": \"Coinbase\",\n        //            \"resource\": \"user\"\n        //        },\n        //        \"to\": { // field only present for withdrawal\n        //            \"address\": \"5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE\",\n        //            \"resource\": \"address\"\n        //        },\n        //        \"description\": \"C3 - One Time BTC Credit . Reference Case # 123.\", //  in some cases, field might be present for deposit\n        //    }\n        //\n        const transactionType = this.safeString (transaction, 'type');\n        let amountAndCurrencyObject = undefined;\n        let feeObject = undefined;\n        const network = this.safeDict (transaction, 'network', {});\n        if (transactionType === 'send') {\n            amountAndCurrencyObject = this.safeDict (network, 'transaction_amount');\n            feeObject = this.safeDict (network, 'transaction_fee', {});\n        } else {\n            amountAndCurrencyObject = this.safeDict (transaction, 'subtotal');\n            feeObject = this.safeDict (transaction, 'fee', {});\n        }\n        if (amountAndCurrencyObject === undefined) {\n            amountAndCurrencyObject = this.safeDict (transaction, 'amount');\n        }\n        const amountString = this.safeString (amountAndCurrencyObject, 'amount');\n        const amountStringAbs = Precise.stringAbs (amountString);\n        let status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        if (status === undefined) {\n            const committed = this.safeBool (transaction, 'committed');\n            status = committed ? 'ok' : 'pending';\n        }\n        const id = this.safeString (transaction, 'id');\n        const currencyId = this.safeString (amountAndCurrencyObject, 'currency');\n        const feeCurrencyId = this.safeString (feeObject, 'currency');\n        const datetime = this.safeString (transaction, 'created_at');\n        const resource = this.safeString (transaction, 'resource');\n        let type = resource;\n        if (!this.inArray (type, [ 'deposit', 'withdrawal' ])) {\n            if (Precise.stringGt (amountString, '0')) {\n                type = 'deposit';\n            } else if (Precise.stringLt (amountString, '0')) {\n                type = 'withdrawal';\n            }\n        }\n        const toObject = this.safeDict (transaction, 'to');\n        const addressTo = this.safeString (toObject, 'address');\n        const networkId = this.safeString (network, 'network_name');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': this.safeString (network, 'hash', id),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'network': this.networkIdToCode (networkId),\n            'address': addressTo,\n            'addressTo': addressTo,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.parseNumber (amountStringAbs),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'status': status,\n            'updated': this.parse8601 (this.safeString (transaction, 'updated_at')),\n            'fee': {\n                'cost': this.safeNumber (feeObject, 'amount'),\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 970,
        "line_end": 977,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'created': 'pending',\n            'completed': 'ok',\n            'canceled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "coinbaseadvanced": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 711,
        "line_end": 780,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (account, 'id', 'uuid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "(active !== undefined) ? this.safeStringLower (parts, 1) : typeV2",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"XLM\",\n         \"name\": \"XLM Wallet\",\n         \"primary\": false,\n         \"type\": \"wallet\",\n         \"currency\": {\n             \"code\": \"XLM\",\n             \"name\": \"Stellar Lumens\",\n             \"color\": \"#000000\",\n             \"sort_index\": 127,\n             \"exponent\": 7,\n             \"type\": \"crypto\",\n             \"address_regex\": \"^G[A-Z2-7]{55}$\",\n             \"asset_id\": \"13b83335-5ede-595b-821e-5bcdfa80560f\",\n             \"destination_tag_name\": \"XLM Memo ID\",\n             \"destination_tag_regex\": \"^[ -~]{1,28}$\"\n         },\n         \"balance\": {\n             \"amount\": \"0.0000000\",\n             \"currency\": \"XLM\"\n         },\n         \"created_at\": null,\n         \"updated_at\": null,\n         \"resource\": \"account\",\n         \"resource_path\": \"/v2/accounts/XLM\",\n         \"allow_deposits\": true,\n         \"allow_withdrawals\": true\n     }",
          "{\n         \"uuid\": \"11111111-1111-1111-1111-111111111111\",\n         \"name\": \"USDC Wallet\",\n         \"currency\": \"USDC\",\n         \"available_balance\": {\n             \"value\": \"0.0000000000000000\",\n             \"currency\": \"USDC\"\n         },\n         \"default\": true,\n         \"active\": true,\n         \"created_at\": \"2023-01-04T06:20:06.456Z\",\n         \"updated_at\": \"2023-01-04T06:20:07.181Z\",\n         \"deleted_at\": null,\n         \"type\": \"ACCOUNT_TYPE_CRYPTO\",\n         \"ready\": false,\n         \"hold\": {\n             \"value\": \"0.0000000000000000\",\n             \"currency\": \"USDC\"\n         }\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        // fetchAccountsV2\n        //\n        //     {\n        //         \"id\": \"XLM\",\n        //         \"name\": \"XLM Wallet\",\n        //         \"primary\": false,\n        //         \"type\": \"wallet\",\n        //         \"currency\": {\n        //             \"code\": \"XLM\",\n        //             \"name\": \"Stellar Lumens\",\n        //             \"color\": \"#000000\",\n        //             \"sort_index\": 127,\n        //             \"exponent\": 7,\n        //             \"type\": \"crypto\",\n        //             \"address_regex\": \"^G[A-Z2-7]{55}$\",\n        //             \"asset_id\": \"13b83335-5ede-595b-821e-5bcdfa80560f\",\n        //             \"destination_tag_name\": \"XLM Memo ID\",\n        //             \"destination_tag_regex\": \"^[ -~]{1,28}$\"\n        //         },\n        //         \"balance\": {\n        //             \"amount\": \"0.0000000\",\n        //             \"currency\": \"XLM\"\n        //         },\n        //         \"created_at\": null,\n        //         \"updated_at\": null,\n        //         \"resource\": \"account\",\n        //         \"resource_path\": \"/v2/accounts/XLM\",\n        //         \"allow_deposits\": true,\n        //         \"allow_withdrawals\": true\n        //     }\n        //\n        // fetchAccountsV3\n        //\n        //     {\n        //         \"uuid\": \"11111111-1111-1111-1111-111111111111\",\n        //         \"name\": \"USDC Wallet\",\n        //         \"currency\": \"USDC\",\n        //         \"available_balance\": {\n        //             \"value\": \"0.0000000000000000\",\n        //             \"currency\": \"USDC\"\n        //         },\n        //         \"default\": true,\n        //         \"active\": true,\n        //         \"created_at\": \"2023-01-04T06:20:06.456Z\",\n        //         \"updated_at\": \"2023-01-04T06:20:07.181Z\",\n        //         \"deleted_at\": null,\n        //         \"type\": \"ACCOUNT_TYPE_CRYPTO\",\n        //         \"ready\": false,\n        //         \"hold\": {\n        //             \"value\": \"0.0000000000000000\",\n        //             \"currency\": \"USDC\"\n        //         }\n        //     }\n        //\n        const active = this.safeBool (account, 'active');\n        const currencyIdV3 = this.safeString (account, 'currency');\n        const currency = this.safeDict (account, 'currency', {});\n        const currencyId = this.safeString (currency, 'code', currencyIdV3);\n        const typeV3 = this.safeString (account, 'name');\n        const typeV2 = this.safeString (account, 'type');\n        const parts = typeV3.split (' ');\n        return {\n            'id': this.safeString2 (account, 'id', 'uuid'),\n            'type': (active !== undefined) ? this.safeStringLower (parts, 1) : typeV2,\n            'code': this.safeCurrencyCode (currencyId),\n            'info': account,\n        };\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseContractMarket",
        "signature": "parseContractMarket (market, feeTier): MarketInterface",
        "line_start": 1672,
        "line_end": 1867,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isSwap",
            "comment": null
          },
          {
            "key": "future",
            "value": "!isSwap",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "!tradingDisabled",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expireTimestamp",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "expireDateTime",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n           \"product_id\":\"BIT-26APR24-CDE\",\n           \"price\":\"71145\",\n           \"price_percentage_change_24h\":\"-2.36722931247427\",\n           \"volume_24h\":\"108549\",\n           \"volume_percentage_change_24h\":\"155.78255337197794\",\n           \"base_increment\":\"1\",\n           \"quote_increment\":\"0.01\",\n           \"quote_min_size\":\"0\",\n           \"quote_max_size\":\"100000000\",\n           \"base_min_size\":\"1\",\n           \"base_max_size\":\"100000000\",\n           \"base_name\":\"\",\n           \"quote_name\":\"US Dollar\",\n           \"watched\":false,\n           \"is_disabled\":false,\n           \"new\":false,\n           \"status\":\"\",\n           \"cancel_only\":false,\n           \"limit_only\":false,\n           \"post_only\":false,\n           \"trading_disabled\":false,\n           \"auction_mode\":false,\n           \"product_type\":\"FUTURE\",\n           \"quote_currency_id\":\"USD\",\n           \"base_currency_id\":\"\",\n           \"fcm_trading_session_details\":{\n              \"is_session_open\":true,\n              \"open_time\":\"2024-04-08T22:00:00Z\",\n              \"close_time\":\"2024-04-09T21:00:00Z\"\n           },\n           \"mid_market_price\":\"71105\",\n           \"alias\":\"\",\n           \"alias_to\":[\n           ],\n           \"base_display_symbol\":\"\",\n           \"quote_display_symbol\":\"USD\",\n           \"view_only\":false,\n           \"price_increment\":\"5\",\n           \"display_name\":\"BTC 26 APR 24\",\n           \"product_venue\":\"FCM\",\n           \"future_product_details\":{\n              \"venue\":\"cde\",\n              \"contract_code\":\"BIT\",\n              \"contract_expiry\":\"2024-04-26T15:00:00Z\",\n              \"contract_size\":\"0.01\",\n              \"contract_root_unit\":\"BTC\",\n              \"group_description\":\"Nano Bitcoin Futures\",\n              \"contract_expiry_timezone\":\"Europe/London\",\n              \"group_short_description\":\"Nano BTC\",\n              \"risk_managed_by\":\"MANAGED_BY_FCM\",\n              \"contract_expiry_type\":\"EXPIRING\",\n              \"contract_display_name\":\"BTC 26 APR 24\"\n           }\n        }",
          "{\n           \"product_id\":\"ETH-PERP-INTX\",\n           \"price\":\"3630.98\",\n           \"price_percentage_change_24h\":\"0.65142426292038\",\n           \"volume_24h\":\"114020.1501\",\n           \"volume_percentage_change_24h\":\"63.33650787154869\",\n           \"base_increment\":\"0.0001\",\n           \"quote_increment\":\"0.01\",\n           \"quote_min_size\":\"10\",\n           \"quote_max_size\":\"50000000\",\n           \"base_min_size\":\"0.0001\",\n           \"base_max_size\":\"50000\",\n           \"base_name\":\"\",\n           \"quote_name\":\"USDC\",\n           \"watched\":false,\n           \"is_disabled\":false,\n           \"new\":false,\n           \"status\":\"\",\n           \"cancel_only\":false,\n           \"limit_only\":false,\n           \"post_only\":false,\n           \"trading_disabled\":false,\n           \"auction_mode\":false,\n           \"product_type\":\"FUTURE\",\n           \"quote_currency_id\":\"USDC\",\n           \"base_currency_id\":\"\",\n           \"fcm_trading_session_details\":null,\n           \"mid_market_price\":\"3630.975\",\n           \"alias\":\"\",\n           \"alias_to\":[],\n           \"base_display_symbol\":\"\",\n           \"quote_display_symbol\":\"USDC\",\n           \"view_only\":false,\n           \"price_increment\":\"0.01\",\n           \"display_name\":\"ETH PERP\",\n           \"product_venue\":\"INTX\",\n           \"future_product_details\":{\n              \"venue\":\"\",\n              \"contract_code\":\"ETH\",\n              \"contract_expiry\":null,\n              \"contract_size\":\"1\",\n              \"contract_root_unit\":\"ETH\",\n              \"group_description\":\"\",\n              \"contract_expiry_timezone\":\"\",\n              \"group_short_description\":\"\",\n              \"risk_managed_by\":\"MANAGED_BY_VENUE\",\n              \"contract_expiry_type\":\"PERPETUAL\",\n              \"perpetual_details\":{\n                 \"open_interest\":\"0\",\n                 \"funding_rate\":\"0.000016\",\n                 \"funding_time\":\"2024-04-09T09:00:00.000008Z\",\n                 \"max_leverage\":\"10\"\n              },\n              \"contract_display_name\":\"ETH PERPETUAL\"\n           }\n        }"
        ],
        "source": "parseContractMarket (market, feeTier): MarketInterface {\n        // expiring\n        //\n        //        {\n        //           \"product_id\":\"BIT-26APR24-CDE\",\n        //           \"price\":\"71145\",\n        //           \"price_percentage_change_24h\":\"-2.36722931247427\",\n        //           \"volume_24h\":\"108549\",\n        //           \"volume_percentage_change_24h\":\"155.78255337197794\",\n        //           \"base_increment\":\"1\",\n        //           \"quote_increment\":\"0.01\",\n        //           \"quote_min_size\":\"0\",\n        //           \"quote_max_size\":\"100000000\",\n        //           \"base_min_size\":\"1\",\n        //           \"base_max_size\":\"100000000\",\n        //           \"base_name\":\"\",\n        //           \"quote_name\":\"US Dollar\",\n        //           \"watched\":false,\n        //           \"is_disabled\":false,\n        //           \"new\":false,\n        //           \"status\":\"\",\n        //           \"cancel_only\":false,\n        //           \"limit_only\":false,\n        //           \"post_only\":false,\n        //           \"trading_disabled\":false,\n        //           \"auction_mode\":false,\n        //           \"product_type\":\"FUTURE\",\n        //           \"quote_currency_id\":\"USD\",\n        //           \"base_currency_id\":\"\",\n        //           \"fcm_trading_session_details\":{\n        //              \"is_session_open\":true,\n        //              \"open_time\":\"2024-04-08T22:00:00Z\",\n        //              \"close_time\":\"2024-04-09T21:00:00Z\"\n        //           },\n        //           \"mid_market_price\":\"71105\",\n        //           \"alias\":\"\",\n        //           \"alias_to\":[\n        //           ],\n        //           \"base_display_symbol\":\"\",\n        //           \"quote_display_symbol\":\"USD\",\n        //           \"view_only\":false,\n        //           \"price_increment\":\"5\",\n        //           \"display_name\":\"BTC 26 APR 24\",\n        //           \"product_venue\":\"FCM\",\n        //           \"future_product_details\":{\n        //              \"venue\":\"cde\",\n        //              \"contract_code\":\"BIT\",\n        //              \"contract_expiry\":\"2024-04-26T15:00:00Z\",\n        //              \"contract_size\":\"0.01\",\n        //              \"contract_root_unit\":\"BTC\",\n        //              \"group_description\":\"Nano Bitcoin Futures\",\n        //              \"contract_expiry_timezone\":\"Europe/London\",\n        //              \"group_short_description\":\"Nano BTC\",\n        //              \"risk_managed_by\":\"MANAGED_BY_FCM\",\n        //              \"contract_expiry_type\":\"EXPIRING\",\n        //              \"contract_display_name\":\"BTC 26 APR 24\"\n        //           }\n        //        }\n        //\n        // perpetual\n        //\n        //        {\n        //           \"product_id\":\"ETH-PERP-INTX\",\n        //           \"price\":\"3630.98\",\n        //           \"price_percentage_change_24h\":\"0.65142426292038\",\n        //           \"volume_24h\":\"114020.1501\",\n        //           \"volume_percentage_change_24h\":\"63.33650787154869\",\n        //           \"base_increment\":\"0.0001\",\n        //           \"quote_increment\":\"0.01\",\n        //           \"quote_min_size\":\"10\",\n        //           \"quote_max_size\":\"50000000\",\n        //           \"base_min_size\":\"0.0001\",\n        //           \"base_max_size\":\"50000\",\n        //           \"base_name\":\"\",\n        //           \"quote_name\":\"USDC\",\n        //           \"watched\":false,\n        //           \"is_disabled\":false,\n        //           \"new\":false,\n        //           \"status\":\"\",\n        //           \"cancel_only\":false,\n        //           \"limit_only\":false,\n        //           \"post_only\":false,\n        //           \"trading_disabled\":false,\n        //           \"auction_mode\":false,\n        //           \"product_type\":\"FUTURE\",\n        //           \"quote_currency_id\":\"USDC\",\n        //           \"base_currency_id\":\"\",\n        //           \"fcm_trading_session_details\":null,\n        //           \"mid_market_price\":\"3630.975\",\n        //           \"alias\":\"\",\n        //           \"alias_to\":[],\n        //           \"base_display_symbol\":\"\",\n        //           \"quote_display_symbol\":\"USDC\",\n        //           \"view_only\":false,\n        //           \"price_increment\":\"0.01\",\n        //           \"display_name\":\"ETH PERP\",\n        //           \"product_venue\":\"INTX\",\n        //           \"future_product_details\":{\n        //              \"venue\":\"\",\n        //              \"contract_code\":\"ETH\",\n        //              \"contract_expiry\":null,\n        //              \"contract_size\":\"1\",\n        //              \"contract_root_unit\":\"ETH\",\n        //              \"group_description\":\"\",\n        //              \"contract_expiry_timezone\":\"\",\n        //              \"group_short_description\":\"\",\n        //              \"risk_managed_by\":\"MANAGED_BY_VENUE\",\n        //              \"contract_expiry_type\":\"PERPETUAL\",\n        //              \"perpetual_details\":{\n        //                 \"open_interest\":\"0\",\n        //                 \"funding_rate\":\"0.000016\",\n        //                 \"funding_time\":\"2024-04-09T09:00:00.000008Z\",\n        //                 \"max_leverage\":\"10\"\n        //              },\n        //              \"contract_display_name\":\"ETH PERPETUAL\"\n        //           }\n        //        }\n        //\n        const id = this.safeString (market, 'product_id');\n        const futureProductDetails = this.safeDict (market, 'future_product_details', {});\n        const contractExpiryType = this.safeString (futureProductDetails, 'contract_expiry_type');\n        const contractSize = this.safeNumber (futureProductDetails, 'contract_size');\n        const contractExpire = this.safeString (futureProductDetails, 'contract_expiry');\n        const expireTimestamp = this.parse8601 (contractExpire);\n        const expireDateTime = this.iso8601 (expireTimestamp);\n        const isSwap = (contractExpiryType === 'PERPETUAL');\n        const baseId = this.safeString (futureProductDetails, 'contract_root_unit');\n        const quoteId = this.safeString (market, 'quote_currency_id');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const tradingDisabled = this.safeBool (market, 'is_disabled');\n        let symbol = base + '/' + quote;\n        let type = undefined;\n        if (isSwap) {\n            type = 'swap';\n            symbol = symbol + ':' + quote;\n        } else {\n            type = 'future';\n            symbol = symbol + ':' + quote + '-' + this.yymmdd (expireTimestamp);\n        }\n        const takerFeeRate = this.safeNumber (feeTier, 'taker_fee_rate');\n        const makerFeeRate = this.safeNumber (feeTier, 'maker_fee_rate');\n        const taker = takerFeeRate ? takerFeeRate : this.parseNumber ('0.06');\n        const maker = makerFeeRate ? makerFeeRate : this.parseNumber ('0.04');\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': quoteId,\n            'type': type,\n            'spot': false,\n            'margin': false,\n            'swap': isSwap,\n            'future': !isSwap,\n            'option': false,\n            'active': !tradingDisabled,\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'taker': taker,\n            'maker': maker,\n            'contractSize': contractSize,\n            'expiry': expireTimestamp,\n            'expiryDatetime': expireDateTime,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 4684,
        "line_end": 4704,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (conversion, 'id')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber (fromAmountStructure, 'value')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (feeAmountStructure, 'value')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        const fromCoin = this.safeString (conversion, 'source_currency');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'target_currency');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        const fromAmountStructure = this.safeDict (conversion, 'user_entered_amount');\n        const feeStructure = this.safeDict (conversion, 'total_fee');\n        const feeAmountStructure = this.safeDict (feeStructure, 'amount');\n        return {\n            'info': conversion,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'id': this.safeString (conversion, 'id'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber (fromAmountStructure, 'value'),\n            'toCurrency': toCode,\n            'toAmount': undefined,\n            'price': undefined,\n            'fee': this.safeNumber (feeAmountStructure, 'value'),\n        } as Conversion;\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseCustomBalance",
        "signature": "parseCustomBalance (response, params = {})",
        "line_start": 2373,
        "line_end": 2424,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCustomBalance (response, params = {}) {\n        const balances = this.safeList2 (response, 'data', 'accounts', []);\n        const accounts = this.safeList (params, 'type', this.options['accounts']);\n        const v3Accounts = this.safeList (params, 'type', this.options['v3Accounts']);\n        const result: Dict = { 'info': response };\n        for (let b = 0; b < balances.length; b++) {\n            const balance = balances[b];\n            const type = this.safeString (balance, 'type');\n            if (this.inArray (type, accounts)) {\n                const value = this.safeDict (balance, 'balance');\n                if (value !== undefined) {\n                    const currencyId = this.safeString (value, 'currency');\n                    const code = this.safeCurrencyCode (currencyId);\n                    const total = this.safeString (value, 'amount');\n                    const free = total;\n                    let account = this.safeDict (result, code);\n                    if (account === undefined) {\n                        account = this.account ();\n                        account['free'] = free;\n                        account['total'] = total;\n                    } else {\n                        account['free'] = Precise.stringAdd (account['free'], total);\n                        account['total'] = Precise.stringAdd (account['total'], total);\n                    }\n                    result[code] = account;\n                }\n            } else if (this.inArray (type, v3Accounts)) {\n                const available = this.safeDict (balance, 'available_balance');\n                const hold = this.safeDict (balance, 'hold');\n                if (available !== undefined && hold !== undefined) {\n                    const currencyId = this.safeString (available, 'currency');\n                    const code = this.safeCurrencyCode (currencyId);\n                    const used = this.safeString (hold, 'value');\n                    const free = this.safeString (available, 'value');\n                    const total = Precise.stringAdd (used, free);\n                    let account = this.safeDict (result, code);\n                    if (account === undefined) {\n                        account = this.account ();\n                        account['free'] = free;\n                        account['used'] = used;\n                        account['total'] = total;\n                    } else {\n                        account['free'] = Precise.stringAdd (account['free'], free);\n                        account['used'] = Precise.stringAdd (account['used'], used);\n                        account['total'] = Precise.stringAdd (account['total'], total);\n                    }\n                    result[code] = account;\n                }\n            }\n        }\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 4291,
        "line_end": 4368,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId, code)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (addressInfo, 'destination_tag')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n        address_info: {\n            address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',\n            destination_tag: '3722061866'\n        },\n        name: null,\n        created_at: '2023-05-29T21:12:12Z',\n        updated_at: '2023-05-29T21:12:12Z',\n        network: 'solana',\n        uri_scheme: 'solana',\n        resource: 'address',\n        resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        warnings: [\n            {\n            type: 'correct_address_warning',\n            title: 'This is an ERC20 USDC address.',\n            details: 'Only send ERC20 USD Coin (USDC) to this address.',\n            image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',\n            options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]\n            }\n        ],\n        qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',\n        address_label: 'USDC address (Solana)',\n        default_receive: true,\n        deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',\n        callback_url: null,\n        share_address_copy: {\n            line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n            line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'\n        },\n        receive_subtitle: 'ERC-20',\n        inline_warning: {\n            text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',\n            tooltip: {\n            title: 'USDC (Solana)',\n            subtitle: 'This address can only receive USDC-SPL from Solana network.'\n            }\n        }\n    }",
          "{\n     \"id\":\"3f2434234943-8c1c-50ef-a5a1-342213bbf45d\",\n     \"address\":\"0x123123126F5921XXXXX\",\n     \"currency\":\"USDC\",\n     \"name\":\"\",\n     \"network\":\"ethereum\",\n     \"created_at\":\"2022-03-17T09:20:17.002Z\",\n     \"updated_at\":\"2022-03-17T09:20:17.002Z\",\n     \"resource\":\"addresses\",\n     \"resource_path\":\"v2/accounts/b1091c6e-9ef2-5e4d-b352-665d0cf8f742/addresses/32fd0943-8c1c-50ef-a5a1-342213bbf45d\",\n     \"destination_tag\":\"\"\n }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        //        address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n        //        address_info: {\n        //            address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',\n        //            destination_tag: '3722061866'\n        //        },\n        //        name: null,\n        //        created_at: '2023-05-29T21:12:12Z',\n        //        updated_at: '2023-05-29T21:12:12Z',\n        //        network: 'solana',\n        //        uri_scheme: 'solana',\n        //        resource: 'address',\n        //        resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',\n        //        warnings: [\n        //            {\n        //            type: 'correct_address_warning',\n        //            title: 'This is an ERC20 USDC address.',\n        //            details: 'Only send ERC20 USD Coin (USDC) to this address.',\n        //            image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',\n        //            options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]\n        //            }\n        //        ],\n        //        qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',\n        //        address_label: 'USDC address (Solana)',\n        //        default_receive: true,\n        //        deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',\n        //        callback_url: null,\n        //        share_address_copy: {\n        //            line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',\n        //            line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'\n        //        },\n        //        receive_subtitle: 'ERC-20',\n        //        inline_warning: {\n        //            text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',\n        //            tooltip: {\n        //            title: 'USDC (Solana)',\n        //            subtitle: 'This address can only receive USDC-SPL from Solana network.'\n        //            }\n        //        }\n        //    }\n        //\n        // {\n        //     \"id\":\"3f2434234943-8c1c-50ef-a5a1-342213bbf45d\",\n        //     \"address\":\"0x123123126F5921XXXXX\",\n        //     \"currency\":\"USDC\",\n        //     \"name\":\"\",\n        //     \"network\":\"ethereum\",\n        //     \"created_at\":\"2022-03-17T09:20:17.002Z\",\n        //     \"updated_at\":\"2022-03-17T09:20:17.002Z\",\n        //     \"resource\":\"addresses\",\n        //     \"resource_path\":\"v2/accounts/b1091c6e-9ef2-5e4d-b352-665d0cf8f742/addresses/32fd0943-8c1c-50ef-a5a1-342213bbf45d\",\n        //     \"destination_tag\":\"\"\n        // }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        const networkId = this.safeString (depositAddress, 'network');\n        const code = this.safeCurrencyCode (undefined, currency);\n        const addressLabel = this.safeString (depositAddress, 'address_label');\n        let currencyId = undefined;\n        if (addressLabel !== undefined) {\n            const splitAddressLabel = addressLabel.split (' ');\n            currencyId = this.safeString (splitAddressLabel, 0);\n        } else {\n            currencyId = this.safeString (depositAddress, 'currency');\n        }\n        const addressInfo = this.safeDict (depositAddress, 'address_info');\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'network': this.networkIdToCode (networkId, code),\n            'address': address,\n            'tag': this.safeString (addressInfo, 'destination_tag'),\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseDepositMethodId",
        "signature": "parseDepositMethodId (depositId)",
        "line_start": 4593,
        "line_end": 4601,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositId",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (depositId, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (depositId, 'currency')",
            "comment": null
          },
          {
            "key": "verified",
            "value": "this.safeBool (depositId, 'verified')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositId, 'name')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositMethodId (depositId) {\n        return {\n            'info': depositId,\n            'id': this.safeString (depositId, 'id'),\n            'currency': this.safeString (depositId, 'currency'),\n            'verified': this.safeBool (depositId, 'verified'),\n            'tag': this.safeString (depositId, 'name'),\n        };\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseDepositMethodIds",
        "signature": "parseDepositMethodIds (ids, params = {})",
        "line_start": 4584,
        "line_end": 4591,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositMethodIds (ids, params = {}) {\n        const result = [];\n        for (let i = 0; i < ids.length; i++) {\n            const id = this.extend (this.parseDepositMethodId (ids[i]), params);\n            result.push (id);\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2599,
        "line_end": 2907,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "accountId",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeAmount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n         \"type\": \"send\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"28.31976528\", currency: \"BCH\" },\n         \"native_amount\": { amount: \"2799.65\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-02-28T12:35:20Z\",\n         \"updated_at\": \"2019-02-28T12:43:24Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n         \"instant_exchange\": false,\n         \"network\": {\n             \"status\": \"confirmed\",\n             \"hash\": \"56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\",\n             \"transaction_url\": \"https://bch.btc.com/56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\"\n         },\n         \"from\": { resource: \"bitcoin_cash_network\", currency: \"BCH\" },\n         \"details\": { title: 'Received Bitcoin Cash', subtitle: \"From Bitcoin Cash address\" }\n     }",
          "{\n         \"id\": \"459aad99-2c41-5698-ac71-b6b81a05196c\",\n         \"type\": \"send\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"-0.36775642\", currency: \"BTC\" },\n         \"native_amount\": { amount: \"-1111.65\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-03-20T08:37:07Z\",\n         \"updated_at\": \"2019-03-20T08:49:33Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/459aad99-2c41-5698-ac71-b6b81a05196c\",\n         \"instant_exchange\": false,\n         \"network\": {\n             \"status\": \"confirmed\",\n             \"hash\": \"2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n             \"transaction_url\": \"https://blockchain.info/tx/2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n             \"transaction_fee\": { amount: \"0.00000000\", currency: \"BTC\" },\n             \"transaction_amount\": { amount: \"0.36775642\", currency: \"BTC\" },\n             \"confirmations\": 15682\n         },\n         \"to\": {\n             \"resource\": \"bitcoin_address\",\n             \"address\": \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\",\n             \"currency\": \"BTC\",\n             \"address_info\": { address: \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\" }\n         },\n         \"idem\": \"da0a2f14-a2af-4c5a-a37e-d4484caf582bsend\",\n         \"application\": {\n             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n             \"resource\": \"application\",\n             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n         },\n         \"details\": { title: 'Sent Bitcoin', subtitle: \"To Bitcoin address\" }\n     }",
          "{\n         \"id\": \"5b1b9fb8-5007-5393-b923-02903b973fdc\",\n         \"type\": \"pro_deposit\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"-0.00001111\", currency: \"BCH\" },\n         \"native_amount\": { amount: \"0.00\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-02-28T13:31:58Z\",\n         \"updated_at\": \"2019-02-28T13:31:58Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/5b1b9fb8-5007-5393-b923-02903b973fdc\",\n         \"instant_exchange\": false,\n         \"application\": {\n             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n             \"resource\": \"application\",\n             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n         },\n         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To Coinbase Pro\" }\n     }",
          "{\n         \"id\": \"badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n         \"type\": \"exchange_deposit\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"-0.43704149\", currency: \"BCH\" },\n         \"native_amount\": { amount: \"-51.90\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2019-03-19T10:30:40Z\",\n         \"updated_at\": \"2019-03-19T10:30:40Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n         \"instant_exchange\": false,\n         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To GDAX\" }\n     }",
          "{\n         \"id\": \"9c4b642c-8688-58bf-8962-13cef64097de\",\n         \"type\": \"exchange_withdrawal\",\n         \"status\": \"completed\",\n         \"amount\": { amount: \"0.57729420\", currency: \"BTC\" },\n         \"native_amount\": { amount: \"4418.72\", currency: \"GBP\" },\n         \"description\": null,\n         \"created_at\": \"2018-02-17T11:33:33Z\",\n         \"updated_at\": \"2018-02-17T11:33:33Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/9c4b642c-8688-58bf-8962-13cef64097de\",\n         \"instant_exchange\": false,\n         \"details\": { title: 'Transferred Bitcoin', subtitle: \"From GDAX\" }\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // crypto deposit transaction\n        //\n        //     {\n        //         \"id\": \"34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n        //         \"type\": \"send\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"28.31976528\", currency: \"BCH\" },\n        //         \"native_amount\": { amount: \"2799.65\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-02-28T12:35:20Z\",\n        //         \"updated_at\": \"2019-02-28T12:43:24Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/34e4816b-4c8c-5323-a01c-35a9fa26e490\",\n        //         \"instant_exchange\": false,\n        //         \"network\": {\n        //             \"status\": \"confirmed\",\n        //             \"hash\": \"56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\",\n        //             \"transaction_url\": \"https://bch.btc.com/56222d865dae83774fccb2efbd9829cf08c75c94ce135bfe4276f3fb46d49701\"\n        //         },\n        //         \"from\": { resource: \"bitcoin_cash_network\", currency: \"BCH\" },\n        //         \"details\": { title: 'Received Bitcoin Cash', subtitle: \"From Bitcoin Cash address\" }\n        //     }\n        //\n        // crypto withdrawal transaction\n        //\n        //     {\n        //         \"id\": \"459aad99-2c41-5698-ac71-b6b81a05196c\",\n        //         \"type\": \"send\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-0.36775642\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"-1111.65\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-03-20T08:37:07Z\",\n        //         \"updated_at\": \"2019-03-20T08:49:33Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/459aad99-2c41-5698-ac71-b6b81a05196c\",\n        //         \"instant_exchange\": false,\n        //         \"network\": {\n        //             \"status\": \"confirmed\",\n        //             \"hash\": \"2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n        //             \"transaction_url\": \"https://blockchain.info/tx/2732bbcf35c69217c47b36dce64933d103895277fe25738ffb9284092701e05b\",\n        //             \"transaction_fee\": { amount: \"0.00000000\", currency: \"BTC\" },\n        //             \"transaction_amount\": { amount: \"0.36775642\", currency: \"BTC\" },\n        //             \"confirmations\": 15682\n        //         },\n        //         \"to\": {\n        //             \"resource\": \"bitcoin_address\",\n        //             \"address\": \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\",\n        //             \"currency\": \"BTC\",\n        //             \"address_info\": { address: \"1AHnhqbvbYx3rnZx8uC7NbFZaTe4tafFHX\" }\n        //         },\n        //         \"idem\": \"da0a2f14-a2af-4c5a-a37e-d4484caf582bsend\",\n        //         \"application\": {\n        //             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n        //             \"resource\": \"application\",\n        //             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n        //         },\n        //         \"details\": { title: 'Sent Bitcoin', subtitle: \"To Bitcoin address\" }\n        //     }\n        //\n        // withdrawal transaction from coinbase to coinbasepro\n        //\n        //     {\n        //         \"id\": \"5b1b9fb8-5007-5393-b923-02903b973fdc\",\n        //         \"type\": \"pro_deposit\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-0.00001111\", currency: \"BCH\" },\n        //         \"native_amount\": { amount: \"0.00\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-02-28T13:31:58Z\",\n        //         \"updated_at\": \"2019-02-28T13:31:58Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/5b1b9fb8-5007-5393-b923-02903b973fdc\",\n        //         \"instant_exchange\": false,\n        //         \"application\": {\n        //             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n        //             \"resource\": \"application\",\n        //             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n        //         },\n        //         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To Coinbase Pro\" }\n        //     }\n        //\n        // withdrawal transaction from coinbase to gdax\n        //\n        //     {\n        //         \"id\": \"badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n        //         \"type\": \"exchange_deposit\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-0.43704149\", currency: \"BCH\" },\n        //         \"native_amount\": { amount: \"-51.90\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-03-19T10:30:40Z\",\n        //         \"updated_at\": \"2019-03-19T10:30:40Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c01d7364-edd7-5f3a-bd1d-de53d4cbb25e/transactions/badb7313-a9d3-5c07-abd0-00f8b44199b1\",\n        //         \"instant_exchange\": false,\n        //         \"details\": { title: 'Transferred Bitcoin Cash', subtitle: \"To GDAX\" }\n        //     }\n        //\n        // deposit transaction from gdax to coinbase\n        //\n        //     {\n        //         \"id\": \"9c4b642c-8688-58bf-8962-13cef64097de\",\n        //         \"type\": \"exchange_withdrawal\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"0.57729420\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"4418.72\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2018-02-17T11:33:33Z\",\n        //         \"updated_at\": \"2018-02-17T11:33:33Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/9c4b642c-8688-58bf-8962-13cef64097de\",\n        //         \"instant_exchange\": false,\n        //         \"details\": { title: 'Transferred Bitcoin', subtitle: \"From GDAX\" }\n        //     }\n        //\n        // deposit transaction from coinbasepro to coinbase\n        //\n        //     {\n        //         \"id\": \"8d6dd0b9-3416-568a-889d-8f112fae9e81\",\n        //         \"type\": \"pro_withdrawal\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"0.40555386\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"1140.27\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2019-03-04T19:41:58Z\",\n        //         \"updated_at\": \"2019-03-04T19:41:58Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/8d6dd0b9-3416-568a-889d-8f112fae9e81\",\n        //         \"instant_exchange\": false,\n        //         \"application\": {\n        //             \"id\": \"5756ab6e-836b-553b-8950-5e389451225d\",\n        //             \"resource\": \"application\",\n        //             \"resource_path\": \"/v2/applications/5756ab6e-836b-553b-8950-5e389451225d\"\n        //         },\n        //         \"details\": { title: 'Transferred Bitcoin', subtitle: \"From Coinbase Pro\" }\n        //     }\n        //\n        // sell trade\n        //\n        //     {\n        //         \"id\": \"a9409207-df64-585b-97ab-a50780d2149e\",\n        //         \"type\": \"sell\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-9.09922880\", currency: \"BTC\" },\n        //         \"native_amount\": { amount: \"-7285.73\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-03-27T15:38:34Z\",\n        //         \"updated_at\": \"2017-03-27T15:38:34Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/transactions/a9409207-df64-585b-97ab-a50780d2149e\",\n        //         \"instant_exchange\": false,\n        //         \"sell\": {\n        //             \"id\": \"e3550b4d-8ae6-5de3-95fe-1fb01ba83051\",\n        //             \"resource\": \"sell\",\n        //             \"resource_path\": \"/v2/accounts/c6afbd34-4bd0-501e-8616-4862c193cd84/sells/e3550b4d-8ae6-5de3-95fe-1fb01ba83051\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Sold Bitcoin\",\n        //             \"subtitle\": \"Using EUR Wallet\",\n        //             \"payment_method_name\": \"EUR Wallet\"\n        //         }\n        //     }\n        //\n        // buy trade\n        //\n        //     {\n        //         \"id\": \"63eeed67-9396-5912-86e9-73c4f10fe147\",\n        //         \"type\": \"buy\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"2.39605772\", currency: \"ETH\" },\n        //         \"native_amount\": { amount: \"98.31\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-03-27T09:07:56Z\",\n        //         \"updated_at\": \"2017-03-27T09:07:57Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/8902f85d-4a69-5d74-82fe-8e390201bda7/transactions/63eeed67-9396-5912-86e9-73c4f10fe147\",\n        //         \"instant_exchange\": false,\n        //         \"buy\": {\n        //             \"id\": \"20b25b36-76c6-5353-aa57-b06a29a39d82\",\n        //             \"resource\": \"buy\",\n        //             \"resource_path\": \"/v2/accounts/8902f85d-4a69-5d74-82fe-8e390201bda7/buys/20b25b36-76c6-5353-aa57-b06a29a39d82\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Bought Ethereum\",\n        //             \"subtitle\": \"Using EUR Wallet\",\n        //             \"payment_method_name\": \"EUR Wallet\"\n        //         }\n        //     }\n        //\n        // fiat deposit transaction\n        //\n        //     {\n        //         \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n        //         \"type\": \"fiat_deposit\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"114.02\", currency: \"EUR\" },\n        //         \"native_amount\": { amount: \"97.23\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-02-09T07:01:21Z\",\n        //         \"updated_at\": \"2017-02-09T07:01:22Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86-b1d2146977d0\",\n        //         \"instant_exchange\": false,\n        //         \"fiat_deposit\": {\n        //             \"id\": \"f34c19f3-b730-5e3d-9f72-96520448677a\",\n        //             \"resource\": \"fiat_deposit\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72-96520448677a\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Deposited funds\",\n        //             \"subtitle\": \"From SEPA Transfer (GB47 BARC 20..., reference CBADVI)\",\n        //             \"payment_method_name\": \"SEPA Transfer (GB47 BARC 20..., reference CBADVI)\"\n        //         }\n        //     }\n        //\n        // fiat withdrawal transaction\n        //\n        //     {\n        //         \"id\": \"957d98e2-f80e-5e2f-a28e-02945aa93079\",\n        //         \"type\": \"fiat_withdrawal\",\n        //         \"status\": \"completed\",\n        //         \"amount\": { amount: \"-11000.00\", currency: \"EUR\" },\n        //         \"native_amount\": { amount: \"-9698.22\", currency: \"GBP\" },\n        //         \"description\": null,\n        //         \"created_at\": \"2017-12-06T13:19:19Z\",\n        //         \"updated_at\": \"2017-12-06T13:19:19Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/957d98e2-f80e-5e2f-a28e-02945aa93079\",\n        //         \"instant_exchange\": false,\n        //         \"fiat_withdrawal\": {\n        //             \"id\": \"f4bf1fd9-ab3b-5de7-906d-ed3e23f7a4e7\",\n        //             \"resource\": \"fiat_withdrawal\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/f4bf1fd9-ab3b-5de7-906d-ed3e23f7a4e7\"\n        //         },\n        //         \"details\": {\n        //             \"title\": \"Withdrew funds\",\n        //             \"subtitle\": \"To HSBC BANK PLC (GB74 MIDL...)\",\n        //             \"payment_method_name\": \"HSBC BANK PLC (GB74 MIDL...)\"\n        //         }\n        //     }\n        //\n        const amountInfo = this.safeDict (item, 'amount', {});\n        let amount = this.safeString (amountInfo, 'amount');\n        let direction = undefined;\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringNeg (amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (amountInfo, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        //\n        // the address and txid do not belong to the unified ledger structure\n        //\n        //     let address = undefined;\n        //     if (item['to']) {\n        //         address = this.safeString (item['to'], 'address');\n        //     }\n        //     let txid = undefined;\n        //\n        let fee = undefined;\n        const networkInfo = this.safeDict (item, 'network', {});\n        // txid = network['hash']; // txid does not belong to the unified ledger structure\n        const feeInfo = this.safeDict (networkInfo, 'transaction_fee');\n        if (feeInfo !== undefined) {\n            const feeCurrencyId = this.safeString (feeInfo, 'currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId, currency);\n            const feeAmount = this.safeNumber (feeInfo, 'amount');\n            fee = {\n                'cost': feeAmount,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const timestamp = this.parse8601 (this.safeString (item, 'created_at'));\n        const id = this.safeString (item, 'id');\n        const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n        const status = this.parseLedgerEntryStatus (this.safeString (item, 'status'));\n        const path = this.safeString (item, 'resource_path');\n        let accountId = undefined;\n        if (path !== undefined) {\n            const parts = path.split ('/');\n            const numParts = parts.length;\n            if (numParts > 3) {\n                accountId = parts[3];\n            }\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': accountId,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'before': undefined,\n            'after': undefined,\n            'status': status,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseLedgerEntryStatus",
        "signature": "parseLedgerEntryStatus (status)",
        "line_start": 2577,
        "line_end": 2582,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryStatus (status) {\n        const types: Dict = {\n            'completed': 'ok',\n        };\n        return this.safeString (types, status, status);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2584,
        "line_end": 2597,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'buy': 'trade',\n            'sell': 'trade',\n            'fiat_deposit': 'transaction',\n            'fiat_withdrawal': 'transaction',\n            'exchange_deposit': 'transaction', // fiat withdrawal (from coinbase to coinbasepro)\n            'exchange_withdrawal': 'transaction', // fiat deposit (to coinbase from coinbasepro)\n            'send': 'transaction', // crypto deposit OR withdrawal\n            'pro_deposit': 'transaction', // crypto withdrawal (from coinbase to coinbasepro)\n            'pro_withdrawal': 'transaction', // crypto deposit (to coinbase from coinbasepro)\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 3865,
        "line_end": 3886,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"start\": \"1673391780\",\n             \"low\": \"17414.36\",\n             \"high\": \"17417.99\",\n             \"open\": \"17417.74\",\n             \"close\": \"17417.38\",\n             \"volume\": \"1.87780853\"\n         },\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         {\n        //             \"start\": \"1673391780\",\n        //             \"low\": \"17414.36\",\n        //             \"high\": \"17417.99\",\n        //             \"open\": \"17417.74\",\n        //             \"close\": \"17417.38\",\n        //             \"volume\": \"1.87780853\"\n        //         },\n        //     ]\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'start'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3223,
        "line_end": 3357,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'order_id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (this.safeString (order, 'order_type'))",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'time_in_force'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'filled_size')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'average_filled_price')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeString (order, 'total_fees'),\n                'currency': currencyFee,\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'total_fees')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyFee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"52cfe5e2-0b29-4c19-a245-a6a773de5030\",\n         \"product_id\": \"LTC-BTC\",\n         \"side\": \"SELL\",\n         \"client_order_id\": \"4d760580-6fca-4094-a70b-ebcca8626288\"\n     }",
          "{\n         \"success\": true,\n         \"failure_reason\": \"UNKNOWN_CANCEL_FAILURE_REASON\",\n         \"order_id\": \"bb8851a3-4fda-4a2c-aa06-9048db0e0f0d\"\n     }",
          "{\n         \"order_id\": \"9bc1eb3b-5b46-4b71-9628-ae2ed0cca75b\",\n         \"product_id\": \"LTC-BTC\",\n         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n         \"order_configuration\": {\n             \"limit_limit_gtc\": {\n                 \"base_size\": \"0.2\",\n                 \"limit_price\": \"0.006\",\n                 \"post_only\": false\n             },\n             \"stop_limit_stop_limit_gtc\": {\n                 \"base_size\": \"48.54\",\n                 \"limit_price\": \"6.998\",\n                 \"stop_price\": \"7.0687\",\n                 \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\"\n             }\n         },\n         \"side\": \"SELL\",\n         \"client_order_id\": \"e5fe8482-05bb-428f-ad4d-dbc8ce39239c\",\n         \"status\": \"OPEN\",\n         \"time_in_force\": \"GOOD_UNTIL_CANCELLED\",\n         \"created_time\": \"2023-01-16T23:37:23.947030Z\",\n         \"completion_percentage\": \"0\",\n         \"filled_size\": \"0\",\n         \"average_filled_price\": \"0\",\n         \"fee\": \"\",\n         \"number_of_fills\": \"0\",\n         \"filled_value\": \"0\",\n         \"pending_cancel\": false,\n         \"size_in_quote\": false,\n         \"total_fees\": \"0\",\n         \"size_inclusive_of_fees\": false,\n         \"total_value_after_fees\": \"0\",\n         \"trigger_status\": \"INVALID_ORDER_TYPE\",\n         \"order_type\": \"LIMIT\",\n         \"reject_reason\": \"REJECT_REASON_UNSPECIFIED\",\n         \"settled\": false,\n         \"product_type\": \"SPOT\",\n         \"reject_message\": \"\",\n         \"cancel_message\": \"\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"order_id\": \"52cfe5e2-0b29-4c19-a245-a6a773de5030\",\n        //         \"product_id\": \"LTC-BTC\",\n        //         \"side\": \"SELL\",\n        //         \"client_order_id\": \"4d760580-6fca-4094-a70b-ebcca8626288\"\n        //     }\n        //\n        // cancelOrder, cancelOrders\n        //\n        //     {\n        //         \"success\": true,\n        //         \"failure_reason\": \"UNKNOWN_CANCEL_FAILURE_REASON\",\n        //         \"order_id\": \"bb8851a3-4fda-4a2c-aa06-9048db0e0f0d\"\n        //     }\n        //\n        // fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n        //\n        //     {\n        //         \"order_id\": \"9bc1eb3b-5b46-4b71-9628-ae2ed0cca75b\",\n        //         \"product_id\": \"LTC-BTC\",\n        //         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n        //         \"order_configuration\": {\n        //             \"limit_limit_gtc\": {\n        //                 \"base_size\": \"0.2\",\n        //                 \"limit_price\": \"0.006\",\n        //                 \"post_only\": false\n        //             },\n        //             \"stop_limit_stop_limit_gtc\": {\n        //                 \"base_size\": \"48.54\",\n        //                 \"limit_price\": \"6.998\",\n        //                 \"stop_price\": \"7.0687\",\n        //                 \"stop_direction\": \"STOP_DIRECTION_STOP_DOWN\"\n        //             }\n        //         },\n        //         \"side\": \"SELL\",\n        //         \"client_order_id\": \"e5fe8482-05bb-428f-ad4d-dbc8ce39239c\",\n        //         \"status\": \"OPEN\",\n        //         \"time_in_force\": \"GOOD_UNTIL_CANCELLED\",\n        //         \"created_time\": \"2023-01-16T23:37:23.947030Z\",\n        //         \"completion_percentage\": \"0\",\n        //         \"filled_size\": \"0\",\n        //         \"average_filled_price\": \"0\",\n        //         \"fee\": \"\",\n        //         \"number_of_fills\": \"0\",\n        //         \"filled_value\": \"0\",\n        //         \"pending_cancel\": false,\n        //         \"size_in_quote\": false,\n        //         \"total_fees\": \"0\",\n        //         \"size_inclusive_of_fees\": false,\n        //         \"total_value_after_fees\": \"0\",\n        //         \"trigger_status\": \"INVALID_ORDER_TYPE\",\n        //         \"order_type\": \"LIMIT\",\n        //         \"reject_reason\": \"REJECT_REASON_UNSPECIFIED\",\n        //         \"settled\": false,\n        //         \"product_type\": \"SPOT\",\n        //         \"reject_message\": \"\",\n        //         \"cancel_message\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'product_id');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        if (symbol !== undefined) {\n            market = this.safeMarket (symbol, market);\n        }\n        const orderConfiguration = this.safeDict (order, 'order_configuration', {});\n        const limitGTC = this.safeDict (orderConfiguration, 'limit_limit_gtc');\n        const limitGTD = this.safeDict (orderConfiguration, 'limit_limit_gtd');\n        const limitIOC = this.safeDict (orderConfiguration, 'sor_limit_ioc');\n        const stopLimitGTC = this.safeDict (orderConfiguration, 'stop_limit_stop_limit_gtc');\n        const stopLimitGTD = this.safeDict (orderConfiguration, 'stop_limit_stop_limit_gtd');\n        const marketIOC = this.safeDict (orderConfiguration, 'market_market_ioc');\n        const isLimit = ((limitGTC !== undefined) || (limitGTD !== undefined) || (limitIOC !== undefined));\n        const isStop = ((stopLimitGTC !== undefined) || (stopLimitGTD !== undefined));\n        let price = undefined;\n        let amount = undefined;\n        let postOnly = undefined;\n        let triggerPrice = undefined;\n        if (isLimit) {\n            let target = undefined;\n            if (limitGTC !== undefined) {\n                target = limitGTC;\n            } else if (limitGTD !== undefined) {\n                target = limitGTD;\n            } else {\n                target = limitIOC;\n            }\n            price = this.safeString (target, 'limit_price');\n            amount = this.safeString (target, 'base_size');\n            postOnly = this.safeBool (target, 'post_only');\n        } else if (isStop) {\n            const stopTarget = (stopLimitGTC !== undefined) ? stopLimitGTC : stopLimitGTD;\n            price = this.safeString (stopTarget, 'limit_price');\n            amount = this.safeString (stopTarget, 'base_size');\n            postOnly = this.safeBool (stopTarget, 'post_only');\n            triggerPrice = this.safeString (stopTarget, 'stop_price');\n        } else {\n            amount = this.safeString (marketIOC, 'base_size');\n        }\n        const datetime = this.safeString (order, 'created_time');\n        const totalFees = this.safeString (order, 'total_fees');\n        let currencyFee = undefined;\n        if ((totalFees !== undefined) && (market !== undefined)) {\n            currencyFee = market['quote'];\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'order_id'),\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': this.parseOrderType (this.safeString (order, 'order_type')),\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'time_in_force')),\n            'postOnly': postOnly,\n            'side': this.safeStringLower (order, 'side'),\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'filled': this.safeString (order, 'filled_size'),\n            'remaining': undefined,\n            'cost': undefined,\n            'average': this.safeString (order, 'average_filled_price'),\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'fee': {\n                'cost': this.safeString (order, 'total_fees'),\n                'currency': currencyFee,\n            },\n            'trades': undefined,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3359,
        "line_end": 3369,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'OPEN': 'open',\n            'FILLED': 'closed',\n            'CANCELLED': 'canceled',\n            'EXPIRED': 'canceled',\n            'FAILED': 'canceled',\n            'UNKNOWN_ORDER_STATUS': undefined,\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 3371,
        "line_end": 3382,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        if (type === 'UNKNOWN_ORDER_TYPE') {\n            return undefined;\n        }\n        const types: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'STOP': 'limit',\n            'STOP_LIMIT': 'limit',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parsePortfolioDetails",
        "signature": "parsePortfolioDetails (portfolioData: Dict)",
        "line_start": 5032,
        "line_end": 5078,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "available_balance",
            "value": "availableBalance",
            "comment": null
          },
          {
            "key": "hold_amount",
            "value": "holdAmount > 0 ? holdAmount : 0",
            "comment": null
          },
          {
            "key": "wallet_name",
            "value": "portfolioName",
            "comment": null
          },
          {
            "key": "account_id",
            "value": "portfolioUuid",
            "comment": null
          },
          {
            "key": "account_uuid",
            "value": "this.safeString (position, 'account_uuid', '')",
            "comment": null
          },
          {
            "key": "total_balance_fiat",
            "value": "totalBalanceFiat",
            "comment": null
          },
          {
            "key": "total_balance_crypto",
            "value": "this.parseNumber (this.safeString (position, 'total_balance_crypto', '0'))",
            "comment": null
          },
          {
            "key": "available_to_trade_fiat",
            "value": "this.parseNumber (this.safeString (position, 'available_to_trade_fiat', '0'))",
            "comment": null
          },
          {
            "key": "available_to_trade_crypto",
            "value": "this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0'))",
            "comment": null
          },
          {
            "key": "available_to_transfer_fiat",
            "value": "this.parseNumber (this.safeString (position, 'available_to_transfer_fiat', '0'))",
            "comment": null
          },
          {
            "key": "available_to_transfer_crypto",
            "value": "this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0'))",
            "comment": null
          },
          {
            "key": "allocation",
            "value": "this.parseNumber (this.safeString (position, 'allocation', '0'))",
            "comment": null
          },
          {
            "key": "cost_basis",
            "value": "this.parseNumber (costBasisStr)",
            "comment": null
          },
          {
            "key": "cost_basis_currency",
            "value": "this.safeString (costBasisDict, 'currency', 'USD')",
            "comment": null
          },
          {
            "key": "is_cash",
            "value": "this.safeBool (position, 'is_cash', false)",
            "comment": null
          },
          {
            "key": "average_entry_price",
            "value": "this.parseNumber (averageEntryPriceStr)",
            "comment": null
          },
          {
            "key": "average_entry_price_currency",
            "value": "this.safeString (averageEntryPriceDict, 'currency', 'USD')",
            "comment": null
          },
          {
            "key": "asset_uuid",
            "value": "this.safeString (position, 'asset_uuid', '')",
            "comment": null
          },
          {
            "key": "unrealized_pnl",
            "value": "this.parseNumber (this.safeString (position, 'unrealized_pnl', '0'))",
            "comment": null
          },
          {
            "key": "asset_color",
            "value": "this.safeString (position, 'asset_color', '')",
            "comment": null
          },
          {
            "key": "account_type",
            "value": "this.safeString (position, 'account_type', '')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePortfolioDetails (portfolioData: Dict) {\n        const breakdown = portfolioData['breakdown'];\n        const portfolioInfo = this.safeDict (breakdown, 'portfolio', {});\n        const portfolioName = this.safeString (portfolioInfo, 'name', 'Unknown');\n        const portfolioUuid = this.safeString (portfolioInfo, 'uuid', '');\n        const spotPositions = this.safeList (breakdown, 'spot_positions', []);\n        const parsedPositions = [];\n        for (let i = 0; i < spotPositions.length; i++) {\n            const position: Dict = spotPositions[i];\n            const currencyCode = this.safeString (position, 'asset', 'Unknown');\n            const availableBalanceStr = this.safeString (position, 'available_to_trade_fiat', '0');\n            const availableBalance = this.parseNumber (availableBalanceStr);\n            const totalBalanceFiatStr = this.safeString (position, 'total_balance_fiat', '0');\n            const totalBalanceFiat = this.parseNumber (totalBalanceFiatStr);\n            const holdAmount = totalBalanceFiat - availableBalance;\n            const costBasisDict = this.safeDict (position, 'cost_basis', {});\n            const costBasisStr = this.safeString (costBasisDict, 'value', '0');\n            const averageEntryPriceDict = this.safeDict (position, 'average_entry_price', {});\n            const averageEntryPriceStr = this.safeString (averageEntryPriceDict, 'value', '0');\n            const positionData: Dict = {\n                'currency': currencyCode,\n                'available_balance': availableBalance,\n                'hold_amount': holdAmount > 0 ? holdAmount : 0,\n                'wallet_name': portfolioName,\n                'account_id': portfolioUuid,\n                'account_uuid': this.safeString (position, 'account_uuid', ''),\n                'total_balance_fiat': totalBalanceFiat,\n                'total_balance_crypto': this.parseNumber (this.safeString (position, 'total_balance_crypto', '0')),\n                'available_to_trade_fiat': this.parseNumber (this.safeString (position, 'available_to_trade_fiat', '0')),\n                'available_to_trade_crypto': this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0')),\n                'available_to_transfer_fiat': this.parseNumber (this.safeString (position, 'available_to_transfer_fiat', '0')),\n                'available_to_transfer_crypto': this.parseNumber (this.safeString (position, 'available_to_trade_crypto', '0')),\n                'allocation': this.parseNumber (this.safeString (position, 'allocation', '0')),\n                'cost_basis': this.parseNumber (costBasisStr),\n                'cost_basis_currency': this.safeString (costBasisDict, 'currency', 'USD'),\n                'is_cash': this.safeBool (position, 'is_cash', false),\n                'average_entry_price': this.parseNumber (averageEntryPriceStr),\n                'average_entry_price_currency': this.safeString (averageEntryPriceDict, 'currency', 'USD'),\n                'asset_uuid': this.safeString (position, 'asset_uuid', ''),\n                'unrealized_pnl': this.parseNumber (this.safeString (position, 'unrealized_pnl', '0')),\n                'asset_color': this.safeString (position, 'asset_color', ''),\n                'account_type': this.safeString (position, 'account_type', ''),\n            };\n            parsedPositions.push (positionData);\n        }\n        return parsedPositions;\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 4814,
        "line_end": 4949,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'product_id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (notionalObject, 'value')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (vwapObject, 'value')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (unrealizedPNLObject, 'value')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'net_size')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "market['contractSize']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (summaryObject, 'collateral')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"product_id\": \"1r4njf84-0-0\",\n     \"product_uuid\": \"cd34c18b-3665-4ed8-9305-3db277c49fc5\",\n     \"symbol\": \"ADA-PERP-INTX\",\n     \"vwap\": {\n        \"value\": \"0.6171\",\n        \"currency\": \"USDC\"\n     },\n     \"position_side\": \"POSITION_SIDE_LONG\",\n     \"net_size\": \"20\",\n     \"buy_order_size\": \"0\",\n     \"sell_order_size\": \"0\",\n     \"im_contribution\": \"0.1\",\n     \"unrealized_pnl\": {\n        \"value\": \"0.074\",\n        \"currency\": \"USDC\"\n     },\n     \"mark_price\": {\n        \"value\": \"0.6208\",\n        \"currency\": \"USDC\"\n     },\n     \"liquidation_price\": {\n        \"value\": \"0\",\n        \"currency\": \"USDC\"\n     },\n     \"leverage\": \"1\",\n     \"im_notional\": {\n        \"value\": \"12.342\",\n        \"currency\": \"USDC\"\n     },\n     \"mm_notional\": {\n        \"value\": \"0.814572\",\n        \"currency\": \"USDC\"\n     },\n     \"position_notional\": {\n        \"value\": \"12.342\",\n        \"currency\": \"USDC\"\n     },\n     \"margin_type\": \"MARGIN_TYPE_CROSS\",\n     \"liquidation_buffer\": \"19.677828\",\n     \"liquidation_percentage\": \"4689.3506\",\n     \"portfolio_summary\": {\n        \"portfolio_uuid\": \"018ebd63-1f6d-7c8e-ada9-0761c5a2235f\",\n        \"collateral\": \"20.4184\",\n        \"position_notional\": \"12.342\",\n        \"open_position_notional\": \"12.342\",\n        \"pending_fees\": \"0\",\n        \"borrow\": \"0\",\n        \"accrued_interest\": \"0\",\n        \"rolling_debt\": \"0\",\n        \"portfolio_initial_margin\": \"0.1\",\n        \"portfolio_im_notional\": {\n           \"value\": \"12.342\",\n           \"currency\": \"USDC\"\n        },\n        \"portfolio_maintenance_margin\": \"0.066\",\n        \"portfolio_mm_notional\": {\n           \"value\": \"0.814572\",\n           \"currency\": \"USDC\"\n        },\n        \"liquidation_percentage\": \"4689.3506\",\n        \"liquidation_buffer\": \"19.677828\",\n        \"margin_type\": \"MARGIN_TYPE_CROSS\",\n        \"margin_flags\": \"PORTFOLIO_MARGIN_FLAGS_UNSPECIFIED\",\n        \"liquidation_status\": \"PORTFOLIO_LIQUIDATION_STATUS_NOT_LIQUIDATING\",\n        \"unrealized_pnl\": {\n           \"value\": \"0.074\",\n           \"currency\": \"USDC\"\n        },\n        \"buying_power\": {\n           \"value\": \"8.1504\",\n           \"currency\": \"USDC\"\n        },\n        \"total_balance\": {\n           \"value\": \"20.4924\",\n           \"currency\": \"USDC\"\n        },\n        \"max_withdrawal\": {\n           \"value\": \"8.0764\",\n           \"currency\": \"USDC\"\n        }\n     },\n     \"entry_vwap\": {\n        \"value\": \"0.6091\",\n        \"currency\": \"USDC\"\n     }\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"product_id\": \"1r4njf84-0-0\",\n        //     \"product_uuid\": \"cd34c18b-3665-4ed8-9305-3db277c49fc5\",\n        //     \"symbol\": \"ADA-PERP-INTX\",\n        //     \"vwap\": {\n        //        \"value\": \"0.6171\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"position_side\": \"POSITION_SIDE_LONG\",\n        //     \"net_size\": \"20\",\n        //     \"buy_order_size\": \"0\",\n        //     \"sell_order_size\": \"0\",\n        //     \"im_contribution\": \"0.1\",\n        //     \"unrealized_pnl\": {\n        //        \"value\": \"0.074\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"mark_price\": {\n        //        \"value\": \"0.6208\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"liquidation_price\": {\n        //        \"value\": \"0\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"leverage\": \"1\",\n        //     \"im_notional\": {\n        //        \"value\": \"12.342\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"mm_notional\": {\n        //        \"value\": \"0.814572\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"position_notional\": {\n        //        \"value\": \"12.342\",\n        //        \"currency\": \"USDC\"\n        //     },\n        //     \"margin_type\": \"MARGIN_TYPE_CROSS\",\n        //     \"liquidation_buffer\": \"19.677828\",\n        //     \"liquidation_percentage\": \"4689.3506\",\n        //     \"portfolio_summary\": {\n        //        \"portfolio_uuid\": \"018ebd63-1f6d-7c8e-ada9-0761c5a2235f\",\n        //        \"collateral\": \"20.4184\",\n        //        \"position_notional\": \"12.342\",\n        //        \"open_position_notional\": \"12.342\",\n        //        \"pending_fees\": \"0\",\n        //        \"borrow\": \"0\",\n        //        \"accrued_interest\": \"0\",\n        //        \"rolling_debt\": \"0\",\n        //        \"portfolio_initial_margin\": \"0.1\",\n        //        \"portfolio_im_notional\": {\n        //           \"value\": \"12.342\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"portfolio_maintenance_margin\": \"0.066\",\n        //        \"portfolio_mm_notional\": {\n        //           \"value\": \"0.814572\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"liquidation_percentage\": \"4689.3506\",\n        //        \"liquidation_buffer\": \"19.677828\",\n        //        \"margin_type\": \"MARGIN_TYPE_CROSS\",\n        //        \"margin_flags\": \"PORTFOLIO_MARGIN_FLAGS_UNSPECIFIED\",\n        //        \"liquidation_status\": \"PORTFOLIO_LIQUIDATION_STATUS_NOT_LIQUIDATING\",\n        //        \"unrealized_pnl\": {\n        //           \"value\": \"0.074\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"buying_power\": {\n        //           \"value\": \"8.1504\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"total_balance\": {\n        //           \"value\": \"20.4924\",\n        //           \"currency\": \"USDC\"\n        //        },\n        //        \"max_withdrawal\": {\n        //           \"value\": \"8.0764\",\n        //           \"currency\": \"USDC\"\n        //        }\n        //     },\n        //     \"entry_vwap\": {\n        //        \"value\": \"0.6091\",\n        //        \"currency\": \"USDC\"\n        //     }\n        // }\n        //\n        const marketId = this.safeString (position, 'symbol', '');\n        market = this.safeMarket (marketId, market);\n        const rawMargin = this.safeString (position, 'margin_type');\n        let marginMode = undefined;\n        if (rawMargin !== undefined) {\n            marginMode = (rawMargin === 'MARGIN_TYPE_CROSS') ? 'cross' : 'isolated';\n        }\n        const notionalObject = this.safeDict (position, 'position_notional', {});\n        const positionSide = this.safeString (position, 'position_side');\n        const side = (positionSide === 'POSITION_SIDE_LONG') ? 'long' : 'short';\n        const unrealizedPNLObject = this.safeDict (position, 'unrealized_pnl', {});\n        const liquidationPriceObject = this.safeDict (position, 'liquidation_price', {});\n        const liquidationPrice = this.safeNumber (liquidationPriceObject, 'value');\n        const vwapObject = this.safeDict (position, 'vwap', {});\n        const summaryObject = this.safeDict (position, 'portfolio_summary', {});\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'product_id'),\n            'symbol': this.safeSymbol (marketId, market),\n            'notional': this.safeNumber (notionalObject, 'value'),\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.safeNumber (vwapObject, 'value'),\n            'unrealizedPnl': this.safeNumber (unrealizedPNLObject, 'value'),\n            'realizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'net_size'),\n            'contractSize': market['contractSize'],\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': side,\n            'hedged': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': this.safeNumber (summaryObject, 'collateral'),\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber (position, 'leverage'),\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseSpotMarket",
        "signature": "parseSpotMarket (market, feeTier): MarketInterface",
        "line_start": 1575,
        "line_end": 1670,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "(marketType === 'spot')",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "!tradingDisabled",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "takerFee",
            "comment": null
          },
          {
            "key": "maker",
            "value": "makerFee",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"product_id\": \"TONE-USD\",\n             \"price\": \"0.01523\",\n             \"price_percentage_change_24h\": \"1.94109772423025\",\n             \"volume_24h\": \"19773129\",\n             \"volume_percentage_change_24h\": \"437.0170530929949\",\n             \"base_increment\": \"1\",\n             \"quote_increment\": \"0.00001\",\n             \"quote_min_size\": \"1\",\n             \"quote_max_size\": \"10000000\",\n             \"base_min_size\": \"26.7187147229469674\",\n             \"base_max_size\": \"267187147.2294696735908216\",\n             \"base_name\": \"TE-FOOD\",\n             \"quote_name\": \"US Dollar\",\n             \"watched\": false,\n             \"is_disabled\": false,\n             \"new\": false,\n             \"status\": \"online\",\n             \"cancel_only\": false,\n             \"limit_only\": false,\n             \"post_only\": false,\n             \"trading_disabled\": false,\n             \"auction_mode\": false,\n             \"product_type\": \"SPOT\",\n             \"quote_currency_id\": \"USD\",\n             \"base_currency_id\": \"TONE\",\n             \"fcm_trading_session_details\": null,\n             \"mid_market_price\": \"\"\n         }"
        ],
        "source": "parseSpotMarket (market, feeTier): MarketInterface {\n        //\n        //         {\n        //             \"product_id\": \"TONE-USD\",\n        //             \"price\": \"0.01523\",\n        //             \"price_percentage_change_24h\": \"1.94109772423025\",\n        //             \"volume_24h\": \"19773129\",\n        //             \"volume_percentage_change_24h\": \"437.0170530929949\",\n        //             \"base_increment\": \"1\",\n        //             \"quote_increment\": \"0.00001\",\n        //             \"quote_min_size\": \"1\",\n        //             \"quote_max_size\": \"10000000\",\n        //             \"base_min_size\": \"26.7187147229469674\",\n        //             \"base_max_size\": \"267187147.2294696735908216\",\n        //             \"base_name\": \"TE-FOOD\",\n        //             \"quote_name\": \"US Dollar\",\n        //             \"watched\": false,\n        //             \"is_disabled\": false,\n        //             \"new\": false,\n        //             \"status\": \"online\",\n        //             \"cancel_only\": false,\n        //             \"limit_only\": false,\n        //             \"post_only\": false,\n        //             \"trading_disabled\": false,\n        //             \"auction_mode\": false,\n        //             \"product_type\": \"SPOT\",\n        //             \"quote_currency_id\": \"USD\",\n        //             \"base_currency_id\": \"TONE\",\n        //             \"fcm_trading_session_details\": null,\n        //             \"mid_market_price\": \"\"\n        //         }\n        //\n        const id = this.safeString (market, 'product_id');\n        const baseId = this.safeString (market, 'base_currency_id');\n        const quoteId = this.safeString (market, 'quote_currency_id');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const marketType = this.safeStringLower (market, 'product_type');\n        const tradingDisabled = this.safeBool (market, 'trading_disabled');\n        const stablePairs = this.safeList (this.options, 'stablePairs', []);\n        const defaultTakerFee = this.safeNumber (this.fees['trading'], 'taker');\n        const defaultMakerFee = this.safeNumber (this.fees['trading'], 'maker');\n        const takerFee = this.inArray (id, stablePairs) ? 0.00001 : this.safeNumber (feeTier, 'taker_fee_rate', defaultTakerFee);\n        const makerFee = this.inArray (id, stablePairs) ? 0.0 : this.safeNumber (feeTier, 'maker_fee_rate', defaultMakerFee);\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': marketType,\n            'spot': (marketType === 'spot'),\n            'margin': undefined,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': !tradingDisabled,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': takerFee,\n            'maker': makerFee,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber2 (market, 'price_increment', 'quote_increment'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min_size'),\n                    'max': this.safeNumber (market, 'base_max_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'quote_min_size'),\n                    'max': this.safeNumber (market, 'quote_max_size'),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2240,
        "line_end": 2371,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (ticker, 'price_percentage_change_24h')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (ticker, 'volume_24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (ticker, 'approximate_quote_24h_volume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"bid\": 20713.37,\n         \"ask\": 20924.65,\n         \"price\": 20809.83\n     }",
          "{\n         \"trade_id\": \"10209805\",\n         \"product_id\": \"BTC-USDT\",\n         \"price\": \"19381.27\",\n         \"size\": \"0.1\",\n         \"time\": \"2023-01-13T20:35:41.865970Z\",\n         \"side\": \"BUY\",\n         \"bid\": \"\",\n         \"ask\": \"\"\n     }",
          "[\n        {\n            \"product_id\": \"ETH-USD\",\n            \"price\": \"4471.59\",\n            \"price_percentage_change_24h\": \"0.14243387238731\",\n            \"volume_24h\": \"87329.92990204\",\n            \"volume_percentage_change_24h\": \"-60.7789801794578\",\n            \"base_increment\": \"0.00000001\",\n            \"quote_increment\": \"0.01\",\n            \"quote_min_size\": \"1\",\n            \"quote_max_size\": \"150000000\",\n            \"base_min_size\": \"0.00000001\",\n            \"base_max_size\": \"42000\",\n            \"base_name\": \"Ethereum\",\n            \"quote_name\": \"US Dollar\",\n            \"watched\": false,\n            \"is_disabled\": false,\n            \"new\": false,\n            \"status\": \"online\",\n            \"cancel_only\": false,\n            \"limit_only\": false,\n            \"post_only\": false,\n            \"trading_disabled\": false,\n            \"auction_mode\": false,\n            \"product_type\": \"SPOT\",\n            \"quote_currency_id\": \"USD\",\n            \"base_currency_id\": \"ETH\",\n            \"fcm_trading_session_details\": null,\n            \"mid_market_price\": \"\",\n            \"alias\": \"\",\n            \"alias_to\": [ \"ETH-USDC\" ],\n            \"base_display_symbol\": \"ETH\",\n            \"quote_display_symbol\": \"USD\",\n            \"view_only\": false,\n            \"price_increment\": \"0.01\",\n            \"display_name\": \"ETH-USD\",\n            \"product_venue\": \"CBE\",\n            \"approximate_quote_24h_volume\": \"390503641.25\",\n            \"new_at\": \"2023-01-01T00:00:00Z\"\n         },\n         ...\n     ]",
          "{\n         \"product_id\": \"TRAC-EUR\",\n         \"bids\": [\n             {\n                 \"price\": \"0.2384\",\n                 \"size\": \"386.1\"\n             }\n         ],\n         \"asks\": [\n             {\n                 \"price\": \"0.2406\",\n                 \"size\": \"672\"\n             }\n         ],\n         \"time\": \"2023-06-30T07:15:24.656044Z\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTickerV2\n        //\n        //     {\n        //         \"bid\": 20713.37,\n        //         \"ask\": 20924.65,\n        //         \"price\": 20809.83\n        //     }\n        //\n        // fetchTickerV3\n        //\n        //     {\n        //         \"trade_id\": \"10209805\",\n        //         \"product_id\": \"BTC-USDT\",\n        //         \"price\": \"19381.27\",\n        //         \"size\": \"0.1\",\n        //         \"time\": \"2023-01-13T20:35:41.865970Z\",\n        //         \"side\": \"BUY\",\n        //         \"bid\": \"\",\n        //         \"ask\": \"\"\n        //     }\n        //\n        // fetchTickersV2\n        //\n        //     \"48691.23\"\n        //\n        // fetchTickersV3\n        //\n        //     [\n        //        {\n        //            \"product_id\": \"ETH-USD\",\n        //            \"price\": \"4471.59\",\n        //            \"price_percentage_change_24h\": \"0.14243387238731\",\n        //            \"volume_24h\": \"87329.92990204\",\n        //            \"volume_percentage_change_24h\": \"-60.7789801794578\",\n        //            \"base_increment\": \"0.00000001\",\n        //            \"quote_increment\": \"0.01\",\n        //            \"quote_min_size\": \"1\",\n        //            \"quote_max_size\": \"150000000\",\n        //            \"base_min_size\": \"0.00000001\",\n        //            \"base_max_size\": \"42000\",\n        //            \"base_name\": \"Ethereum\",\n        //            \"quote_name\": \"US Dollar\",\n        //            \"watched\": false,\n        //            \"is_disabled\": false,\n        //            \"new\": false,\n        //            \"status\": \"online\",\n        //            \"cancel_only\": false,\n        //            \"limit_only\": false,\n        //            \"post_only\": false,\n        //            \"trading_disabled\": false,\n        //            \"auction_mode\": false,\n        //            \"product_type\": \"SPOT\",\n        //            \"quote_currency_id\": \"USD\",\n        //            \"base_currency_id\": \"ETH\",\n        //            \"fcm_trading_session_details\": null,\n        //            \"mid_market_price\": \"\",\n        //            \"alias\": \"\",\n        //            \"alias_to\": [ \"ETH-USDC\" ],\n        //            \"base_display_symbol\": \"ETH\",\n        //            \"quote_display_symbol\": \"USD\",\n        //            \"view_only\": false,\n        //            \"price_increment\": \"0.01\",\n        //            \"display_name\": \"ETH-USD\",\n        //            \"product_venue\": \"CBE\",\n        //            \"approximate_quote_24h_volume\": \"390503641.25\",\n        //            \"new_at\": \"2023-01-01T00:00:00Z\"\n        //         },\n        //         ...\n        //     ]\n        //\n        // fetchBidsAsks\n        //\n        //     {\n        //         \"product_id\": \"TRAC-EUR\",\n        //         \"bids\": [\n        //             {\n        //                 \"price\": \"0.2384\",\n        //                 \"size\": \"386.1\"\n        //             }\n        //         ],\n        //         \"asks\": [\n        //             {\n        //                 \"price\": \"0.2406\",\n        //                 \"size\": \"672\"\n        //             }\n        //         ],\n        //         \"time\": \"2023-06-30T07:15:24.656044Z\"\n        //     }\n        //\n        let bid = this.safeNumber (ticker, 'bid');\n        let ask = this.safeNumber (ticker, 'ask');\n        let bidVolume = undefined;\n        let askVolume = undefined;\n        if (('bids' in ticker)) {\n            const bids = this.safeList (ticker, 'bids', []);\n            const asks = this.safeList (ticker, 'asks', []);\n            const firstBid = this.safeDict (bids, 0, {});\n            const firstAsk = this.safeDict (asks, 0, {});\n            bid = this.safeNumber (firstBid, 'price');\n            bidVolume = this.safeNumber (firstBid, 'size');\n            ask = this.safeNumber (firstAsk, 'price');\n            askVolume = this.safeNumber (firstAsk, 'size');\n        }\n        const marketId = this.safeString (ticker, 'product_id');\n        market = this.safeMarket (marketId, market);\n        const last = this.safeNumber (ticker, 'price');\n        const datetime = this.safeString (ticker, 'time');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'bid': bid,\n            'ask': ask,\n            'last': last,\n            'high': undefined,\n            'low': undefined,\n            'bidVolume': bidVolume,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeNumber (ticker, 'price_percentage_change_24h'),\n            'average': undefined,\n            'baseVolume': this.safeNumber (ticker, 'volume_24h'),\n            'quoteVolume': this.safeNumber (ticker, 'approximate_quote_24h_volume'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 3384,
        "line_end": 3393,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GOOD_UNTIL_CANCELLED': 'GTC',\n            'GOOD_UNTIL_DATE_TIME': 'GTD',\n            'IMMEDIATE_OR_CANCEL': 'IOC',\n            'FILL_OR_KILL': 'FOK',\n            'UNKNOWN_TIME_IN_FORCE': undefined,\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1195,
        "line_end": 1325,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'id', 'trade_id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "(side === 'unknown_order_side') ? undefined : side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "(takerOrMaker === 'unknown_liquidity_indicator') ? undefined : takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"67e0eaec-07d7-54c4-a72c-2e92826897df\",\n         \"status\": \"completed\",\n         \"payment_method\": {\n             \"id\": \"83562370-3e5c-51db-87da-752af5ab9559\",\n             \"resource\": \"payment_method\",\n             \"resource_path\": \"/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559\"\n         },\n         \"transaction\": {\n             \"id\": \"441b9494-b3f0-5b98-b9b0-4d82c21c252a\",\n             \"resource\": \"transaction\",\n             \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a\"\n         },\n         \"amount\": { \"amount\": \"1.00000000\", \"currency\": \"BTC\" },\n         \"total\": { \"amount\": \"10.25\", \"currency\": \"USD\" },\n         \"subtotal\": { \"amount\": \"10.10\", \"currency\": \"USD\" },\n         \"created_at\": \"2015-01-31T20:49:02Z\",\n         \"updated_at\": \"2015-02-11T16:54:02-08:00\",\n         \"resource\": \"buy\",\n         \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/67e0eaec-07d7-54c4-a72c-2e92826897df\",\n         \"committed\": true,\n         \"instant\": false,\n         \"fee\": { \"amount\": \"0.15\", \"currency\": \"USD\" },\n         \"payout_at\": \"2015-02-18T16:54:00-08:00\"\n     }",
          "{\n         \"trade_id\": \"10092327\",\n         \"product_id\": \"BTC-USDT\",\n         \"price\": \"17488.12\",\n         \"size\": \"0.0000623\",\n         \"time\": \"2023-01-11T00:52:37.557001Z\",\n         \"side\": \"BUY\",\n         \"bid\": \"\",\n         \"ask\": \"\"\n     }",
          "{\n         \"entry_id\": \"b88b82cc89e326a2778874795102cbafd08dd979a2a7a3c69603fc4c23c2e010\",\n         \"trade_id\": \"cdc39e45-bbd3-44ec-bf02-61742dfb16a1\",\n         \"order_id\": \"813a53c5-3e39-47bb-863d-2faf685d22d8\",\n         \"trade_time\": \"2023-01-18T01:37:38.091377090Z\",\n         \"trade_type\": \"FILL\",\n         \"price\": \"21220.64\",\n         \"size\": \"0.0046830664333996\",\n         \"commission\": \"0.0000280983986004\",\n         \"product_id\": \"BTC-USDT\",\n         \"sequence_timestamp\": \"2023-01-18T01:37:38.092520Z\",\n         \"liquidity_indicator\": \"UNKNOWN_LIQUIDITY_INDICATOR\",\n         \"size_in_quote\": true,\n         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n         \"side\": \"BUY\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchMyBuys, fetchMySells\n        //\n        //     {\n        //         \"id\": \"67e0eaec-07d7-54c4-a72c-2e92826897df\",\n        //         \"status\": \"completed\",\n        //         \"payment_method\": {\n        //             \"id\": \"83562370-3e5c-51db-87da-752af5ab9559\",\n        //             \"resource\": \"payment_method\",\n        //             \"resource_path\": \"/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559\"\n        //         },\n        //         \"transaction\": {\n        //             \"id\": \"441b9494-b3f0-5b98-b9b0-4d82c21c252a\",\n        //             \"resource\": \"transaction\",\n        //             \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a\"\n        //         },\n        //         \"amount\": { \"amount\": \"1.00000000\", \"currency\": \"BTC\" },\n        //         \"total\": { \"amount\": \"10.25\", \"currency\": \"USD\" },\n        //         \"subtotal\": { \"amount\": \"10.10\", \"currency\": \"USD\" },\n        //         \"created_at\": \"2015-01-31T20:49:02Z\",\n        //         \"updated_at\": \"2015-02-11T16:54:02-08:00\",\n        //         \"resource\": \"buy\",\n        //         \"resource_path\": \"/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/67e0eaec-07d7-54c4-a72c-2e92826897df\",\n        //         \"committed\": true,\n        //         \"instant\": false,\n        //         \"fee\": { \"amount\": \"0.15\", \"currency\": \"USD\" },\n        //         \"payout_at\": \"2015-02-18T16:54:00-08:00\"\n        //     }\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"trade_id\": \"10092327\",\n        //         \"product_id\": \"BTC-USDT\",\n        //         \"price\": \"17488.12\",\n        //         \"size\": \"0.0000623\",\n        //         \"time\": \"2023-01-11T00:52:37.557001Z\",\n        //         \"side\": \"BUY\",\n        //         \"bid\": \"\",\n        //         \"ask\": \"\"\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"entry_id\": \"b88b82cc89e326a2778874795102cbafd08dd979a2a7a3c69603fc4c23c2e010\",\n        //         \"trade_id\": \"cdc39e45-bbd3-44ec-bf02-61742dfb16a1\",\n        //         \"order_id\": \"813a53c5-3e39-47bb-863d-2faf685d22d8\",\n        //         \"trade_time\": \"2023-01-18T01:37:38.091377090Z\",\n        //         \"trade_type\": \"FILL\",\n        //         \"price\": \"21220.64\",\n        //         \"size\": \"0.0046830664333996\",\n        //         \"commission\": \"0.0000280983986004\",\n        //         \"product_id\": \"BTC-USDT\",\n        //         \"sequence_timestamp\": \"2023-01-18T01:37:38.092520Z\",\n        //         \"liquidity_indicator\": \"UNKNOWN_LIQUIDITY_INDICATOR\",\n        //         \"size_in_quote\": true,\n        //         \"user_id\": \"1111111-1111-1111-1111-111111111111\",\n        //         \"side\": \"BUY\"\n        //     }\n        //\n        let symbol = undefined;\n        const totalObject = this.safeDict (trade, 'total', {});\n        const amountObject = this.safeDict (trade, 'amount', {});\n        const subtotalObject = this.safeDict (trade, 'subtotal', {});\n        const feeObject = this.safeDict (trade, 'fee', {});\n        const marketId = this.safeString (trade, 'product_id');\n        market = this.safeMarket (marketId, market, '-');\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        } else {\n            const baseId = this.safeString (amountObject, 'currency');\n            const quoteId = this.safeString (totalObject, 'currency');\n            if ((baseId !== undefined) && (quoteId !== undefined)) {\n                const base = this.safeCurrencyCode (baseId);\n                const quote = this.safeCurrencyCode (quoteId);\n                symbol = base + '/' + quote;\n            }\n        }\n        const sizeInQuote = this.safeBool (trade, 'size_in_quote');\n        const v3Price = this.safeString (trade, 'price');\n        let v3Cost = undefined;\n        let v3Amount = this.safeString (trade, 'size');\n        if (sizeInQuote) {\n            // calculate base size\n            v3Cost = v3Amount;\n            v3Amount = Precise.stringDiv (v3Amount, v3Price);\n        }\n        const v3FeeCost = this.safeString (trade, 'commission');\n        const amountString = this.safeString (amountObject, 'amount', v3Amount);\n        const costString = this.safeString (subtotalObject, 'amount', v3Cost);\n        let priceString = undefined;\n        let cost = undefined;\n        if ((costString !== undefined) && (amountString !== undefined)) {\n            priceString = Precise.stringDiv (costString, amountString);\n        } else {\n            priceString = v3Price;\n        }\n        if ((priceString !== undefined) && (amountString !== undefined)) {\n            cost = Precise.stringMul (priceString, amountString);\n        } else {\n            cost = costString;\n        }\n        let feeCurrencyId = this.safeString (feeObject, 'currency');\n        const feeCost = this.safeNumber (feeObject, 'amount', this.parseNumber (v3FeeCost));\n        if ((feeCurrencyId === undefined) && (market !== undefined) && (feeCost !== undefined)) {\n            feeCurrencyId = market['quote'];\n        }\n        const datetime = this.safeStringN (trade, [ 'created_at', 'trade_time', 'time' ]);\n        const side = this.safeStringLower2 (trade, 'resource', 'side');\n        const takerOrMaker = this.safeStringLower (trade, 'liquidity_indicator');\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'id', 'trade_id'),\n            'order': this.safeString (trade, 'order_id'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'symbol': symbol,\n            'type': undefined,\n            'side': (side === 'unknown_order_side') ? undefined : side,\n            'takerOrMaker': (takerOrMaker === 'unknown_liquidity_indicator') ? undefined : takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': cost,\n            'fee': {\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            },\n        });\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 979,
        "line_end": 1193,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (network, 'hash', id)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountStringAbs)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.parse8601 (this.safeString (transaction, 'updated_at'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (feeObject, 'amount'),\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (feeObject, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"f34c19f3-b730-5e3d-9f72\",\n         \"status\": \"completed\",\n         \"payment_method\": {\n             \"id\": \"a022b31d-f9c7-5043-98f2\",\n             \"resource\": \"payment_method\",\n             \"resource_path\": \"/v2/payment-methods/a022b31d-f9c7-5043-98f2\"\n         },\n         \"transaction\": {\n             \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n             \"resource\": \"transaction\",\n             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86\"\n         },\n         \"user_reference\": \"2VTYTH\",\n         \"created_at\": \"2017-02-09T07:01:18Z\",\n         \"updated_at\": \"2017-02-09T07:01:26Z\",\n         \"resource\": \"deposit\",\n         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72\",\n         \"committed\": true,\n         \"payout_at\": \"2017-02-12T07:01:17Z\",\n         \"instant\": false,\n         \"fee\": { \"amount\": \"0.00\", \"currency\": \"EUR\" },\n         \"amount\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n         \"subtotal\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n         \"hold_until\": null,\n         \"hold_days\": 0,\n         \"hold_business_days\": 0,\n         \"next_step\": null\n     }",
          "{\n         \"id\": \"cfcc3b4a-eeb6-5e8c-8058\",\n         \"status\": \"completed\",\n         \"payment_method\": {\n             \"id\": \"8b94cfa4-f7fd-5a12-a76a\",\n             \"resource\": \"payment_method\",\n             \"resource_path\": \"/v2/payment-methods/8b94cfa4-f7fd-5a12-a76a\"\n         },\n         \"transaction\": {\n             \"id\": \"fcc2550b-5104-5f83-a444\",\n             \"resource\": \"transaction\",\n             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/fcc2550b-5104-5f83-a444\"\n         },\n         \"user_reference\": \"MEUGK\",\n         \"created_at\": \"2018-07-26T08:55:12Z\",\n         \"updated_at\": \"2018-07-26T08:58:18Z\",\n         \"resource\": \"withdrawal\",\n         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/cfcc3b4a-eeb6-5e8c-8058\",\n         \"committed\": true,\n         \"payout_at\": \"2018-07-31T08:55:12Z\",\n         \"instant\": false,\n         \"fee\": { \"amount\": \"0.15\", \"currency\": \"EUR\" },\n         \"amount\": { \"amount\": \"13130.69\", \"currency\": \"EUR\" },\n         \"subtotal\": { \"amount\": \"13130.84\", \"currency\": \"EUR\" },\n         \"idem\": \"e549dee5-63ed-4e79-8a96\",\n         \"next_step\": null\n     }",
          "{\n         \"id\": \"a1794ecf-5693-55fa-70cf-ef731748ed82\",\n         \"type\": \"send\",\n         \"status\": \"pending\",\n         \"amount\": {\n             \"amount\": \"-14.008308\",\n             \"currency\": \"USDC\"\n         },\n         \"native_amount\": {\n             \"amount\": \"-18.74\",\n             \"currency\": \"CAD\"\n         },\n         \"description\": null,\n         \"created_at\": \"2024-01-12T01:27:31Z\",\n         \"updated_at\": \"2024-01-12T01:27:31Z\",\n         \"resource\": \"transaction\",\n         \"resource_path\": \"/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82\",\n         \"instant_exchange\": false,\n         \"network\": {\n             \"status\": \"pending\",\n             \"status_description\": \"Pending (est. less than 10 minutes)\",\n             \"transaction_fee\": {\n                 \"amount\": \"4.008308\",\n                 \"currency\": \"USDC\"\n             },\n             \"transaction_amount\": {\n                 \"amount\": \"10.000000\",\n                 \"currency\": \"USDC\"\n             },\n             \"confirmations\": 0\n         },\n         \"to\": {\n             \"resource\": \"ethereum_address\",\n             \"address\": \"0x9...\",\n             \"currency\": \"USDC\",\n             \"address_info\": {\n                 \"address\": \"0x9...\"\n             }\n         },\n         \"idem\": \"748d8591-dg9a-7831-a45b-crd61dg78762\",\n         \"details\": {\n             \"title\": \"Sent USDC\",\n             \"subtitle\": \"To USDC address on Ethereum network\",\n             \"header\": \"Sent 14.008308 USDC ($18.74)\",\n             \"health\": \"warning\"\n         },\n         \"hide_native_amount\": false\n     }",
          "{\n        \"amount\": {\n            \"amount\": \"0.00014200\", (negative for withdrawal)\n            \"currency\": \"BTC\"\n        },\n        \"created_at\": \"2024-03-29T15:48:30Z\",\n        \"id\": \"0031a605-241d-514d-a97b-d4b99f3225d3\",\n        \"idem\": \"092a979b-017e-4403-940a-2ca57811f442\", // field present only in case of withdrawal\n        \"native_amount\": {\n            \"amount\": \"9.85\", (negative for withdrawal)\n            \"currency\": \"USD\"\n        },\n        \"network\": {\n            \"status\": \"pending\", // if status is `off_blockchain` then no more other fields are present in this object\n            \"hash\": \"5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE\",\n            \"network_name\": \"solana\",\n            \"transaction_fee\": {\n                \"amount\": \"0.000100000\",\n                \"currency\": \"SOL\"\n            }\n        },\n        \"resource\": \"transaction\",\n        \"resource_path\": \"/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3\",\n        \"status\": \"completed\",\n        \"type\": \"send\",\n        \"from\": { // in some cases, field might be present for deposit\n            \"id\": \"7fd10cd7-b091-5cee-ba41-c29e49a7cccf\",\n            \"name\": \"Coinbase\",\n            \"resource\": \"user\"\n        },\n        \"to\": { // field only present for withdrawal\n            \"address\": \"5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE\",\n            \"resource\": \"address\"\n        },\n        \"description\": \"C3 - One Time BTC Credit . Reference Case # 123.\", //  in some cases, field might be present for deposit\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fiat deposit\n        //\n        //     {\n        //         \"id\": \"f34c19f3-b730-5e3d-9f72\",\n        //         \"status\": \"completed\",\n        //         \"payment_method\": {\n        //             \"id\": \"a022b31d-f9c7-5043-98f2\",\n        //             \"resource\": \"payment_method\",\n        //             \"resource_path\": \"/v2/payment-methods/a022b31d-f9c7-5043-98f2\"\n        //         },\n        //         \"transaction\": {\n        //             \"id\": \"04ed4113-3732-5b0c-af86-b1d2146977d0\",\n        //             \"resource\": \"transaction\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/04ed4113-3732-5b0c-af86\"\n        //         },\n        //         \"user_reference\": \"2VTYTH\",\n        //         \"created_at\": \"2017-02-09T07:01:18Z\",\n        //         \"updated_at\": \"2017-02-09T07:01:26Z\",\n        //         \"resource\": \"deposit\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/deposits/f34c19f3-b730-5e3d-9f72\",\n        //         \"committed\": true,\n        //         \"payout_at\": \"2017-02-12T07:01:17Z\",\n        //         \"instant\": false,\n        //         \"fee\": { \"amount\": \"0.00\", \"currency\": \"EUR\" },\n        //         \"amount\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n        //         \"subtotal\": { \"amount\": \"114.02\", \"currency\": \"EUR\" },\n        //         \"hold_until\": null,\n        //         \"hold_days\": 0,\n        //         \"hold_business_days\": 0,\n        //         \"next_step\": null\n        //     }\n        //\n        // fiat_withdrawal\n        //\n        //     {\n        //         \"id\": \"cfcc3b4a-eeb6-5e8c-8058\",\n        //         \"status\": \"completed\",\n        //         \"payment_method\": {\n        //             \"id\": \"8b94cfa4-f7fd-5a12-a76a\",\n        //             \"resource\": \"payment_method\",\n        //             \"resource_path\": \"/v2/payment-methods/8b94cfa4-f7fd-5a12-a76a\"\n        //         },\n        //         \"transaction\": {\n        //             \"id\": \"fcc2550b-5104-5f83-a444\",\n        //             \"resource\": \"transaction\",\n        //             \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/transactions/fcc2550b-5104-5f83-a444\"\n        //         },\n        //         \"user_reference\": \"MEUGK\",\n        //         \"created_at\": \"2018-07-26T08:55:12Z\",\n        //         \"updated_at\": \"2018-07-26T08:58:18Z\",\n        //         \"resource\": \"withdrawal\",\n        //         \"resource_path\": \"/v2/accounts/91cd2d36-3a91-55b6-a5d4-0124cf105483/withdrawals/cfcc3b4a-eeb6-5e8c-8058\",\n        //         \"committed\": true,\n        //         \"payout_at\": \"2018-07-31T08:55:12Z\",\n        //         \"instant\": false,\n        //         \"fee\": { \"amount\": \"0.15\", \"currency\": \"EUR\" },\n        //         \"amount\": { \"amount\": \"13130.69\", \"currency\": \"EUR\" },\n        //         \"subtotal\": { \"amount\": \"13130.84\", \"currency\": \"EUR\" },\n        //         \"idem\": \"e549dee5-63ed-4e79-8a96\",\n        //         \"next_step\": null\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": \"a1794ecf-5693-55fa-70cf-ef731748ed82\",\n        //         \"type\": \"send\",\n        //         \"status\": \"pending\",\n        //         \"amount\": {\n        //             \"amount\": \"-14.008308\",\n        //             \"currency\": \"USDC\"\n        //         },\n        //         \"native_amount\": {\n        //             \"amount\": \"-18.74\",\n        //             \"currency\": \"CAD\"\n        //         },\n        //         \"description\": null,\n        //         \"created_at\": \"2024-01-12T01:27:31Z\",\n        //         \"updated_at\": \"2024-01-12T01:27:31Z\",\n        //         \"resource\": \"transaction\",\n        //         \"resource_path\": \"/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82\",\n        //         \"instant_exchange\": false,\n        //         \"network\": {\n        //             \"status\": \"pending\",\n        //             \"status_description\": \"Pending (est. less than 10 minutes)\",\n        //             \"transaction_fee\": {\n        //                 \"amount\": \"4.008308\",\n        //                 \"currency\": \"USDC\"\n        //             },\n        //             \"transaction_amount\": {\n        //                 \"amount\": \"10.000000\",\n        //                 \"currency\": \"USDC\"\n        //             },\n        //             \"confirmations\": 0\n        //         },\n        //         \"to\": {\n        //             \"resource\": \"ethereum_address\",\n        //             \"address\": \"0x9...\",\n        //             \"currency\": \"USDC\",\n        //             \"address_info\": {\n        //                 \"address\": \"0x9...\"\n        //             }\n        //         },\n        //         \"idem\": \"748d8591-dg9a-7831-a45b-crd61dg78762\",\n        //         \"details\": {\n        //             \"title\": \"Sent USDC\",\n        //             \"subtitle\": \"To USDC address on Ethereum network\",\n        //             \"header\": \"Sent 14.008308 USDC ($18.74)\",\n        //             \"health\": \"warning\"\n        //         },\n        //         \"hide_native_amount\": false\n        //     }\n        //\n        //\n        // crypto deposit & withdrawal (using `/transactions` endpoint)\n        //    {\n        //        \"amount\": {\n        //            \"amount\": \"0.00014200\", (negative for withdrawal)\n        //            \"currency\": \"BTC\"\n        //        },\n        //        \"created_at\": \"2024-03-29T15:48:30Z\",\n        //        \"id\": \"0031a605-241d-514d-a97b-d4b99f3225d3\",\n        //        \"idem\": \"092a979b-017e-4403-940a-2ca57811f442\", // field present only in case of withdrawal\n        //        \"native_amount\": {\n        //            \"amount\": \"9.85\", (negative for withdrawal)\n        //            \"currency\": \"USD\"\n        //        },\n        //        \"network\": {\n        //            \"status\": \"pending\", // if status is `off_blockchain` then no more other fields are present in this object\n        //            \"hash\": \"5jYuvrNsvX2DZoMnzGYzVpYxJLfYu4GSK3xetG1H5LHrSovsuFCFYdFMwNRoiht3s6fBk92MM8QLLnz65xuEFTrE\",\n        //            \"network_name\": \"solana\",\n        //            \"transaction_fee\": {\n        //                \"amount\": \"0.000100000\",\n        //                \"currency\": \"SOL\"\n        //            }\n        //        },\n        //        \"resource\": \"transaction\",\n        //        \"resource_path\": \"/v2/accounts/dc504b1c-248e-5b68-a3b0-b991f7fa84e6/transactions/0031a605-241d-514d-a97b-d4b99f3225d3\",\n        //        \"status\": \"completed\",\n        //        \"type\": \"send\",\n        //        \"from\": { // in some cases, field might be present for deposit\n        //            \"id\": \"7fd10cd7-b091-5cee-ba41-c29e49a7cccf\",\n        //            \"name\": \"Coinbase\",\n        //            \"resource\": \"user\"\n        //        },\n        //        \"to\": { // field only present for withdrawal\n        //            \"address\": \"5HA12BNthAvBwNYARYf9y5MqqCpB4qhCNFCs1Qw48ACE\",\n        //            \"resource\": \"address\"\n        //        },\n        //        \"description\": \"C3 - One Time BTC Credit . Reference Case # 123.\", //  in some cases, field might be present for deposit\n        //    }\n        //\n        const transactionType = this.safeString (transaction, 'type');\n        let amountAndCurrencyObject = undefined;\n        let feeObject = undefined;\n        const network = this.safeDict (transaction, 'network', {});\n        if (transactionType === 'send') {\n            amountAndCurrencyObject = this.safeDict (network, 'transaction_amount');\n            feeObject = this.safeDict (network, 'transaction_fee', {});\n        } else {\n            amountAndCurrencyObject = this.safeDict (transaction, 'subtotal');\n            feeObject = this.safeDict (transaction, 'fee', {});\n        }\n        if (amountAndCurrencyObject === undefined) {\n            amountAndCurrencyObject = this.safeDict (transaction, 'amount');\n        }\n        const amountString = this.safeString (amountAndCurrencyObject, 'amount');\n        const amountStringAbs = Precise.stringAbs (amountString);\n        let status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        if (status === undefined) {\n            const committed = this.safeBool (transaction, 'committed');\n            status = committed ? 'ok' : 'pending';\n        }\n        const id = this.safeString (transaction, 'id');\n        const currencyId = this.safeString (amountAndCurrencyObject, 'currency');\n        const feeCurrencyId = this.safeString (feeObject, 'currency');\n        const datetime = this.safeString (transaction, 'created_at');\n        const resource = this.safeString (transaction, 'resource');\n        let type = resource;\n        if (!this.inArray (type, [ 'deposit', 'withdrawal' ])) {\n            if (Precise.stringGt (amountString, '0')) {\n                type = 'deposit';\n            } else if (Precise.stringLt (amountString, '0')) {\n                type = 'withdrawal';\n            }\n        }\n        const toObject = this.safeDict (transaction, 'to');\n        const addressTo = this.safeString (toObject, 'address');\n        const networkId = this.safeString (network, 'network_name');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': this.safeString (network, 'hash', id),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'network': this.networkIdToCode (networkId),\n            'address': addressTo,\n            'addressTo': addressTo,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.parseNumber (amountStringAbs),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'status': status,\n            'updated': this.parse8601 (this.safeString (transaction, 'updated_at')),\n            'fee': {\n                'cost': this.safeNumber (feeObject, 'amount'),\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            },\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 970,
        "line_end": 977,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'created': 'pending',\n            'completed': 'ok',\n            'canceled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "coinbase"
      }
    ],
    "coinbaseexchange": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 732,
        "line_end": 750,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (account, 'id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"4aac9c60-cbda-4396-9da4-4aa71e95fba0\",\n         \"currency\": \"BTC\",\n         \"balance\": \"0.0000000000000000\",\n         \"available\": \"0\",\n         \"hold\": \"0.0000000000000000\",\n         \"profile_id\": \"b709263e-f42a-4c7d-949a-a95c83d065da\"\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        //     {\n        //         \"id\": \"4aac9c60-cbda-4396-9da4-4aa71e95fba0\",\n        //         \"currency\": \"BTC\",\n        //         \"balance\": \"0.0000000000000000\",\n        //         \"available\": \"0\",\n        //         \"hold\": \"0.0000000000000000\",\n        //         \"profile_id\": \"b709263e-f42a-4c7d-949a-a95c83d065da\"\n        //     }\n        //\n        const currencyId = this.safeString (account, 'currency');\n        return {\n            'id': this.safeString (account, 'id'),\n            'type': undefined,\n            'code': this.safeCurrencyCode (currencyId),\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 752,
        "line_end": 765,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'hold');\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1702,
        "line_end": 1773,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "referenceAccount",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "before",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"id\": \"12087495079\",\n      \"amount\": \"-0.0100000000000000\",\n      \"balance\": \"0.0645419900000000\",\n      \"created_at\": \"2021-10-28T17:14:32.593168Z\",\n      \"type\": \"transfer\",\n      \"details\": {\n          \"from\": \"2f74edf7-1440-4586-86dc-ae58c5693691\",\n          \"profile_transfer_id\": \"3ef093ad-2482-40d1-8ede-2f89cff5099e\",\n          \"to\": \"dda99503-4980-4b60-9549-0b770ee51336\"\n      }\n  },",
          "{\n     \"id\": \"11740725774\",\n     \"amount\": \"-1.7565669701255000\",\n     \"balance\": \"0.0016490047745000\",\n     \"created_at\": \"2021-10-22T03:47:34.764122Z\",\n     \"type\": \"fee\",\n     \"details\": {\n         \"order_id\": \"ad06abf4-95ab-432a-a1d8-059ef572e296\",\n         \"product_id\": \"ETH-DAI\",\n         \"trade_id\": \"1740617\"\n     }\n  }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //  {\n        //      \"id\": \"12087495079\",\n        //      \"amount\": \"-0.0100000000000000\",\n        //      \"balance\": \"0.0645419900000000\",\n        //      \"created_at\": \"2021-10-28T17:14:32.593168Z\",\n        //      \"type\": \"transfer\",\n        //      \"details\": {\n        //          \"from\": \"2f74edf7-1440-4586-86dc-ae58c5693691\",\n        //          \"profile_transfer_id\": \"3ef093ad-2482-40d1-8ede-2f89cff5099e\",\n        //          \"to\": \"dda99503-4980-4b60-9549-0b770ee51336\"\n        //      }\n        //  },\n        //  {\n        //     \"id\": \"11740725774\",\n        //     \"amount\": \"-1.7565669701255000\",\n        //     \"balance\": \"0.0016490047745000\",\n        //     \"created_at\": \"2021-10-22T03:47:34.764122Z\",\n        //     \"type\": \"fee\",\n        //     \"details\": {\n        //         \"order_id\": \"ad06abf4-95ab-432a-a1d8-059ef572e296\",\n        //         \"product_id\": \"ETH-DAI\",\n        //         \"trade_id\": \"1740617\"\n        //     }\n        //  }\n        const id = this.safeString (item, 'id');\n        let amountString = this.safeString (item, 'amount');\n        let direction = undefined;\n        const afterString = this.safeString (item, 'balance');\n        const beforeString = Precise.stringSub (afterString, amountString);\n        if (Precise.stringLt (amountString, '0')) {\n            direction = 'out';\n            amountString = Precise.stringAbs (amountString);\n        } else {\n            direction = 'in';\n        }\n        const amount = this.parseNumber (amountString);\n        const after = this.parseNumber (afterString);\n        const before = this.parseNumber (beforeString);\n        const timestamp = this.parse8601 (this.safeValue (item, 'created_at'));\n        const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n        const code = this.safeCurrencyCode (undefined, currency);\n        const details = this.safeValue (item, 'details', {});\n        let account = undefined;\n        let referenceAccount = undefined;\n        let referenceId = undefined;\n        if (type === 'transfer') {\n            account = this.safeString (details, 'from');\n            referenceAccount = this.safeString (details, 'to');\n            referenceId = this.safeString (details, 'profile_transfer_id');\n        } else {\n            referenceId = this.safeString (details, 'order_id');\n        }\n        const status = 'ok';\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': account,\n            'referenceAccount': referenceAccount,\n            'referenceId': referenceId,\n            'type': type,\n            'currency': code,\n            'amount': amount,\n            'before': before,\n            'after': after,\n            'status': status,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1691,
        "line_end": 1700,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'transfer': 'transfer', // Funds moved between portfolios\n            'match': 'trade',       // Funds moved as a result of a trade\n            'fee': 'fee',           // Fee as a result of a trade\n            'rebate': 'rebate',     // Fee rebate\n            'conversion': 'trade',  // Funds converted between fiat currency and a stablecoin\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1178,
        "line_end": 1197,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591514160,\n         0.02507,\n         0.02507,\n         0.02507,\n         0.02507,\n         0.02816506\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1591514160,\n        //         0.02507,\n        //         0.02507,\n        //         0.02507,\n        //         0.02507,\n        //         0.02816506\n        //     ]\n        //\n        return [\n            this.safeTimestamp (ohlcv, 0),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1292,
        "line_end": 1365,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"d0c5340b-6d6c-49d9-b567-48c4bfca13d2\",\n         \"price\": \"0.10000000\",\n         \"size\": \"0.01000000\",\n         \"product_id\": \"BTC-USD\",\n         \"side\": \"buy\",\n         \"stp\": \"dc\",\n         \"type\": \"limit\",\n         \"time_in_force\": \"GTC\",\n         \"post_only\": false,\n         \"created_at\": \"2016-12-08T20:02:28.53864Z\",\n         \"fill_fees\": \"0.0000000000000000\",\n         \"filled_size\": \"0.00000000\",\n         \"executed_value\": \"0.0000000000000000\",\n         \"status\": \"pending\",\n         \"settled\": false\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"id\": \"d0c5340b-6d6c-49d9-b567-48c4bfca13d2\",\n        //         \"price\": \"0.10000000\",\n        //         \"size\": \"0.01000000\",\n        //         \"product_id\": \"BTC-USD\",\n        //         \"side\": \"buy\",\n        //         \"stp\": \"dc\",\n        //         \"type\": \"limit\",\n        //         \"time_in_force\": \"GTC\",\n        //         \"post_only\": false,\n        //         \"created_at\": \"2016-12-08T20:02:28.53864Z\",\n        //         \"fill_fees\": \"0.0000000000000000\",\n        //         \"filled_size\": \"0.00000000\",\n        //         \"executed_value\": \"0.0000000000000000\",\n        //         \"status\": \"pending\",\n        //         \"settled\": false\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n        const marketId = this.safeString (order, 'product_id');\n        market = this.safeMarket (marketId, market, '-');\n        let status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const doneReason = this.safeString (order, 'done_reason');\n        if ((status === 'closed') && (doneReason === 'canceled')) {\n            status = 'canceled';\n        }\n        const price = this.safeString (order, 'price');\n        const filled = this.safeString (order, 'filled_size');\n        const amount = this.safeString (order, 'size', filled);\n        const cost = this.safeString (order, 'executed_value');\n        const feeCost = this.safeNumber (order, 'fill_fees');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': market['quote'],\n                'rate': undefined,\n            };\n        }\n        const id = this.safeString (order, 'id');\n        const type = this.safeString (order, 'type');\n        const side = this.safeString (order, 'side');\n        const timeInForce = this.safeString (order, 'time_in_force');\n        const postOnly = this.safeValue (order, 'post_only');\n        const triggerPrice = this.safeNumber (order, 'stop_price');\n        const clientOrderId = this.safeString (order, 'client_oid');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'fee': fee,\n            'average': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1280,
        "line_end": 1290,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'pending': 'open',\n            'active': 'open',\n            'open': 'open',\n            'done': 'closed',\n            'canceled': 'canceled',\n            'canceling': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 821,
        "line_end": 900,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "volume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "[\n         1639472400, // timestamp\n         4.26, // low\n         4.38, // high\n         4.35, // open\n         4.27 // close\n      ]",
          "{\n         \"trade_id\":843439,\n         \"price\":\"0.997999\",\n         \"size\":\"80.29769\",\n         \"time\":\"2020-01-28T02:13:33.012523Z\",\n         \"bid\":\"0.997094\",\n         \"ask\":\"0.998\",\n         \"volume\":\"1903188.03750000\"\n     }",
          "{\n         \"open\": \"34.19000000\",\n         \"high\": \"95.70000000\",\n         \"low\": \"7.06000000\",\n         \"volume\": \"2.41000000\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTickers\n        //\n        //      [\n        //         1639472400, // timestamp\n        //         4.26, // low\n        //         4.38, // high\n        //         4.35, // open\n        //         4.27 // close\n        //      ]\n        //\n        // fetchTicker\n        //\n        //     publicGetProductsIdTicker\n        //\n        //     {\n        //         \"trade_id\":843439,\n        //         \"price\":\"0.997999\",\n        //         \"size\":\"80.29769\",\n        //         \"time\":\"2020-01-28T02:13:33.012523Z\",\n        //         \"bid\":\"0.997094\",\n        //         \"ask\":\"0.998\",\n        //         \"volume\":\"1903188.03750000\"\n        //     }\n        //\n        //     publicGetProductsIdStats\n        //\n        //     {\n        //         \"open\": \"34.19000000\",\n        //         \"high\": \"95.70000000\",\n        //         \"low\": \"7.06000000\",\n        //         \"volume\": \"2.41000000\"\n        //     }\n        //\n        let timestamp = undefined;\n        let bid = undefined;\n        let ask = undefined;\n        let last = undefined;\n        let high = undefined;\n        let low = undefined;\n        let open = undefined;\n        let volume = undefined;\n        const symbol = (market === undefined) ? undefined : market['symbol'];\n        if (Array.isArray (ticker)) {\n            last = this.safeString (ticker, 4);\n            timestamp = this.milliseconds ();\n        } else {\n            timestamp = this.parse8601 (this.safeValue (ticker, 'time'));\n            bid = this.safeString (ticker, 'bid');\n            ask = this.safeString (ticker, 'ask');\n            high = this.safeString (ticker, 'high');\n            low = this.safeString (ticker, 'low');\n            open = this.safeString (ticker, 'open');\n            last = this.safeString2 (ticker, 'price', 'last');\n            volume = this.safeString (ticker, 'volume');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': undefined,\n            'ask': ask,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': volume,\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 993,
        "line_end": 1064,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "rate",
            "value": "feeRate",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"type\": \"match\",\n         \"trade_id\": 82047307,\n         \"maker_order_id\": \"0f358725-2134-435e-be11-753912a326e0\",\n         \"taker_order_id\": \"252b7002-87a3-425c-ac73-f5b9e23f3caf\",\n         \"order_id\": \"d50ec984-77a8-460a-b958-66f114b0de9b\",\n         \"side\": \"sell\",\n         \"size\": \"0.00513192\",\n         \"price\": \"9314.78\",\n         \"product_id\": \"BTC-USD\",\n         \"profile_id\": \"6244401d-c078-40d9-b305-7ad3551bc3b0\",\n         \"sequence\": 12038915443,\n         \"time\": \"2020-01-31T20:03:41.158814Z\"\n         \"created_at\": \"2014-11-07T22:19:28.578544Z\",\n         \"liquidity\": \"T\",\n         \"fee\": \"0.00025\",\n         \"settled\": true,\n         \"usd_volume\": \"0.0924556000000000\",\n         \"user_id\": \"595eb864313c2b02ddf2937d\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        //     {\n        //         \"type\": \"match\",\n        //         \"trade_id\": 82047307,\n        //         \"maker_order_id\": \"0f358725-2134-435e-be11-753912a326e0\",\n        //         \"taker_order_id\": \"252b7002-87a3-425c-ac73-f5b9e23f3caf\",\n        //         \"order_id\": \"d50ec984-77a8-460a-b958-66f114b0de9b\",\n        //         \"side\": \"sell\",\n        //         \"size\": \"0.00513192\",\n        //         \"price\": \"9314.78\",\n        //         \"product_id\": \"BTC-USD\",\n        //         \"profile_id\": \"6244401d-c078-40d9-b305-7ad3551bc3b0\",\n        //         \"sequence\": 12038915443,\n        //         \"time\": \"2020-01-31T20:03:41.158814Z\"\n        //         \"created_at\": \"2014-11-07T22:19:28.578544Z\",\n        //         \"liquidity\": \"T\",\n        //         \"fee\": \"0.00025\",\n        //         \"settled\": true,\n        //         \"usd_volume\": \"0.0924556000000000\",\n        //         \"user_id\": \"595eb864313c2b02ddf2937d\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString2 (trade, 'time', 'created_at'));\n        const marketId = this.safeString (trade, 'product_id');\n        market = this.safeMarket (marketId, market, '-');\n        let feeRate = undefined;\n        let takerOrMaker = undefined;\n        let cost = undefined;\n        const feeCurrencyId = this.safeStringLower (market, 'quoteId');\n        if (feeCurrencyId !== undefined) {\n            const costField = feeCurrencyId + '_value';\n            cost = this.safeString (trade, costField);\n            const liquidity = this.safeString (trade, 'liquidity');\n            if (liquidity !== undefined) {\n                takerOrMaker = (liquidity === 'T') ? 'taker' : 'maker';\n                feeRate = this.safeString (market, takerOrMaker);\n            }\n        }\n        const feeCost = this.safeString2 (trade, 'fill_fees', 'fee');\n        const fee = {\n            'cost': feeCost,\n            'currency': market['quote'],\n            'rate': feeRate,\n        };\n        const id = this.safeString (trade, 'trade_id');\n        let side = (trade['side'] === 'buy') ? 'sell' : 'buy';\n        const orderId = this.safeString (trade, 'order_id');\n        // Coinbase Pro returns inverted side to fetchMyTrades vs fetchTrades\n        const makerOrderId = this.safeString (trade, 'maker_order_id');\n        const takerOrderId = this.safeString (trade, 'taker_order_id');\n        if ((orderId !== undefined) || ((makerOrderId !== undefined) && (takerOrderId !== undefined))) {\n            side = (trade['side'] === 'buy') ? 'buy' : 'sell';\n        }\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'size');\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'fee': fee,\n            'cost': cost,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1983,
        "line_end": 2062,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (details, 'crypto_transaction_hash')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (transaction)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "this.safeString (details, 'crypto_address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (details, 'destination_tag')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.parse8601 (this.safeString (transaction, 'processed_at'))",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "[\n        {\n            \"id\": \"bee6fd7c-afb2-4e47-8298-671d09997d16\",\n            \"type\": \"deposit\",\n            \"created_at\": \"2022-12-21 00:48:45.477503+00\",\n            \"completed_at\": null,\n            \"account_id\": \"sal3802-36bd-46be-a7b8-alsjf383sldak\",     // only from privateGetTransfers\n            \"user_id\": \"6382048209f92as392039dlks2\",                  // only from privateGetTransfers\n            \"amount\": \"0.01000000\",\n            \"details\": {\n                \"network\": \"litecoin\",\n                \"crypto_address\": \"MKemtnCFUYKsNWaf5EMYMpwSszcXWFDtTY\",\n                \"coinbase_account_id\": \"fl2b6925-f6ba-403n-jj03-40fl435n430f\",\n                \"coinbase_transaction_id\": \"63a25bb13cb5cf0001d2cf17\", // withdrawals only\n                \"crypto_transaction_hash\": \"752f35570736341e2a253f7041a34cf1e196fc56128c900fd03d99da899d94c1\",\n                \"tx_service_transaction_id\": \"1873249104\",\n                \"coinbase_payment_method_id\": \"\"\n            },\n            \"canceled_at\": null,\n            \"processed_at\": null,\n            \"user_nonce\": null,\n            \"idem\": \"5e3201b0-e390-5k3k-a913-c32932049242\",\n            \"profile_id\": \"k3k302a8-c4dk-4f49-9d39-3203923wpk39\",\n            \"currency\": \"LTC\"\n        }\n    ]"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // privateGetTransfers\n        //\n        //    [\n        //        {\n        //            \"id\": \"bee6fd7c-afb2-4e47-8298-671d09997d16\",\n        //            \"type\": \"deposit\",\n        //            \"created_at\": \"2022-12-21 00:48:45.477503+00\",\n        //            \"completed_at\": null,\n        //            \"account_id\": \"sal3802-36bd-46be-a7b8-alsjf383sldak\",     // only from privateGetTransfers\n        //            \"user_id\": \"6382048209f92as392039dlks2\",                  // only from privateGetTransfers\n        //            \"amount\": \"0.01000000\",\n        //            \"details\": {\n        //                \"network\": \"litecoin\",\n        //                \"crypto_address\": \"MKemtnCFUYKsNWaf5EMYMpwSszcXWFDtTY\",\n        //                \"coinbase_account_id\": \"fl2b6925-f6ba-403n-jj03-40fl435n430f\",\n        //                \"coinbase_transaction_id\": \"63a25bb13cb5cf0001d2cf17\", // withdrawals only\n        //                \"crypto_transaction_hash\": \"752f35570736341e2a253f7041a34cf1e196fc56128c900fd03d99da899d94c1\",\n        //                \"tx_service_transaction_id\": \"1873249104\",\n        //                \"coinbase_payment_method_id\": \"\"\n        //            },\n        //            \"canceled_at\": null,\n        //            \"processed_at\": null,\n        //            \"user_nonce\": null,\n        //            \"idem\": \"5e3201b0-e390-5k3k-a913-c32932049242\",\n        //            \"profile_id\": \"k3k302a8-c4dk-4f49-9d39-3203923wpk39\",\n        //            \"currency\": \"LTC\"\n        //        }\n        //    ]\n        //\n        const details = this.safeValue (transaction, 'details', {});\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let amount = this.safeNumber (transaction, 'amount');\n        let type = this.safeString (transaction, 'type');\n        let address = this.safeString (details, 'crypto_address');\n        address = this.safeString (transaction, 'crypto_address', address);\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        if (type === 'withdraw') {\n            type = 'withdrawal';\n            address = this.safeString (details, 'sent_to_address', address);\n            const feeCost = this.safeNumber (details, 'fee');\n            if (feeCost !== undefined) {\n                if (amount !== undefined) {\n                    amount -= feeCost;\n                }\n                fee['cost'] = feeCost;\n                fee['currency'] = code;\n            }\n        }\n        const networkId = this.safeString (details, 'network');\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (details, 'crypto_transaction_hash'),\n            'type': type,\n            'currency': code,\n            'network': this.networkIdToCode (networkId),\n            'amount': amount,\n            'status': this.parseTransactionStatus (transaction),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': this.safeString (details, 'crypto_address'),\n            'tag': this.safeString (details, 'destination_tag'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': this.parse8601 (this.safeString (transaction, 'processed_at')),\n            'comment': undefined,\n            'internal': false,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (transaction)",
        "line_start": 1967,
        "line_end": 1981,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (transaction) {\n        const canceled = this.safeValue (transaction, 'canceled_at');\n        if (canceled) {\n            return 'canceled';\n        }\n        const processed = this.safeValue (transaction, 'processed_at');\n        const completed = this.safeValue (transaction, 'completed_at');\n        if (completed) {\n            return 'ok';\n        } else if (processed && !completed) {\n            return 'failed';\n        } else {\n            return 'pending';\n        }\n    }"
      }
    ],
    "coinbaseinternational": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 407,
        "line_end": 429,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (account, 'portfolio_id', 'portfolio_uuid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"portfolio_id\":\"1ap32qsc-1-0\",\n       \"portfolio_uuid\":\"028d7f6c-b92c-7361-8b7e-2932711e5a22\",\n       \"name\":\"CCXT Portfolio 030624-17:16\",\n       \"user_uuid\":\"e6cf46b6-a32f-5fa7-addb-3324d4526fbd\",\n       \"maker_fee_rate\":\"0\",\n       \"taker_fee_rate\":\"0.0002\",\n       \"trading_lock\":false,\n       \"borrow_disabled\":false,\n       \"is_lsp\":false,\n       \"is_default\":true,\n       \"cross_collateral_enabled\":false\n    }"
        ],
        "source": "parseAccount (account) {\n        //\n        //    {\n        //       \"portfolio_id\":\"1ap32qsc-1-0\",\n        //       \"portfolio_uuid\":\"028d7f6c-b92c-7361-8b7e-2932711e5a22\",\n        //       \"name\":\"CCXT Portfolio 030624-17:16\",\n        //       \"user_uuid\":\"e6cf46b6-a32f-5fa7-addb-3324d4526fbd\",\n        //       \"maker_fee_rate\":\"0\",\n        //       \"taker_fee_rate\":\"0.0002\",\n        //       \"trading_lock\":false,\n        //       \"borrow_disabled\":false,\n        //       \"is_lsp\":false,\n        //       \"is_default\":true,\n        //       \"cross_collateral_enabled\":false\n        //    }\n        //\n        return {\n            'id': this.safeString2 (account, 'portfolio_id', 'portfolio_uuid'),\n            'type': undefined,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1650,
        "line_end": 1679,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n       \"asset_id\":\"0-0-1\",\n       \"asset_name\":\"USDC\",\n       \"asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n       \"quantity\":\"500000.0000000000\",\n       \"hold\":\"0\",\n       \"hold_available_for_collateral\":\"0\",\n       \"transfer_hold\":\"0\",\n       \"collateral_value\":\"500000.0\",\n       \"max_withdraw_amount\":\"500000.0000000000\",\n       \"loan\":\"0\",\n       \"loan_collateral_requirement\":\"0.0\"\n    }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        //    {\n        //       \"asset_id\":\"0-0-1\",\n        //       \"asset_name\":\"USDC\",\n        //       \"asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n        //       \"quantity\":\"500000.0000000000\",\n        //       \"hold\":\"0\",\n        //       \"hold_available_for_collateral\":\"0\",\n        //       \"transfer_hold\":\"0\",\n        //       \"collateral_value\":\"500000.0\",\n        //       \"max_withdraw_amount\":\"500000.0000000000\",\n        //       \"loan\":\"0\",\n        //       \"loan_collateral_requirement\":\"0.0\"\n        //    }\n        //\n        const result: Dict = {\n            'info': response,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const rawBalance = response[i];\n            const currencyId = this.safeString (rawBalance, 'asset_name');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (rawBalance, 'quantity');\n            account['used'] = this.safeString (rawBalance, 'hold');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseCurrency",
        "signature": "parseCurrency (currency: Dict): Currency",
        "line_start": 1495,
        "line_end": 1523,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "name",
            "value": "code",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "precision",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "currency",
            "comment": null
          },
          {
            "key": "active",
            "value": "(statusId === 'ACTIVE')",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "networks",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fees",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "limits",
            "value": "this.limits",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"asset_id\":\"1\",\n       \"asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n       \"asset_name\":\"USDC\",\n       \"status\":\"ACTIVE\",\n       \"collateral_weight\":1.0,\n       \"supported_networks_enabled\":true\n    }"
        ],
        "source": "parseCurrency (currency: Dict): Currency {\n        //\n        //    {\n        //       \"asset_id\":\"1\",\n        //       \"asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n        //       \"asset_name\":\"USDC\",\n        //       \"status\":\"ACTIVE\",\n        //       \"collateral_weight\":1.0,\n        //       \"supported_networks_enabled\":true\n        //    }\n        //\n        const id = this.safeString (currency, 'asset_name');\n        const code = this.safeCurrencyCode (id);\n        const statusId = this.safeString (currency, 'status');\n        return this.safeCurrencyStructure ({\n            'id': id,\n            'name': code,\n            'code': code,\n            'precision': undefined,\n            'info': currency,\n            'active': (statusId === 'ACTIVE'),\n            'deposit': undefined,\n            'withdraw': undefined,\n            'networks': undefined,\n            'fee': undefined,\n            'fees': undefined,\n            'limits': this.limits,\n        });\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined)",
        "line_start": 567,
        "line_end": 596,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (fundingDatetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "fundingDatetime",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "this.parse8601 (fundingDatetime)",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "fundingDatetime",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"instrument_id\":\"149264167780483072\",\n       \"funding_rate\":\"0.000011\",\n       \"mark_price\":\"47388.1\",\n       \"event_time\":\"2024-02-10T16:00:00Z\"\n    }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined) {\n        //\n        //    {\n        //       \"instrument_id\":\"149264167780483072\",\n        //       \"funding_rate\":\"0.000011\",\n        //       \"mark_price\":\"47388.1\",\n        //       \"event_time\":\"2024-02-10T16:00:00Z\"\n        //    }\n        //\n        const fundingDatetime = this.safeString2 (contract, 'event_time', 'time');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': this.safeNumber (contract, 'mark_price'),\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': this.parse8601 (fundingDatetime),\n            'datetime': fundingDatetime,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': this.parse8601 (fundingDatetime),\n            'fundingDatetime': fundingDatetime,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (info, market: Market = undefined)",
        "line_start": 563,
        "line_end": 565,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingRateHistory (info, market: Market = undefined) {\n        return this.parseFundingRate (info, market) as FundingRateHistory;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 636,
        "line_end": 675,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (income, 'transfer_uuid')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'amount')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"amount\":\"0.0008\",\n     \"asset\":\"USDC\",\n     \"created_at\":\"2024-02-22T16:00:00Z\",\n     \"from_portfolio\":{\n        \"id\":\"13yuk1fs-1-0\",\n        \"name\":\"Eng Test Portfolio - 2\",\n        \"uuid\":\"018712f2-5ff9-7de3-9010-xxxxxxxxx\"\n     },\n     \"instrument_id\":\"149264164756389888\",\n     \"instrument_symbol\":\"ETH-PERP\",\n     \"position_id\":\"1xy4v51m-1-2\",\n     \"status\":\"PROCESSED\",\n     \"to_portfolio\":{\n        \"name\":\"CB_FUND\"\n     },\n     \"transfer_type\":\"FUNDING\",\n     \"transfer_uuid\":\"a6b708df-2c44-32c5-bb98-xxxxxxxxxx\",\n     \"updated_at\":\"2024-02-22T16:00:00Z\"\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        // {\n        //     \"amount\":\"0.0008\",\n        //     \"asset\":\"USDC\",\n        //     \"created_at\":\"2024-02-22T16:00:00Z\",\n        //     \"from_portfolio\":{\n        //        \"id\":\"13yuk1fs-1-0\",\n        //        \"name\":\"Eng Test Portfolio - 2\",\n        //        \"uuid\":\"018712f2-5ff9-7de3-9010-xxxxxxxxx\"\n        //     },\n        //     \"instrument_id\":\"149264164756389888\",\n        //     \"instrument_symbol\":\"ETH-PERP\",\n        //     \"position_id\":\"1xy4v51m-1-2\",\n        //     \"status\":\"PROCESSED\",\n        //     \"to_portfolio\":{\n        //        \"name\":\"CB_FUND\"\n        //     },\n        //     \"transfer_type\":\"FUNDING\",\n        //     \"transfer_uuid\":\"a6b708df-2c44-32c5-bb98-xxxxxxxxxx\",\n        //     \"updated_at\":\"2024-02-22T16:00:00Z\"\n        // }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const datetime = this.safeInteger (income, 'created_at');\n        const timestamp = this.parse8601 (datetime);\n        const currencyId = this.safeString (income, 'asset');\n        const code = this.safeCurrencyCode (currencyId);\n        return {\n            'info': income,\n            'symbol': market['symbol'],\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (income, 'transfer_uuid'),\n            'amount': this.safeNumber (income, 'amount'),\n            'rate': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1355,
        "line_end": 1467,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "lowercaseId",
            "value": "marketId.toLowerCase ()",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settleId ? settleId : undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId ? settleId : undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "isSpot ? 'spot' : 'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "isSpot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "!isSpot",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeString (market, 'trading_state') === 'TRADING'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "!isSpot",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isSpot ? undefined : (settleId === quoteId)",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isSpot ? undefined : (settleId !== quoteId)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "isSpot ? undefined : 1",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber (market, 'quote_increment'),\n                'cost': this.safeNumber (market, 'quote_increment'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'base_imf'),\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': isSpot ? undefined : this.safeNumber (market, 'position_limit_qty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional_value'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'base_increment')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'quote_increment')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (market, 'quote_increment')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'base_imf'),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': isSpot ? undefined : this.safeNumber (market, 'position_limit_qty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'min_notional_value'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "isSpot ? undefined : this.safeNumber (market, 'position_limit_qty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"instrument_id\":\"149264164756389888\",\n       \"instrument_uuid\":\"e9360798-6a10-45d6-af05-67c30eb91e2d\",\n       \"symbol\":\"ETH-PERP\",\n       \"type\":\"PERP\",\n       \"base_asset_id\":\"118059611793145856\",\n       \"base_asset_uuid\":\"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4\",\n       \"base_asset_name\":\"ETH\",\n       \"quote_asset_id\":\"1\",\n       \"quote_asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n       \"quote_asset_name\":\"USDC\",\n       \"base_increment\":\"0.0001\",\n       \"quote_increment\":\"0.01\",\n       \"price_band_percent\":\"0.02\",\n       \"market_order_percent\":\"0.0075\",\n       \"qty_24hr\":\"44434.8131\",\n       \"notional_24hr\":\"110943454.279785\",\n       \"avg_daily_qty\":\"1099171.6025\",\n       \"avg_daily_notional\":\"2637240145.456987\",\n       \"previous_day_qty\":\"78909.3939\",\n       \"open_interest\":\"1270.749\",\n       \"position_limit_qty\":\"1831.9527\",\n       \"position_limit_adq_pct\":\"0.05\",\n       \"replacement_cost\":\"0.23\",\n       \"base_imf\":\"0.1\",\n       \"min_notional_value\":\"10\",\n       \"funding_interval\":\"3600000000000\",\n       \"trading_state\":\"TRADING\",\n       \"quote\":{\n          \"best_bid_price\":\"2490.8\",\n          \"best_bid_size\":\"9.0515\",\n          \"best_ask_price\":\"2490.81\",\n          \"best_ask_size\":\"4.8486\",\n          \"trade_price\":\"2490.39\",\n          \"trade_qty\":\"0.9508\",\n          \"index_price\":\"2490.5\",\n          \"mark_price\":\"2490.8\",\n          \"settlement_price\":\"2490.81\",\n          \"limit_up\":\"2615.42\",\n          \"limit_down\":\"2366.34\",\n          \"predicted_funding\":\"0.000009\",\n          \"timestamp\":\"2024-02-10T16:07:39.454Z\"\n       }\n    }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //   {\n        //       \"instrument_id\":\"149264164756389888\",\n        //       \"instrument_uuid\":\"e9360798-6a10-45d6-af05-67c30eb91e2d\",\n        //       \"symbol\":\"ETH-PERP\",\n        //       \"type\":\"PERP\",\n        //       \"base_asset_id\":\"118059611793145856\",\n        //       \"base_asset_uuid\":\"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4\",\n        //       \"base_asset_name\":\"ETH\",\n        //       \"quote_asset_id\":\"1\",\n        //       \"quote_asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n        //       \"quote_asset_name\":\"USDC\",\n        //       \"base_increment\":\"0.0001\",\n        //       \"quote_increment\":\"0.01\",\n        //       \"price_band_percent\":\"0.02\",\n        //       \"market_order_percent\":\"0.0075\",\n        //       \"qty_24hr\":\"44434.8131\",\n        //       \"notional_24hr\":\"110943454.279785\",\n        //       \"avg_daily_qty\":\"1099171.6025\",\n        //       \"avg_daily_notional\":\"2637240145.456987\",\n        //       \"previous_day_qty\":\"78909.3939\",\n        //       \"open_interest\":\"1270.749\",\n        //       \"position_limit_qty\":\"1831.9527\",\n        //       \"position_limit_adq_pct\":\"0.05\",\n        //       \"replacement_cost\":\"0.23\",\n        //       \"base_imf\":\"0.1\",\n        //       \"min_notional_value\":\"10\",\n        //       \"funding_interval\":\"3600000000000\",\n        //       \"trading_state\":\"TRADING\",\n        //       \"quote\":{\n        //          \"best_bid_price\":\"2490.8\",\n        //          \"best_bid_size\":\"9.0515\",\n        //          \"best_ask_price\":\"2490.81\",\n        //          \"best_ask_size\":\"4.8486\",\n        //          \"trade_price\":\"2490.39\",\n        //          \"trade_qty\":\"0.9508\",\n        //          \"index_price\":\"2490.5\",\n        //          \"mark_price\":\"2490.8\",\n        //          \"settlement_price\":\"2490.81\",\n        //          \"limit_up\":\"2615.42\",\n        //          \"limit_down\":\"2366.34\",\n        //          \"predicted_funding\":\"0.000009\",\n        //          \"timestamp\":\"2024-02-10T16:07:39.454Z\"\n        //       }\n        //    }\n        //\n        const marketId = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'base_asset_name');\n        const quoteId = this.safeString (market, 'quote_asset_name');\n        const typeId = this.safeString (market, 'type'); // 'SPOT', 'PERP'\n        const isSpot = (typeId === 'SPOT');\n        const fees = this.fees;\n        let symbol = baseId + '/' + quoteId;\n        let settleId = undefined;\n        if (!isSpot) {\n            settleId = quoteId;\n            symbol += ':' + quoteId;\n        }\n        return {\n            'id': marketId,\n            'lowercaseId': marketId.toLowerCase (),\n            'symbol': symbol,\n            'base': baseId,\n            'quote': quoteId,\n            'settle': settleId ? settleId : undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId ? settleId : undefined,\n            'type': isSpot ? 'spot' : 'swap',\n            'spot': isSpot,\n            'margin': false,\n            'swap': !isSpot,\n            'future': false,\n            'option': false,\n            'active': this.safeString (market, 'trading_state') === 'TRADING',\n            'contract': !isSpot,\n            'linear': isSpot ? undefined : (settleId === quoteId),\n            'inverse': isSpot ? undefined : (settleId !== quoteId),\n            'taker': fees['trading']['taker'],\n            'maker': fees['trading']['maker'],\n            'contractSize': isSpot ? undefined : 1,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_increment'),\n                'price': this.safeNumber (market, 'quote_increment'),\n                'cost': this.safeNumber (market, 'quote_increment'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'base_imf'),\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': isSpot ? undefined : this.safeNumber (market, 'position_limit_qty'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional_value'),\n                    'max': undefined,\n                },\n            },\n            'info': market,\n            'created': undefined,\n        };\n    }"
      },
      {
        "name": "parseNetwork",
        "signature": "parseNetwork (network, params = {})",
        "line_start": 875,
        "line_end": 916,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "network",
            "comment": null
          },
          {
            "key": "id",
            "value": "networkId",
            "comment": null
          },
          {
            "key": "name",
            "value": "this.safeString (network, 'display_name')",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkIdForCode, currencyCode)",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'withdraw': {\n                    'min': this.safeNumber (network, 'min_withdrawal_amt'),\n                    'max': this.safeNumber (network, 'max_withdrawal_amt'),\n                },\n                'deposit': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                    'min': this.safeNumber (network, 'min_withdrawal_amt'),\n                    'max': this.safeNumber (network, 'max_withdrawal_amt'),\n                }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"asset_id\":\"1\",\n        \"asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n        \"asset_name\":\"USDC\",\n        \"network_arn_id\":\"networks/ethereum-mainnet/assets/9bc140b4-69c3-5fc9-bd0d-b041bcf40039\",\n        \"min_withdrawal_amt\":\"1\",\n        \"max_withdrawal_amt\":\"100000000\",\n        \"network_confirms\":35,\n        \"processing_time\":485,\n        \"is_default\":true,\n        \"network_name\":\"ethereum\",\n        \"display_name\":\"Ethereum\"\n    }"
        ],
        "source": "parseNetwork (network, params = {}) {\n        //\n        //    {\n        //        \"asset_id\":\"1\",\n        //        \"asset_uuid\":\"2b92315d-eab7-5bef-84fa-089a131333f5\",\n        //        \"asset_name\":\"USDC\",\n        //        \"network_arn_id\":\"networks/ethereum-mainnet/assets/9bc140b4-69c3-5fc9-bd0d-b041bcf40039\",\n        //        \"min_withdrawal_amt\":\"1\",\n        //        \"max_withdrawal_amt\":\"100000000\",\n        //        \"network_confirms\":35,\n        //        \"processing_time\":485,\n        //        \"is_default\":true,\n        //        \"network_name\":\"ethereum\",\n        //        \"display_name\":\"Ethereum\"\n        //    }\n        //\n        const currencyId = this.safeString (network, 'asset_name');\n        const currencyCode = this.safeCurrencyCode (currencyId);\n        const networkId = this.safeString (network, 'network_arn_id');\n        const networkIdForCode = this.safeStringN (network, [ 'network_name', 'display_name', 'network_arn_id' ], '');\n        return this.safeNetwork ({\n            'info': network,\n            'id': networkId,\n            'name': this.safeString (network, 'display_name'),\n            'network': this.networkIdToCode (networkIdForCode, currencyCode),\n            'active': undefined,\n            'deposit': undefined,\n            'withdraw': undefined,\n            'precision': undefined,\n            'fee': undefined,\n            'limits': {\n                'withdraw': {\n                    'min': this.safeNumber (network, 'min_withdrawal_amt'),\n                    'max': this.safeNumber (network, 'max_withdrawal_amt'),\n                },\n                'deposit': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n        });\n    }"
      },
      {
        "name": "parseNetworks",
        "signature": "parseNetworks (networks, params = {})",
        "line_start": 866,
        "line_end": 873,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseNetworks (networks, params = {}) {\n        const result: Dict = {};\n        for (let i = 0; i < networks.length; i++) {\n            const network = this.extend (this.parseNetwork (networks[i]), params);\n            result[network['network']] = network;\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 486,
        "line_end": 505,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n     \"start\": \"2024-04-23T00:00:00Z\",\n     \"open\": \"62884.4\",\n     \"high\": \"64710.6\",\n     \"low\": \"62884.4\",\n     \"close\": \"63508.4\",\n     \"volume\": \"3253.9983\"\n   }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //   {\n        //     \"start\": \"2024-04-23T00:00:00Z\",\n        //     \"open\": \"62884.4\",\n        //     \"high\": \"64710.6\",\n        //     \"low\": \"62884.4\",\n        //     \"close\": \"63508.4\",\n        //     \"volume\": \"3253.9983\"\n        //   }\n        //\n        return [\n            this.parse8601 (this.safeString2 (ohlcv, 'start', 'time')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1814,
        "line_end": 1870,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'order_id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (this.safeString (order, 'type'))",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'tif')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'size')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'exec_qty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.safeString (order, 'leaves_qty')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'avg_price')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'order_status'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"order_id\":\"1x96skvg-1-0\",\n        \"client_order_id\":\"ccxt\",\n        \"side\":\"BUY\",\n        \"instrument_id\":\"114jqr89-0-0\",\n        \"instrument_uuid\":\"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0\",\n        \"symbol\":\"BTC-PERP\",\n        \"portfolio_id\":\"1wp37qsc-1-0\",\n        \"portfolio_uuid\":\"018d7f6c-b92c-7361-8b7e-2932711e5a22\",\n        \"type\":\"LIMIT\",\n        \"price\":\"10000\",\n        \"size\":\"0.001\",\n        \"tif\":\"GTC\",\n        \"stp_mode\":\"BOTH\",\n        \"event_type\":\"NEW\",\n        \"order_status\":\"WORKING\",\n        \"leaves_qty\":\"0.001\",\n        \"exec_qty\":\"0\",\n        \"avg_price\":\"0\",\n        \"fee\":\"0\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //    {\n        //        \"order_id\":\"1x96skvg-1-0\",\n        //        \"client_order_id\":\"ccxt\",\n        //        \"side\":\"BUY\",\n        //        \"instrument_id\":\"114jqr89-0-0\",\n        //        \"instrument_uuid\":\"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0\",\n        //        \"symbol\":\"BTC-PERP\",\n        //        \"portfolio_id\":\"1wp37qsc-1-0\",\n        //        \"portfolio_uuid\":\"018d7f6c-b92c-7361-8b7e-2932711e5a22\",\n        //        \"type\":\"LIMIT\",\n        //        \"price\":\"10000\",\n        //        \"size\":\"0.001\",\n        //        \"tif\":\"GTC\",\n        //        \"stp_mode\":\"BOTH\",\n        //        \"event_type\":\"NEW\",\n        //        \"order_status\":\"WORKING\",\n        //        \"leaves_qty\":\"0.001\",\n        //        \"exec_qty\":\"0\",\n        //        \"avg_price\":\"0\",\n        //        \"fee\":\"0\"\n        //    }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        const feeCost = this.safeNumber (order, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n            };\n        }\n        const datetime = this.safeString2 (order, 'submit_time', 'event_time');\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'order_id'),\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastTradeTimestamp': undefined,\n            'symbol': this.safeSymbol (marketId, market),\n            'type': this.parseOrderType (this.safeString (order, 'type')),\n            'timeInForce': this.safeString (order, 'tif'),\n            'postOnly': undefined,\n            'side': this.safeStringLower (order, 'side'),\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': this.safeString (order, 'stop_price'),\n            'amount': this.safeString (order, 'size'),\n            'filled': this.safeString (order, 'exec_qty'),\n            'remaining': this.safeString (order, 'leaves_qty'),\n            'cost': undefined,\n            'average': this.safeString (order, 'avg_price'),\n            'status': this.parseOrderStatus (this.safeString (order, 'order_status')),\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1872,
        "line_end": 1886,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIAL_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'REPLACED': 'canceled',\n            'PENDING_CANCEL': 'open',\n            'REJECTED': 'rejected',\n            'PENDING_NEW': 'open',\n            'EXPIRED': 'expired',\n            'PENDING_REPLACE': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1888,
        "line_end": 1899,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        if (type === 'UNKNOWN_ORDER_TYPE') {\n            return undefined;\n        }\n        const types: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'STOP': 'limit',\n            'STOP_LIMIT': 'limit',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1056,
        "line_end": 1105,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'mark_price')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealized_pnl')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'im_contribution')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"symbol\":\"BTC-PERP\",\n       \"instrument_id\":\"114jqr89-0-0\",\n       \"instrument_uuid\":\"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0\",\n       \"vwap\":\"52482.3\",\n       \"net_size\":\"0\",\n       \"buy_order_size\":\"0.001\",\n       \"sell_order_size\":\"0\",\n       \"im_contribution\":\"0.2\",\n       \"unrealized_pnl\":\"0\",\n       \"mark_price\":\"52406.8\",\n       \"entry_vwap\":\"52472.9\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //    {\n        //       \"symbol\":\"BTC-PERP\",\n        //       \"instrument_id\":\"114jqr89-0-0\",\n        //       \"instrument_uuid\":\"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0\",\n        //       \"vwap\":\"52482.3\",\n        //       \"net_size\":\"0\",\n        //       \"buy_order_size\":\"0.001\",\n        //       \"sell_order_size\":\"0\",\n        //       \"im_contribution\":\"0.2\",\n        //       \"unrealized_pnl\":\"0\",\n        //       \"mark_price\":\"52406.8\",\n        //       \"entry_vwap\":\"52472.9\"\n        //    }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        let quantity = this.safeString (position, 'net_size');\n        market = this.safeMarket (marketId, market, '-');\n        let side = 'long';\n        if (Precise.stringLe (quantity, '0')) {\n            side = 'short';\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'id'),\n            'symbol': market['symbol'],\n            'entryPrice': undefined,\n            'markPrice': this.safeNumber (position, 'mark_price'),\n            'notional': undefined,\n            'collateral': undefined,\n            'unrealizedPnl': this.safeNumber (position, 'unrealized_pnl'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': this.safeNumber (position, 'im_contribution'),\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: object, market: Market = undefined): Ticker",
        "line_start": 1568,
        "line_end": 1611,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'best_bid_price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeNumber (ticker, 'best_bid_size')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'best_ask_price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeNumber (ticker, 'best_ask_size')",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "last",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (ticker, 'index_price')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"best_bid_price\":\"2490.8\",\n        \"best_bid_size\":\"9.0515\",\n        \"best_ask_price\":\"2490.81\",\n        \"best_ask_size\":\"4.8486\",\n        \"trade_price\":\"2490.39\",\n        \"trade_qty\":\"0.9508\",\n        \"index_price\":\"2490.5\",\n        \"mark_price\":\"2490.8\",\n        \"settlement_price\":\"2490.81\",\n        \"limit_up\":\"2615.42\",\n        \"limit_down\":\"2366.34\",\n        \"predicted_funding\":\"0.000009\",\n        \"timestamp\":\"2024-02-10T16:07:39.454Z\"\n    }"
        ],
        "source": "parseTicker (ticker: object, market: Market = undefined): Ticker {\n        //\n        //    {\n        //        \"best_bid_price\":\"2490.8\",\n        //        \"best_bid_size\":\"9.0515\",\n        //        \"best_ask_price\":\"2490.81\",\n        //        \"best_ask_size\":\"4.8486\",\n        //        \"trade_price\":\"2490.39\",\n        //        \"trade_qty\":\"0.9508\",\n        //        \"index_price\":\"2490.5\",\n        //        \"mark_price\":\"2490.8\",\n        //        \"settlement_price\":\"2490.81\",\n        //        \"limit_up\":\"2615.42\",\n        //        \"limit_down\":\"2366.34\",\n        //        \"predicted_funding\":\"0.000009\",\n        //        \"timestamp\":\"2024-02-10T16:07:39.454Z\"\n        //    }\n        //\n        const datetime = this.safeString (ticker, 'timestamp');\n        return this.safeTicker ({\n            'info': ticker,\n            'symbol': this.safeSymbol (undefined, market),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'bid': this.safeNumber (ticker, 'best_bid_price'),\n            'bidVolume': this.safeNumber (ticker, 'best_bid_size'),\n            'ask': this.safeNumber (ticker, 'best_ask_price'),\n            'askVolume': this.safeNumber (ticker, 'best_ask_size'),\n            'high': undefined,\n            'low': undefined,\n            'open': undefined,\n            'close': undefined,\n            'last': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'vwap': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': undefined,\n            'previousClose': undefined,\n            'markPrice': this.safeNumber (ticker, 'mark_price'),\n            'indexPrice': this.safeNumber (ticker, 'index_price'),\n        });\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1238,
        "line_end": 1291,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'fill_id', 'exec_id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (trade, 'side')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (trade, 'fill_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (trade, 'fill_qty')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (trade, 'fee'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'fee_asset')),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (trade, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (trade, 'fee_asset'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"portfolio_id\":\"1wp37qsc-1-0\",\n       \"portfolio_uuid\":\"018d7f6c-b92c-7361-8b7e-2932711e5a22\",\n       \"portfolio_name\":\"CCXT Portfolio 020624-17:16\",\n       \"fill_id\":\"1xbfy19y-1-184\",\n       \"exec_id\":\"280841526207070392\",\n       \"order_id\":\"1xbfv8yw-1-0\",\n       \"instrument_id\":\"114jqr89-0-0\",\n       \"instrument_uuid\":\"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0\",\n       \"symbol\":\"BTC-PERP\",\n       \"match_id\":\"280841526207053840\",\n       \"fill_price\":\"52500\",\n       \"fill_qty\":\"0.01\",\n       \"client_id\":\"1x59ctku-1-1\",\n       \"client_order_id\":\"ccxt3e4e2a5f-4a89-\",\n       \"order_qty\":\"0.01\",\n       \"limit_price\":\"52500\",\n       \"total_filled\":\"0.01\",\n       \"filled_vwap\":\"52500\",\n       \"expire_time\":\"\",\n       \"stop_price\":\"\",\n       \"side\":\"BUY\",\n       \"tif\":\"GTC\",\n       \"stp_mode\":\"BOTH\",\n       \"flags\":\"\",\n       \"fee\":\"0.105\",\n       \"fee_asset\":\"USDC\",\n       \"order_status\":\"DONE\",\n       \"event_time\":\"2024-02-15T00:43:57.631Z\"\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        //    {\n        //       \"portfolio_id\":\"1wp37qsc-1-0\",\n        //       \"portfolio_uuid\":\"018d7f6c-b92c-7361-8b7e-2932711e5a22\",\n        //       \"portfolio_name\":\"CCXT Portfolio 020624-17:16\",\n        //       \"fill_id\":\"1xbfy19y-1-184\",\n        //       \"exec_id\":\"280841526207070392\",\n        //       \"order_id\":\"1xbfv8yw-1-0\",\n        //       \"instrument_id\":\"114jqr89-0-0\",\n        //       \"instrument_uuid\":\"b3469e0b-222c-4f8a-9f68-1f9e44d7e5e0\",\n        //       \"symbol\":\"BTC-PERP\",\n        //       \"match_id\":\"280841526207053840\",\n        //       \"fill_price\":\"52500\",\n        //       \"fill_qty\":\"0.01\",\n        //       \"client_id\":\"1x59ctku-1-1\",\n        //       \"client_order_id\":\"ccxt3e4e2a5f-4a89-\",\n        //       \"order_qty\":\"0.01\",\n        //       \"limit_price\":\"52500\",\n        //       \"total_filled\":\"0.01\",\n        //       \"filled_vwap\":\"52500\",\n        //       \"expire_time\":\"\",\n        //       \"stop_price\":\"\",\n        //       \"side\":\"BUY\",\n        //       \"tif\":\"GTC\",\n        //       \"stp_mode\":\"BOTH\",\n        //       \"flags\":\"\",\n        //       \"fee\":\"0.105\",\n        //       \"fee_asset\":\"USDC\",\n        //       \"order_status\":\"DONE\",\n        //       \"event_time\":\"2024-02-15T00:43:57.631Z\"\n        //    }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        const datetime = this.safeString (trade, 'event_time');\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'fill_id', 'exec_id'),\n            'order': this.safeString (trade, 'order_id'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'symbol': this.safeSymbol (marketId, market),\n            'type': undefined,\n            'side': this.safeStringLower (trade, 'side'),\n            'takerOrMaker': undefined,\n            'price': this.safeNumber (trade, 'fill_price'),\n            'amount': this.safeNumber (trade, 'fill_qty'),\n            'cost': undefined,\n            'fee': {\n                'cost': this.safeNumber (trade, 'fee'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'fee_asset')),\n            },\n        });\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1202,
        "line_end": 1236,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'transfer_uuid')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transaction_uuid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'network_name'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (transaction, 'resource')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (transaction, 'asset'), currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': undefined,\n                'currency': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"idem\":\"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3\"\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //    {\n        //        \"idem\":\"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3\"\n        //    }\n        // const transactionType = this.safeString (transaction, 'type');\n        const datetime = this.safeString (transaction, 'updated_at');\n        const fromPorfolio = this.safeDict (transaction, 'from_portfolio', {});\n        const addressFrom = this.safeStringN (transaction, [ 'from_address', 'from_cb_account', this.safeStringN (fromPorfolio, [ 'id', 'uuid', 'name' ]), 'from_counterparty_id' ]);\n        const toPorfolio = this.safeDict (transaction, 'from_portfolio', {});\n        const addressTo = this.safeStringN (transaction, [ 'to_address', 'to_cb_account', this.safeStringN (toPorfolio, [ 'id', 'uuid', 'name' ]), 'to_counterparty_id' ]);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'transfer_uuid'),\n            'txid': this.safeString (transaction, 'transaction_uuid'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'network': this.networkIdToCode (this.safeString (transaction, 'network_name')),\n            'address': undefined, // TODO check if withdraw or deposit and populate\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': this.safeString (transaction, 'resource'),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': this.safeCurrencyCode (this.safeString (transaction, 'asset'), currency),\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': this.parse8601 (datetime),\n            'fee': {\n                'cost': undefined,\n                'currency': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1192,
        "line_end": 1200,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'PROCESSED': 'ok',\n            'NEW': 'pending',\n            'STARTED': 'pending',\n            'FAILED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 715,
        "line_end": 757,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'transfer_uuid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromId",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toId",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'status'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"amount\":\"0.0008\",\n     \"asset\":\"USDC\",\n     \"created_at\":\"2024-02-22T16:00:00Z\",\n     \"from_portfolio\":{\n        \"id\":\"13yuk1fs-1-0\",\n        \"name\":\"Eng Test Portfolio - 2\",\n        \"uuid\":\"018712f2-5ff9-7de3-9010-xxxxxxxxx\"\n     },\n     \"instrument_id\":\"149264164756389888\",\n     \"instrument_symbol\":\"ETH-PERP\",\n     \"position_id\":\"1xy4v51m-1-2\",\n     \"status\":\"PROCESSED\",\n     \"to_portfolio\":{\n        \"name\":\"CB_FUND\"\n     },\n     \"transfer_type\":\"FUNDING\",\n     \"transfer_uuid\":\"a6b708df-2c44-32c5-bb98-xxxxxxxxxx\",\n     \"updated_at\":\"2024-02-22T16:00:00Z\"\n }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // {\n        //     \"amount\":\"0.0008\",\n        //     \"asset\":\"USDC\",\n        //     \"created_at\":\"2024-02-22T16:00:00Z\",\n        //     \"from_portfolio\":{\n        //        \"id\":\"13yuk1fs-1-0\",\n        //        \"name\":\"Eng Test Portfolio - 2\",\n        //        \"uuid\":\"018712f2-5ff9-7de3-9010-xxxxxxxxx\"\n        //     },\n        //     \"instrument_id\":\"149264164756389888\",\n        //     \"instrument_symbol\":\"ETH-PERP\",\n        //     \"position_id\":\"1xy4v51m-1-2\",\n        //     \"status\":\"PROCESSED\",\n        //     \"to_portfolio\":{\n        //        \"name\":\"CB_FUND\"\n        //     },\n        //     \"transfer_type\":\"FUNDING\",\n        //     \"transfer_uuid\":\"a6b708df-2c44-32c5-bb98-xxxxxxxxxx\",\n        //     \"updated_at\":\"2024-02-22T16:00:00Z\"\n        // }\n        //\n        const datetime = this.safeInteger (transfer, 'created_at');\n        const timestamp = this.parse8601 (datetime);\n        const currencyId = this.safeString (transfer, 'asset');\n        const code = this.safeCurrencyCode (currencyId);\n        const fromPorfolio = this.safeDict (transfer, 'from_portfolio', {});\n        const fromId = this.safeString (fromPorfolio, 'id');\n        const toPorfolio = this.safeDict (transfer, 'to_portfolio', {});\n        const toId = this.safeString (toPorfolio, 'id');\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'transfer_uuid'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': fromId,\n            'toAccount': toId,\n            'status': this.parseTransferStatus (this.safeString (transfer, 'status')),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 759,
        "line_end": 767,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'FAILED': 'failed',\n            'PROCESSED': 'ok',\n            'NEW': 'pending',\n            'STARTED': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "coincatch": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (balances): Balances",
        "line_start": 1858,
        "line_end": 1908,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"coinId\": 2,\n             \"coinName\": \"USDT\",\n             \"available\": \"99.20000000\",\n             \"frozen\": \"0.00000000\",\n             \"lock\": \"0.00000000\",\n             \"uTime\": \"1724938746000\"\n         }\n     ]",
          "[\n         {\n             \"marginCoin\": \"USDT\",\n             \"locked\": \"0\",\n             \"available\": \"60\",\n             \"crossMaxAvailable\": \"60\",\n             \"fixedMaxAvailable\": \"60\",\n             \"maxTransferOut\": \"60\",\n             \"equity\": \"60\",\n             \"usdtEquity\": \"60\",\n             \"btcEquity\": \"0.001002360626\",\n             \"crossRiskRate\": \"0\",\n             \"unrealizedPL\": \"0\",\n             \"bonus\": \"0\",\n             \"crossedUnrealizedPL\": null,\n             \"isolatedUnrealizedPL\": null\n         }\n     ]"
        ],
        "source": "parseBalance (balances): Balances {\n        //\n        // spot\n        //     [\n        //         {\n        //             \"coinId\": 2,\n        //             \"coinName\": \"USDT\",\n        //             \"available\": \"99.20000000\",\n        //             \"frozen\": \"0.00000000\",\n        //             \"lock\": \"0.00000000\",\n        //             \"uTime\": \"1724938746000\"\n        //         }\n        //     ]\n        //\n        // swap\n        //     [\n        //         {\n        //             \"marginCoin\": \"USDT\",\n        //             \"locked\": \"0\",\n        //             \"available\": \"60\",\n        //             \"crossMaxAvailable\": \"60\",\n        //             \"fixedMaxAvailable\": \"60\",\n        //             \"maxTransferOut\": \"60\",\n        //             \"equity\": \"60\",\n        //             \"usdtEquity\": \"60\",\n        //             \"btcEquity\": \"0.001002360626\",\n        //             \"crossRiskRate\": \"0\",\n        //             \"unrealizedPL\": \"0\",\n        //             \"bonus\": \"0\",\n        //             \"crossedUnrealizedPL\": null,\n        //             \"isolatedUnrealizedPL\": null\n        //         }\n        //     ]\n        //\n        const result: Dict = {\n            'info': balances,\n        };\n        for (let i = 0; i < balances.length; i++) {\n            const balanceEntry = this.safeDict (balances, i, {});\n            const currencyId = this.safeString2 (balanceEntry, 'coinName', 'marginCoin');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balanceEntry, 'available');\n            const locked = this.safeString2 (balanceEntry, 'lock', 'locked');\n            const frozen = this.safeString (balanceEntry, 'frozen', '0');\n            account['used'] = Precise.stringAdd (locked, frozen);\n            account['total'] = this.safeString (balanceEntry, 'equity');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2031,
        "line_end": 2053,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"USDT\",\n         \"address\": \"TKTUt7qiTaMgnTwZXjE3ZBkPB6LKhLPJyZ\",\n         \"chain\": \"TRC20\",\n         \"tag\": null,\n         \"url\": \"https://tronscan.org/#/transaction/\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"USDT\",\n        //         \"address\": \"TKTUt7qiTaMgnTwZXjE3ZBkPB6LKhLPJyZ\",\n        //         \"chain\": \"TRC20\",\n        //         \"tag\": null,\n        //         \"url\": \"https://tronscan.org/#/transaction/\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        const networkId = this.safeString (depositAddress, 'chain');\n        const network = this.safeString (this.options['networksById'], networkId, networkId);\n        const tag = this.safeString (depositAddress, 'tag');\n        return {\n            'currency': currency['code'],\n            'address': address,\n            'tag': tag,\n            'network': network,\n            'info': depositAddress,\n        };\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 685,
        "line_end": 736,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': this.safeNumber (chain, 'withdrawFee'), 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"coinId\":\"1\",\n     \"coinName\":\"BTC\",\n     \"transfer\":\"true\",\n     \"chains\":[\n         {\n             \"chain\":null,\n             \"needTag\":\"false\",\n             \"withdrawable\":\"true\",\n             \"rechargeAble\":\"true\",\n             \"withdrawFee\":\"0.005\",\n             \"depositConfirm\":\"1\",\n             \"withdrawConfirm\":\"1\",\n             \"minDepositAmount\":\"0.001\",\n             \"minWithdrawAmount\":\"0.001\",\n             \"browserUrl\":\"https://blockchair.com/bitcoin/testnet/transaction/\"\n         }\n     ]\n }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        // {\n        //     \"coinId\":\"1\",\n        //     \"coinName\":\"BTC\",\n        //     \"transfer\":\"true\",\n        //     \"chains\":[\n        //         {\n        //             \"chain\":null,\n        //             \"needTag\":\"false\",\n        //             \"withdrawable\":\"true\",\n        //             \"rechargeAble\":\"true\",\n        //             \"withdrawFee\":\"0.005\",\n        //             \"depositConfirm\":\"1\",\n        //             \"withdrawConfirm\":\"1\",\n        //             \"minDepositAmount\":\"0.001\",\n        //             \"minWithdrawAmount\":\"0.001\",\n        //             \"browserUrl\":\"https://blockchair.com/bitcoin/testnet/transaction/\"\n        //         }\n        //     ]\n        // }\n        //\n        const chains = this.safeList (fee, 'chains', []);\n        const chainsLength = chains.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        for (let i = 0; i < chainsLength; i++) {\n            const chain = chains[i];\n            const networkId = this.safeString (chain, 'chain');\n            const currencyCode = this.safeString (currency, 'code');\n            const networkCode = this.networkIdToCode (networkId, currencyCode);\n            result['networks'][networkCode] = {\n                'deposit': { 'fee': undefined, 'percentage': undefined },\n                'withdraw': { 'fee': this.safeNumber (chain, 'withdrawFee'), 'percentage': false },\n            };\n            if (chainsLength === 1) {\n                result['withdraw']['fee'] = this.safeNumber (chain, 'withdrawFee');\n                result['withdraw']['percentage'] = false;\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFeeDetailString",
        "signature": "parseFeeDetailString (feeDetailString: Str)",
        "line_start": 4311,
        "line_end": 4330,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "currency",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFeeDetailString (feeDetailString: Str) {\n        const result = [];\n        const feeDetail = this.parseJson (feeDetailString);\n        if (feeDetail) {\n            const keys = Object.keys (feeDetail);\n            for (let i = 0; i < keys.length; i++) {\n                const currencyId = this.safeString (keys, i);\n                if (currencyId in this.currencies_by_id) {\n                    const currency = this.safeCurrencyCode (currencyId);\n                    const feeEntry = this.safeDict (feeDetail, currencyId, {});\n                    const amount = Precise.stringAbs (this.safeString (feeEntry, 'totalFee'));\n                    result.push ({\n                        'currency': currency,\n                        'amount': amount,\n                    });\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined)",
        "line_start": 1689,
        "line_end": 1712,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRate (contract, market: Market = undefined) {\n        const marketId = this.safeString (contract, 'symbol');\n        market = this.safeMarketCustom (marketId, market);\n        const fundingRate = this.safeNumber (contract, 'fundingRate');\n        return {\n            'info': contract,\n            'symbol': market['symbol'],\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': fundingRate,\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 5347,
        "line_end": 5408,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "Precise.stringAbs (this.safeString2 (item, 'fee', 'fees'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (item, 'feeCoin')",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (item, 'billId', 'id')",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeStringLower2 (item, 'bizType', 'business'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (settleId, currency)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeString (item, 'balance')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"billId\": \"1220289012519190529\",\n         \"coinId\": 2,\n         \"coinName\": \"USDT\",\n         \"groupType\": \"transfer\",\n         \"bizType\": \"Transfer out\",\n         \"quantity\": \"-40.00000000\",\n         \"balance\": \"4.43878673\",\n         \"fees\": \"0.00000000\",\n         \"cTime\": \"1726665493092\"\n     }",
          "{\n         \"id\": \"1220288640761122816\",\n         \"symbol\": null,\n         \"marginCoin\": \"ETH\",\n         \"amount\": \"0.01\",\n         \"fee\": \"0\",\n         \"feeByCoupon\": \"\",\n         \"feeCoin\": \"ETH\",\n         \"business\": \"trans_from_exchange\",\n         \"cTime\": \"1726665404563\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // spot\n        //     {\n        //         \"billId\": \"1220289012519190529\",\n        //         \"coinId\": 2,\n        //         \"coinName\": \"USDT\",\n        //         \"groupType\": \"transfer\",\n        //         \"bizType\": \"Transfer out\",\n        //         \"quantity\": \"-40.00000000\",\n        //         \"balance\": \"4.43878673\",\n        //         \"fees\": \"0.00000000\",\n        //         \"cTime\": \"1726665493092\"\n        //     }\n        //\n        // swap\n        //     {\n        //         \"id\": \"1220288640761122816\",\n        //         \"symbol\": null,\n        //         \"marginCoin\": \"ETH\",\n        //         \"amount\": \"0.01\",\n        //         \"fee\": \"0\",\n        //         \"feeByCoupon\": \"\",\n        //         \"feeCoin\": \"ETH\",\n        //         \"business\": \"trans_from_exchange\",\n        //         \"cTime\": \"1726665404563\"\n        //     }\n        //\n        const timestamp = this.safeInteger (item, 'cTime');\n        const settleId = this.safeString2 (item, 'coinName', 'marginCoin');\n        let market: Market = undefined;\n        const marketId = this.safeString (item, 'symbol');\n        market = this.safeMarketCustom (marketId, market, settleId);\n        let amountString = this.safeString2 (item, 'quantity', 'amount');\n        let direction = 'in';\n        if (Precise.stringLt (amountString, '0')) {\n            direction = 'out';\n            amountString = Precise.stringMul (amountString, '-1');\n        }\n        const fee = {\n            'cost': Precise.stringAbs (this.safeString2 (item, 'fee', 'fees')),\n            'currency': this.safeString (item, 'feeCoin'),\n        };\n        return this.safeLedgerEntry ({\n            'id': this.safeString2 (item, 'billId', 'id'),\n            'info': item,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'account': undefined,\n            'direction': direction,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeStringLower2 (item, 'bizType', 'business')),\n            'currency': this.safeCurrencyCode (settleId, currency),\n            'symbol': market['symbol'],\n            'amount': amountString,\n            'before': undefined,\n            'after': this.safeString (item, 'balance'),\n            'status': 'ok',\n            'fee': fee,\n        }, currency);\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type: string): string",
        "line_start": 5410,
        "line_end": 5437,
        "comment": null,
        "mappings": [
          {
            "key": "deposit",
            "value": "'deposit'",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "'withdrawal'",
            "comment": null
          },
          {
            "key": "buy",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "sell",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "deduction of handling fee",
            "value": "'fee'",
            "comment": null
          },
          {
            "key": "transfer in",
            "value": "'transfer'",
            "comment": null
          },
          {
            "key": "transfer out",
            "value": "'transfer'",
            "comment": null
          },
          {
            "key": "rebate rewards",
            "value": "'rebate'",
            "comment": null
          },
          {
            "key": "user lock",
            "value": "'user lock'",
            "comment": null
          },
          {
            "key": "open_long",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "open_short",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "close_long",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "close_short",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "trans_from_exchange",
            "value": "'transfer'",
            "comment": null
          },
          {
            "key": "trans_to_exchange",
            "value": "'transfer'",
            "comment": null
          },
          {
            "key": "contract_settle_fee",
            "value": "'fee'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntryType (type: string): string {\n        const types = {\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'buy': 'trade',\n            'sell': 'trade',\n            'deduction of handling fee': 'fee', // todo check\n            'transfer-in': 'transfer',\n            'transfer in': 'transfer',\n            'transfer out': 'transfer',\n            'rebate rewards': 'rebate', // todo check\n            'airdrop rewards': 'rebate', // todo check\n            'usdt contract rewards': 'rebate', // todo check\n            'mix contract rewards': 'rebate', // todo check\n            'system lock': 'system lock',\n            'user lock': 'user lock',\n            'open_long': 'trade',\n            'open_short': 'trade',\n            'close_long': 'trade',\n            'close_short': 'trade',\n            'trans_from_exchange': 'transfer',\n            'trans_to_exchange': 'transfer',\n            'contract_settle_fee': 'fee', // todo check sometimes it is positive, sometimes negative\n            'burst_long_loss_query': 'trade', // todo check\n            'burst_short_loss_query': 'trade', // todo check\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 4774,
        "line_end": 4826,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marginCoin\": \"ETH\",\n         \"locked\": \"0\",\n         \"available\": \"0.01\",\n         \"crossMaxAvailable\": \"0.01\",\n         \"fixedMaxAvailable\": \"0.01\",\n         \"maxTransferOut\": \"0.01\",\n         \"equity\": \"0.01\",\n         \"usdtEquity\": \"22.97657025\",\n         \"btcEquity\": \"0.000386195288\",\n         \"crossRiskRate\": \"0\",\n         \"crossMarginLeverage\": 100,\n         \"fixedLongLeverage\": 100,\n         \"fixedShortLeverage\": 100,\n         \"marginMode\": \"crossed\",\n         \"holdMode\": \"double_hold\",\n         \"unrealizedPL\": \"0\",\n         \"bonus\": \"0\",\n         \"crossedUnrealizedPL\": \"0\",\n         \"isolatedUnrealizedPL\": \"\"\n     }",
          "{\n         \"symbol\": \"ETHUSD_DMCBL\",\n         \"marginCoin\": \"ETH\",\n         \"longLeverage\": 2,\n         \"shortLeverage\": 2,\n         \"crossMarginLeverage\": 2,\n         \"marginMode\": \"crossed\"\n     }"
        ],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        //\n        // fetchLeverage\n        //     {\n        //         \"marginCoin\": \"ETH\",\n        //         \"locked\": \"0\",\n        //         \"available\": \"0.01\",\n        //         \"crossMaxAvailable\": \"0.01\",\n        //         \"fixedMaxAvailable\": \"0.01\",\n        //         \"maxTransferOut\": \"0.01\",\n        //         \"equity\": \"0.01\",\n        //         \"usdtEquity\": \"22.97657025\",\n        //         \"btcEquity\": \"0.000386195288\",\n        //         \"crossRiskRate\": \"0\",\n        //         \"crossMarginLeverage\": 100,\n        //         \"fixedLongLeverage\": 100,\n        //         \"fixedShortLeverage\": 100,\n        //         \"marginMode\": \"crossed\",\n        //         \"holdMode\": \"double_hold\",\n        //         \"unrealizedPL\": \"0\",\n        //         \"bonus\": \"0\",\n        //         \"crossedUnrealizedPL\": \"0\",\n        //         \"isolatedUnrealizedPL\": \"\"\n        //     }\n        //\n        // setLeverage\n        //     {\n        //         \"symbol\": \"ETHUSD_DMCBL\",\n        //         \"marginCoin\": \"ETH\",\n        //         \"longLeverage\": 2,\n        //         \"shortLeverage\": 2,\n        //         \"crossMarginLeverage\": 2,\n        //         \"marginMode\": \"crossed\"\n        //     }\n        //\n        const marketId = this.safeString (leverage, 'symbol');\n        market = this.safeMarketCustom (marketId, market);\n        const marginMode = this.parseMarginModeType (this.safeStringLower (leverage, 'marginMode'));\n        let longLeverage = this.safeInteger2 (leverage, 'fixedLongLeverage', 'longLeverage');\n        let shortLeverage = this.safeInteger2 (leverage, 'fixedShortLeverage', 'shortLeverage');\n        const crossMarginLeverage = this.safeInteger (leverage, 'crossMarginLeverage');\n        if (marginMode === 'cross') {\n            longLeverage = crossMarginLeverage;\n            shortLeverage = crossMarginLeverage;\n        }\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 4552,
        "line_end": 4559,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.parseMarginModeType (marginType)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marginType = this.safeStringLower (marginMode, 'marginMode');\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (undefined, market),\n            'marginMode': this.parseMarginModeType (marginType),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModeType",
        "signature": "parseMarginModeType (type: string): string",
        "line_start": 4561,
        "line_end": 4567,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarginModeType (type: string): string {\n        const types: Dict = {\n            'crossed': 'cross',\n            'fixed': 'isolated',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 4861,
        "line_end": 4878,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //\n        const msg = this.safeString (data, 'msg');\n        const status = (msg === 'success') ? 'ok' : 'failed';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': undefined,\n            'amount': undefined,\n            'total': undefined,\n            'code': market['quote'],\n            'status': status,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 879,
        "line_end": 1027,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "subType",
            "value": "subType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "isSpot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "isSpot ? false : undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "!isSpot",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "!isSpot",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'sizeMultiplier')",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isInverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeBool (fees, 'percentage')",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "this.safeBool (fees, 'tierBased')",
            "comment": null
          },
          {
            "key": "feeSide",
            "value": "this.safeString (fees, 'feeSide')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (amountPrecisionString),\n                'price': this.parseNumber (pricePrecisionString),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (market, 'minTradeNum'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountPrecisionString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (pricePrecisionString)",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"high24h\": \"59461.34\",\n         \"low24h\": \"57723.23\",\n         \"close\": \"59056.02\",\n         \"quoteVol\": \"18240112.23368\",\n         \"baseVol\": \"309.05564\",\n         \"usdtVol\": \"18240112.2336744\",\n         \"ts\": \"1725114038951\",\n         \"buyOne\": \"59055.85\",\n         \"sellOne\": \"59057.45\",\n         \"bidSz\": \"0.0139\",\n         \"askSz\": \"0.0139\",\n         \"openUtc0\": \"59126.71\",\n         \"changeUtc\": \"-0.0012\",\n         \"change\": \"0.01662\"\n     },",
          "{\n         \"symbol\": \"BTCUSDT_UMCBL\",\n         \"makerFeeRate\": \"0.0002\",\n         \"takerFeeRate\": \"0.0006\",\n         \"feeRateUpRatio\": \"0.005\",\n         \"openCostUpRatio\": \"0.01\",\n         \"quoteCoin\": \"USDT\",\n         \"baseCoin\": \"BTC\",\n         \"buyLimitPriceRatio\": \"0.01\",\n         \"sellLimitPriceRatio\": \"0.01\",\n         \"supportMarginCoins\": [ \"USDT\" ],\n         \"minTradeNum\": \"0.001\",\n         \"priceEndStep\": \"1\",\n         \"volumePlace\": \"3\",\n         \"pricePlace\": \"1\",\n         \"sizeMultiplier\": \"0.001\",\n         \"symbolType\": \"perpetual\",\n         \"symbolStatus\": \"normal\",\n         \"offTime\": \"-1\",\n         \"limitOpenTime\": \"-1\",\n         \"maintainTime\": \"\",\n         \"symbolName\": \"BTCUSDT\",\n         \"minTradeUSDT\": null,\n         \"maxPositionNum\": null,\n         \"maxOrderNum\": null\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        // spot\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"high24h\": \"59461.34\",\n        //         \"low24h\": \"57723.23\",\n        //         \"close\": \"59056.02\",\n        //         \"quoteVol\": \"18240112.23368\",\n        //         \"baseVol\": \"309.05564\",\n        //         \"usdtVol\": \"18240112.2336744\",\n        //         \"ts\": \"1725114038951\",\n        //         \"buyOne\": \"59055.85\",\n        //         \"sellOne\": \"59057.45\",\n        //         \"bidSz\": \"0.0139\",\n        //         \"askSz\": \"0.0139\",\n        //         \"openUtc0\": \"59126.71\",\n        //         \"changeUtc\": \"-0.0012\",\n        //         \"change\": \"0.01662\"\n        //     },\n        //\n        // swap\n        //     {\n        //         \"symbol\": \"BTCUSDT_UMCBL\",\n        //         \"makerFeeRate\": \"0.0002\",\n        //         \"takerFeeRate\": \"0.0006\",\n        //         \"feeRateUpRatio\": \"0.005\",\n        //         \"openCostUpRatio\": \"0.01\",\n        //         \"quoteCoin\": \"USDT\",\n        //         \"baseCoin\": \"BTC\",\n        //         \"buyLimitPriceRatio\": \"0.01\",\n        //         \"sellLimitPriceRatio\": \"0.01\",\n        //         \"supportMarginCoins\": [ \"USDT\" ],\n        //         \"minTradeNum\": \"0.001\",\n        //         \"priceEndStep\": \"1\",\n        //         \"volumePlace\": \"3\",\n        //         \"pricePlace\": \"1\",\n        //         \"sizeMultiplier\": \"0.001\",\n        //         \"symbolType\": \"perpetual\",\n        //         \"symbolStatus\": \"normal\",\n        //         \"offTime\": \"-1\",\n        //         \"limitOpenTime\": \"-1\",\n        //         \"maintainTime\": \"\",\n        //         \"symbolName\": \"BTCUSDT\",\n        //         \"minTradeUSDT\": null,\n        //         \"maxPositionNum\": null,\n        //         \"maxOrderNum\": null\n        //     }\n        //\n        let marketId = this.safeString (market, 'symbol');\n        const tradingFees = this.safeDict (this.fees, 'trading');\n        const fees = this.safeDict (tradingFees, 'spot');\n        let baseId = this.safeString (market, 'baseCoin');\n        let quoteId = this.safeString (market, 'quoteCoin');\n        let settleId: Str = undefined;\n        let suffix = '';\n        let settle: Str = undefined;\n        let type = 'spot';\n        let isLinear: Bool = undefined;\n        let isInverse: Bool = undefined;\n        let subType: Str = undefined;\n        const isSpot = baseId === undefined; // for now spot markets have no properties baseCoin and quoteCoin\n        if (isSpot) {\n            const parsedMarketId = this.parseSpotMarketId (marketId);\n            baseId = this.safeString (parsedMarketId, 'baseId');\n            quoteId = this.safeString (parsedMarketId, 'quoteId');\n            marketId += '_SPBL'; // spot markets should have current suffix\n        } else {\n            type = 'swap';\n            fees['taker'] = this.safeNumber (market, 'takerFeeRate');\n            fees['maker'] = this.safeNumber (market, 'makerFeeRate');\n            const supportMarginCoins = this.safeList (market, 'supportMarginCoins', []);\n            settleId = this.safeString (supportMarginCoins, 0);\n            settle = this.safeCurrencyCode (settleId);\n            suffix = ':' + settle;\n            isLinear = quoteId === settleId; // todo check\n            isInverse = baseId === settleId; // todo check\n            if (isLinear) {\n                subType = 'linear';\n            } else if (isInverse) {\n                subType = 'inverse';\n            }\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote + suffix;\n        const symbolStatus = this.safeString (market, 'symbolStatus');\n        const active = symbolStatus ? (symbolStatus === 'normal') : undefined;\n        const volumePlace = this.safeString (market, 'volumePlace');\n        const amountPrecisionString = this.parsePrecision (volumePlace);\n        const pricePlace = this.safeString (market, 'pricePlace');\n        const priceEndStep = this.safeString (market, 'priceEndStep');\n        const pricePrecisionString = Precise.stringMul (this.parsePrecision (pricePlace), priceEndStep);\n        return this.safeMarketStructure ({\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'active': active,\n            'type': type,\n            'subType': subType,\n            'spot': isSpot,\n            'margin': isSpot ? false : undefined,\n            'swap': !isSpot,\n            'future': false,\n            'option': false,\n            'contract': !isSpot,\n            'settle': settle,\n            'settleId': settleId,\n            'contractSize': this.safeNumber (market, 'sizeMultiplier'),\n            'linear': isLinear,\n            'inverse': isInverse,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'percentage': this.safeBool (fees, 'percentage'),\n            'tierBased': this.safeBool (fees, 'tierBased'),\n            'feeSide': this.safeString (fees, 'feeSide'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (amountPrecisionString),\n                'price': this.parseNumber (pricePrecisionString),\n            },\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (market, 'minTradeNum'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1471,
        "line_end": 1480,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger2 (ohlcv, 'ts', 0),\n            this.safeNumber2 (ohlcv, 'open', 1),\n            this.safeNumber2 (ohlcv, 'high', 2),\n            this.safeNumber2 (ohlcv, 'low', 3),\n            this.safeNumber2 (ohlcv, 'close', 4),\n            this.safeNumber2 (ohlcv, 'baseVol', 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order, market = undefined): Order",
        "line_start": 4049,
        "line_end": 4262,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString2 (order, 'clientOrderId', 'clientOid')",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'uTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "average",
            "value": "priceAvg ? priceAvg : this.safeString (order, 'fillPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString2 (order, 'fillQuantity', 'filledQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (order, 'fillTotalAmount', 'filledAmount')",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCurrency,\n                'cost': feeCost,\n            }",
            "comment": null
          },
          {
            "key": "fees",
            "value": "fees",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": \"1217143186968068096\",\n         \"clientOrderId\": \"8fa3eb89-2377-4519-a199-35d5db9ed262\"\n     }",
          "{\n         \"clientOid\": \"1225791137701519360\",\n         \"orderId\": \"1225791137697325056\"\n     }",
          "{\n         \"accountId\": \"1002820815393\",\n         \"symbol\": \"ETHUSDT_SPBL\",\n         \"orderId\": \"1217143186968068096\",\n         \"clientOrderId\": \"8fa3eb89-2377-4519-a199-35d5db9ed262\",\n         \"price\": \"0\",\n         \"quantity\": \"10.0000000000000000\",\n         \"orderType\": \"market\",\n         \"side\": \"buy\",\n         \"status\": \"full_fill\",\n         \"fillPrice\": \"2340.5500000000000000\",\n         \"fillQuantity\": \"0.0042000000000000\",\n         \"fillTotalAmount\": \"9.8303100000000000\",\n         \"enterPointSource\": \"API\",\n         \"feeDetail\": \"{\n             \\\"ETH\\\": {\n                 \\\"deduction\\\": false,\n                 \\\"feeCoinCode\\\": \\\"ETH\\\",\n                 \\\"totalDeductionFee\\\": 0,\n                 \\\"totalFee\\\": -0.0000042000000000},\n                 \\\"newFees\\\": {\n                     \\\"c\\\": 0,\n                     \\\"d\\\": 0,\n                     \\\"deduction\\\": false,\n                     \\\"r\\\": -0.0000042,\n                     \\\"t\\\": -0.0000042,\n                     \\\"totalDeductionFee\\\": 0\n             }\n         }\",\n         \"orderSource\": \"market\",\n         \"cTime\": \"1725915469877\"\n     }",
          "{\n         \"symbol\": \"ETHUSDT_UMCBL\",\n         \"size\": 0.01,\n         \"orderId\": \"1225791137697325056\",\n         \"clientOid\": \"1225791137701519360\",\n         \"filledQty\": 0.01,\n         \"fee\": -0.01398864,\n         \"price\": null,\n         \"priceAvg\": 2331.44,\n         \"state\": \"filled\",\n         \"side\": \"close_long\",\n         \"timeInForce\": \"normal\",\n         \"totalProfits\": -2.23680000,\n         \"posSide\": \"long\",\n         \"marginCoin\": \"USDT\",\n         \"filledAmount\": 23.3144,\n         \"orderType\": \"market\",\n         \"leverage\": \"5\",\n         \"marginMode\": \"crossed\",\n         \"reduceOnly\": true,\n         \"enterPointSource\": \"API\",\n         \"tradeSide\": \"close_long\",\n         \"holdMode\": \"double_hold\",\n         \"orderSource\": \"market\",\n         \"cTime\": \"1727977302003\",\n         \"uTime\": \"1727977303604\"\n     }",
          "{\n         \"accountId\": \"1002820815393\",\n         \"symbol\": \"ETHUSDT_SPBL\",\n         \"orderId\": \"1217347655911653376\",\n         \"clientOrderId\": \"c57c07d1-bd00-4167-95e2-9b22a55fbc28\",\n         \"price\": \"2000.0000000000000000\",\n         \"quantity\": \"0.0010000000000000\",\n         \"orderType\": \"limit\",\n         \"side\": \"buy\",\n         \"status\": \"new\",\n         \"fillPrice\": \"0\",\n         \"fillQuantity\": \"0.0000000000000000\",\n         \"fillTotalAmount\": \"0.0000000000000000\",\n         \"enterPointSource\": \"API\",\n         \"feeDetail\": \"\",\n         \"orderSource\": \"normal\",\n         \"cTime\": \"1725964219072\"\n     }"
        ],
        "source": "parseOrder (order, market = undefined): Order {\n        //\n        // createOrder spot\n        //     {\n        //         \"orderId\": \"1217143186968068096\",\n        //         \"clientOrderId\": \"8fa3eb89-2377-4519-a199-35d5db9ed262\"\n        //     }\n        //\n        // createOrder swap\n        //     {\n        //         \"clientOid\": \"1225791137701519360\",\n        //         \"orderId\": \"1225791137697325056\"\n        //     }\n        //\n        // privatePostApiSpotV1TradeOrderInfo, privatePostApiSpotV1TradeHistory\n        //     {\n        //         \"accountId\": \"1002820815393\",\n        //         \"symbol\": \"ETHUSDT_SPBL\",\n        //         \"orderId\": \"1217143186968068096\",\n        //         \"clientOrderId\": \"8fa3eb89-2377-4519-a199-35d5db9ed262\",\n        //         \"price\": \"0\",\n        //         \"quantity\": \"10.0000000000000000\",\n        //         \"orderType\": \"market\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"full_fill\",\n        //         \"fillPrice\": \"2340.5500000000000000\",\n        //         \"fillQuantity\": \"0.0042000000000000\",\n        //         \"fillTotalAmount\": \"9.8303100000000000\",\n        //         \"enterPointSource\": \"API\",\n        //         \"feeDetail\": \"{\n        //             \\\"ETH\\\": {\n        //                 \\\"deduction\\\": false,\n        //                 \\\"feeCoinCode\\\": \\\"ETH\\\",\n        //                 \\\"totalDeductionFee\\\": 0,\n        //                 \\\"totalFee\\\": -0.0000042000000000},\n        //                 \\\"newFees\\\": {\n        //                     \\\"c\\\": 0,\n        //                     \\\"d\\\": 0,\n        //                     \\\"deduction\\\": false,\n        //                     \\\"r\\\": -0.0000042,\n        //                     \\\"t\\\": -0.0000042,\n        //                     \\\"totalDeductionFee\\\": 0\n        //             }\n        //         }\",\n        //         \"orderSource\": \"market\",\n        //         \"cTime\": \"1725915469877\"\n        //     }\n        //\n        // privatePostApiMixV1OrderDetail, privateGetApiMixV1OrderMarginCoinCurrent\n        //     {\n        //         \"symbol\": \"ETHUSDT_UMCBL\",\n        //         \"size\": 0.01,\n        //         \"orderId\": \"1225791137697325056\",\n        //         \"clientOid\": \"1225791137701519360\",\n        //         \"filledQty\": 0.01,\n        //         \"fee\": -0.01398864,\n        //         \"price\": null,\n        //         \"priceAvg\": 2331.44,\n        //         \"state\": \"filled\",\n        //         \"side\": \"close_long\",\n        //         \"timeInForce\": \"normal\",\n        //         \"totalProfits\": -2.23680000,\n        //         \"posSide\": \"long\",\n        //         \"marginCoin\": \"USDT\",\n        //         \"filledAmount\": 23.3144,\n        //         \"orderType\": \"market\",\n        //         \"leverage\": \"5\",\n        //         \"marginMode\": \"crossed\",\n        //         \"reduceOnly\": true,\n        //         \"enterPointSource\": \"API\",\n        //         \"tradeSide\": \"close_long\",\n        //         \"holdMode\": \"double_hold\",\n        //         \"orderSource\": \"market\",\n        //         \"cTime\": \"1727977302003\",\n        //         \"uTime\": \"1727977303604\"\n        //     }\n        //\n        // privatePostApiSpotV1TradeOpenOrders\n        //     {\n        //         \"accountId\": \"1002820815393\",\n        //         \"symbol\": \"ETHUSDT_SPBL\",\n        //         \"orderId\": \"1217347655911653376\",\n        //         \"clientOrderId\": \"c57c07d1-bd00-4167-95e2-9b22a55fbc28\",\n        //         \"price\": \"2000.0000000000000000\",\n        //         \"quantity\": \"0.0010000000000000\",\n        //         \"orderType\": \"limit\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"new\",\n        //         \"fillPrice\": \"0\",\n        //         \"fillQuantity\": \"0.0000000000000000\",\n        //         \"fillTotalAmount\": \"0.0000000000000000\",\n        //         \"enterPointSource\": \"API\",\n        //         \"feeDetail\": \"\",\n        //         \"orderSource\": \"normal\",\n        //         \"cTime\": \"1725964219072\"\n        //     }\n        //\n        // privatePostApiSpotV1PlanCurrentPlan, privatePostApiSpotV1PlanHistoryPlan\n        //     {\n        //         \"orderId\": \"1228669617606991872\",\n        //         \"clientOid\": \"1228669617573437440\",\n        //         \"symbol\": \"ETHUSDT_SPBL\",\n        //         \"size\": \"50\",\n        //         \"executePrice\": \"0\",\n        //         \"triggerPrice\": \"4000\",\n        //         \"status\": \"not_trigger\",\n        //         \"orderType\": \"market\",\n        //         \"side\": \"sell\",\n        //         \"triggerType\": \"fill_price\",\n        //         \"enterPointSource\": \"API\",\n        //         \"placeType\": null,\n        //         \"cTime\": \"1728663585092\",\n        //         \"uTime\": null\n        //     }\n        //\n        // privateGetApiMixV1PlanCurrentPlan\n        //     {\n        //         \"orderId\": \"1230779428914049025\",\n        //         \"clientOid\": \"1230779428914049024\",\n        //         \"symbol\": \"ETHUSDT_UMCBL\",\n        //         \"marginCoin\": \"USDT\",\n        //         \"size\": \"0.01\",\n        //         \"executePrice\": \"1000\",\n        //         \"triggerPrice\": \"1200\",\n        //         \"status\": \"not_trigger\",\n        //         \"orderType\": \"limit\",\n        //         \"planType\": \"normal_plan\",\n        //         \"side\": \"buy_single\",\n        //         \"triggerType\": \"fill_price\",\n        //         \"presetTakeProfitPrice\": \"4000\",\n        //         \"presetTakeLossPrice\": \"900\",\n        //         \"rangeRate\": \"\",\n        //         \"enterPointSource\": \"API\",\n        //         \"tradeSide\": \"buy_single\",\n        //         \"holdMode\": \"single_hold\",\n        //         \"reduceOnly\": false,\n        //         \"cTime\": \"1729166603306\",\n        //         \"uTime\": null\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        const marginCoin = this.safeString (order, 'marginCoin');\n        market = this.safeMarketCustom (marketId, market, marginCoin);\n        const timestamp = this.safeInteger (order, 'cTime');\n        let price = this.omitZero (this.safeString2 (order, 'price', 'executePrice')); // price is zero for market orders\n        const priceAvg = this.omitZero (this.safeString (order, 'priceAvg'));\n        if (price === undefined) {\n            price = priceAvg;\n        }\n        const type = this.safeString (order, 'orderType');\n        const side = this.parseOrderSide (this.safeStringLower (order, 'side'));\n        let amount = this.safeString2 (order, 'quantity', 'size');\n        const isTrigger = this.safeString (order, 'triggerType') !== undefined;\n        const isMarketBuy = (type === 'market') && (side === 'buy');\n        if ((market['spot']) && (isMarketBuy) && (!isTrigger)) {\n            amount = undefined; // cost instead of amount is returned for market buy spot non-trigger orders\n        }\n        const status = this.safeString2 (order, 'status', 'state');\n        const feeDetailString = this.safeString (order, 'feeDetail');\n        let fees = undefined;\n        let feeCurrency: Str = undefined;\n        let feeCost: Str = undefined;\n        if (feeDetailString !== undefined) {\n            fees = this.parseFeeDetailString (feeDetailString);\n        } else {\n            feeCurrency = marginCoin ? this.safeCurrencyCode (marginCoin) : undefined;\n            feeCost = Precise.stringAbs (this.safeString (order, 'fee'));\n        }\n        const timeInForce = this.parseOrderTimeInForce (this.safeStringLower (order, 'timeInForce'));\n        let postOnly: Bool = undefined;\n        if (timeInForce !== undefined) {\n            postOnly = timeInForce === 'PO';\n        }\n        const triggerPrice = this.omitZero (this.safeString (order, 'triggerPrice'));\n        let takeProfitPrice = this.omitZero (this.safeString (order, 'presetTakeProfitPrice'));\n        let stopLossPrice = this.omitZero (this.safeString2 (order, 'presetTakeProfitPrice', 'presetTakeLossPrice'));\n        const planType = this.safeString (order, 'planType');\n        if (planType === 'loss_plan') {\n            stopLossPrice = triggerPrice;\n        } else if (planType === 'profit_plan') {\n            takeProfitPrice = triggerPrice;\n        }\n        return this.safeOrder ({\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString2 (order, 'clientOrderId', 'clientOid'),\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (order, 'uTime'),\n            'status': this.parseOrderStatus (status),\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'side': side,\n            'price': price,\n            'average': priceAvg ? priceAvg : this.safeString (order, 'fillPrice'),\n            'amount': amount,\n            'filled': this.safeString2 (order, 'fillQuantity', 'filledQty'),\n            'remaining': undefined,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'cost': this.safeString2 (order, 'fillTotalAmount', 'filledAmount'),\n            'trades': undefined,\n            'fee': {\n                'currency': feeCurrency,\n                'cost': feeCost,\n            },\n            'fees': fees,\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'postOnly': postOnly,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (side: Str): Str",
        "line_start": 4279,
        "line_end": 4299,
        "comment": null,
        "mappings": [
          {
            "key": "buy",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "sell",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "open_long",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "open_short",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "close_long",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "close_short",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "reduce_close_long",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "reduce_close_short",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "offset_close_long",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "offset_close_short",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "burst_close_long",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "burst_close_short",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "delivery_close_long",
            "value": "'sell'",
            "comment": null
          },
          {
            "key": "delivery_close_short",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "buy_single",
            "value": "'buy'",
            "comment": null
          },
          {
            "key": "sell_single",
            "value": "'sell'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderSide (side: Str): Str {\n        const sides = {\n            'buy': 'buy',\n            'sell': 'sell',\n            'open_long': 'buy',\n            'open_short': 'sell',\n            'close_long': 'sell',\n            'close_short': 'buy',\n            'reduce_close_long': 'sell',\n            'reduce_close_short': 'buy',\n            'offset_close_long': 'sell',\n            'offset_close_short': 'buy',\n            'burst_close_long': 'sell',\n            'burst_close_short': 'buy',\n            'delivery_close_long': 'sell',\n            'delivery_close_short': 'buy',\n            'buy_single': 'buy',\n            'sell_single': 'sell',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str): Str",
        "line_start": 4264,
        "line_end": 4277,
        "comment": null,
        "mappings": [
          {
            "key": "not_trigger",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "init",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "new",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "partially_filled",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "full_fill",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "filled",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "cancel",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "canceled",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "cancelled",
            "value": "'canceled'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status: Str): Str {\n        const satuses = {\n            'not_trigger': 'open',\n            'init': 'open',\n            'new': 'open',\n            'partially_filled': 'open',\n            'full_fill': 'closed',\n            'filled': 'closed',\n            'cancel': 'canceled',\n            'canceled': 'canceled',\n            'cancelled': 'canceled',\n        };\n        return this.safeString (satuses, status, status);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (timeInForce: Str): Str",
        "line_start": 4301,
        "line_end": 4309,
        "comment": null,
        "mappings": [
          {
            "key": "normal",
            "value": "'GTC'",
            "comment": null
          },
          {
            "key": "post_only",
            "value": "'PO'",
            "comment": null
          },
          {
            "key": "iok",
            "value": "'IOC'",
            "comment": null
          },
          {
            "key": "fok",
            "value": "'FOK'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderTimeInForce (timeInForce: Str): Str {\n        const timeInForces = {\n            'normal': 'GTC',\n            'post_only': 'PO',\n            'iok': 'IOC',\n            'fok': 'FOK',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 5074,
        "line_end": 5144,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'total')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (position, 'holdSide')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "margin",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPL')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'achievedProfits')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'marketPrice')",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidationPrice')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.parseMarginModeType (marginMode)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "isHedged",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.safeNumber (position, 'marginRatio')",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'uTime')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "position",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marginCoin\": \"USDT\",\n         \"symbol\": \"ETHUSDT_UMCBL\",\n         \"holdSide\": \"long\",\n         \"openDelegateCount\": \"0\",\n         \"margin\": \"2.55512\",\n         \"available\": \"0.01\",\n         \"locked\": \"0\",\n         \"total\": \"0.01\",\n         \"leverage\": 10,\n         \"achievedProfits\": \"0\",\n         \"averageOpenPrice\": \"2555.12\",\n         \"marginMode\": \"crossed\",\n         \"holdMode\": \"double_hold\",\n         \"unrealizedPL\": \"0.0093\",\n         \"liquidationPrice\": \"-3433.378333\",\n         \"keepMarginRate\": \"0.0033\",\n         \"marketPrice\": \"2556.05\",\n         \"marginRatio\": \"0.001661599511\",\n         \"autoMargin\": \"off\",\n         \"cTime\": \"1726919819686\",\n         \"uTime\": \"1726919819686\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"marginCoin\": \"USDT\",\n        //         \"symbol\": \"ETHUSDT_UMCBL\",\n        //         \"holdSide\": \"long\",\n        //         \"openDelegateCount\": \"0\",\n        //         \"margin\": \"2.55512\",\n        //         \"available\": \"0.01\",\n        //         \"locked\": \"0\",\n        //         \"total\": \"0.01\",\n        //         \"leverage\": 10,\n        //         \"achievedProfits\": \"0\",\n        //         \"averageOpenPrice\": \"2555.12\",\n        //         \"marginMode\": \"crossed\",\n        //         \"holdMode\": \"double_hold\",\n        //         \"unrealizedPL\": \"0.0093\",\n        //         \"liquidationPrice\": \"-3433.378333\",\n        //         \"keepMarginRate\": \"0.0033\",\n        //         \"marketPrice\": \"2556.05\",\n        //         \"marginRatio\": \"0.001661599511\",\n        //         \"autoMargin\": \"off\",\n        //         \"cTime\": \"1726919819686\",\n        //         \"uTime\": \"1726919819686\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        const settleId = this.safeString (position, 'marginCoin');\n        market = this.safeMarketCustom (marketId, market, settleId);\n        const timestamp = this.safeInteger (position, 'cTime');\n        const marginMode = this.safeString (position, 'marginMode');\n        let isHedged: Bool = undefined;\n        const holdMode = this.safeString (position, 'holdMode');\n        if (holdMode === 'double_hold') {\n            isHedged = true;\n        } else if (holdMode === 'single_hold') {\n            isHedged = false;\n        }\n        const margin = this.safeNumber (position, 'margin');\n        const keepMarginRate = this.safeString (position, 'keepMarginRate');\n        return this.safePosition ({\n            'symbol': market['symbol'],\n            'id': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'contracts': this.safeNumber (position, 'total'), // todo check\n            'contractSize': undefined,\n            'side': this.safeStringLower (position, 'holdSide'),\n            'notional': margin, // todo check\n            'leverage': this.safeInteger (position, 'leverage'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPL'),\n            'realizedPnl': this.safeNumber (position, 'achievedProfits'),\n            'collateral': undefined, // todo check\n            'entryPrice': this.safeNumber (position, 'averageOpenPrice'),\n            'markPrice': this.safeNumber (position, 'marketPrice'),\n            'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n            'marginMode': this.parseMarginModeType (marginMode),\n            'hedged': isHedged,\n            'maintenanceMargin': undefined, // todo check\n            'maintenanceMarginPercentage': this.parseNumber (Precise.stringMul (keepMarginRate, '100')), // todo check\n            'initialMargin': margin, // todo check\n            'initialMarginPercentage': undefined,\n            'marginRatio': this.safeNumber (position, 'marginRatio'),\n            'lastUpdateTimestamp': this.safeInteger (position, 'uTime'),\n            'lastPrice': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n            'percentage': undefined,\n            'info': position,\n        });\n    }"
      },
      {
        "name": "parseSpotMarketId",
        "signature": "parseSpotMarketId (marketId)",
        "line_start": 1029,
        "line_end": 1053,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSpotMarketId (marketId) {\n        let baseId = undefined;\n        let quoteId = undefined;\n        const currencyIds = this.safeList (this.options, 'currencyIdsListForParseMarket', []);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const entryIndex = marketId.indexOf (currencyId);\n            if (entryIndex > -1) {\n                const restId = marketId.replace (currencyId, '');\n                if (entryIndex === 0) {\n                    baseId = currencyId;\n                    quoteId = restId;\n                } else {\n                    baseId = restId;\n                    quoteId = currencyId;\n                }\n                break;\n            }\n        }\n        const result: Dict = {\n            'baseId': baseId,\n            'quoteId': quoteId,\n        };\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker, market: Market = undefined): Ticker",
        "line_start": 1233,
        "line_end": 1310,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low24h')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'buyOne', 'bestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSz')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'sellOne', 'bestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSz')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'openUtc0', 'openUtc')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "Precise.stringMul (this.safeString2 (ticker, 'changeUtc', 'chgUtc'), '100')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'baseVol', 'baseVolume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString2 (ticker, 'quoteVol', 'quoteVolume')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"high24h\": \"59461.34\",\n         \"low24h\": \"57723.23\",\n         \"close\": \"59056.02\",\n         \"quoteVol\": \"18240112.23368\",\n         \"baseVol\": \"309.05564\",\n         \"usdtVol\": \"18240112.2336744\",\n         \"ts\": \"1725114038951\",\n         \"buyOne\": \"59055.85\",\n         \"sellOne\": \"59057.45\",\n         \"bidSz\": \"0.0139\",\n         \"askSz\": \"0.0139\",\n         \"openUtc0\": \"59126.71\",\n         \"changeUtc\": \"-0.0012\",\n         \"change\": \"0.01662\"\n     }",
          "{\n         \"symbol\": \"ETHUSDT_UMCBL\",\n         \"last\": \"2540.6\",\n         \"bestAsk\": \"2540.71\",\n         \"bestBid\": \"2540.38\",\n         \"bidSz\": \"12.1\",\n         \"askSz\": \"20\",\n         \"high24h\": \"2563.91\",\n         \"low24h\": \"2398.3\",\n         \"timestamp\": \"1725316687177\",\n         \"priceChangePercent\": \"0.01134\",\n         \"baseVolume\": \"706928.96\",\n         \"quoteVolume\": \"1756401737.8766\",\n         \"usdtVolume\": \"1756401737.8766\",\n         \"openUtc\": \"2424.49\",\n         \"chgUtc\": \"0.04789\",\n         \"indexPrice\": \"2541.977142\",\n         \"fundingRate\": \"0.00006\",\n         \"holdingAmount\": \"144688.49\",\n         \"deliveryStartTime\": null,\n         \"deliveryTime\": null,\n         \"deliveryStatus\": \"normal\"\n     }"
        ],
        "source": "parseTicker (ticker, market: Market = undefined): Ticker {\n        //\n        // spot\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"high24h\": \"59461.34\",\n        //         \"low24h\": \"57723.23\",\n        //         \"close\": \"59056.02\",\n        //         \"quoteVol\": \"18240112.23368\",\n        //         \"baseVol\": \"309.05564\",\n        //         \"usdtVol\": \"18240112.2336744\",\n        //         \"ts\": \"1725114038951\",\n        //         \"buyOne\": \"59055.85\",\n        //         \"sellOne\": \"59057.45\",\n        //         \"bidSz\": \"0.0139\",\n        //         \"askSz\": \"0.0139\",\n        //         \"openUtc0\": \"59126.71\",\n        //         \"changeUtc\": \"-0.0012\",\n        //         \"change\": \"0.01662\"\n        //     }\n        //\n        // swap\n        //     {\n        //         \"symbol\": \"ETHUSDT_UMCBL\",\n        //         \"last\": \"2540.6\",\n        //         \"bestAsk\": \"2540.71\",\n        //         \"bestBid\": \"2540.38\",\n        //         \"bidSz\": \"12.1\",\n        //         \"askSz\": \"20\",\n        //         \"high24h\": \"2563.91\",\n        //         \"low24h\": \"2398.3\",\n        //         \"timestamp\": \"1725316687177\",\n        //         \"priceChangePercent\": \"0.01134\",\n        //         \"baseVolume\": \"706928.96\",\n        //         \"quoteVolume\": \"1756401737.8766\",\n        //         \"usdtVolume\": \"1756401737.8766\",\n        //         \"openUtc\": \"2424.49\",\n        //         \"chgUtc\": \"0.04789\",\n        //         \"indexPrice\": \"2541.977142\",\n        //         \"fundingRate\": \"0.00006\",\n        //         \"holdingAmount\": \"144688.49\",\n        //         \"deliveryStartTime\": null,\n        //         \"deliveryTime\": null,\n        //         \"deliveryStatus\": \"normal\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (ticker, 'ts', 'timestamp');\n        let marketId = this.safeString (ticker, 'symbol', '');\n        if (marketId.indexOf ('_') < 0) {\n            marketId += '_SPBL'; // spot markets from tickers endpoints have no suffix specific for market id\n        }\n        market = this.safeMarketCustom (marketId, market);\n        const last = this.safeString2 (ticker, 'close', 'last');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high24h'),\n            'low': this.safeString (ticker, 'low24h'),\n            'bid': this.safeString2 (ticker, 'buyOne', 'bestBid'),\n            'bidVolume': this.safeString (ticker, 'bidSz'),\n            'ask': this.safeString2 (ticker, 'sellOne', 'bestAsk'),\n            'askVolume': this.safeString (ticker, 'askSz'),\n            'vwap': undefined,\n            'open': this.safeString2 (ticker, 'openUtc0', 'openUtc'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': Precise.stringMul (this.safeString2 (ticker, 'changeUtc', 'chgUtc'), '100'),\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'baseVol', 'baseVolume'),\n            'quoteVolume': this.safeString2 (ticker, 'quoteVol', 'quoteVolume'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'markPrice': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1565,
        "line_end": 1653,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'tradeId', 'fillId')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (trade, 'orderType')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parseOrderSide (side)",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeString (trade, 'takerMakerFlag')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'fillPrice', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeStringN (trade, [ 'fillQuantity', 'size', 'sizeQty' ])",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (trade, 'fillTotalAmount', 'fillAmount')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': feeCost,\n                'currency': feeCurrency,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT_SPBL\",\n         \"tradeId\": \"1214135619719827457\",\n         \"side\": \"Buy\",\n         \"fillPrice\": \"2458.62\",\n         \"fillQuantity\": \"0.4756\",\n         \"fillTime\": \"1725198409967\"\n     }",
          "{\n         \"tradeId\": \"1214936067582234782\",\n         \"price\": \"57998.5\",\n         \"size\": \"1.918\",\n         \"side\": \"Sell\",\n         \"timestamp\": \"1725389251000\",\n         \"symbol\": \"BTCUSDT_UMCBL\"\n     }",
          "{\n         \"accountId\": \"1002820815393\",\n         \"symbol\": \"ETHUSDT_SPBL\",\n         \"orderId\": \"1217143186968068096\",\n         \"fillId\": \"1217143193356505089\",\n         \"orderType\": \"market\",\n         \"side\": \"buy\",\n         \"fillPrice\": \"2340.55\",\n         \"fillQuantity\": \"0.0042\",\n         \"fillTotalAmount\": \"9.83031\",\n         \"feeCcy\": \"ETH\",\n         \"fees\": \"-0.0000042\",\n         \"takerMakerFlag\": \"taker\",\n         \"cTime\": \"1725915471400\"\n     }",
          "{\n         \"tradeId\": \"1225467075440189441\",\n         \"symbol\": \"ETHUSD_DMCBL\",\n         \"orderId\": \"1225467075288719360\",\n         \"price\": \"2362.03\",\n         \"sizeQty\": \"0.1\",\n         \"fee\": \"-0.00005996\",\n         \"side\": \"burst_close_long\",\n         \"fillAmount\": \"236.203\",\n         \"profit\": \"-0.0083359\",\n         \"enterPointSource\": \"SYS\",\n         \"tradeSide\": \"burst_close_long\",\n         \"holdMode\": \"double_hold\",\n         \"takerMakerFlag\": \"taker\",\n         \"cTime\": \"1727900039539\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades spot\n        //     {\n        //         \"symbol\": \"ETHUSDT_SPBL\",\n        //         \"tradeId\": \"1214135619719827457\",\n        //         \"side\": \"Buy\",\n        //         \"fillPrice\": \"2458.62\",\n        //         \"fillQuantity\": \"0.4756\",\n        //         \"fillTime\": \"1725198409967\"\n        //     }\n        //\n        // fetchTrades swap\n        //     {\n        //         \"tradeId\": \"1214936067582234782\",\n        //         \"price\": \"57998.5\",\n        //         \"size\": \"1.918\",\n        //         \"side\": \"Sell\",\n        //         \"timestamp\": \"1725389251000\",\n        //         \"symbol\": \"BTCUSDT_UMCBL\"\n        //     }\n        //\n        // fetchMyTrades spot\n        //     {\n        //         \"accountId\": \"1002820815393\",\n        //         \"symbol\": \"ETHUSDT_SPBL\",\n        //         \"orderId\": \"1217143186968068096\",\n        //         \"fillId\": \"1217143193356505089\",\n        //         \"orderType\": \"market\",\n        //         \"side\": \"buy\",\n        //         \"fillPrice\": \"2340.55\",\n        //         \"fillQuantity\": \"0.0042\",\n        //         \"fillTotalAmount\": \"9.83031\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"fees\": \"-0.0000042\",\n        //         \"takerMakerFlag\": \"taker\",\n        //         \"cTime\": \"1725915471400\"\n        //     }\n        //\n        // fetchMyTrades swap\n        //     {\n        //         \"tradeId\": \"1225467075440189441\",\n        //         \"symbol\": \"ETHUSD_DMCBL\",\n        //         \"orderId\": \"1225467075288719360\",\n        //         \"price\": \"2362.03\",\n        //         \"sizeQty\": \"0.1\",\n        //         \"fee\": \"-0.00005996\",\n        //         \"side\": \"burst_close_long\",\n        //         \"fillAmount\": \"236.203\",\n        //         \"profit\": \"-0.0083359\",\n        //         \"enterPointSource\": \"SYS\",\n        //         \"tradeSide\": \"burst_close_long\",\n        //         \"holdMode\": \"double_hold\",\n        //         \"takerMakerFlag\": \"taker\",\n        //         \"cTime\": \"1727900039539\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarketCustom (marketId, market);\n        const timestamp = this.safeIntegerN (trade, [ 'fillTime', 'timestamp', 'cTime' ]);\n        const fees = this.safeString2 (trade, 'fees', 'fee');\n        let feeCost: Str = undefined;\n        if (fees !== undefined) {\n            feeCost = Precise.stringAbs (fees);\n        }\n        let feeCurrency = this.safeString (trade, 'feeCcy');\n        if ((feeCurrency === undefined) && (market['settle'] !== undefined)) {\n            feeCurrency = market['settle'];\n        }\n        const side = this.safeStringLower2 (trade, 'tradeSide', 'side');\n        return this.safeTrade ({\n            'id': this.safeString2 (trade, 'tradeId', 'fillId'),\n            'order': this.safeString (trade, 'orderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': this.safeString (trade, 'orderType'),\n            'side': this.parseOrderSide (side),\n            'takerOrMaker': this.safeString (trade, 'takerMakerFlag'),\n            'price': this.safeString2 (trade, 'fillPrice', 'price'),\n            'amount': this.safeStringN (trade, [ 'fillQuantity', 'size', 'sizeQty' ]),\n            'cost': this.safeString2 (trade, 'fillTotalAmount', 'fillAmount'),\n            'fee': {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            },\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction, currency: Currency = undefined): Transaction",
        "line_start": 2207,
        "line_end": 2286,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'orderId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1213046466852196352\",\n         \"txId\": \"824246b030cd84d56400661303547f43a1d9fef66cf968628dd5112f362053ff\",\n         \"coin\": \"USDT\",\n         \"type\": \"deposit\",\n         \"amount\": \"99.20000000\",\n         \"status\": \"success\",\n         \"toAddress\": \"TKTUt7qiTaMgnTwZXjE3ZBkPB6LKhLPJyZ\",\n         \"fee\": null,\n         \"chain\": \"TRX(TRC20)\",\n         \"confirm\": null,\n         \"clientOid\": null,\n         \"tag\": null,\n         \"fromAddress\": null,\n         \"dest\": \"on_chain\",\n         \"cTime\": \"1724938735688\",\n         \"uTime\": \"1724938746015\"\n     }",
          "{\n         \"code\": \"00000\",\n         \"msg\": \"success\",\n         \"data\": {\n             \"orderId\":888291686266343424\",\n             \"clientOrderId\":\"123\"\n         }\n     }"
        ],
        "source": "parseTransaction (transaction, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": \"1213046466852196352\",\n        //         \"txId\": \"824246b030cd84d56400661303547f43a1d9fef66cf968628dd5112f362053ff\",\n        //         \"coin\": \"USDT\",\n        //         \"type\": \"deposit\",\n        //         \"amount\": \"99.20000000\",\n        //         \"status\": \"success\",\n        //         \"toAddress\": \"TKTUt7qiTaMgnTwZXjE3ZBkPB6LKhLPJyZ\",\n        //         \"fee\": null,\n        //         \"chain\": \"TRX(TRC20)\",\n        //         \"confirm\": null,\n        //         \"clientOid\": null,\n        //         \"tag\": null,\n        //         \"fromAddress\": null,\n        //         \"dest\": \"on_chain\",\n        //         \"cTime\": \"1724938735688\",\n        //         \"uTime\": \"1724938746015\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"code\": \"00000\",\n        //         \"msg\": \"success\",\n        //         \"data\": {\n        //             \"orderId\":888291686266343424\",\n        //             \"clientOrderId\":\"123\"\n        //         }\n        //     }\n        //\n        let status = this.safeString (transaction, 'status');\n        if (status === 'success') {\n            status = 'ok';\n        }\n        const txid = this.safeString (transaction, 'txId');\n        const coin = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (coin, currency);\n        const timestamp = this.safeInteger (transaction, 'cTime');\n        const amount = this.safeNumber (transaction, 'amount');\n        const networkId = this.safeString (transaction, 'chain');\n        const network = this.safeString (this.options['networksById'], networkId, networkId);\n        const addressTo = this.safeString (transaction, 'toAddress');\n        const addressFrom = this.safeString (transaction, 'fromAddress');\n        const tag = this.safeString (transaction, 'tag');\n        const type = this.safeString (transaction, 'type');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'orderId'),\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': undefined,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency: Currency = undefined)",
        "line_start": 1966,
        "line_end": 1984,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (data, 'transferId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer, currency: Currency = undefined) {\n        const msg = this.safeString (transfer, 'msg');\n        let status: Str = undefined;\n        if (msg === 'success') {\n            status = 'ok';\n        }\n        const data = this.safeDict (transfer, 'data', {});\n        return {\n            'id': this.safeString (data, 'transferId'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': status,\n            'info': transfer,\n        };\n    }"
      }
    ],
    "coincheck": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 265,
        "line_end": 281,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const codes = Object.keys (this.currencies);\n        for (let i = 0; i < codes.length; i++) {\n            const code = codes[i];\n            const currency = this.currency (code);\n            const currencyId = currency['id'];\n            if (currencyId in response) {\n                const account = this.account ();\n                const reserved = currencyId + '_reserved';\n                account['free'] = this.safeString (response, currencyId);\n                account['used'] = this.safeString (response, reserved);\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 325,
        "line_end": 372,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{                        id:  202835,\n                      \"order_type\": \"buy\",\n                            \"rate\":  26890,\n                            \"pair\": \"btc_jpy\",\n                  \"pending_amount\": \"0.5527\",\n       \"pending_market_buy_amount\":  null,\n                  \"stop_loss_rate\":  null,\n                      \"created_at\": \"2015-01-10T05:55:38.000Z\" }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOpenOrders\n        //\n        //     {                        id:  202835,\n        //                      \"order_type\": \"buy\",\n        //                            \"rate\":  26890,\n        //                            \"pair\": \"btc_jpy\",\n        //                  \"pending_amount\": \"0.5527\",\n        //       \"pending_market_buy_amount\":  null,\n        //                  \"stop_loss_rate\":  null,\n        //                      \"created_at\": \"2015-01-10T05:55:38.000Z\" }\n        //\n        // todo: add formats for fetchOrder, fetchClosedOrders here\n        //\n        const id = this.safeString (order, 'id');\n        const side = this.safeString (order, 'order_type');\n        const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n        const amount = this.safeString (order, 'pending_amount');\n        const remaining = this.safeString (order, 'pending_amount');\n        const price = this.safeString (order, 'rate');\n        const status = undefined;\n        const marketId = this.safeString (order, 'pair');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'amount': amount,\n            'remaining': remaining,\n            'filled': undefined,\n            'side': side,\n            'type': undefined,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'status': status,\n            'symbol': symbol,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 394,
        "line_end": 431,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"last\":4192632.0,\n     \"bid\":4192496.0,\n     \"ask\":4193749.0,\n     \"high\":4332000.0,\n     \"low\":4101047.0,\n     \"volume\":2313.43191762,\n     \"timestamp\":1643374115\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // {\n        //     \"last\":4192632.0,\n        //     \"bid\":4192496.0,\n        //     \"ask\":4193749.0,\n        //     \"high\":4332000.0,\n        //     \"low\":4101047.0,\n        //     \"volume\":2313.43191762,\n        //     \"timestamp\":1643374115\n        // }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeTimestamp (ticker, 'timestamp');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 466,
        "line_end": 545,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (trade, 'fee_currency')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"id\": \"206849494\",\n          \"amount\": \"0.01\",\n          \"rate\": \"5598346.0\",\n          \"pair\": \"btc_jpy\",\n          \"order_type\": \"sell\",\n          \"created_at\": \"2021-12-08T14:10:33.000Z\"\n      }",
          "{\n          \"id\": 38,\n          \"order_id\": 49,\n          \"created_at\": \"2015-11-18T07:02:21.000Z\",\n          \"funds\": {\n              \"btc\": \"0.1\",\n              \"jpy\": \"-4096.135\"\n                  },\n           \"pair\": \"btc_jpy\",\n           \"rate\": \"40900.0\",\n           \"fee_currency\": \"JPY\",\n           \"fee\": \"6.135\",\n           \"liquidity\": \"T\",\n           \"side\": \"buy\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"id\": \"206849494\",\n        //          \"amount\": \"0.01\",\n        //          \"rate\": \"5598346.0\",\n        //          \"pair\": \"btc_jpy\",\n        //          \"order_type\": \"sell\",\n        //          \"created_at\": \"2021-12-08T14:10:33.000Z\"\n        //      }\n        //\n        // fetchMyTrades (private) - example from docs\n        //\n        //      {\n        //          \"id\": 38,\n        //          \"order_id\": 49,\n        //          \"created_at\": \"2015-11-18T07:02:21.000Z\",\n        //          \"funds\": {\n        //              \"btc\": \"0.1\",\n        //              \"jpy\": \"-4096.135\"\n        //                  },\n        //           \"pair\": \"btc_jpy\",\n        //           \"rate\": \"40900.0\",\n        //           \"fee_currency\": \"JPY\",\n        //           \"fee\": \"6.135\",\n        //           \"liquidity\": \"T\",\n        //           \"side\": \"buy\"\n        //      }\n        //\n        const timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n        const id = this.safeString (trade, 'id');\n        const priceString = this.safeString (trade, 'rate');\n        const marketId = this.safeString (trade, 'pair');\n        market = this.safeMarket (marketId, market, '_');\n        const baseId = market['baseId'];\n        const quoteId = market['quoteId'];\n        const symbol = market['symbol'];\n        let takerOrMaker = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        let side = undefined;\n        let fee = undefined;\n        let orderId = undefined;\n        if ('liquidity' in trade) {\n            if (this.safeString (trade, 'liquidity') === 'T') {\n                takerOrMaker = 'taker';\n            } else if (this.safeString (trade, 'liquidity') === 'M') {\n                takerOrMaker = 'maker';\n            }\n            const funds = this.safeValue (trade, 'funds', {});\n            amountString = this.safeString (funds, baseId);\n            costString = this.safeString (funds, quoteId);\n            fee = {\n                'currency': this.safeString (trade, 'fee_currency'),\n                'cost': this.safeString (trade, 'fee'),\n            };\n            side = this.safeString (trade, 'side');\n            orderId = this.safeString (trade, 'order_id');\n        } else {\n            amountString = this.safeString (trade, 'amount');\n            side = this.safeString (trade, 'order_type');\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'order': orderId,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 854,
        "line_end": 919,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": 2,\n       \"amount\": \"0.05\",\n       \"currency\": \"BTC\",\n       \"address\": \"13PhzoK8me3u5nHzzFD85qT9RqEWR9M4Ty\",\n       \"status\": \"confirmed\",\n       \"confirmed_at\": \"2015-06-13T08:29:18.000Z\",\n       \"created_at\": \"2015-06-13T08:22:18.000Z\"\n  }",
          "{\n       \"id\": 398,\n       \"status\": \"finished\",\n       \"amount\": \"242742.0\",\n       \"currency\": \"JPY\",\n       \"created_at\": \"2014-12-04T15:00:00.000Z\",\n       \"bank_account_id\": 243,\n       \"fee\": \"400.0\",\n       \"is_fast\": true\n  }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        // {\n        //       \"id\": 2,\n        //       \"amount\": \"0.05\",\n        //       \"currency\": \"BTC\",\n        //       \"address\": \"13PhzoK8me3u5nHzzFD85qT9RqEWR9M4Ty\",\n        //       \"status\": \"confirmed\",\n        //       \"confirmed_at\": \"2015-06-13T08:29:18.000Z\",\n        //       \"created_at\": \"2015-06-13T08:22:18.000Z\"\n        //  }\n        //\n        // fetchWithdrawals\n        //\n        //  {\n        //       \"id\": 398,\n        //       \"status\": \"finished\",\n        //       \"amount\": \"242742.0\",\n        //       \"currency\": \"JPY\",\n        //       \"created_at\": \"2014-12-04T15:00:00.000Z\",\n        //       \"bank_account_id\": 243,\n        //       \"fee\": \"400.0\",\n        //       \"is_fast\": true\n        //  }\n        //\n        const id = this.safeString (transaction, 'id');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n        const address = this.safeString (transaction, 'address');\n        const amount = this.safeNumber (transaction, 'amount');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const updated = this.parse8601 (this.safeString (transaction, 'confirmed_at'));\n        let fee = undefined;\n        const feeCost = this.safeNumber (transaction, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 840,
        "line_end": 852,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // withdrawals\n            'pending': 'pending',\n            'processing': 'pending',\n            'finished': 'ok',\n            'canceled': 'canceled',\n            // deposits\n            'confirmed': 'pending',\n            'received': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "coinex": [
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 5524,
        "line_end": 5553,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'ccy'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'to_repaied_amount')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'daily_interest_rate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'borrow_amount')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"borrow_id\": 2642934,\n         \"created_at\": 1654761016000,\n         \"market\": \"BTCUSDT\",\n         \"ccy\": \"USDT\",\n         \"daily_interest_rate\": \"0.001\",\n         \"expired_at\": 1655625016000,\n         \"borrow_amount\": \"100\",\n         \"to_repaied_amount\": \"0\",\n         \"is_auto_renew\": false,\n         \"status\": \"finish\"\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        //     {\n        //         \"borrow_id\": 2642934,\n        //         \"created_at\": 1654761016000,\n        //         \"market\": \"BTCUSDT\",\n        //         \"ccy\": \"USDT\",\n        //         \"daily_interest_rate\": \"0.001\",\n        //         \"expired_at\": 1655625016000,\n        //         \"borrow_amount\": \"100\",\n        //         \"to_repaied_amount\": \"0\",\n        //         \"is_auto_renew\": false,\n        //         \"status\": \"finish\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'market');\n        market = this.safeMarket (marketId, market, undefined, 'spot');\n        const timestamp = this.safeInteger (info, 'expired_at');\n        return {\n            'info': info,\n            'symbol': market['symbol'],\n            'currency': this.safeCurrencyCode (this.safeString (info, 'ccy')),\n            'interest': this.safeNumber (info, 'to_repaied_amount'),\n            'interestRate': this.safeNumber (info, 'daily_interest_rate'),\n            'amountBorrowed': this.safeNumber (info, 'borrow_amount'),\n            'marginMode': 'isolated',\n            'timestamp': timestamp,  // expiry time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 3987,
        "line_end": 4012,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo', tag)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"1P1JqozxioQwaqPwgMAQdNDYNyaVSqgARq\",\n         \"memo\": \"\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"1P1JqozxioQwaqPwgMAQdNDYNyaVSqgARq\",\n        //         \"memo\": \"\"\n        //     }\n        //\n        const coinAddress = this.safeString (depositAddress, 'address');\n        const parts = coinAddress.split (':');\n        let address = undefined;\n        let tag = undefined;\n        const partsLength = parts.length;\n        if (partsLength > 1 && parts[0] !== 'cfx') {\n            address = parts[0];\n            tag = parts[1];\n        } else {\n            address = coinAddress;\n        }\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'network': undefined,\n            'address': address,\n            'tag': this.safeString (depositAddress, 'memo', tag),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 5785,
        "line_end": 5852,
        "comment": null,
        "mappings": [
          {
            "key": "withdraw",
            "value": "{\n                            'fee': this.safeNumber (entry, 'withdrawal_fee'),\n                            'percentage': false,\n                        }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                            'fee': undefined,\n                            'percentage': undefined,\n                        }",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"asset\": {\n             \"ccy\": \"USDT\",\n             \"deposit_enabled\": true,\n             \"withdraw_enabled\": true,\n             \"inter_transfer_enabled\": true,\n             \"is_st\": false\n         },\n         \"chains\": [\n             {\n                 \"chain\": \"TRC20\",\n                 \"min_deposit_amount\": \"2.4\",\n                 \"min_withdraw_amount\": \"2.4\",\n                 \"deposit_enabled\": true,\n                 \"withdraw_enabled\": true,\n                 \"deposit_delay_minutes\": 0,\n                 \"safe_confirmations\": 10,\n                 \"irreversible_confirmations\": 20,\n                 \"deflation_rate\": \"0\",\n                 \"withdrawal_fee\": \"2.4\",\n                 \"withdrawal_precision\": 6,\n                 \"memo\": \"\",\n                 \"is_memo_required_for_deposit\": false,\n                 \"explorer_asset_url\": \"https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\"\n             },\n         ]\n     }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"asset\": {\n        //             \"ccy\": \"USDT\",\n        //             \"deposit_enabled\": true,\n        //             \"withdraw_enabled\": true,\n        //             \"inter_transfer_enabled\": true,\n        //             \"is_st\": false\n        //         },\n        //         \"chains\": [\n        //             {\n        //                 \"chain\": \"TRC20\",\n        //                 \"min_deposit_amount\": \"2.4\",\n        //                 \"min_withdraw_amount\": \"2.4\",\n        //                 \"deposit_enabled\": true,\n        //                 \"withdraw_enabled\": true,\n        //                 \"deposit_delay_minutes\": 0,\n        //                 \"safe_confirmations\": 10,\n        //                 \"irreversible_confirmations\": 20,\n        //                 \"deflation_rate\": \"0\",\n        //                 \"withdrawal_fee\": \"2.4\",\n        //                 \"withdrawal_precision\": 6,\n        //                 \"memo\": \"\",\n        //                 \"is_memo_required_for_deposit\": false,\n        //                 \"explorer_asset_url\": \"https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\"\n        //             },\n        //         ]\n        //     }\n        //\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        const chains = this.safeList (fee, 'chains', []);\n        const asset = this.safeDict (fee, 'asset', {});\n        for (let i = 0; i < chains.length; i++) {\n            const entry = chains[i];\n            const isWithdrawEnabled = this.safeBool (entry, 'withdraw_enabled');\n            if (isWithdrawEnabled) {\n                result['withdraw']['fee'] = this.safeNumber (entry, 'withdrawal_fee');\n                result['withdraw']['percentage'] = false;\n                const networkId = this.safeString (entry, 'chain');\n                if (networkId) {\n                    const networkCode = this.networkIdToCode (networkId, this.safeString (asset, 'ccy'));\n                    result['networks'][networkCode] = {\n                        'withdraw': {\n                            'fee': this.safeNumber (entry, 'withdrawal_fee'),\n                            'percentage': false,\n                        },\n                        'deposit': {\n                            'fee': undefined,\n                            'percentage': undefined,\n                        },\n                    };\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 4824,
        "line_end": 4833,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 4781,
        "line_end": 4822,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'latest_funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "currentFundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (currentFundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'next_funding_rate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "futureFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (futureFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"latest_funding_rate\": \"0\",\n         \"latest_funding_time\": 1715731200000,\n         \"mark_price\": \"61602.22\",\n         \"market\": \"BTCUSDT\",\n         \"max_funding_rate\": \"0.00375\",\n         \"min_funding_rate\": \"-0.00375\",\n         \"next_funding_rate\": \"0.00021074\",\n         \"next_funding_time\": 1715760000000\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        // fetchFundingRate, fetchFundingRates, fetchFundingInterval\n        //\n        //     {\n        //         \"latest_funding_rate\": \"0\",\n        //         \"latest_funding_time\": 1715731200000,\n        //         \"mark_price\": \"61602.22\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"max_funding_rate\": \"0.00375\",\n        //         \"min_funding_rate\": \"-0.00375\",\n        //         \"next_funding_rate\": \"0.00021074\",\n        //         \"next_funding_time\": 1715760000000\n        //     }\n        //\n        const currentFundingTimestamp = this.safeInteger (contract, 'latest_funding_time');\n        const futureFundingTimestamp = this.safeInteger (contract, 'next_funding_time');\n        const fundingTimeString = this.safeString (contract, 'latest_funding_time');\n        const nextFundingTimeString = this.safeString (contract, 'next_funding_time');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        const marketId = this.safeString (contract, 'market');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'markPrice': this.safeNumber (contract, 'mark_price'),\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'latest_funding_rate'),\n            'fundingTimestamp': currentFundingTimestamp,\n            'fundingDatetime': this.iso8601 (currentFundingTimestamp),\n            'nextFundingRate': this.safeNumber (contract, 'next_funding_rate'),\n            'nextFundingTimestamp': futureFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (futureFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 5394,
        "line_end": 5427,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "base",
            "value": "market['base']",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "baseRate",
            "comment": null
          },
          {
            "key": "quote",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "quoteRate",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"market\": \"BTCUSDT\",\n         \"ccy\": \"USDT\",\n         \"leverage\": 10,\n         \"min_amount\": \"60\",\n         \"max_amount\": \"500000\",\n         \"daily_interest_rate\": \"0.001\"\n     }"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //     {\n        //         \"market\": \"BTCUSDT\",\n        //         \"ccy\": \"USDT\",\n        //         \"leverage\": 10,\n        //         \"min_amount\": \"60\",\n        //         \"max_amount\": \"500000\",\n        //         \"daily_interest_rate\": \"0.001\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'market');\n        market = this.safeMarket (marketId, market, undefined, 'spot');\n        const currency = this.safeString (info, 'ccy');\n        const rate = this.safeNumber (info, 'daily_interest_rate');\n        let baseRate = undefined;\n        let quoteRate = undefined;\n        if (currency === market['baseId']) {\n            baseRate = rate;\n        } else if (currency === market['quoteId']) {\n            quoteRate = rate;\n        }\n        return {\n            'symbol': market['symbol'],\n            'base': market['base'],\n            'baseRate': baseRate,\n            'quote': market['quote'],\n            'quoteRate': quoteRate,\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 5896,
        "line_end": 5916,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'spot')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"market\": \"BTCUSDT\",\n         \"ccy\": \"USDT\",\n         \"leverage\": 10,\n         \"min_amount\": \"50\",\n         \"max_amount\": \"500000\",\n         \"daily_interest_rate\": \"0.001\"\n     }"
        ],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        //\n        //     {\n        //         \"market\": \"BTCUSDT\",\n        //         \"ccy\": \"USDT\",\n        //         \"leverage\": 10,\n        //         \"min_amount\": \"50\",\n        //         \"max_amount\": \"500000\",\n        //         \"daily_interest_rate\": \"0.001\"\n        //     }\n        //\n        const marketId = this.safeString (leverage, 'market');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'spot'),\n            'marginMode': 'isolated',\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 5641,
        "line_end": 5666,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'borrow_id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (info, 'borrow_amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, undefined, undefined, 'spot')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"borrow_id\": 13784021,\n         \"market\": \"BTCUSDT\",\n         \"ccy\": \"USDT\",\n         \"daily_interest_rate\": \"0.001\",\n         \"expired_at\": 1717299948340,\n         \"borrow_amount\": \"60\",\n         \"to_repaied_amount\": \"60.0025\",\n         \"status\": \"loan\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"borrow_id\": 13784021,\n        //         \"market\": \"BTCUSDT\",\n        //         \"ccy\": \"USDT\",\n        //         \"daily_interest_rate\": \"0.001\",\n        //         \"expired_at\": 1717299948340,\n        //         \"borrow_amount\": \"60\",\n        //         \"to_repaied_amount\": \"60.0025\",\n        //         \"status\": \"loan\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'ccy');\n        const marketId = this.safeString (info, 'market');\n        const timestamp = this.safeInteger (info, 'expired_at');\n        return {\n            'id': this.safeInteger (info, 'borrow_id'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeString (info, 'borrow_amount'),\n            'symbol': this.safeSymbol (marketId, undefined, undefined, 'spot'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 4557,
        "line_end": 4626,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (Precise.stringAbs (change))",
            "comment": null
          },
          {
            "key": "total",
            "value": "this.safeNumber (data, 'margin_avbl')",
            "comment": null
          },
          {
            "key": "code",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"adl_level\": 1,\n         \"ath_margin_size\": \"2.034928\",\n         \"ath_position_amount\": \"0.0001\",\n         \"avg_entry_price\": \"61047.84\",\n         \"bkr_price\": \"30698.5600000000000004142\",\n         \"close_avbl\": \"0.0001\",\n         \"cml_position_value\": \"6.104784\",\n         \"created_at\": 1715488472908,\n         \"leverage\": \"3\",\n         \"liq_price\": \"30852.82412060301507579316\",\n         \"maintenance_margin_rate\": \"0.005\",\n         \"maintenance_margin_value\": \"0.03051465\",\n         \"margin_avbl\": \"3.034928\",\n         \"margin_mode\": \"isolated\",\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"FUTURES\",\n         \"max_position_value\": \"6.104784\",\n         \"open_interest\": \"0.0001\",\n         \"position_id\": 306458800,\n         \"position_margin_rate\": \"0.49713929272518077625\",\n         \"realized_pnl\": \"-0.003052392\",\n         \"settle_price\": \"61047.84\",\n         \"settle_value\": \"6.104784\",\n         \"side\": \"long\",\n         \"stop_loss_price\": \"0\",\n         \"stop_loss_type\": \"\",\n         \"take_profit_price\": \"0\",\n         \"take_profit_type\": \"\",\n         \"unrealized_pnl\": \"0\",\n         \"updated_at\": 1715488805563\n     }",
          "{\n         \"bkr_pirce\": \"24698.56000000000000005224\",\n         \"created_at\": 1715489978697,\n         \"leverage\": \"3\",\n         \"liq_price\": \"24822.67336683417085432386\",\n         \"margin_avbl\": \"3.634928\",\n         \"margin_change\": \"-1.5\",\n         \"margin_mode\": \"isolated\",\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"FUTURES\",\n         \"open_interest\": \"0.0001\",\n         \"position_id\": 306458800,\n         \"settle_price\": \"61047.84\"\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //     {\n        //         \"adl_level\": 1,\n        //         \"ath_margin_size\": \"2.034928\",\n        //         \"ath_position_amount\": \"0.0001\",\n        //         \"avg_entry_price\": \"61047.84\",\n        //         \"bkr_price\": \"30698.5600000000000004142\",\n        //         \"close_avbl\": \"0.0001\",\n        //         \"cml_position_value\": \"6.104784\",\n        //         \"created_at\": 1715488472908,\n        //         \"leverage\": \"3\",\n        //         \"liq_price\": \"30852.82412060301507579316\",\n        //         \"maintenance_margin_rate\": \"0.005\",\n        //         \"maintenance_margin_value\": \"0.03051465\",\n        //         \"margin_avbl\": \"3.034928\",\n        //         \"margin_mode\": \"isolated\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"max_position_value\": \"6.104784\",\n        //         \"open_interest\": \"0.0001\",\n        //         \"position_id\": 306458800,\n        //         \"position_margin_rate\": \"0.49713929272518077625\",\n        //         \"realized_pnl\": \"-0.003052392\",\n        //         \"settle_price\": \"61047.84\",\n        //         \"settle_value\": \"6.104784\",\n        //         \"side\": \"long\",\n        //         \"stop_loss_price\": \"0\",\n        //         \"stop_loss_type\": \"\",\n        //         \"take_profit_price\": \"0\",\n        //         \"take_profit_type\": \"\",\n        //         \"unrealized_pnl\": \"0\",\n        //         \"updated_at\": 1715488805563\n        //     }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //     {\n        //         \"bkr_pirce\": \"24698.56000000000000005224\",\n        //         \"created_at\": 1715489978697,\n        //         \"leverage\": \"3\",\n        //         \"liq_price\": \"24822.67336683417085432386\",\n        //         \"margin_avbl\": \"3.634928\",\n        //         \"margin_change\": \"-1.5\",\n        //         \"margin_mode\": \"isolated\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"open_interest\": \"0.0001\",\n        //         \"position_id\": 306458800,\n        //         \"settle_price\": \"61047.84\"\n        //     }\n        //\n        const marketId = this.safeString (data, 'market');\n        const timestamp = this.safeInteger2 (data, 'updated_at', 'created_at');\n        const change = this.safeString (data, 'margin_change');\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': this.parseNumber (Precise.stringAbs (change)),\n            'total': this.safeNumber (data, 'margin_avbl'),\n            'code': market['quote'],\n            'status': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 4471,
        "line_end": 4493,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['linear'] ? market['base'] : market['quote']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "maxNotional",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintenance_margin_rate')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeInteger (tier, 'leverage')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        const tiers = [];\n        const brackets = this.safeList (info, 'level', []);\n        let minNotional = 0;\n        for (let i = 0; i < brackets.length; i++) {\n            const tier = brackets[i];\n            const marketId = this.safeString (info, 'market');\n            market = this.safeMarket (marketId, market, undefined, 'swap');\n            const maxNotional = this.safeNumber (tier, 'amount');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n                'currency': market['linear'] ? market['base'] : market['quote'],\n                'minNotional': minNotional,\n                'maxNotional': maxNotional,\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintenance_margin_rate'),\n                'maxLeverage': this.safeInteger (tier, 'leverage'),\n                'info': tier,\n            });\n            minNotional = maxNotional;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1621,
        "line_end": 1642,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"close\": \"66999.95\",\n         \"created_at\": 1713934620000,\n         \"high\": \"66999.95\",\n         \"low\": \"66988.53\",\n         \"market\": \"BTCUSDT\",\n         \"open\": \"66988.53\",\n         \"value\": \"0.1572393\",        // base volume\n         \"volume\": \"10533.2501364336\" // quote volume\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"close\": \"66999.95\",\n        //         \"created_at\": 1713934620000,\n        //         \"high\": \"66999.95\",\n        //         \"low\": \"66988.53\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"open\": \"66988.53\",\n        //         \"value\": \"0.1572393\",        // base volume\n        //         \"volume\": \"10533.2501364336\" // quote volume\n        //     }\n        //\n        return [\n            this.safeInteger (ohlcv, 'created_at'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'value'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1886,
        "line_end": 2152,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'position_id', 'order_id', 'stop_id' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "updatedTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (order, 'type')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'trigger_price')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeNumber (order, 'take_profit_price')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeNumber (order, 'stop_loss_price')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'filled_value')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'avg_entry_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'amount')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'filled_amount')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.safeString (order, 'unfilled_amount')",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCurrency,\n                'cost': this.safeString2 (order, 'quote_fee', 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (order, 'quote_fee', 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": \"0.0001\",\n         \"base_fee\": \"0\",\n         \"ccy\": \"BTC\",\n         \"client_id\": \"x-167673045-a0a3c6461459a801\",\n         \"created_at\": 1714114386250,\n         \"discount_fee\": \"0\",\n         \"filled_amount\": \"0\",\n         \"filled_value\": \"0\",\n         \"last_fill_amount\": \"0\",\n         \"last_fill_price\": \"0\",\n         \"maker_fee_rate\": \"0.002\",\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"SPOT\",\n         \"order_id\": 117178743547,\n         \"price\": \"61000\",\n         \"quote_fee\": \"0\",\n         \"side\": \"buy\",\n         \"taker_fee_rate\": \"0.002\",\n         \"type\": \"limit\",\n         \"unfilled_amount\": \"0.0001\",\n         \"updated_at\": 1714114386250\n     }",
          "{\n         \"order_id\": 117180532345,\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"SPOT\",\n         \"side\": \"sell\",\n         \"type\": \"market\",\n         \"ccy\": \"BTC\",\n         \"amount\": \"0.00015484\",\n         \"price\": \"0\",\n         \"client_id\": \"\",\n         \"created_at\": 1714116494219,\n         \"updated_at\": 0,\n         \"base_fee\": \"0\",\n         \"quote_fee\": \"0.0199931699632\",\n         \"discount_fee\": \"0\",\n         \"maker_fee_rate\": \"0\",\n         \"taker_fee_rate\": \"0.002\",\n         \"unfilled_amount\": \"0\",\n         \"filled_amount\": \"0.00015484\",\n         \"filled_value\": \"9.9965849816\"\n     }",
          "{\n         \"stop_id\": 117180138153\n     }",
          "{\n         \"amount\": \"0.0001\",\n         \"client_id\": \"x-167673045-1471b81d747080a0\",\n         \"created_at\": 1714116769986,\n         \"fee\": \"0\",\n         \"fee_ccy\": \"USDT\",\n         \"filled_amount\": \"0\",\n         \"filled_value\": \"0\",\n         \"last_filled_amount\": \"0\",\n         \"last_filled_price\": \"0\",\n         \"maker_fee_rate\": \"0.0003\",\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"FUTURES\",\n         \"order_id\": 136913377780,\n         \"price\": \"61000.42\",\n         \"realized_pnl\": \"0\",\n         \"side\": \"buy\",\n         \"taker_fee_rate\": \"0.0005\",\n         \"type\": \"limit\",\n         \"unfilled_amount\": \"0.0001\",\n         \"updated_at\": 1714116769986\n     }",
          "{\n         \"adl_level\": 1,\n         \"ath_margin_size\": \"2.14586666\",\n         \"ath_position_amount\": \"0.0001\",\n         \"avg_entry_price\": \"64376\",\n         \"bkr_price\": \"0\",\n         \"close_avbl\": \"0.0001\",\n         \"cml_position_value\": \"6.4376\",\n         \"created_at\": 1714119054558,\n         \"leverage\": \"3\",\n         \"liq_price\": \"0\",\n         \"maintenance_margin_rate\": \"0.005\",\n         \"maintenance_margin_value\": \"0.03218632\",\n         \"margin_avbl\": \"2.14586666\",\n         \"margin_mode\": \"cross\",\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"FUTURES\",\n         \"max_position_value\": \"6.4376\",\n         \"open_interest\": \"0.0001\",\n         \"position_id\": 303884204,\n         \"position_margin_rate\": \"3.10624785634397912265\",\n         \"realized_pnl\": \"-0.0032188\",\n         \"settle_price\": \"64376\",\n         \"settle_value\": \"6.4376\",\n         \"side\": \"long\",\n         \"stop_loss_price\": \"62000\",\n         \"stop_loss_type\": \"latest_price\",\n         \"take_profit_price\": \"0\",\n         \"take_profit_type\": \"\",\n         \"unrealized_pnl\": \"0\",\n         \"updated_at\": 1714119054559\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // Spot and Margin createOrder, createOrders, editOrder, cancelOrders, cancelOrder, fetchOpenOrders\n        //\n        //     {\n        //         \"amount\": \"0.0001\",\n        //         \"base_fee\": \"0\",\n        //         \"ccy\": \"BTC\",\n        //         \"client_id\": \"x-167673045-a0a3c6461459a801\",\n        //         \"created_at\": 1714114386250,\n        //         \"discount_fee\": \"0\",\n        //         \"filled_amount\": \"0\",\n        //         \"filled_value\": \"0\",\n        //         \"last_fill_amount\": \"0\",\n        //         \"last_fill_price\": \"0\",\n        //         \"maker_fee_rate\": \"0.002\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"SPOT\",\n        //         \"order_id\": 117178743547,\n        //         \"price\": \"61000\",\n        //         \"quote_fee\": \"0\",\n        //         \"side\": \"buy\",\n        //         \"taker_fee_rate\": \"0.002\",\n        //         \"type\": \"limit\",\n        //         \"unfilled_amount\": \"0.0001\",\n        //         \"updated_at\": 1714114386250\n        //     }\n        //\n        // Spot and Margin fetchClosedOrders\n        //\n        //     {\n        //         \"order_id\": 117180532345,\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"SPOT\",\n        //         \"side\": \"sell\",\n        //         \"type\": \"market\",\n        //         \"ccy\": \"BTC\",\n        //         \"amount\": \"0.00015484\",\n        //         \"price\": \"0\",\n        //         \"client_id\": \"\",\n        //         \"created_at\": 1714116494219,\n        //         \"updated_at\": 0,\n        //         \"base_fee\": \"0\",\n        //         \"quote_fee\": \"0.0199931699632\",\n        //         \"discount_fee\": \"0\",\n        //         \"maker_fee_rate\": \"0\",\n        //         \"taker_fee_rate\": \"0.002\",\n        //         \"unfilled_amount\": \"0\",\n        //         \"filled_amount\": \"0.00015484\",\n        //         \"filled_value\": \"9.9965849816\"\n        //     }\n        //\n        // Spot, Margin and Swap trigger createOrder, createOrders, editOrder\n        //\n        //     {\n        //         \"stop_id\": 117180138153\n        //     }\n        //\n        // Swap createOrder, createOrders, editOrder, cancelOrders, cancelOrder, fetchOpenOrders, fetchClosedOrders, closePosition\n        //\n        //     {\n        //         \"amount\": \"0.0001\",\n        //         \"client_id\": \"x-167673045-1471b81d747080a0\",\n        //         \"created_at\": 1714116769986,\n        //         \"fee\": \"0\",\n        //         \"fee_ccy\": \"USDT\",\n        //         \"filled_amount\": \"0\",\n        //         \"filled_value\": \"0\",\n        //         \"last_filled_amount\": \"0\",\n        //         \"last_filled_price\": \"0\",\n        //         \"maker_fee_rate\": \"0.0003\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"order_id\": 136913377780,\n        //         \"price\": \"61000.42\",\n        //         \"realized_pnl\": \"0\",\n        //         \"side\": \"buy\",\n        //         \"taker_fee_rate\": \"0.0005\",\n        //         \"type\": \"limit\",\n        //         \"unfilled_amount\": \"0.0001\",\n        //         \"updated_at\": 1714116769986\n        //     }\n        //\n        // Swap stopLossPrice and takeProfitPrice createOrder\n        //\n        //     {\n        //         \"adl_level\": 1,\n        //         \"ath_margin_size\": \"2.14586666\",\n        //         \"ath_position_amount\": \"0.0001\",\n        //         \"avg_entry_price\": \"64376\",\n        //         \"bkr_price\": \"0\",\n        //         \"close_avbl\": \"0.0001\",\n        //         \"cml_position_value\": \"6.4376\",\n        //         \"created_at\": 1714119054558,\n        //         \"leverage\": \"3\",\n        //         \"liq_price\": \"0\",\n        //         \"maintenance_margin_rate\": \"0.005\",\n        //         \"maintenance_margin_value\": \"0.03218632\",\n        //         \"margin_avbl\": \"2.14586666\",\n        //         \"margin_mode\": \"cross\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"max_position_value\": \"6.4376\",\n        //         \"open_interest\": \"0.0001\",\n        //         \"position_id\": 303884204,\n        //         \"position_margin_rate\": \"3.10624785634397912265\",\n        //         \"realized_pnl\": \"-0.0032188\",\n        //         \"settle_price\": \"64376\",\n        //         \"settle_value\": \"6.4376\",\n        //         \"side\": \"long\",\n        //         \"stop_loss_price\": \"62000\",\n        //         \"stop_loss_type\": \"latest_price\",\n        //         \"take_profit_price\": \"0\",\n        //         \"take_profit_type\": \"\",\n        //         \"unrealized_pnl\": \"0\",\n        //         \"updated_at\": 1714119054559\n        //     }\n        //\n        // Swap fetchOrder\n        //\n        //     {\n        //         \"amount\": \"0.0001\",\n        //         \"client_id\": \"x-167673045-da5f31dcd478a829\",\n        //         \"created_at\": 1714460987164,\n        //         \"fee\": \"0\",\n        //         \"fee_ccy\": \"USDT\",\n        //         \"filled_amount\": \"0\",\n        //         \"filled_value\": \"0\",\n        //         \"last_filled_amount\": \"0\",\n        //         \"last_filled_price\": \"0\",\n        //         \"maker_fee_rate\": \"0.0003\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"order_id\": 137319868771,\n        //         \"price\": \"61000\",\n        //         \"realized_pnl\": \"0\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"open\",\n        //         \"taker_fee_rate\": \"0.0005\",\n        //         \"type\": \"limit\",\n        //         \"unfilled_amount\": \"0.0001\",\n        //         \"updated_at\": 1714460987164\n        //     }\n        //\n        // Spot and Margin fetchOrder\n        //\n        //     {\n        //         \"amount\": \"0.0001\",\n        //         \"base_fee\": \"0\",\n        //         \"ccy\": \"BTC\",\n        //         \"client_id\": \"x-167673045-da918d6724e3af81\",\n        //         \"created_at\": 1714461638958,\n        //         \"discount_fee\": \"0\",\n        //         \"filled_amount\": \"0\",\n        //         \"filled_value\": \"0\",\n        //         \"last_fill_amount\": \"0\",\n        //         \"last_fill_price\": \"0\",\n        //         \"maker_fee_rate\": \"0.002\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"SPOT\",\n        //         \"order_id\": 117492012985,\n        //         \"price\": \"61000\",\n        //         \"quote_fee\": \"0\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"open\",\n        //         \"taker_fee_rate\": \"0.002\",\n        //         \"type\": \"limit\",\n        //         \"unfilled_amount\": \"0.0001\",\n        //         \"updated_at\": 1714461638958\n        //     }\n        //\n        // Swap trigger fetchOpenOrders, fetchClosedOrders - Spot and Swap trigger cancelOrders, cancelOrder\n        //\n        //     {\n        //         \"amount\": \"0.0001\",\n        //         \"client_id\": \"x-167673045-a7d7714c6478acf6\",\n        //         \"created_at\": 1714187923820,\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"price\": \"61000\",\n        //         \"side\": \"buy\",\n        //         \"stop_id\": 136984426097,\n        //         \"trigger_direction\": \"higher\",\n        //         \"trigger_price\": \"62000\",\n        //         \"trigger_price_type\": \"latest_price\",\n        //         \"type\": \"limit\",\n        //         \"updated_at\": 1714187974363\n        //     }\n        //\n        // Spot and Margin trigger fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"stop_id\": 117586439530,\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"SPOT\",\n        //         \"ccy\": \"BTC\",\n        //         \"side\": \"buy\",\n        //         \"type\": \"limit\",\n        //         \"amount\": \"0.0001\",\n        //         \"price\": \"51000\",\n        //         \"trigger_price\": \"52000\",\n        //         \"trigger_direction\": \"higher\",\n        //         \"trigger_price_type\": \"mark_price\",\n        //         \"client_id\": \"x-167673045-df61777094c69312\",\n        //         \"created_at\": 1714551237335,\n        //         \"updated_at\": 1714551237335\n        //     }\n        //\n        const rawStatus = this.safeString (order, 'status');\n        const timestamp = this.safeInteger (order, 'created_at');\n        let updatedTimestamp = this.safeInteger (order, 'updated_at');\n        if (updatedTimestamp === 0) {\n            updatedTimestamp = timestamp;\n        }\n        const marketId = this.safeString (order, 'market');\n        const defaultType = this.safeString (this.options, 'defaultType');\n        let orderType = this.safeStringLower (order, 'market_type', defaultType);\n        if (orderType === 'futures') {\n            orderType = 'swap';\n        }\n        const marketType = (orderType === 'swap') ? 'swap' : 'spot';\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const feeCurrencyId = this.safeString (order, 'fee_ccy');\n        let feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n        if (feeCurrency === undefined) {\n            feeCurrency = market['quote'];\n        }\n        let side = this.safeString (order, 'side');\n        if (side === 'long') {\n            side = 'buy';\n        } else if (side === 'short') {\n            side = 'sell';\n        }\n        let clientOrderId = this.safeString (order, 'client_id');\n        if (clientOrderId === '') {\n            clientOrderId = undefined;\n        }\n        return this.safeOrder ({\n            'id': this.safeStringN (order, [ 'position_id', 'order_id', 'stop_id' ]),\n            'clientOrderId': clientOrderId,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': updatedTimestamp,\n            'status': this.parseOrderStatus (rawStatus),\n            'symbol': market['symbol'],\n            'type': this.safeString (order, 'type'),\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'reduceOnly': undefined,\n            'side': side,\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': this.safeString (order, 'trigger_price'),\n            'takeProfitPrice': this.safeNumber (order, 'take_profit_price'),\n            'stopLossPrice': this.safeNumber (order, 'stop_loss_price'),\n            'cost': this.safeString (order, 'filled_value'),\n            'average': this.safeString (order, 'avg_entry_price'),\n            'amount': this.safeString (order, 'amount'),\n            'filled': this.safeString (order, 'filled_amount'),\n            'remaining': this.safeString (order, 'unfilled_amount'),\n            'trades': undefined,\n            'fee': {\n                'currency': feeCurrency,\n                'cost': this.safeString2 (order, 'quote_fee', 'fee'),\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1874,
        "line_end": 1884,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'rejected': 'rejected',\n            'open': 'open',\n            'not_deal': 'open',\n            'part_deal': 'open',\n            'done': 'closed',\n            'cancel': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 4258,
        "line_end": 4326,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeInteger (position, 'position_id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'settle_value')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (position, 'margin_mode')",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liq_price')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'avg_entry_price')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealized_pnl')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realized_pnl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'close_avbl')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (position, 'side')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'updated_at')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (position, 'maintenance_margin_value')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.safeNumber (position, 'maintenance_margin_rate')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'margin_avbl')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.safeNumber (position, 'position_margin_rate')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.omitZero (this.safeString (position, 'stop_loss_price'))",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.omitZero (this.safeString (position, 'take_profit_price'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"position_id\": 305891033,\n         \"market\": \"BTCUSDT\",\n         \"market_type\": \"FUTURES\",\n         \"side\": \"long\",\n         \"margin_mode\": \"cross\",\n         \"open_interest\": \"0.0001\",\n         \"close_avbl\": \"0.0001\",\n         \"ath_position_amount\": \"0.0001\",\n         \"unrealized_pnl\": \"0\",\n         \"realized_pnl\": \"-0.00311684\",\n         \"avg_entry_price\": \"62336.8\",\n         \"cml_position_value\": \"6.23368\",\n         \"max_position_value\": \"6.23368\",\n         \"created_at\": 1715152208041,\n         \"updated_at\": 1715152208041,\n         \"take_profit_price\": \"0\",\n         \"stop_loss_price\": \"0\",\n         \"take_profit_type\": \"\",\n         \"stop_loss_type\": \"\",\n         \"settle_price\": \"62336.8\",\n         \"settle_value\": \"6.23368\",\n         \"leverage\": \"3\",\n         \"margin_avbl\": \"2.07789333\",\n         \"ath_margin_size\": \"2.07789333\",\n         \"position_margin_rate\": \"2.40545879023305655728\",\n         \"maintenance_margin_rate\": \"0.005\",\n         \"maintenance_margin_value\": \"0.03118094\",\n         \"liq_price\": \"0\",\n         \"bkr_price\": \"0\",\n         \"adl_level\": 1\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"position_id\": 305891033,\n        //         \"market\": \"BTCUSDT\",\n        //         \"market_type\": \"FUTURES\",\n        //         \"side\": \"long\",\n        //         \"margin_mode\": \"cross\",\n        //         \"open_interest\": \"0.0001\",\n        //         \"close_avbl\": \"0.0001\",\n        //         \"ath_position_amount\": \"0.0001\",\n        //         \"unrealized_pnl\": \"0\",\n        //         \"realized_pnl\": \"-0.00311684\",\n        //         \"avg_entry_price\": \"62336.8\",\n        //         \"cml_position_value\": \"6.23368\",\n        //         \"max_position_value\": \"6.23368\",\n        //         \"created_at\": 1715152208041,\n        //         \"updated_at\": 1715152208041,\n        //         \"take_profit_price\": \"0\",\n        //         \"stop_loss_price\": \"0\",\n        //         \"take_profit_type\": \"\",\n        //         \"stop_loss_type\": \"\",\n        //         \"settle_price\": \"62336.8\",\n        //         \"settle_value\": \"6.23368\",\n        //         \"leverage\": \"3\",\n        //         \"margin_avbl\": \"2.07789333\",\n        //         \"ath_margin_size\": \"2.07789333\",\n        //         \"position_margin_rate\": \"2.40545879023305655728\",\n        //         \"maintenance_margin_rate\": \"0.005\",\n        //         \"maintenance_margin_value\": \"0.03118094\",\n        //         \"liq_price\": \"0\",\n        //         \"bkr_price\": \"0\",\n        //         \"adl_level\": 1\n        //     }\n        //\n        const marketId = this.safeString (position, 'market');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const timestamp = this.safeInteger (position, 'created_at');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeInteger (position, 'position_id'),\n            'symbol': market['symbol'],\n            'notional': this.safeNumber (position, 'settle_value'),\n            'marginMode': this.safeString (position, 'margin_mode'),\n            'liquidationPrice': this.safeNumber (position, 'liq_price'),\n            'entryPrice': this.safeNumber (position, 'avg_entry_price'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealized_pnl'),\n            'realizedPnl': this.safeNumber (position, 'realized_pnl'),\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'close_avbl'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': this.safeString (position, 'side'),\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'updated_at'),\n            'maintenanceMargin': this.safeNumber (position, 'maintenance_margin_value'),\n            'maintenanceMarginPercentage': this.safeNumber (position, 'maintenance_margin_rate'),\n            'collateral': this.safeNumber (position, 'margin_avbl'),\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber (position, 'leverage'),\n            'marginRatio': this.safeNumber (position, 'position_margin_rate'),\n            'stopLossPrice': this.omitZero (this.safeString (position, 'stop_loss_price')),\n            'takeProfitPrice': this.omitZero (this.safeString (position, 'take_profit_price')),\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1024,
        "line_end": 1087,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'volume_buy')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'volume_sell')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString (ticker, 'close')",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeString (ticker, 'last')",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'index_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"close\": \"62393.47\",\n         \"high\": \"64106.41\",\n         \"last\": \"62393.47\",\n         \"low\": \"59650.01\",\n         \"market\": \"BTCUSDT\",\n         \"open\": \"61616.15\",\n         \"period\": 86400,\n         \"value\": \"28711273.4065667262\",\n         \"volume\": \"461.76557205\",\n         \"volume_buy\": \"11.41506354\",\n         \"volume_sell\": \"7.3240169\"\n     }",
          "{\n         \"close\": \"62480.08\",\n         \"high\": \"64100\",\n         \"index_price\": \"62443.05\",\n         \"last\": \"62480.08\",\n         \"low\": \"59600\",\n         \"mark_price\": \"62443.05\",\n         \"market\": \"BTCUSDT\",\n         \"open\": \"61679.98\",\n         \"period\": 86400,\n         \"value\": \"180226025.69791713065326633165\",\n         \"volume\": \"2900.2218\",\n         \"volume_buy\": \"7.3847\",\n         \"volume_sell\": \"6.1249\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // Spot fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"close\": \"62393.47\",\n        //         \"high\": \"64106.41\",\n        //         \"last\": \"62393.47\",\n        //         \"low\": \"59650.01\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"open\": \"61616.15\",\n        //         \"period\": 86400,\n        //         \"value\": \"28711273.4065667262\",\n        //         \"volume\": \"461.76557205\",\n        //         \"volume_buy\": \"11.41506354\",\n        //         \"volume_sell\": \"7.3240169\"\n        //     }\n        //\n        // Swap fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"close\": \"62480.08\",\n        //         \"high\": \"64100\",\n        //         \"index_price\": \"62443.05\",\n        //         \"last\": \"62480.08\",\n        //         \"low\": \"59600\",\n        //         \"mark_price\": \"62443.05\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"open\": \"61679.98\",\n        //         \"period\": 86400,\n        //         \"value\": \"180226025.69791713065326633165\",\n        //         \"volume\": \"2900.2218\",\n        //         \"volume_buy\": \"7.3847\",\n        //         \"volume_sell\": \"6.1249\"\n        //     }\n        //\n        const marketType = ('mark_price' in ticker) ? 'swap' : 'spot';\n        const marketId = this.safeString (ticker, 'market');\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': undefined,\n            'bidVolume': this.safeString (ticker, 'volume_buy'),\n            'ask': undefined,\n            'askVolume': this.safeString (ticker, 'volume_sell'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': this.safeString (ticker, 'close'),\n            'last': this.safeString (ticker, 'last'),\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': undefined,\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'indexPrice': this.safeString (ticker, 'index_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1346,
        "line_end": 1418,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'deal_id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (trade, 'side')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeString (trade, 'role')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'amount')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'deal_money')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": \"0.00049432\",\n         \"created_at\": 1713849825667,\n         \"deal_id\": 4137517302,\n         \"price\": \"66251\",\n         \"side\": \"buy\"\n     }",
          "{\n         \"amount\": \"0.00010087\",\n         \"created_at\": 1714618087585,\n         \"deal_id\": 4161200602,\n         \"margin_market\": \"\",\n         \"market\": \"BTCUSDT\",\n         \"order_id\": 117654919342,\n         \"price\": \"57464.04\",\n         \"side\": \"sell\"\n     }",
          "{\n         \"deal_id\": 1180222387,\n         \"created_at\": 1714119054558,\n         \"market\": \"BTCUSDT\",\n         \"side\": \"buy\",\n         \"order_id\": 136915589622,\n         \"price\": \"64376\",\n         \"amount\": \"0.0001\",\n         \"role\": \"taker\",\n         \"fee\": \"0.0299\",\n         \"fee_ccy\": \"USDT\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // Spot and Swap fetchTrades (public)\n        //\n        //     {\n        //         \"amount\": \"0.00049432\",\n        //         \"created_at\": 1713849825667,\n        //         \"deal_id\": 4137517302,\n        //         \"price\": \"66251\",\n        //         \"side\": \"buy\"\n        //     }\n        //\n        // Spot and Margin fetchMyTrades (private)\n        //\n        //     {\n        //         \"amount\": \"0.00010087\",\n        //         \"created_at\": 1714618087585,\n        //         \"deal_id\": 4161200602,\n        //         \"margin_market\": \"\",\n        //         \"market\": \"BTCUSDT\",\n        //         \"order_id\": 117654919342,\n        //         \"price\": \"57464.04\",\n        //         \"side\": \"sell\"\n        //     }\n        //\n        // Swap fetchMyTrades (private)\n        //\n        //     {\n        //         \"deal_id\": 1180222387,\n        //         \"created_at\": 1714119054558,\n        //         \"market\": \"BTCUSDT\",\n        //         \"side\": \"buy\",\n        //         \"order_id\": 136915589622,\n        //         \"price\": \"64376\",\n        //         \"amount\": \"0.0001\",\n        //         \"role\": \"taker\",\n        //         \"fee\": \"0.0299\",\n        //         \"fee_ccy\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.safeInteger (trade, 'created_at');\n        let defaultType = this.safeString (this.options, 'defaultType');\n        if (market !== undefined) {\n            defaultType = market['type'];\n        }\n        const marketId = this.safeString (trade, 'market');\n        market = this.safeMarket (marketId, market, undefined, defaultType);\n        const feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fee_ccy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': this.safeString (trade, 'deal_id'),\n            'order': this.safeString (trade, 'order_id'),\n            'type': undefined,\n            'side': this.safeString (trade, 'side'),\n            'takerOrMaker': this.safeString (trade, 'role'),\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString (trade, 'amount'),\n            'cost': this.safeString (trade, 'deal_money'),\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1608,
        "line_end": 1619,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'maker_fee_rate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'taker_fee_rate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "true",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        const marketId = this.safeValue (fee, 'market');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'maker_fee_rate'),\n            'taker': this.safeNumber (fee, 'taker_fee_rate'),\n            'percentage': true,\n            'tierBased': true,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 5030,
        "line_end": 5136,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'withdraw_id', 'deposit_id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "comment",
            "value": "remark",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"deposit_id\": 5173806,\n         \"created_at\": 1714021652557,\n         \"tx_id\": \"d9f47d2550397c635cb89a8963118f8fe78ef048bc8b6f0caaeaa7dc6\",\n         \"tx_id_display\": \"\",\n         \"ccy\": \"USDT\",\n         \"chain\": \"TRC20\",\n         \"deposit_method\": \"ON_CHAIN\",\n         \"amount\": \"30\",\n         \"actual_amount\": \"\",\n         \"to_address\": \"TYewD2pVWDUwfNr9A\",\n         \"confirmations\": 20,\n         \"status\": \"FINISHED\",\n         \"tx_explorer_url\": \"https://tronscan.org/#/transaction\",\n         \"to_addr_explorer_url\": \"https://tronscan.org/#/address\",\n         \"remark\": \"\"\n     }",
          "{\n         \"withdraw_id\": 259364,\n         \"created_at\": 1701323541548,\n         \"withdraw_method\": \"ON_CHAIN\",\n         \"ccy\": \"USDT\",\n         \"amount\": \"23.845744\",\n         \"actual_amount\": \"22.445744\",\n         \"chain\": \"TRC20\",\n         \"tx_fee\": \"1.4\",\n         \"fee_asset\": \"USDT\",\n         \"fee_amount\": \"1.4\",\n         \"to_address\": \"T8t5i2454dhdhnnnGdi49vMbihvY\",\n         \"memo\": \"\",\n         \"tx_id\": \"1237623941964de9954ed2e36640228d78765c1026\",\n         \"confirmations\": 18,\n         \"explorer_address_url\": \"https://tronscan.org/#/address\",\n         \"explorer_tx_url\": \"https://tronscan.org/#/transaction\",\n         \"remark\": \"\",\n         \"status\": \"finished\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"deposit_id\": 5173806,\n        //         \"created_at\": 1714021652557,\n        //         \"tx_id\": \"d9f47d2550397c635cb89a8963118f8fe78ef048bc8b6f0caaeaa7dc6\",\n        //         \"tx_id_display\": \"\",\n        //         \"ccy\": \"USDT\",\n        //         \"chain\": \"TRC20\",\n        //         \"deposit_method\": \"ON_CHAIN\",\n        //         \"amount\": \"30\",\n        //         \"actual_amount\": \"\",\n        //         \"to_address\": \"TYewD2pVWDUwfNr9A\",\n        //         \"confirmations\": 20,\n        //         \"status\": \"FINISHED\",\n        //         \"tx_explorer_url\": \"https://tronscan.org/#/transaction\",\n        //         \"to_addr_explorer_url\": \"https://tronscan.org/#/address\",\n        //         \"remark\": \"\"\n        //     }\n        //\n        // fetchWithdrawals and withdraw\n        //\n        //     {\n        //         \"withdraw_id\": 259364,\n        //         \"created_at\": 1701323541548,\n        //         \"withdraw_method\": \"ON_CHAIN\",\n        //         \"ccy\": \"USDT\",\n        //         \"amount\": \"23.845744\",\n        //         \"actual_amount\": \"22.445744\",\n        //         \"chain\": \"TRC20\",\n        //         \"tx_fee\": \"1.4\",\n        //         \"fee_asset\": \"USDT\",\n        //         \"fee_amount\": \"1.4\",\n        //         \"to_address\": \"T8t5i2454dhdhnnnGdi49vMbihvY\",\n        //         \"memo\": \"\",\n        //         \"tx_id\": \"1237623941964de9954ed2e36640228d78765c1026\",\n        //         \"confirmations\": 18,\n        //         \"explorer_address_url\": \"https://tronscan.org/#/address\",\n        //         \"explorer_tx_url\": \"https://tronscan.org/#/transaction\",\n        //         \"remark\": \"\",\n        //         \"status\": \"finished\"\n        //     }\n        //\n        const address = this.safeString (transaction, 'to_address');\n        let tag = this.safeString (transaction, 'memo');\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        let remark = this.safeString (transaction, 'remark');\n        if (remark !== undefined) {\n            if (remark.length < 1) {\n                remark = undefined;\n            }\n        }\n        let txid = this.safeString (transaction, 'tx_id');\n        if (txid !== undefined) {\n            if (txid.length < 1) {\n                txid = undefined;\n            }\n        }\n        const currencyId = this.safeString (transaction, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger (transaction, 'created_at');\n        const type = ('withdraw_id' in transaction) ? 'withdrawal' : 'deposit';\n        const networkId = this.safeString (transaction, 'chain');\n        let feeCost = this.safeString (transaction, 'tx_fee');\n        const transferMethod = this.safeStringLower2 (transaction, 'withdraw_method', 'deposit_method');\n        const internal = transferMethod === 'local';\n        let amount = this.safeNumber (transaction, 'actual_amount');\n        if (amount === undefined) {\n            amount = this.safeNumber (transaction, 'amount');\n        }\n        if (type === 'deposit') {\n            feeCost = '0';\n        }\n        const feeCurrencyId = this.safeString (transaction, 'fee_asset');\n        const fee = {\n            'cost': this.parseNumber (feeCost),\n            'currency': this.safeCurrencyCode (feeCurrencyId),\n        };\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'withdraw_id', 'deposit_id'),\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': undefined,\n            'fee': fee,\n            'comment': remark,\n            'internal': internal,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 4943,
        "line_end": 4957,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'audit': 'pending',\n            'pass': 'pending',\n            'audit_required': 'pending',\n            'processing': 'pending',\n            'confirming': 'pending',\n            'not_pass': 'failed',\n            'cancel': 'canceled',\n            'finish': 'ok',\n            'finished': 'ok',\n            'fail': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 5201,
        "line_end": 5217,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (accountsById, fromId, fromId)",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (accountsById, toId, toId)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString2 (transfer, 'code', 'status'))",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        const timestamp = this.safeInteger (transfer, 'created_at');\n        const currencyId = this.safeString (transfer, 'ccy');\n        const fromId = this.safeString (transfer, 'from_account_type');\n        const toId = this.safeString (transfer, 'to_account_type');\n        const accountsById = this.safeValue (this.options, 'accountsById', {});\n        return {\n            'id': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': this.safeString (accountsById, fromId, fromId),\n            'toAccount': this.safeString (accountsById, toId, toId),\n            'status': this.parseTransferStatus (this.safeString2 (transfer, 'code', 'status')),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status)",
        "line_start": 5190,
        "line_end": 5199,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status) {\n        const statuses: Dict = {\n            '0': 'ok',\n            'SUCCESS': 'ok',\n            'OK': 'ok',\n            'finished': 'ok',\n            'FINISHED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "coinmate": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 445,
        "line_end": 460,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response, 'data', {});\n        const result: Dict = { 'info': response };\n        const currencyIds = Object.keys (balances);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const balance = this.safeValue (balances, currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'reserved');\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1030,
        "line_end": 1115,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "averageString",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remainingString",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 781246605,\n         \"timestamp\": 1584480015133,\n         \"trailingUpdatedTimestamp\": null,\n         \"type\": \"SELL\",\n         \"currencyPair\": \"ETH_BTC\",\n         \"price\": 0.0345,\n         \"amount\": 0.01,\n         \"stopPrice\": null,\n         \"originalStopPrice\": null,\n         \"marketPriceAtLastUpdate\": null,\n         \"marketPriceAtOrderCreation\": null,\n         \"orderTradeType\": \"LIMIT\",\n         \"hidden\": false,\n         \"trailing\": false,\n         \"clientOrderId\": null\n     }",
          "{\n         \"id\": 67527001,\n         \"timestamp\": 1517931722613,\n         \"trailingUpdatedTimestamp\": null,\n         \"type\": \"BUY\",\n         \"price\": 5897.24,\n         \"remainingAmount\": 0.002367,\n         \"originalAmount\": 0.1,\n         \"stopPrice\": null,\n         \"originalStopPrice\": null,\n         \"marketPriceAtLastUpdate\": null,\n         \"marketPriceAtOrderCreation\": null,\n         \"status\": \"CANCELLED\",\n         \"orderTradeType\": \"LIMIT\",\n         \"hidden\": false,\n         \"avgPrice\": null,\n         \"trailing\": false,\n     }",
          "{\n        \"success\": true,\n        \"remainingAmount\": 0.1\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // limit sell\n        //\n        //     {\n        //         \"id\": 781246605,\n        //         \"timestamp\": 1584480015133,\n        //         \"trailingUpdatedTimestamp\": null,\n        //         \"type\": \"SELL\",\n        //         \"currencyPair\": \"ETH_BTC\",\n        //         \"price\": 0.0345,\n        //         \"amount\": 0.01,\n        //         \"stopPrice\": null,\n        //         \"originalStopPrice\": null,\n        //         \"marketPriceAtLastUpdate\": null,\n        //         \"marketPriceAtOrderCreation\": null,\n        //         \"orderTradeType\": \"LIMIT\",\n        //         \"hidden\": false,\n        //         \"trailing\": false,\n        //         \"clientOrderId\": null\n        //     }\n        //\n        // limit buy\n        //\n        //     {\n        //         \"id\": 67527001,\n        //         \"timestamp\": 1517931722613,\n        //         \"trailingUpdatedTimestamp\": null,\n        //         \"type\": \"BUY\",\n        //         \"price\": 5897.24,\n        //         \"remainingAmount\": 0.002367,\n        //         \"originalAmount\": 0.1,\n        //         \"stopPrice\": null,\n        //         \"originalStopPrice\": null,\n        //         \"marketPriceAtLastUpdate\": null,\n        //         \"marketPriceAtOrderCreation\": null,\n        //         \"status\": \"CANCELLED\",\n        //         \"orderTradeType\": \"LIMIT\",\n        //         \"hidden\": false,\n        //         \"avgPrice\": null,\n        //         \"trailing\": false,\n        //     }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"success\": true,\n        //        \"remainingAmount\": 0.1\n        //    }\n        //\n        const id = this.safeString (order, 'id');\n        const timestamp = this.safeInteger (order, 'timestamp');\n        const side = this.safeStringLower (order, 'type');\n        const priceString = this.safeString (order, 'price');\n        const amountString = this.safeString (order, 'originalAmount');\n        const remainingString = this.safeString2 (order, 'remainingAmount', 'amount');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const type = this.parseOrderType (this.safeString (order, 'orderTradeType'));\n        const averageString = this.safeString (order, 'avgPrice');\n        const marketId = this.safeString (order, 'currencyPair');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': priceString,\n            'triggerPrice': this.safeNumber (order, 'stopPrice'),\n            'amount': amountString,\n            'cost': undefined,\n            'average': averageString,\n            'filled': undefined,\n            'remaining': remainingString,\n            'status': status,\n            'trades': undefined,\n            'info': order,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1012,
        "line_end": 1020,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'FILLED': 'closed',\n            'CANCELLED': 'canceled',\n            'PARTIALLY_FILLED': 'open',\n            'OPEN': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1022,
        "line_end": 1028,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 579,
        "line_end": 617,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (ticker, 'amount')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"last\": \"0.001337\",\n         \"high\": \"0.001348\",\n         \"low\": \"0.001332\",\n         \"amount\": \"34.75472959\",\n         \"bid\": \"0.001348\",\n         \"ask\": \"0.001356\",\n         \"change\": \"-0.74239050\",\n         \"open\": \"0.001347\",\n         \"timestamp\": \"1708074485\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"last\": \"0.001337\",\n        //         \"high\": \"0.001348\",\n        //         \"low\": \"0.001332\",\n        //         \"amount\": \"34.75472959\",\n        //         \"bid\": \"0.001348\",\n        //         \"ask\": \"0.001356\",\n        //         \"change\": \"-0.74239050\",\n        //         \"open\": \"0.001347\",\n        //         \"timestamp\": \"1708074485\"\n        //     }\n        //\n        const timestamp = this.safeTimestamp (ticker, 'timestamp');\n        const last = this.safeNumber (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeNumber (ticker, 'high'),\n            'low': this.safeNumber (ticker, 'low'),\n            'bid': this.safeNumber (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeNumber (ticker, 'ask'),\n            'vwap': undefined,\n            'askVolume': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeNumber (ticker, 'amount'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 826,
        "line_end": 888,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transactionId\": 2671819,\n         \"createdTimestamp\": 1529649127605,\n         \"currencyPair\": \"LTC_BTC\",\n         \"type\": \"BUY\",\n         \"orderType\": \"LIMIT\",\n         \"orderId\": 101810227,\n         \"amount\": 0.01,\n         \"price\": 0.01406,\n         \"fee\": 0,\n         \"feeType\": \"MAKER\"\n     }",
          "{\n         \"timestamp\":1561598833416,\n         \"transactionId\":\"4156303\",\n         \"price\":10950.41,\n         \"amount\":0.004,\n         \"currencyPair\":\"BTC_EUR\",\n         \"tradeType\":\"BUY\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"transactionId\": 2671819,\n        //         \"createdTimestamp\": 1529649127605,\n        //         \"currencyPair\": \"LTC_BTC\",\n        //         \"type\": \"BUY\",\n        //         \"orderType\": \"LIMIT\",\n        //         \"orderId\": 101810227,\n        //         \"amount\": 0.01,\n        //         \"price\": 0.01406,\n        //         \"fee\": 0,\n        //         \"feeType\": \"MAKER\"\n        //     }\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"timestamp\":1561598833416,\n        //         \"transactionId\":\"4156303\",\n        //         \"price\":10950.41,\n        //         \"amount\":0.004,\n        //         \"currencyPair\":\"BTC_EUR\",\n        //         \"tradeType\":\"BUY\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'currencyPair');\n        market = this.safeMarket (marketId, market, '_');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const side = this.safeStringLower2 (trade, 'type', 'tradeType');\n        const type = this.safeStringLower (trade, 'orderType');\n        const orderId = this.safeString (trade, 'orderId');\n        const id = this.safeString (trade, 'transactionId');\n        const timestamp = this.safeInteger2 (trade, 'timestamp', 'createdTimestamp');\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': feeCostString,\n                'currency': market['quote'],\n            };\n        }\n        let takerOrMaker = this.safeString (trade, 'feeType');\n        takerOrMaker = (takerOrMaker === 'MAKER') ? 'maker' : 'taker';\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': type,\n            'side': side,\n            'order': orderId,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 663,
        "line_end": 733,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'transactionId', 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (transaction, 'transferType')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (transaction, 'walletType')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'transferStatus'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'destination')",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'destinationTag')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (transaction, 'fee'),\n                'currency': code,\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (transaction, 'fee')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transactionId\": 1862815,\n         \"timestamp\": 1516803982388,\n         \"amountCurrency\": \"LTC\",\n         \"amount\": 1,\n         \"fee\": 0,\n         \"walletType\": \"LTC\",\n         \"transferType\": \"DEPOSIT\",\n         \"transferStatus\": \"COMPLETED\",\n         \"txid\":\n         \"ccb9255dfa874e6c28f1a64179769164025329d65e5201849c2400abd6bce245\",\n         \"destination\": \"LQrtSKA6LnhcwRrEuiborQJnjFF56xqsFn\",\n         \"destinationTag\": null\n     }",
          "{\n         \"transactionId\": 2140966,\n         \"timestamp\": 1519314282976,\n         \"amountCurrency\": \"EUR\",\n         \"amount\": 8421.7228,\n         \"fee\": 16.8772,\n         \"walletType\": \"BANK_WIRE\",\n         \"transferType\": \"WITHDRAWAL\",\n         \"transferStatus\": \"COMPLETED\",\n         \"txid\": null,\n         \"destination\": null,\n         \"destinationTag\": null\n     }",
          "{\n         \"id\": 2132583,\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // deposits\n        //\n        //     {\n        //         \"transactionId\": 1862815,\n        //         \"timestamp\": 1516803982388,\n        //         \"amountCurrency\": \"LTC\",\n        //         \"amount\": 1,\n        //         \"fee\": 0,\n        //         \"walletType\": \"LTC\",\n        //         \"transferType\": \"DEPOSIT\",\n        //         \"transferStatus\": \"COMPLETED\",\n        //         \"txid\":\n        //         \"ccb9255dfa874e6c28f1a64179769164025329d65e5201849c2400abd6bce245\",\n        //         \"destination\": \"LQrtSKA6LnhcwRrEuiborQJnjFF56xqsFn\",\n        //         \"destinationTag\": null\n        //     }\n        //\n        // withdrawals\n        //\n        //     {\n        //         \"transactionId\": 2140966,\n        //         \"timestamp\": 1519314282976,\n        //         \"amountCurrency\": \"EUR\",\n        //         \"amount\": 8421.7228,\n        //         \"fee\": 16.8772,\n        //         \"walletType\": \"BANK_WIRE\",\n        //         \"transferType\": \"WITHDRAWAL\",\n        //         \"transferStatus\": \"COMPLETED\",\n        //         \"txid\": null,\n        //         \"destination\": null,\n        //         \"destinationTag\": null\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": 2132583,\n        //     }\n        //\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        const currencyId = this.safeString (transaction, 'amountCurrency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'transactionId', 'id'),\n            'txid': this.safeString (transaction, 'txid'),\n            'type': this.safeStringLower (transaction, 'transferType'),\n            'currency': code,\n            'network': this.safeString (transaction, 'walletType'),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'transferStatus')),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': this.safeString (transaction, 'destination'),\n            'addressFrom': undefined,\n            'addressTo': undefined,\n            'tag': this.safeString (transaction, 'destinationTag'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'cost': this.safeNumber (transaction, 'fee'),\n                'currency': code,\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 650,
        "line_end": 661,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'COMPLETED': 'ok',\n            'WAITING': 'pending',\n            'SENT': 'pending',\n            'CREATED': 'pending',\n            'OK': 'ok',\n            'NEW': 'pending',\n            'CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "coinmetro": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (balances): Balances",
        "line_start": 1086,
        "line_end": 1122,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"xcmLocks\": [],\n             \"xcmLockAmounts\": [],\n             \"refList\": [],\n             \"balanceHistory\": [],\n             \"_id\": \"5fecd3c998e75c2e4d63f7c3\",\n             \"currency\": \"BTC\",\n             \"label\": \"BTC\",\n             \"userId\": \"5fecd3c97fbfed1521db23bd\",\n             \"__v\": 0,\n             \"balance\": 0.5,\n             \"createdAt\": \"2020-12-30T19:23:53.646Z\",\n             \"disabled\": false,\n             \"updatedAt\": \"2020-12-30T19:23:53.653Z\",\n             \"reserved\": 0,\n             \"id\": \"5fecd3c998e75c2e4d63f7c3\"\n         },\n         ...\n     ]"
        ],
        "source": "parseBalance (balances): Balances {\n        //\n        //     [\n        //         {\n        //             \"xcmLocks\": [],\n        //             \"xcmLockAmounts\": [],\n        //             \"refList\": [],\n        //             \"balanceHistory\": [],\n        //             \"_id\": \"5fecd3c998e75c2e4d63f7c3\",\n        //             \"currency\": \"BTC\",\n        //             \"label\": \"BTC\",\n        //             \"userId\": \"5fecd3c97fbfed1521db23bd\",\n        //             \"__v\": 0,\n        //             \"balance\": 0.5,\n        //             \"createdAt\": \"2020-12-30T19:23:53.646Z\",\n        //             \"disabled\": false,\n        //             \"updatedAt\": \"2020-12-30T19:23:53.653Z\",\n        //             \"reserved\": 0,\n        //             \"id\": \"5fecd3c998e75c2e4d63f7c3\"\n        //         },\n        //         ...\n        //     ]\n        //\n        const result: Dict = {\n            'info': balances,\n        };\n        for (let i = 0; i < balances.length; i++) {\n            const balanceEntry = this.safeDict (balances, i, {});\n            const currencyId = this.safeString (balanceEntry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balanceEntry, 'balance');\n            account['used'] = this.safeString (balanceEntry, 'reserved');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBidsAsks",
        "signature": "parseBidsAsks (bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2)",
        "line_start": 906,
        "line_end": 916,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBidsAsks (bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2) {\n        const prices = Object.keys (bidasks);\n        const result = [];\n        for (let i = 0; i < prices.length; i++) {\n            const priceString = this.safeString (prices, i);\n            const price = this.safeNumber (prices, i);\n            const volume = this.safeNumber (bidasks, priceString);\n            result.push ([ price, volume ]);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1253,
        "line_end": 1293,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        const datetime = this.safeString (item, 'timestamp');\n        const currencyId = this.safeString (item, 'currencyId');\n        item = this.omit (item, 'currencyId');\n        currency = this.safeCurrency (currencyId, currency);\n        const description = this.safeString (item, 'description', '');\n        const [ type, referenceId ] = this.parseLedgerEntryDescription (description);\n        const JSONdata = this.safeValue (item, 'JSONdata', {});\n        const feeCost = this.safeString (JSONdata, 'fees');\n        const fee = {\n            'cost': feeCost,\n            'currency': undefined,\n        };\n        let amount = this.safeString (item, 'amount');\n        let direction = undefined;\n        if (amount !== undefined) {\n            if (Precise.stringLt (amount, '0')) {\n                direction = 'out';\n                amount = Precise.stringAbs (amount);\n            } else if (Precise.stringGt (amount, '0')) {\n                direction = 'in';\n            }\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'direction': direction,\n            'account': undefined,\n            'referenceId': referenceId,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': currency,\n            'amount': amount,\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryDescription",
        "signature": "parseLedgerEntryDescription (description)",
        "line_start": 1295,
        "line_end": 1312,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryDescription (description) {\n        let descriptionArray = [];\n        if (description !== undefined) {\n            descriptionArray = description.split (' ');\n        }\n        let type = undefined;\n        let referenceId = undefined;\n        const length = descriptionArray.length;\n        if (length > 1) {\n            type = this.parseLedgerEntryType (descriptionArray[0]);\n            if (descriptionArray[1] !== '-') {\n                referenceId = descriptionArray[1];\n            } else {\n                referenceId = this.safeString (descriptionArray, 2);\n            }\n        }\n        return [ type, referenceId ];\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1314,
        "line_end": 1321,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'Deposit': 'transaction',\n            'Withdraw': 'transaction',\n            'Order': 'trade',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 1980,
        "line_end": 1991,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        const currencyId = this.safeString (info, 'coin');\n        return {\n            'id': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': undefined,\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 475,
        "line_end": 537,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "margin",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (tradingFees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (tradingFees, 'maker')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': basePrecisionAndLimits['precision'],\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'precision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': basePrecisionAndLimits['minLimit'],\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': quotePrecisionAndLimits['minLimit'],\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "basePrecisionAndLimits['precision']",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'precision')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': basePrecisionAndLimits['minLimit'],\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': quotePrecisionAndLimits['minLimit'],\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'pair');\n        const parsedMarketId = this.parseMarketId (id);\n        const baseId = this.safeString (parsedMarketId, 'baseId');\n        const quoteId = this.safeString (parsedMarketId, 'quoteId');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const basePrecisionAndLimits = this.parseMarketPrecisionAndLimits (baseId);\n        const quotePrecisionAndLimits = this.parseMarketPrecisionAndLimits (quoteId);\n        const margin = this.safeBool (market, 'margin', false);\n        const tradingFees = this.safeValue (this.fees, 'trading', {});\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': margin,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': true,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (tradingFees, 'taker'),\n            'maker': this.safeNumber (tradingFees, 'maker'),\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': basePrecisionAndLimits['precision'],\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'precision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': basePrecisionAndLimits['minLimit'],\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': quotePrecisionAndLimits['minLimit'],\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketId",
        "signature": "parseMarketId (marketId)",
        "line_start": 539,
        "line_end": 588,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarketId (marketId) {\n        let baseId = undefined;\n        let quoteId = undefined;\n        const currencyIds = this.safeValue (this.options, 'currencyIdsListForParseMarket', []);\n        // Bubble sort by length (longest first)\n        const currencyIdsLength = currencyIds.length;\n        for (let i = 0; i < currencyIdsLength; i++) {\n            for (let j = 0; j < currencyIdsLength - i - 1; j++) {\n                const a = currencyIds[j];\n                const b = currencyIds[j + 1];\n                if (a.length < b.length) {\n                    currencyIds[j] = b;\n                    currencyIds[j + 1] = a;\n                }\n            }\n        }\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const entryIndex = marketId.indexOf (currencyId);\n            if (entryIndex === 0) {\n                const restId = marketId.replace (currencyId, '');\n                if (this.inArray (restId, currencyIds)) {\n                    if (entryIndex === 0) {\n                        baseId = currencyId;\n                        quoteId = restId;\n                    } else {\n                        baseId = restId;\n                        quoteId = currencyId;\n                    }\n                    break;\n                }\n            }\n        }\n        if (baseId === undefined || quoteId === undefined) {\n            // https://github.com/ccxt/ccxt/issues/26820\n            if (marketId.endsWith ('USDT')) {\n                baseId = marketId.replace ('USDT', '');\n                quoteId = 'USDT';\n            }\n            if (marketId.endsWith ('USD')) {\n                baseId = marketId.replace ('USD', '');\n                quoteId = 'USD';\n            }\n        }\n        const result: Dict = {\n            'baseId': baseId,\n            'quoteId': quoteId,\n        };\n        return result;\n    }"
      },
      {
        "name": "parseMarketPrecisionAndLimits",
        "signature": "parseMarketPrecisionAndLimits (currencyId)",
        "line_start": 590,
        "line_end": 601,
        "comment": null,
        "mappings": [
          {
            "key": "precision",
            "value": "this.safeNumber (currency, 'precision')",
            "comment": null
          },
          {
            "key": "minLimit",
            "value": "minLimit",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketPrecisionAndLimits (currencyId) {\n        const currencies = this.safeValue (this.options, 'currenciesByIdForParseMarket', {});\n        const currency = this.safeValue (currencies, currencyId, {});\n        const limits = this.safeValue (currency, 'limits', {});\n        const amountLimits = this.safeValue (limits, 'amount', {});\n        const minLimit = this.safeNumber (amountLimits, 'min');\n        const result: Dict = {\n            'precision': this.safeNumber (currency, 'precision'),\n            'minLimit': minLimit,\n        };\n        return result;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 672,
        "line_end": 681,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'timestamp'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber (ohlcv, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1665,
        "line_end": 1940,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'orderID')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'lastFillTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseOrderTimeInForce (this.safeInteger (order, 'timeInForce'))",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "baseAmount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "fees",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"userID\": \"65671262d93d9525ac009e36\",\n         \"orderID\": \"65671262d93d9525ac009e36170257448481749b7ee2893bafec2\",\n         \"orderType\": \"market\",\n         \"buyingCurrency\": \"ETH\",\n         \"sellingCurrency\": \"USDC\",\n         \"buyingQty\": 0.002,\n         \"timeInForce\": 4,\n         \"boughtQty\": 0.002,\n         \"soldQty\": 4.587,\n         \"creationTime\": 1702574484829,\n         \"seqNumber\": 10874285330,\n         \"firstFillTime\": 1702574484831,\n         \"lastFillTime\": 1702574484831,\n         \"fills\": [\n             {\n                 \"seqNumber\": 10874285329,\n                 \"timestamp\": 1702574484831,\n                 \"qty\": 0.002,\n                 \"price\": 2293.5,\n                 \"side\": \"buy\"\n             }\n         ],\n         \"completionTime\": 1702574484831,\n         \"takerQty\": 0.002\n     }",
          "{\n         \"userID\": \"65671262d93d9525ac009e36\",\n         \"orderID\": \"65671262d93d9525ac009e3617026635256739c996fe17d7cd5d4\",\n         \"orderType\": \"limit\",\n         \"buyingCurrency\": \"ETH\",\n         \"sellingCurrency\": \"USDC\",\n         \"fillStyle\": \"sell\",\n         \"orderPlatform\": \"trade-v3\",\n         \"timeInForce\": 1,\n         \"buyingQty\": 0.005655,\n         \"sellingQty\": 11.31,\n         \"boughtQty\": 0,\n         \"soldQty\": 0,\n         \"creationTime\": 1702663525713,\n         \"seqNumber\": 10885528683,\n         \"fees\": 0,\n         \"fills\": [],\n         \"isAncillary\": false,\n         \"margin\": false,\n         \"trade\": false\n     }",
          "{\n         \"userID\": \"65671262d93d9525ac009e36\",\n         \"orderID\": \"65671262d93d9525ac009e36170257061073952c6423a8c5b4d6c\",\n         \"orderType\": \"market\",\n         \"buyingCurrency\": \"ETH\",\n         \"sellingCurrency\": \"USDC\",\n         \"buyingQty\": 0.002,\n         \"timeInForce\": 4,\n         \"boughtQty\": 0.002,\n         \"soldQty\": 4.564,\n         \"creationTime\": 1702570610746,\n         \"seqNumber\": 10873722344,\n         \"firstFillTime\": 1702570610747,\n         \"lastFillTime\": 1702570610747,\n         \"fills\": [\n             {\n                 \"_id\": \"657b31d360a9542449381bdc\",\n                 \"seqNumber\": 10873722343,\n                 \"timestamp\": 1702570610747,\n                 \"qty\": 0.002,\n                 \"price\": 2282,\n                 \"side\": \"buy\"\n             }\n         ],\n         \"completionTime\": 1702570610747,\n         \"takerQty\": 0.002,\n         \"fees\": 0.000002,\n         \"isAncillary\": false,\n         \"margin\": false,\n         \"trade\": false,\n         \"canceled\": false,\n         \"__v\": 0\n     }",
          "{\n         \"userData\": {\n             \"takeProfit\": 1700,\n             \"stopLoss\": 2100\n         },\n         \"_id\": \"658201d060a95424499394a2\",\n         \"seqNumber\": 10925300213,\n         \"orderType\": \"limit\",\n         \"buyingCurrency\": \"EUR\",\n         \"sellingCurrency\": \"ETH\",\n         \"userID\": \"65671262d93d9525ac009e36\",\n         \"closedQty\": 0.03,\n         \"sellingQty\": 0.03,\n         \"buyingQty\": 58.8,\n         \"creationTime\": 1703015281205,\n         \"margin\": true,\n         \"timeInForce\": 1,\n         \"boughtQty\": 59.31,\n         \"orderID\": \"65671262d93d9525ac009e3617030152811996e5b352556d3d7d8\",\n         \"lastFillTime\": 1703015281206,\n         \"soldQty\": 0.03,\n         \"closedTime\": 1703015488488,\n         \"closedVal\": 59.375,\n         \"trade\": true,\n         \"takerQty\": 59.31,\n         \"firstFillTime\": 1703015281206,\n         \"completionTime\": 1703015281206,\n         \"fills\": [\n             {\n                 \"_id\": \"658201d060a95424499394a3\",\n                 \"seqNumber\": 10925300212,\n                 \"side\": \"sell\",\n                 \"price\": 1977,\n                 \"qty\": 0.03,\n                 \"timestamp\": 1703015281206\n             },\n             {\n                 \"_id\": \"658201d060a95424499394a4\",\n                 \"seqNumber\": 10925321178,\n                 \"timestamp\": 1703015488483,\n                 \"qty\": 0.03,\n                 \"price\": 1979.1666666666667,\n                 \"side\": \"buy\"\n             }\n         ],\n         \"fees\": 0.11875000200000001,\n         \"settledQtys\": {\n             \"ETH\": -0.000092842104710025\n         },\n         \"isAncillary\": false,\n         \"canceled\": false\n     }",
          "{\n         \"_id\": \"657b4e6d60a954244939ac6f\",\n         \"userID\": \"65671262d93d9525ac009e36\",\n         \"orderID\": \"65671262d93d9525ac009e361702576531985b78465468b9cc544\",\n         \"orderType\": \"market\",\n         \"buyingCurrency\": \"ETH\",\n         \"sellingCurrency\": \"USDC\",\n         \"buyingQty\": 0.004,\n         \"timeInForce\": 4,\n         \"boughtQty\": 0.004,\n         \"soldQty\": 9.236,\n         \"creationTime\": 1702576531995,\n         \"seqNumber\": 10874644062,\n         \"firstFillTime\": 1702576531995,\n         \"lastFillTime\": 1702576531995,\n         \"fills\": [\n             {\n                 \"_id\": \"657b4e6d60a954244939ac70\",\n                 \"seqNumber\": 10874644061,\n                 \"timestamp\": 1702576531995,\n                 \"qty\": 0.004,\n                 \"price\": 2309,\n                 \"side\": \"buy\"\n             }\n         ],\n         \"completionTime\": 1702576531995,\n         \"takerQty\": 0.004,\n         \"fees\": 0.000004,\n         \"isAncillary\": false,\n         \"margin\": false,\n         \"trade\": false,\n         \"canceled\": false\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder market\n        //     {\n        //         \"userID\": \"65671262d93d9525ac009e36\",\n        //         \"orderID\": \"65671262d93d9525ac009e36170257448481749b7ee2893bafec2\",\n        //         \"orderType\": \"market\",\n        //         \"buyingCurrency\": \"ETH\",\n        //         \"sellingCurrency\": \"USDC\",\n        //         \"buyingQty\": 0.002,\n        //         \"timeInForce\": 4,\n        //         \"boughtQty\": 0.002,\n        //         \"soldQty\": 4.587,\n        //         \"creationTime\": 1702574484829,\n        //         \"seqNumber\": 10874285330,\n        //         \"firstFillTime\": 1702574484831,\n        //         \"lastFillTime\": 1702574484831,\n        //         \"fills\": [\n        //             {\n        //                 \"seqNumber\": 10874285329,\n        //                 \"timestamp\": 1702574484831,\n        //                 \"qty\": 0.002,\n        //                 \"price\": 2293.5,\n        //                 \"side\": \"buy\"\n        //             }\n        //         ],\n        //         \"completionTime\": 1702574484831,\n        //         \"takerQty\": 0.002\n        //     }\n        //\n        // createOrder limit\n        //     {\n        //         \"userID\": \"65671262d93d9525ac009e36\",\n        //         \"orderID\": \"65671262d93d9525ac009e3617026635256739c996fe17d7cd5d4\",\n        //         \"orderType\": \"limit\",\n        //         \"buyingCurrency\": \"ETH\",\n        //         \"sellingCurrency\": \"USDC\",\n        //         \"fillStyle\": \"sell\",\n        //         \"orderPlatform\": \"trade-v3\",\n        //         \"timeInForce\": 1,\n        //         \"buyingQty\": 0.005655,\n        //         \"sellingQty\": 11.31,\n        //         \"boughtQty\": 0,\n        //         \"soldQty\": 0,\n        //         \"creationTime\": 1702663525713,\n        //         \"seqNumber\": 10885528683,\n        //         \"fees\": 0,\n        //         \"fills\": [],\n        //         \"isAncillary\": false,\n        //         \"margin\": false,\n        //         \"trade\": false\n        //     }\n        //\n        // fetchOrders market\n        //     {\n        //         \"userID\": \"65671262d93d9525ac009e36\",\n        //         \"orderID\": \"65671262d93d9525ac009e36170257061073952c6423a8c5b4d6c\",\n        //         \"orderType\": \"market\",\n        //         \"buyingCurrency\": \"ETH\",\n        //         \"sellingCurrency\": \"USDC\",\n        //         \"buyingQty\": 0.002,\n        //         \"timeInForce\": 4,\n        //         \"boughtQty\": 0.002,\n        //         \"soldQty\": 4.564,\n        //         \"creationTime\": 1702570610746,\n        //         \"seqNumber\": 10873722344,\n        //         \"firstFillTime\": 1702570610747,\n        //         \"lastFillTime\": 1702570610747,\n        //         \"fills\": [\n        //             {\n        //                 \"_id\": \"657b31d360a9542449381bdc\",\n        //                 \"seqNumber\": 10873722343,\n        //                 \"timestamp\": 1702570610747,\n        //                 \"qty\": 0.002,\n        //                 \"price\": 2282,\n        //                 \"side\": \"buy\"\n        //             }\n        //         ],\n        //         \"completionTime\": 1702570610747,\n        //         \"takerQty\": 0.002,\n        //         \"fees\": 0.000002,\n        //         \"isAncillary\": false,\n        //         \"margin\": false,\n        //         \"trade\": false,\n        //         \"canceled\": false,\n        //         \"__v\": 0\n        //     }\n        //\n        // fetchOrders margin\n        //     {\n        //         \"userData\": {\n        //             \"takeProfit\": 1700,\n        //             \"stopLoss\": 2100\n        //         },\n        //         \"_id\": \"658201d060a95424499394a2\",\n        //         \"seqNumber\": 10925300213,\n        //         \"orderType\": \"limit\",\n        //         \"buyingCurrency\": \"EUR\",\n        //         \"sellingCurrency\": \"ETH\",\n        //         \"userID\": \"65671262d93d9525ac009e36\",\n        //         \"closedQty\": 0.03,\n        //         \"sellingQty\": 0.03,\n        //         \"buyingQty\": 58.8,\n        //         \"creationTime\": 1703015281205,\n        //         \"margin\": true,\n        //         \"timeInForce\": 1,\n        //         \"boughtQty\": 59.31,\n        //         \"orderID\": \"65671262d93d9525ac009e3617030152811996e5b352556d3d7d8\",\n        //         \"lastFillTime\": 1703015281206,\n        //         \"soldQty\": 0.03,\n        //         \"closedTime\": 1703015488488,\n        //         \"closedVal\": 59.375,\n        //         \"trade\": true,\n        //         \"takerQty\": 59.31,\n        //         \"firstFillTime\": 1703015281206,\n        //         \"completionTime\": 1703015281206,\n        //         \"fills\": [\n        //             {\n        //                 \"_id\": \"658201d060a95424499394a3\",\n        //                 \"seqNumber\": 10925300212,\n        //                 \"side\": \"sell\",\n        //                 \"price\": 1977,\n        //                 \"qty\": 0.03,\n        //                 \"timestamp\": 1703015281206\n        //             },\n        //             {\n        //                 \"_id\": \"658201d060a95424499394a4\",\n        //                 \"seqNumber\": 10925321178,\n        //                 \"timestamp\": 1703015488483,\n        //                 \"qty\": 0.03,\n        //                 \"price\": 1979.1666666666667,\n        //                 \"side\": \"buy\"\n        //             }\n        //         ],\n        //         \"fees\": 0.11875000200000001,\n        //         \"settledQtys\": {\n        //             \"ETH\": -0.000092842104710025\n        //         },\n        //         \"isAncillary\": false,\n        //         \"canceled\": false\n        //     }\n        //\n        // fetchOrder\n        //     {\n        //         \"_id\": \"657b4e6d60a954244939ac6f\",\n        //         \"userID\": \"65671262d93d9525ac009e36\",\n        //         \"orderID\": \"65671262d93d9525ac009e361702576531985b78465468b9cc544\",\n        //         \"orderType\": \"market\",\n        //         \"buyingCurrency\": \"ETH\",\n        //         \"sellingCurrency\": \"USDC\",\n        //         \"buyingQty\": 0.004,\n        //         \"timeInForce\": 4,\n        //         \"boughtQty\": 0.004,\n        //         \"soldQty\": 9.236,\n        //         \"creationTime\": 1702576531995,\n        //         \"seqNumber\": 10874644062,\n        //         \"firstFillTime\": 1702576531995,\n        //         \"lastFillTime\": 1702576531995,\n        //         \"fills\": [\n        //             {\n        //                 \"_id\": \"657b4e6d60a954244939ac70\",\n        //                 \"seqNumber\": 10874644061,\n        //                 \"timestamp\": 1702576531995,\n        //                 \"qty\": 0.004,\n        //                 \"price\": 2309,\n        //                 \"side\": \"buy\"\n        //             }\n        //         ],\n        //         \"completionTime\": 1702576531995,\n        //         \"takerQty\": 0.004,\n        //         \"fees\": 0.000004,\n        //         \"isAncillary\": false,\n        //         \"margin\": false,\n        //         \"trade\": false,\n        //         \"canceled\": false\n        //     }\n        //\n        let timestamp = this.safeInteger (order, 'creationTime');\n        const isCanceled = this.safeValue (order, 'canceled');\n        let status = undefined;\n        if (isCanceled === true) {\n            if (timestamp === undefined) {\n                timestamp = this.safeInteger (order, 'completionTime'); // market orders with bad price gain IOC - we mark them as 'rejected'?\n                status = 'rejected'; // these orders don't have the 'creationTime` param and have 'canceled': true\n            } else {\n                status = 'canceled';\n            }\n        } else {\n            status = this.safeString (order, 'status');\n            order = this.omit (order, 'status'); // we mark orders from fetchOpenOrders with param 'status': 'open'\n        }\n        const type = this.safeString (order, 'orderType');\n        let buyingQty = this.safeString (order, 'buyingQty');\n        let sellingQty = this.safeString (order, 'sellingQty');\n        const boughtQty = this.safeString (order, 'boughtQty');\n        const soldQty = this.safeString (order, 'soldQty');\n        if (type === 'market') {\n            if ((buyingQty === undefined) && (boughtQty !== undefined) && (boughtQty !== '0')) {\n                buyingQty = boughtQty;\n            }\n            if ((sellingQty === undefined) && (soldQty !== undefined) && (soldQty !== '0')) {\n                sellingQty = soldQty;\n            }\n        }\n        const buyingCurrencyId = this.safeString (order, 'buyingCurrency', '');\n        const sellingCurrencyId = this.safeString (order, 'sellingCurrency', '');\n        const byuingIdPlusSellingId = buyingCurrencyId + sellingCurrencyId;\n        const sellingIdPlusBuyingId = sellingCurrencyId + buyingCurrencyId;\n        let side = undefined;\n        let marketId = undefined;\n        let baseAmount = buyingQty;\n        let quoteAmount = buyingQty;\n        let filled = undefined;\n        let cost = undefined;\n        let feeInBaseOrQuote = undefined;\n        const marketsById = this.indexBy (this.markets, 'id');\n        if (this.safeValue (marketsById, byuingIdPlusSellingId) !== undefined) {\n            side = 'buy';\n            marketId = byuingIdPlusSellingId;\n            quoteAmount = sellingQty;\n            filled = boughtQty;\n            cost = soldQty;\n            feeInBaseOrQuote = 'base';\n        } else if (this.safeValue (marketsById, sellingIdPlusBuyingId) !== undefined) {\n            side = 'sell';\n            marketId = sellingIdPlusBuyingId;\n            baseAmount = sellingQty;\n            filled = soldQty;\n            cost = boughtQty;\n            feeInBaseOrQuote = 'quote';\n        }\n        let price = undefined;\n        if ((baseAmount !== undefined) && (quoteAmount !== undefined)) {\n            price = Precise.stringDiv (quoteAmount, baseAmount);\n        }\n        market = this.safeMarket (marketId, market);\n        let fee = undefined;\n        const feeCost = this.safeString (order, 'fees');\n        if ((feeCost !== undefined) && (feeInBaseOrQuote !== undefined)) {\n            fee = {\n                'currency': market[feeInBaseOrQuote],\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        const trades = this.safeValue (order, 'fills', []);\n        const userData = this.safeValue (order, 'userData', {});\n        const clientOrderId = this.safeString (userData, 'comment');\n        const takeProfitPrice = this.safeString (userData, 'takeProfit');\n        const stopLossPrice = this.safeString (userData, 'stopLoss');\n        return this.safeOrder ({\n            'id': this.safeString (order, 'orderID'),\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.safeInteger (order, 'lastFillTime'),\n            'status': status,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': this.parseOrderTimeInForce (this.safeInteger (order, 'timeInForce')),\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString (order, 'stopPrice'),\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'average': undefined,\n            'amount': baseAmount,\n            'cost': cost,\n            'filled': filled,\n            'remaining': undefined,\n            'fee': fee,\n            'fees': undefined,\n            'trades': trades,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (timeInForce)",
        "line_start": 1942,
        "line_end": 1951,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderTimeInForce (timeInForce) {\n        const timeInForceTypes = [\n            undefined,\n            'GTC',\n            'IOC',\n            'GTD',\n            'FOK',\n        ];\n        return this.safeValue (timeInForceTypes, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1017,
        "line_end": 1069,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "close",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"pair\": \"PERPUSD\",\n         \"timestamp\": 1702549841973,\n         \"price\": 0.8615317721366659,\n         \"qty\": 1e-12,\n         \"ask\": 0.8742333599999257,\n         \"bid\": 0.8490376365388491\n         \"delta\": 0.26915154078134096,\n         \"h\": 0.86220315458898,\n         \"l\": 0.67866757035154,\n         \"v\": 2.835000000000001e-9,\n         \"sentimentData\": {\n             \"sentiment\": 36.71333333333333,\n             \"interest\": 0.47430830039525695\n         }\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"pair\": \"PERPUSD\",\n        //         \"timestamp\": 1702549841973,\n        //         \"price\": 0.8615317721366659,\n        //         \"qty\": 1e-12,\n        //         \"ask\": 0.8742333599999257,\n        //         \"bid\": 0.8490376365388491\n        //         \"delta\": 0.26915154078134096,\n        //         \"h\": 0.86220315458898,\n        //         \"l\": 0.67866757035154,\n        //         \"v\": 2.835000000000001e-9,\n        //         \"sentimentData\": {\n        //             \"sentiment\": 36.71333333333333,\n        //             \"interest\": 0.47430830039525695\n        //         }\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'pair');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const bid = this.safeString (ticker, 'bid');\n        const ask = this.safeString (ticker, 'ask');\n        const high = this.safeString (ticker, 'h');\n        const low = this.safeString (ticker, 'l');\n        const last = this.safeString (ticker, 'price');\n        const baseVolume = this.safeString (ticker, 'v');\n        const delta = this.safeString (ticker, 'delta');\n        const percentage = Precise.stringMul (delta, '100');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'open': undefined,\n            'high': high,\n            'low': low,\n            'close': undefined,\n            'last': last,\n            'bid': bid,\n            'bidVolume': undefined,\n            'ask': ask,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 781,
        "line_end": 848,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"pair\": \"ETHUSDT\",\n         \"price\": 2077.1513,\n         \"qty\": 0.00337,\n         \"timestamp\": 1700684816853,\n         \"seqNum\": 10644567113\n     },",
          "{\n         \"pair\": \"ETHUSDC\",\n         \"seqNumber\": 10873722343,\n         \"timestamp\": 1702570610747,\n         \"qty\": 0.002,\n         \"price\": 2282,\n         \"side\": \"buy\",\n         \"orderID\": \"65671262d93d9525ac009e36170257061073952c6423a8c5b4d6c\"\n     }",
          "{\n         \"_id\": \"657b31d360a9542449381bdc\",\n         \"seqNumber\": 10873722343,\n         \"timestamp\": 1702570610747,\n         \"qty\": 0.002,\n         \"price\": 2282,\n         \"side\": \"buy\"\n     }",
          "{\n        \"pair\":\"ETHUSDC\",\n        \"seqNumber\":\"10873722343\",\n        \"timestamp\":\"1702570610747\",\n        \"qty\":\"0.002\",\n        \"price\":\"2282\",\n        \"side\":\"buy\",\n        \"orderID\":\"65671262d93d9525ac009e36170257061073952c6423a8c5b4d6c\",\n        \"userID\":\"65671262d93d9525ac009e36\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //         \"pair\": \"ETHUSDT\",\n        //         \"price\": 2077.1513,\n        //         \"qty\": 0.00337,\n        //         \"timestamp\": 1700684816853,\n        //         \"seqNum\": 10644567113\n        //     },\n        //\n        // fetchMyTrades\n        //     {\n        //         \"pair\": \"ETHUSDC\",\n        //         \"seqNumber\": 10873722343,\n        //         \"timestamp\": 1702570610747,\n        //         \"qty\": 0.002,\n        //         \"price\": 2282,\n        //         \"side\": \"buy\",\n        //         \"orderID\": \"65671262d93d9525ac009e36170257061073952c6423a8c5b4d6c\"\n        //     }\n        //\n        // fetchOrders\n        //     {\n        //         \"_id\": \"657b31d360a9542449381bdc\",\n        //         \"seqNumber\": 10873722343,\n        //         \"timestamp\": 1702570610747,\n        //         \"qty\": 0.002,\n        //         \"price\": 2282,\n        //         \"side\": \"buy\"\n        //     }\n        //\n        //    {\n        //        \"pair\":\"ETHUSDC\",\n        //        \"seqNumber\":\"10873722343\",\n        //        \"timestamp\":\"1702570610747\",\n        //        \"qty\":\"0.002\",\n        //        \"price\":\"2282\",\n        //        \"side\":\"buy\",\n        //        \"orderID\":\"65671262d93d9525ac009e36170257061073952c6423a8c5b4d6c\",\n        //        \"userID\":\"65671262d93d9525ac009e36\"\n        //     }\n        //\n        const marketId = this.safeString2 (trade, 'symbol', 'pair');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const id = this.safeStringN (trade, [ '_id', 'seqNum', 'seqNumber' ]);\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'qty');\n        const order = this.safeString (trade, 'orderID');\n        const side = this.safeString (trade, 'side');\n        return this.safeTrade ({\n            'id': id,\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n            'info': trade,\n        }, market);\n    }"
      }
    ],
    "coinone": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 476,
        "line_end": 494,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const balances = this.omit (response, [\n            'errorCode',\n            'result',\n            'normalWallets',\n        ]);\n        const currencyIds = Object.keys (balances);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const balance = balances[currencyId];\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'avail');\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 936,
        "line_end": 1049,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'averageExecutedPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'executedQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remainingString",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"result\": \"success\",\n         \"errorCode\": \"0\",\n         \"orderId\": \"8a82c561-40b4-4cb3-9bc0-9ac9ffc1d63b\"\n     }",
          "{\n         \"result\": \"success\",\n         \"errorCode\": \"0\",\n         \"orderId\": \"0e3019f2-1e4d-11e9-9ec7-00e04c3600d7\",\n         \"baseCurrency\": \"KRW\",\n         \"targetCurrency\": \"BTC\",\n         \"price\": \"10011000.0\",\n         \"originalQty\": \"3.0\",\n         \"executedQty\": \"0.62\",\n         \"canceledQty\": \"1.125\",\n         \"remainQty\": \"1.255\",\n         \"status\": \"partially_filled\",\n         \"side\": \"bid\",\n         \"orderedAt\": 1499340941,\n         \"updatedAt\": 1499341142,\n         \"feeRate\": \"0.002\",\n         \"fee\": \"0.00124\",\n         \"averageExecutedPrice\": \"10011000.0\"\n     }",
          "{\n         \"index\": \"0\",\n         \"orderId\": \"68665943-1eb5-4e4b-9d76-845fc54f5489\",\n         \"timestamp\": \"1449037367\",\n         \"price\": \"444000.0\",\n         \"qty\": \"0.3456\",\n         \"type\": \"ask\",\n         \"feeRate\": \"-0.0015\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"result\": \"success\",\n        //         \"errorCode\": \"0\",\n        //         \"orderId\": \"8a82c561-40b4-4cb3-9bc0-9ac9ffc1d63b\"\n        //     }\n        //\n        // fetchOrder\n        //\n        //     {\n        //         \"result\": \"success\",\n        //         \"errorCode\": \"0\",\n        //         \"orderId\": \"0e3019f2-1e4d-11e9-9ec7-00e04c3600d7\",\n        //         \"baseCurrency\": \"KRW\",\n        //         \"targetCurrency\": \"BTC\",\n        //         \"price\": \"10011000.0\",\n        //         \"originalQty\": \"3.0\",\n        //         \"executedQty\": \"0.62\",\n        //         \"canceledQty\": \"1.125\",\n        //         \"remainQty\": \"1.255\",\n        //         \"status\": \"partially_filled\",\n        //         \"side\": \"bid\",\n        //         \"orderedAt\": 1499340941,\n        //         \"updatedAt\": 1499341142,\n        //         \"feeRate\": \"0.002\",\n        //         \"fee\": \"0.00124\",\n        //         \"averageExecutedPrice\": \"10011000.0\"\n        //     }\n        //\n        // fetchOpenOrders\n        //\n        //     {\n        //         \"index\": \"0\",\n        //         \"orderId\": \"68665943-1eb5-4e4b-9d76-845fc54f5489\",\n        //         \"timestamp\": \"1449037367\",\n        //         \"price\": \"444000.0\",\n        //         \"qty\": \"0.3456\",\n        //         \"type\": \"ask\",\n        //         \"feeRate\": \"-0.0015\"\n        //     }\n        //\n        const id = this.safeString (order, 'orderId');\n        const baseId = this.safeString (order, 'baseCurrency');\n        const quoteId = this.safeString (order, 'targetCurrency');\n        let base = undefined;\n        let quote = undefined;\n        if (baseId !== undefined) {\n            base = this.safeCurrencyCode (baseId);\n        }\n        if (quoteId !== undefined) {\n            quote = this.safeCurrencyCode (quoteId);\n        }\n        let symbol = undefined;\n        if ((base !== undefined) && (quote !== undefined)) {\n            symbol = base + '/' + quote;\n            market = this.safeMarket (symbol, market, '/');\n        }\n        const timestamp = this.safeTimestamp2 (order, 'timestamp', 'updatedAt');\n        let side = this.safeString2 (order, 'type', 'side');\n        if (side === 'ask') {\n            side = 'sell';\n        } else if (side === 'bid') {\n            side = 'buy';\n        }\n        const remainingString = this.safeString (order, 'remainQty');\n        const amountString = this.safeString2 (order, 'originalQty', 'qty');\n        let status = this.safeString (order, 'status');\n        // https://github.com/ccxt/ccxt/pull/7067\n        if (status === 'live') {\n            if ((remainingString !== undefined) && (amountString !== undefined)) {\n                const isLessThan = Precise.stringLt (remainingString, amountString);\n                if (isLessThan) {\n                    status = 'canceled';\n                }\n            }\n        }\n        status = this.parseOrderStatus (status);\n        let fee = undefined;\n        const feeCostString = this.safeString (order, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrencyCode = (side === 'sell') ? quote : base;\n            fee = {\n                'cost': feeCostString,\n                'rate': this.safeString (order, 'feeRate'),\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': 'limit',\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'average': this.safeString (order, 'averageExecutedPrice'),\n            'amount': amountString,\n            'filled': this.safeString (order, 'executedQty'),\n            'remaining': remainingString,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 925,
        "line_end": 934,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'live': 'open',\n            'partially_filled': 'open',\n            'partially_canceled': 'open',\n            'filled': 'closed',\n            'canceled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 677,
        "line_end": 734,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (bids, 'price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (bids, 'qty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (asks, 'price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (asks, 'qty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'first')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'target_volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quote_volume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quote_currency\": \"krw\",\n         \"target_currency\": \"btc\",\n         \"timestamp\": 1701073357818,\n         \"high\": \"50543000.0\",\n         \"low\": \"49945000.0\",\n         \"first\": \"50487000.0\",\n         \"last\": \"50062000.0\",\n         \"quote_volume\": \"11349804285.3859\",\n         \"target_volume\": \"226.07268994\",\n         \"best_asks\": [\n             {\n                 \"price\": \"50081000.0\",\n                 \"qty\": \"0.18471358\"\n             }\n         ],\n         \"best_bids\": [\n             {\n                 \"price\": \"50062000.0\",\n                 \"qty\": \"0.04213455\"\n             }\n         ],\n         \"id\": \"1701073357818001\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"quote_currency\": \"krw\",\n        //         \"target_currency\": \"btc\",\n        //         \"timestamp\": 1701073357818,\n        //         \"high\": \"50543000.0\",\n        //         \"low\": \"49945000.0\",\n        //         \"first\": \"50487000.0\",\n        //         \"last\": \"50062000.0\",\n        //         \"quote_volume\": \"11349804285.3859\",\n        //         \"target_volume\": \"226.07268994\",\n        //         \"best_asks\": [\n        //             {\n        //                 \"price\": \"50081000.0\",\n        //                 \"qty\": \"0.18471358\"\n        //             }\n        //         ],\n        //         \"best_bids\": [\n        //             {\n        //                 \"price\": \"50062000.0\",\n        //                 \"qty\": \"0.04213455\"\n        //             }\n        //         ],\n        //         \"id\": \"1701073357818001\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const last = this.safeString (ticker, 'last');\n        const asks = this.safeList (ticker, 'best_asks', []);\n        const bids = this.safeList (ticker, 'best_bids', []);\n        const baseId = this.safeString (ticker, 'target_currency');\n        const quoteId = this.safeString (ticker, 'quote_currency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        return this.safeTicker ({\n            'symbol': base + '/' + quote,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (bids, 'price'),\n            'bidVolume': this.safeString (bids, 'qty'),\n            'ask': this.safeString (asks, 'price'),\n            'askVolume': this.safeString (asks, 'qty'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'first'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'target_volume'),\n            'quoteVolume': this.safeString (ticker, 'quote_volume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 736,
        "line_end": 798,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (trade, 'id')",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          },
          {
            "key": "rate",
            "value": "feeRateString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1701075265708001\",\n         \"timestamp\": 1701075265708,\n         \"price\": \"50020000\",\n         \"qty\": \"0.00155177\",\n         \"is_seller_maker\": false\n     }",
          "{\n         \"timestamp\": \"1416561032\",\n         \"price\": \"419000.0\",\n         \"type\": \"bid\",\n         \"qty\": \"0.001\",\n         \"feeRate\": \"-0.0015\",\n         \"fee\": \"-0.0000015\",\n         \"orderId\": \"E84A1AC2-8088-4FA0-B093-A3BCDB9B3C85\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"id\": \"1701075265708001\",\n        //         \"timestamp\": 1701075265708,\n        //         \"price\": \"50020000\",\n        //         \"qty\": \"0.00155177\",\n        //         \"is_seller_maker\": false\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"timestamp\": \"1416561032\",\n        //         \"price\": \"419000.0\",\n        //         \"type\": \"bid\",\n        //         \"qty\": \"0.001\",\n        //         \"feeRate\": \"-0.0015\",\n        //         \"fee\": \"-0.0000015\",\n        //         \"orderId\": \"E84A1AC2-8088-4FA0-B093-A3BCDB9B3C85\"\n        //     }\n        //\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        market = this.safeMarket (undefined, market);\n        const isSellerMaker = this.safeBool (trade, 'is_seller_maker');\n        let side = undefined;\n        if (isSellerMaker !== undefined) {\n            side = isSellerMaker ? 'sell' : 'buy';\n        }\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'qty');\n        const orderId = this.safeString (trade, 'orderId');\n        let feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            feeCostString = Precise.stringAbs (feeCostString);\n            let feeRateString = this.safeString (trade, 'feeRate');\n            feeRateString = Precise.stringAbs (feeRateString);\n            const feeCurrencyCode = (side === 'sell') ? market['quote'] : market['base'];\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n                'rate': feeRateString,\n            };\n        }\n        return this.safeTrade ({\n            'id': this.safeString (trade, 'id'),\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': orderId,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      }
    ],
    "coinsph": [
      {
        "name": "parseArrayParam",
        "signature": "parseArrayParam (array, key)",
        "line_start": 2195,
        "line_end": 2201,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseArrayParam (array, key) {\n        let stringifiedArray = this.json (array);\n        stringifiedArray = stringifiedArray.replace ('[', '%5B');\n        stringifiedArray = stringifiedArray.replace (']', '%5D');\n        const urlEncodedParam = key + '=' + stringifiedArray;\n        return urlEncodedParam;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1345,
        "line_end": 1362,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeList (response, 'balances', []);\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'free');\n            account['used'] = this.safeString (balance, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2153,
        "line_end": 2170,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "parsedCurrency",
            "comment": null
          },
          {
            "key": "network",
            "value": "null",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'addressTag')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"ETH\",\n         \"address\": \"0xfe98628173830bf79c59f04585ce41f7de168784\",\n         \"addressTag\": \"\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"coin\": \"ETH\",\n        //         \"address\": \"0xfe98628173830bf79c59f04585ce41f7de168784\",\n        //         \"addressTag\": \"\"\n        //     }\n        //\n        const currencyId = this.safeString (depositAddress, 'coin');\n        const parsedCurrency = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': depositAddress,\n            'currency': parsedCurrency,\n            'network': null,\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': this.safeString (depositAddress, 'addressTag'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1117,
        "line_end": 1126,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1606,
        "line_end": 1707,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (this.safeString (order, 'type'))",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseOrderTimeInForce (this.safeString (order, 'timeInForce'))",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parseOrderSide (this.safeString (order, 'side'))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'origQty')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'cummulativeQuoteQty')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'executedQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fees",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"orderId\": 1375445991893797391,\n         \"clientOrderId\": \"1375445991893799115\",\n         \"transactTime\": 1678701939513,\n         \"price\": \"0\",\n         \"origQty\": \"0\",\n         \"executedQty\": \"0.001899\",\n         \"cummulativeQuoteQty\": \"2.99948949\",\n         \"status\": \"FILLED\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"MARKET\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0\",\n         \"origQuoteOrderQty\": \"3\",\n         \"fills\": [\n             {\n                 \"price\": \"1579.51\",\n                 \"qty\": \"0.001899\",\n                 \"commission\": \"0\",\n                 \"commissionAsset\": \"ETH\",\n                 \"tradeId\":1375445992035598337\n             }\n         ]\n     }",
          "{\n         \"symbol\": \"DOGEPHP\",\n         \"orderId\":1375465375097982423,\n         \"clientOrderId\": \"1375465375098001241\",\n         \"price\": \"0\",\n         \"origQty\": \"0\",\n         \"executedQty\": \"13\",\n         \"cummulativeQuoteQty\": \"49.621\",\n         \"status\": \"FILLED\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"MARKET\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0\",\n         \"time\":1678704250171,\n         \"updateTime\":1678704250256,\n         \"isWorking\":false,\n         \"origQuoteOrderQty\": \"50\"\n     }",
          "{\n         \"symbol\": \"ETHPHP\",\n         \"orderId\":1375609441915774332,\n         \"clientOrderId\": \"1375609441915899557\",\n         \"price\": \"96000\",\n         \"origQty\": \"0.001\",\n         \"executedQty\": \"0\",\n         \"cummulativeQuoteQty\": \"0\",\n         \"status\": \"CANCELED\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"SELL\",\n         \"stopPrice\": \"0\",\n         \"origQuoteOrderQty\": \"0\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder POST /openapi/v1/order\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"orderId\": 1375445991893797391,\n        //         \"clientOrderId\": \"1375445991893799115\",\n        //         \"transactTime\": 1678701939513,\n        //         \"price\": \"0\",\n        //         \"origQty\": \"0\",\n        //         \"executedQty\": \"0.001899\",\n        //         \"cummulativeQuoteQty\": \"2.99948949\",\n        //         \"status\": \"FILLED\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"MARKET\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0\",\n        //         \"origQuoteOrderQty\": \"3\",\n        //         \"fills\": [\n        //             {\n        //                 \"price\": \"1579.51\",\n        //                 \"qty\": \"0.001899\",\n        //                 \"commission\": \"0\",\n        //                 \"commissionAsset\": \"ETH\",\n        //                 \"tradeId\":1375445992035598337\n        //             }\n        //         ]\n        //     }\n        //\n        // fetchOrder GET /openapi/v1/order\n        // fetchOpenOrders GET /openapi/v1/openOrders\n        // fetchClosedOrders GET /openapi/v1/historyOrders\n        // cancelAllOrders DELETE /openapi/v1/openOrders\n        //     {\n        //         \"symbol\": \"DOGEPHP\",\n        //         \"orderId\":1375465375097982423,\n        //         \"clientOrderId\": \"1375465375098001241\",\n        //         \"price\": \"0\",\n        //         \"origQty\": \"0\",\n        //         \"executedQty\": \"13\",\n        //         \"cummulativeQuoteQty\": \"49.621\",\n        //         \"status\": \"FILLED\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"MARKET\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0\",\n        //         \"time\":1678704250171,\n        //         \"updateTime\":1678704250256,\n        //         \"isWorking\":false,\n        //         \"origQuoteOrderQty\": \"50\"\n        //     }\n        //\n        // cancelOrder DELETE /openapi/v1/order\n        //     {\n        //         \"symbol\": \"ETHPHP\",\n        //         \"orderId\":1375609441915774332,\n        //         \"clientOrderId\": \"1375609441915899557\",\n        //         \"price\": \"96000\",\n        //         \"origQty\": \"0.001\",\n        //         \"executedQty\": \"0\",\n        //         \"cummulativeQuoteQty\": \"0\",\n        //         \"status\": \"CANCELED\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"SELL\",\n        //         \"stopPrice\": \"0\",\n        //         \"origQuoteOrderQty\": \"0\"\n        //     }\n        //\n        const id = this.safeString (order, 'orderId');\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger2 (order, 'time', 'transactTime');\n        const trades = this.safeValue (order, 'fills', undefined);\n        let triggerPrice = this.safeString (order, 'stopPrice');\n        if (Precise.stringEq (triggerPrice, '0')) {\n            triggerPrice = undefined;\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'symbol': market['symbol'],\n            'type': this.parseOrderType (this.safeString (order, 'type')),\n            'timeInForce': this.parseOrderTimeInForce (this.safeString (order, 'timeInForce')),\n            'side': this.parseOrderSide (this.safeString (order, 'side')),\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': triggerPrice,\n            'average': undefined,\n            'amount': this.safeString (order, 'origQty'),\n            'cost': this.safeString (order, 'cummulativeQuoteQty'),\n            'filled': this.safeString (order, 'executedQty'),\n            'remaining': undefined,\n            'fee': undefined,\n            'fees': undefined,\n            'trades': trades,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (status)",
        "line_start": 1709,
        "line_end": 1715,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSide (status) {\n        const statuses: Dict = {\n            'BUY': 'buy',\n            'SELL': 'sell',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1751,
        "line_end": 1761,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'PARTIALLY_FILLED': 'open',\n            'PARTIALLY_CANCELED': 'canceled',\n            'REJECTED': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (status)",
        "line_start": 1763,
        "line_end": 1770,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderTimeInForce (status) {\n        const statuses: Dict = {\n            'GTC': 'GTC',\n            'FOK': 'FOK',\n            'IOC': 'IOC',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1725,
        "line_end": 1736,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'LIMIT_MAKER': 'limit',\n            'STOP_LOSS': 'market',\n            'STOP_LOSS_LIMIT': 'limit',\n            'TAKE_PROFIT': 'market',\n            'TAKE_PROFIT_LIMIT': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 935,
        "line_end": 1012,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString2 (ticker, 'lastPrice', 'price')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "prevClose",
            "comment": null
          },
          {
            "key": "change",
            "value": "changeValue",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "changePcnt",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"priceChange\": \"41.440000000000000000\",\n         \"priceChangePercent\": \"0.0259\",\n         \"weightedAvgPrice\": \"1631.169825783972125436\",\n         \"prevClosePrice\": \"1601.520000000000000000\",\n         \"lastPrice\": \"1642.96\",\n         \"lastQty\": \"0.000001000000000000\",\n         \"bidPrice\": \"1638.790000000000000000\",\n         \"bidQty\": \"0.280075000000000000\",\n         \"askPrice\": \"1647.340000000000000000\",\n         \"askQty\": \"0.165183000000000000\",\n         \"openPrice\": \"1601.52\",\n         \"highPrice\": \"1648.28\",\n         \"lowPrice\": \"1601.52\",\n         \"volume\": \"0.000287\",\n         \"quoteVolume\": \"0.46814574\",\n         \"openTime\": \"1677417000000\",\n         \"closeTime\": \"1677503415200\",\n         \"firstId\": \"1364680572697591809\",\n         \"lastId\": \"1365389809203560449\",\n         \"count\": \"100\"\n     }",
          "{ \"symbol\": \"ETHUSDT\", \"price\": \"1599.68\" }",
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"bidPrice\": \"1596.57\",\n         \"bidQty\": \"0.246405\",\n         \"askPrice\": \"1605.12\",\n         \"askQty\": \"0.242681\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // publicGetOpenapiQuoteV1Ticker24hr\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"priceChange\": \"41.440000000000000000\",\n        //         \"priceChangePercent\": \"0.0259\",\n        //         \"weightedAvgPrice\": \"1631.169825783972125436\",\n        //         \"prevClosePrice\": \"1601.520000000000000000\",\n        //         \"lastPrice\": \"1642.96\",\n        //         \"lastQty\": \"0.000001000000000000\",\n        //         \"bidPrice\": \"1638.790000000000000000\",\n        //         \"bidQty\": \"0.280075000000000000\",\n        //         \"askPrice\": \"1647.340000000000000000\",\n        //         \"askQty\": \"0.165183000000000000\",\n        //         \"openPrice\": \"1601.52\",\n        //         \"highPrice\": \"1648.28\",\n        //         \"lowPrice\": \"1601.52\",\n        //         \"volume\": \"0.000287\",\n        //         \"quoteVolume\": \"0.46814574\",\n        //         \"openTime\": \"1677417000000\",\n        //         \"closeTime\": \"1677503415200\",\n        //         \"firstId\": \"1364680572697591809\",\n        //         \"lastId\": \"1365389809203560449\",\n        //         \"count\": \"100\"\n        //     }\n        //\n        // publicGetOpenapiQuoteV1TickerPrice\n        //     { \"symbol\": \"ETHUSDT\", \"price\": \"1599.68\" }\n        //\n        // publicGetOpenapiQuoteV1TickerBookTicker\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"bidPrice\": \"1596.57\",\n        //         \"bidQty\": \"0.246405\",\n        //         \"askPrice\": \"1605.12\",\n        //         \"askQty\": \"0.242681\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (ticker, 'closeTime');\n        const bid = this.safeString (ticker, 'bidPrice');\n        const ask = this.safeString (ticker, 'askPrice');\n        const bidVolume = this.safeString (ticker, 'bidQty');\n        const askVolume = this.safeString (ticker, 'askQty');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = this.safeString (ticker, 'quoteVolume');\n        const open = this.safeString (ticker, 'openPrice');\n        const high = this.safeString (ticker, 'highPrice');\n        const low = this.safeString (ticker, 'lowPrice');\n        const prevClose = this.safeString (ticker, 'prevClosePrice');\n        const vwap = this.safeString (ticker, 'weightedAvgPrice');\n        const changeValue = this.safeString (ticker, 'priceChange');\n        let changePcnt = this.safeString (ticker, 'priceChangePercent');\n        changePcnt = Precise.stringMul (changePcnt, '100');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'open': open,\n            'high': high,\n            'low': low,\n            'close': this.safeString2 (ticker, 'lastPrice', 'price'),\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': vwap,\n            'previousClose': prevClose,\n            'change': changeValue,\n            'percentage': changePcnt,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1223,
        "line_end": 1308,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"price\": \"89685.8\",\n         \"id\": \"1365561108437680129\",\n         \"qty\": \"0.000004\",\n         \"quoteQty\": \"0.000004000000000000\", // warning: report to exchange - this is not quote quantity, this is base quantity\n         \"time\": \"1677523569575\",\n         \"isBuyerMaker\": false,\n         \"isBestMatch\": true\n     },",
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"id\": 1375426310524125185,\n         \"orderId\": 1375426310415879614,\n         \"price\": \"1580.91\",\n         \"qty\": \"0.01\",\n         \"quoteQty\": \"15.8091\",\n         \"commission\": \"0\",\n         \"commissionAsset\": \"USDT\",\n         \"time\": 1678699593307,\n         \"isBuyer\": false,\n         \"isMaker\":false,\n         \"isBestMatch\":false\n     }",
          "{\n         \"price\": \"1579.51\",\n         \"qty\": \"0.001899\",\n         \"commission\": \"0\",\n         \"commissionAsset\": \"ETH\",\n         \"tradeId\":1375445992035598337\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //         \"price\": \"89685.8\",\n        //         \"id\": \"1365561108437680129\",\n        //         \"qty\": \"0.000004\",\n        //         \"quoteQty\": \"0.000004000000000000\", // warning: report to exchange - this is not quote quantity, this is base quantity\n        //         \"time\": \"1677523569575\",\n        //         \"isBuyerMaker\": false,\n        //         \"isBestMatch\": true\n        //     },\n        //\n        // fetchMyTrades\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"id\": 1375426310524125185,\n        //         \"orderId\": 1375426310415879614,\n        //         \"price\": \"1580.91\",\n        //         \"qty\": \"0.01\",\n        //         \"quoteQty\": \"15.8091\",\n        //         \"commission\": \"0\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"time\": 1678699593307,\n        //         \"isBuyer\": false,\n        //         \"isMaker\":false,\n        //         \"isBestMatch\":false\n        //     }\n        //\n        // createOrder\n        //     {\n        //         \"price\": \"1579.51\",\n        //         \"qty\": \"0.001899\",\n        //         \"commission\": \"0\",\n        //         \"commissionAsset\": \"ETH\",\n        //         \"tradeId\":1375445992035598337\n        //     }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const id = this.safeString2 (trade, 'id', 'tradeId');\n        const orderId = this.safeString (trade, 'orderId');\n        const timestamp = this.safeInteger (trade, 'time');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'qty');\n        const type = undefined;\n        let fee = undefined;\n        const feeCost = this.safeString (trade, 'commission');\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'commissionAsset');\n            fee = {\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            };\n        }\n        const isBuyer = this.safeBool2 (trade, 'isBuyer', 'isBuyerMaker', undefined);\n        let side = undefined;\n        if (isBuyer !== undefined) {\n            side = (isBuyer === true) ? 'buy' : 'sell';\n        }\n        const isMaker = this.safeString2 (trade, 'isMaker', undefined);\n        let takerOrMaker = undefined;\n        if (isMaker !== undefined) {\n            takerOrMaker = (isMaker === 'true') ? 'maker' : 'taker';\n        }\n        let costString = undefined;\n        if (orderId !== undefined) {\n            costString = this.safeString (trade, 'quoteQty');\n        }\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1835,
        "line_end": 1854,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'makerCommission')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'takerCommission')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"makerCommission\": \"0.0025\",\n         \"takerCommission\": \"0.003\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"makerCommission\": \"0.0025\",\n        //         \"takerCommission\": \"0.003\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'makerCommission'),\n            'taker': this.safeNumber (fee, 'takerCommission'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2017,
        "line_end": 2107,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"coin\": \"PHP\",\n         \"address\": \"Internal Transfer\",\n         \"addressTag\": \"Internal Transfer\",\n         \"amount\": \"0.02\",\n         \"id\": \"31312321312312312312322\",\n         \"network\": \"Internal\",\n         \"transferType\": \"0\",\n         \"status\": 3,\n         \"confirmTimes\": \"\",\n         \"unlockConfirm\": \"\",\n         \"txId\": \"Internal Transfer\",\n         \"insertTime\": 1657623798000,\n         \"depositOrderId\": \"the deposit id which created by client\"\n     }",
          "{\n         \"coin\": \"BTC\",\n         \"address\": \"Internal Transfer\",\n         \"amount\": \"0.1\",\n         \"id\": \"1201515362324421632\",\n         \"withdrawOrderId\": null,\n         \"network\": \"Internal\",\n         \"transferType\": \"0\",\n         \"status\": 0,\n         \"transactionFee\": \"0\",\n         \"confirmNo\": 0,\n         \"info\": \"{}\",\n         \"txId\": \"Internal Transfer\",\n         \"applyTime\": 1657967792000\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //     {\n        //         \"coin\": \"PHP\",\n        //         \"address\": \"Internal Transfer\",\n        //         \"addressTag\": \"Internal Transfer\",\n        //         \"amount\": \"0.02\",\n        //         \"id\": \"31312321312312312312322\",\n        //         \"network\": \"Internal\",\n        //         \"transferType\": \"0\",\n        //         \"status\": 3,\n        //         \"confirmTimes\": \"\",\n        //         \"unlockConfirm\": \"\",\n        //         \"txId\": \"Internal Transfer\",\n        //         \"insertTime\": 1657623798000,\n        //         \"depositOrderId\": \"the deposit id which created by client\"\n        //     }\n        //\n        // fetchWithdrawals\n        //     {\n        //         \"coin\": \"BTC\",\n        //         \"address\": \"Internal Transfer\",\n        //         \"amount\": \"0.1\",\n        //         \"id\": \"1201515362324421632\",\n        //         \"withdrawOrderId\": null,\n        //         \"network\": \"Internal\",\n        //         \"transferType\": \"0\",\n        //         \"status\": 0,\n        //         \"transactionFee\": \"0\",\n        //         \"confirmNo\": 0,\n        //         \"info\": \"{}\",\n        //         \"txId\": \"Internal Transfer\",\n        //         \"applyTime\": 1657967792000\n        //     }\n        //\n        // todo: this is in progress\n        const id = this.safeString (transaction, 'id');\n        const address = this.safeString (transaction, 'address');\n        let tag = this.safeString (transaction, 'addressTag');\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        const txid = this.safeString (transaction, 'txId');\n        const currencyId = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let timestamp = undefined;\n        timestamp = this.safeInteger2 (transaction, 'insertTime', 'applyTime');\n        const updated = undefined;\n        let type = undefined;\n        const withdrawOrderId = this.safeString (transaction, 'withdrawOrderId');\n        const depositOrderId = this.safeString (transaction, 'depositOrderId');\n        if (withdrawOrderId !== undefined) {\n            type = 'withdrawal';\n        } else if (depositOrderId !== undefined) {\n            type = 'deposit';\n        }\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber (transaction, 'transactionFee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const network = this.safeString (transaction, 'network');\n        const internal = network === 'Internal';\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': internal,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2109,
        "line_end": 2117,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            '0': 'pending',\n            '1': 'ok',\n            '2': 'failed',\n            '3': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "coinspot": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 302,
        "line_end": 329,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const balances = this.safeValue2 (response, 'balance', 'balances');\n        if (Array.isArray (balances)) {\n            for (let i = 0; i < balances.length; i++) {\n                const currencies = balances[i];\n                const currencyIds = Object.keys (currencies);\n                for (let j = 0; j < currencyIds.length; j++) {\n                    const currencyId = currencyIds[j];\n                    const balance = currencies[currencyId];\n                    const code = this.safeCurrencyCode (currencyId);\n                    const account = this.account ();\n                    account['total'] = this.safeString (balance, 'balance');\n                    result[code] = account;\n                }\n            }\n        } else {\n            const currencyIds = Object.keys (balances);\n            for (let i = 0; i < currencyIds.length; i++) {\n                const currencyId = currencyIds[i];\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['total'] = this.safeString (balances, currencyId);\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 382,
        "line_end": 416,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"btc\":{\n             \"bid\":\"51970\",\n             \"ask\":\"53000\",\n             \"last\":\"52806.47\"\n         }\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"btc\":{\n        //             \"bid\":\"51970\",\n        //             \"ask\":\"53000\",\n        //             \"last\":\"52806.47\"\n        //         }\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': undefined,\n            'low': undefined,\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 584,
        "line_end": 652,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (priceString)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (costString)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\":0.00102091,\n         \"rate\":21549.09999991,\n         \"total\":21.99969168,\n         \"coin\":\"BTC\",\n         \"solddate\":1604890646143,\n         \"market\":\"BTC/AUD\"\n     }",
          "{\n       \"otc\": false,\n       \"market\": \"ALGO/AUD\",\n       \"amount\": 386.95197925,\n       \"created\": \"2022-10-20T09:56:44.502Z\",\n       \"audfeeExGst\": 1.80018002,\n       \"audGst\": 0.180018,\n       \"audtotal\": 200,\n       \"total\": 200,\n       \"side\": \"buy\",\n       \"price\": 0.5168600000125209\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"amount\":0.00102091,\n        //         \"rate\":21549.09999991,\n        //         \"total\":21.99969168,\n        //         \"coin\":\"BTC\",\n        //         \"solddate\":1604890646143,\n        //         \"market\":\"BTC/AUD\"\n        //     }\n        //\n        // private fetchMyTrades\n        //     {\n        //       \"otc\": false,\n        //       \"market\": \"ALGO/AUD\",\n        //       \"amount\": 386.95197925,\n        //       \"created\": \"2022-10-20T09:56:44.502Z\",\n        //       \"audfeeExGst\": 1.80018002,\n        //       \"audGst\": 0.180018,\n        //       \"audtotal\": 200,\n        //       \"total\": 200,\n        //       \"side\": \"buy\",\n        //       \"price\": 0.5168600000125209\n        //     }\n        let timestamp = undefined;\n        let priceString = undefined;\n        let fee = undefined;\n        const audTotal = this.safeString (trade, 'audtotal');\n        const costString = this.safeString (trade, 'total', audTotal);\n        const side = this.safeString (trade, 'side');\n        const amountString = this.safeString (trade, 'amount');\n        const marketId = this.safeString (trade, 'market');\n        const symbol = this.safeSymbol (marketId, market, '/');\n        const solddate = this.safeInteger (trade, 'solddate');\n        if (solddate !== undefined) {\n            priceString = this.safeString (trade, 'rate');\n            timestamp = solddate;\n        } else {\n            priceString = Precise.stringDiv (costString, amountString);\n            const createdString = this.safeString (trade, 'created');\n            timestamp = this.parse8601 (createdString);\n            const audfeeExGst = this.safeString (trade, 'audfeeExGst');\n            const audGst = this.safeString (trade, 'audGst');\n            // The transaction fee which consumers pay is inclusive of GST by default\n            const feeCost = Precise.stringAdd (audfeeExGst, audGst);\n            const feeCurrencyId = 'AUD';\n            fee = {\n                'cost': this.parseNumber (feeCost),\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': undefined,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': this.parseNumber (priceString),\n            'amount': this.parseNumber (amountString),\n            'cost': this.parseNumber (costString),\n            'fee': fee,\n        }, market);\n    }"
      }
    ],
    "cryptocom": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 2891,
        "line_end": 2923,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (account, 'uuid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (account, 'label')",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n         \"user_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n         \"master_account_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n         \"label\": \"FORMER_MASTER_MARGIN\",\n         \"enabled\": true,\n         \"tradable\": true,\n         \"name\": \"YOUR_NAME\",\n         \"country_code\": \"YOUR_COUNTRY_CODE\",\n         \"incorp_country_code\": \"\",\n         \"margin_access\": \"DEFAULT\",\n         \"derivatives_access\": \"DEFAULT\",\n         \"create_time\": 1656481992000,\n         \"update_time\": 1667272884594,\n         \"two_fa_enabled\": false,\n         \"kyc_level\": \"ADVANCED\",\n         \"suspended\": false,\n         \"terminated\": false,\n         \"spot_enabled\": false,\n         \"margin_enabled\": false,\n         \"derivatives_enabled\": false,\n         \"system_label\": \"FORMER_MASTER_MARGIN\"\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        //     {\n        //         \"uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n        //         \"user_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n        //         \"master_account_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n        //         \"label\": \"FORMER_MASTER_MARGIN\",\n        //         \"enabled\": true,\n        //         \"tradable\": true,\n        //         \"name\": \"YOUR_NAME\",\n        //         \"country_code\": \"YOUR_COUNTRY_CODE\",\n        //         \"incorp_country_code\": \"\",\n        //         \"margin_access\": \"DEFAULT\",\n        //         \"derivatives_access\": \"DEFAULT\",\n        //         \"create_time\": 1656481992000,\n        //         \"update_time\": 1667272884594,\n        //         \"two_fa_enabled\": false,\n        //         \"kyc_level\": \"ADVANCED\",\n        //         \"suspended\": false,\n        //         \"terminated\": false,\n        //         \"spot_enabled\": false,\n        //         \"margin_enabled\": false,\n        //         \"derivatives_enabled\": false,\n        //         \"system_label\": \"FORMER_MASTER_MARGIN\"\n        //     }\n        //\n        return {\n            'id': this.safeString (account, 'uuid'),\n            'type': this.safeString (account, 'label'),\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseAddress",
        "signature": "parseAddress (addressString)",
        "line_start": 1960,
        "line_end": 1972,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseAddress (addressString) {\n        let address = undefined;\n        let tag = undefined;\n        let rawTag = undefined;\n        if (addressString.indexOf ('?') > 0) {\n            [ address, rawTag ] = addressString.split ('?');\n            const splitted = rawTag.split ('=');\n            tag = splitted[1];\n        } else {\n            address = addressString;\n        }\n        return [ address, tag ];\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1198,
        "line_end": 1213,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const responseResult = this.safeDict (response, 'result', {});\n        const data = this.safeList (responseResult, 'data', []);\n        const positionBalances = this.safeValue (data[0], 'position_balances', []);\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < positionBalances.length; i++) {\n            const balance = positionBalances[i];\n            const currencyId = this.safeString (balance, 'instrument_name');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'quantity');\n            account['used'] = this.safeString (balance, 'reserved_qty');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositStatus",
        "signature": "parseDepositStatus (status)",
        "line_start": 2492,
        "line_end": 2500,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositStatus (status) {\n        const statuses: Dict = {\n            '0': 'pending',\n            '1': 'ok',\n            '2': 'failed',\n            '3': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2628,
        "line_end": 2676,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{ 'fee': undefined, 'percentage': undefined }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'fee': this.safeNumber (networkInfo, 'withdrawal_fee'), 'percentage': false }",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"full_name\": \"Alchemix\",\n        \"default_network\": \"ETH\",\n        \"network_list\": [\n          {\n            \"network_id\": \"ETH\",\n            \"withdrawal_fee\": \"0.25000000\",\n            \"withdraw_enabled\": true,\n            \"min_withdrawal_amount\": \"0.5\",\n            \"deposit_enabled\": true,\n            \"confirmation_required\": \"0\"\n          }\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"full_name\": \"Alchemix\",\n        //        \"default_network\": \"ETH\",\n        //        \"network_list\": [\n        //          {\n        //            \"network_id\": \"ETH\",\n        //            \"withdrawal_fee\": \"0.25000000\",\n        //            \"withdraw_enabled\": true,\n        //            \"min_withdrawal_amount\": \"0.5\",\n        //            \"deposit_enabled\": true,\n        //            \"confirmation_required\": \"0\"\n        //          }\n        //        ]\n        //    }\n        //\n        const networkList = this.safeList (fee, 'network_list', []);\n        const networkListLength = networkList.length;\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        if (networkList !== undefined) {\n            for (let i = 0; i < networkListLength; i++) {\n                const networkInfo = networkList[i];\n                const networkId = this.safeString (networkInfo, 'network_id');\n                const currencyCode = this.safeString (currency, 'code');\n                const networkCode = this.networkIdToCode (networkId, currencyCode);\n                result['networks'][networkCode] = {\n                    'deposit': { 'fee': undefined, 'percentage': undefined },\n                    'withdraw': { 'fee': this.safeNumber (networkInfo, 'withdrawal_fee'), 'percentage': false },\n                };\n                if (networkListLength === 1) {\n                    result['withdraw']['fee'] = this.safeNumber (networkInfo, 'withdrawal_fee');\n                    result['withdraw']['percentage'] = false;\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3058,
        "line_end": 3090,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'v')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "'1h'",
            "comment": null
          }
        ],
        "examples": [
          "{\n                     \"v\": \"-0.000001884\",\n                     \"t\": 1687892400000\n                 },"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //                 {\n        //                     \"v\": \"-0.000001884\",\n        //                     \"t\": 1687892400000\n        //                 },\n        //\n        const timestamp = this.safeInteger (contract, 't');\n        let fundingTimestamp = undefined;\n        if (timestamp !== undefined) {\n            fundingTimestamp = Math.ceil (timestamp / 3600000) * 3600000; // end of the next hour\n        }\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 'v'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': '1h',\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2760,
        "line_end": 2813,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'order_id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'account_id')",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'trade_id')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "this.safeString (item, 'trade_match_id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'journal_type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': undefined,\n                'cost': undefined,\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"account_id\": \"ce075cef-1234-4321-bd6e-gf9007351e64\",\n         \"event_date\": \"2023-06-15\",\n         \"journal_type\": \"TRADING\",\n         \"journal_id\": \"6530219460124075091\",\n         \"transaction_qty\": \"6.0091224\",\n         \"transaction_cost\": \"6.0091224\",\n         \"realized_pnl\": \"0\",\n         \"order_id\": \"6530219477766741833\",\n         \"trade_id\": \"6530219495775954765\",\n         \"trade_match_id\": \"4611686018455865176\",\n         \"event_timestamp_ms\": 1686804665013,\n         \"event_timestamp_ns\": \"1686804665013642422\",\n         \"client_oid\": \"CCXT_d6ea7c5db6c1495aa8b758\",\n         \"taker_side\": \"\",\n         \"side\": \"BUY\",\n         \"instrument_name\": \"USD\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"account_id\": \"ce075cef-1234-4321-bd6e-gf9007351e64\",\n        //         \"event_date\": \"2023-06-15\",\n        //         \"journal_type\": \"TRADING\",\n        //         \"journal_id\": \"6530219460124075091\",\n        //         \"transaction_qty\": \"6.0091224\",\n        //         \"transaction_cost\": \"6.0091224\",\n        //         \"realized_pnl\": \"0\",\n        //         \"order_id\": \"6530219477766741833\",\n        //         \"trade_id\": \"6530219495775954765\",\n        //         \"trade_match_id\": \"4611686018455865176\",\n        //         \"event_timestamp_ms\": 1686804665013,\n        //         \"event_timestamp_ns\": \"1686804665013642422\",\n        //         \"client_oid\": \"CCXT_d6ea7c5db6c1495aa8b758\",\n        //         \"taker_side\": \"\",\n        //         \"side\": \"BUY\",\n        //         \"instrument_name\": \"USD\"\n        //     }\n        //\n        const timestamp = this.safeInteger (item, 'event_timestamp_ms');\n        const currencyId = this.safeString (item, 'instrument_name');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        let amount = this.safeString (item, 'transaction_qty');\n        let direction = undefined;\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringAbs (amount);\n        } else {\n            direction = 'in';\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'order_id'),\n            'direction': direction,\n            'account': this.safeString (item, 'account_id'),\n            'referenceId': this.safeString (item, 'trade_id'),\n            'referenceAccount': this.safeString (item, 'trade_match_id'),\n            'type': this.parseLedgerEntryType (this.safeString (item, 'journal_type')),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': {\n                'currency': undefined,\n                'cost': undefined,\n            },\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2815,
        "line_end": 2840,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'TRADING': 'trade',\n            'TRADE_FEE': 'fee',\n            'WITHDRAW_FEE': 'fee',\n            'WITHDRAW': 'withdrawal',\n            'DEPOSIT': 'deposit',\n            'ROLLBACK_WITHDRAW': 'rollback',\n            'ROLLBACK_DEPOSIT': 'rollback',\n            'FUNDING': 'fee',\n            'REALIZED_PNL': 'trade',\n            'INSURANCE_FUND': 'insurance',\n            'SOCIALIZED_LOSS': 'trade',\n            'LIQUIDATION_FEE': 'fee',\n            'SESSION_RESET': 'reset',\n            'ADJUSTMENT': 'adjustment',\n            'SESSION_SETTLE': 'settlement',\n            'UNCOVERED_LOSS': 'trade',\n            'ADMIN_ADJUSTMENT': 'adjustment',\n            'DELIST': 'delist',\n            'SETTLEMENT_FEE': 'fee',\n            'AUTO_CONVERSION': 'conversion',\n            'MANUAL_CONVERSION': 'conversion',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2352,
        "line_end": 2371,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"o\": \"26949.89\",\n         \"h\": \"26957.64\",\n         \"l\": \"26948.24\",\n         \"c\": \"26950.00\",\n         \"v\": \"0.0670\",\n         \"t\": 1687237080000\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"o\": \"26949.89\",\n        //         \"h\": \"26957.64\",\n        //         \"l\": \"26948.24\",\n        //         \"c\": \"26950.00\",\n        //         \"v\": \"0.0670\",\n        //         \"t\": 1687237080000\n        //     }\n        //\n        return [\n            this.safeInteger (ohlcv, 't'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber (ohlcv, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2393,
        "line_end": 2490,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'order_id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_oid')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "created",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (created)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'update_time')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (order, 'order_type')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'time_in_force'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'limit_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (order, 'quantity')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeNumber (order, 'cumulative_quantity')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber (order, 'avg_price')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'cumulative_value')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': this.safeCurrencyCode (feeCurrency),\n                'cost': this.safeNumber (order, 'cumulative_fee'),\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "[]",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrency)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'cumulative_fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"6540219377766741832\",\n         \"client_oid\": \"CCXT_d6ef7c3db6c1495aa8b757\"\n     }",
          "{\n         \"account_id\": \"ce075bef-1234-4321-bd6g-ff9007252e63\",\n         \"order_id\": \"6530219477767564494\",\n         \"client_oid\": \"CCXT_7ce730f0388441df9bc218\",\n         \"order_type\": \"LIMIT\",\n         \"time_in_force\": \"GOOD_TILL_CANCEL\",\n         \"side\": \"BUY\",\n         \"exec_inst\": [ ],\n         \"quantity\": \"0.00020\",\n         \"limit_price\": \"20000.00\",\n         \"order_value\": \"4\",\n         \"avg_price\": \"0\",\n         \"trigger_price\": \"0\",\n         \"ref_price\": \"0\",\n         \"cumulative_quantity\": \"0\",\n         \"cumulative_value\": \"0\",\n         \"cumulative_fee\": \"0\",\n         \"status\": \"ACTIVE\",\n         \"update_user_id\": \"ce075bef-1234-4321-bd6g-gg9007252e63\",\n         \"order_date\": \"2023-06-15\",\n         \"instrument_name\": \"BTC_USD\",\n         \"fee_instrument_name\": \"BTC\",\n         \"create_time\": 1686806053992,\n         \"create_time_ns\": \"1686806053992921880\",\n         \"update_time\": 1686806053993\n     }",
          "{\n             \"code\" : 306,\n             \"index\" : 1,\n             \"client_oid\" : \"1698068111133_1\",\n             \"message\" : \"INSUFFICIENT_AVAILABLE_BALANCE\",\n             \"order_id\" : \"6142909896519488207\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, cancelOrder\n        //\n        //     {\n        //         \"order_id\": \"6540219377766741832\",\n        //         \"client_oid\": \"CCXT_d6ef7c3db6c1495aa8b757\"\n        //     }\n        //\n        // fetchOpenOrders, fetchOrder, fetchOrders\n        //\n        //     {\n        //         \"account_id\": \"ce075bef-1234-4321-bd6g-ff9007252e63\",\n        //         \"order_id\": \"6530219477767564494\",\n        //         \"client_oid\": \"CCXT_7ce730f0388441df9bc218\",\n        //         \"order_type\": \"LIMIT\",\n        //         \"time_in_force\": \"GOOD_TILL_CANCEL\",\n        //         \"side\": \"BUY\",\n        //         \"exec_inst\": [ ],\n        //         \"quantity\": \"0.00020\",\n        //         \"limit_price\": \"20000.00\",\n        //         \"order_value\": \"4\",\n        //         \"avg_price\": \"0\",\n        //         \"trigger_price\": \"0\",\n        //         \"ref_price\": \"0\",\n        //         \"cumulative_quantity\": \"0\",\n        //         \"cumulative_value\": \"0\",\n        //         \"cumulative_fee\": \"0\",\n        //         \"status\": \"ACTIVE\",\n        //         \"update_user_id\": \"ce075bef-1234-4321-bd6g-gg9007252e63\",\n        //         \"order_date\": \"2023-06-15\",\n        //         \"instrument_name\": \"BTC_USD\",\n        //         \"fee_instrument_name\": \"BTC\",\n        //         \"create_time\": 1686806053992,\n        //         \"create_time_ns\": \"1686806053992921880\",\n        //         \"update_time\": 1686806053993\n        //     }\n        //\n        // createOrders\n        //     {\n        //             \"code\" : 306,\n        //             \"index\" : 1,\n        //             \"client_oid\" : \"1698068111133_1\",\n        //             \"message\" : \"INSUFFICIENT_AVAILABLE_BALANCE\",\n        //             \"order_id\" : \"6142909896519488207\"\n        //     }\n        //\n        const code = this.safeInteger (order, 'code');\n        if ((code !== undefined) && (code !== 0)) {\n            return this.safeOrder ({\n                'id': this.safeString (order, 'order_id'),\n                'clientOrderId': this.safeString (order, 'client_oid'),\n                'info': order,\n                'status': 'rejected',\n            });\n        }\n        const created = this.safeInteger (order, 'create_time');\n        const marketId = this.safeString (order, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        const execInst = this.safeValue (order, 'exec_inst');\n        let postOnly = undefined;\n        if (execInst !== undefined) {\n            postOnly = false;\n            for (let i = 0; i < execInst.length; i++) {\n                const inst = execInst[i];\n                if (inst === 'POST_ONLY') {\n                    postOnly = true;\n                    break;\n                }\n            }\n        }\n        const feeCurrency = this.safeString (order, 'fee_instrument_name');\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'order_id'),\n            'clientOrderId': this.safeString (order, 'client_oid'),\n            'timestamp': created,\n            'datetime': this.iso8601 (created),\n            'lastTradeTimestamp': this.safeInteger (order, 'update_time'),\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'symbol': symbol,\n            'type': this.safeStringLower (order, 'order_type'),\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'time_in_force')),\n            'postOnly': postOnly,\n            'side': this.safeStringLower (order, 'side'),\n            'price': this.safeNumber (order, 'limit_price'),\n            'amount': this.safeNumber (order, 'quantity'),\n            'filled': this.safeNumber (order, 'cumulative_quantity'),\n            'remaining': undefined,\n            'average': this.safeNumber (order, 'avg_price'),\n            'cost': this.safeNumber (order, 'cumulative_value'),\n            'fee': {\n                'currency': this.safeCurrencyCode (feeCurrency),\n                'cost': this.safeNumber (order, 'cumulative_fee'),\n            },\n            'trades': [],\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2373,
        "line_end": 2382,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'ACTIVE': 'open',\n            'CANCELED': 'canceled',\n            'FILLED': 'closed',\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3276,
        "line_end": 3322,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "Precise.stringGt (amount, '0') ? 'buy' : 'sell'",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "Precise.stringAbs (amount)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "market['contractSize']",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'open_pos_cost')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'cost')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'open_position_pnl')",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"account_id\": \"ce075bef-b600-4277-bd6e-ff9007251e63\",\n         \"quantity\": \"0.0001\",\n         \"cost\": \"3.02392\",\n         \"open_pos_cost\": \"3.02392\",\n         \"open_position_pnl\": \"-0.0010281328\",\n         \"session_pnl\": \"-0.0010281328\",\n         \"update_timestamp_ms\": 1688015919091,\n         \"instrument_name\": \"BTCUSD-PERP\",\n         \"type\": \"PERPETUAL_SWAP\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"account_id\": \"ce075bef-b600-4277-bd6e-ff9007251e63\",\n        //         \"quantity\": \"0.0001\",\n        //         \"cost\": \"3.02392\",\n        //         \"open_pos_cost\": \"3.02392\",\n        //         \"open_position_pnl\": \"-0.0010281328\",\n        //         \"session_pnl\": \"-0.0010281328\",\n        //         \"update_timestamp_ms\": 1688015919091,\n        //         \"instrument_name\": \"BTCUSD-PERP\",\n        //         \"type\": \"PERPETUAL_SWAP\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'instrument_name');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const timestamp = this.safeInteger (position, 'update_timestamp_ms');\n        const amount = this.safeString (position, 'quantity');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'side': Precise.stringGt (amount, '0') ? 'buy' : 'sell',\n            'contracts': Precise.stringAbs (amount),\n            'contractSize': market['contractSize'],\n            'entryPrice': undefined,\n            'markPrice': undefined,\n            'notional': undefined,\n            'leverage': undefined,\n            'collateral': this.safeNumber (position, 'open_pos_cost'),\n            'initialMargin': this.safeNumber (position, 'cost'),\n            'maintenanceMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'unrealizedPnl': this.safeNumber (position, 'open_position_pnl'),\n            'liquidationPrice': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 2977,
        "line_end": 2995,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'v')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"i\": \"BTCUSD-230526\",\n         \"x\": 1685088000000,\n         \"v\": \"26464.1\",\n         \"t\": 1685087999500\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        //     {\n        //         \"i\": \"BTCUSD-230526\",\n        //         \"x\": 1685088000000,\n        //         \"v\": \"26464.1\",\n        //         \"t\": 1685087999500\n        //     }\n        //\n        const timestamp = this.safeInteger (settlement, 'x');\n        const marketId = this.safeString (settlement, 'i');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'v'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 2997,
        "line_end": 3013,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"i\": \"BTCUSD-230526\",\n             \"x\": 1685088000000,\n             \"v\": \"26464.1\",\n             \"t\": 1685087999500\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        //     [\n        //         {\n        //             \"i\": \"BTCUSD-230526\",\n        //             \"x\": 1685088000000,\n        //             \"v\": \"26464.1\",\n        //             \"t\": 1685087999500\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2230,
        "line_end": 2290,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (ticker, 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (ticker, 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'b')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'k')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'c')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'v')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "(quote === 'USD') ? this.safeString (ticker, 'vv') : undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"i\": \"BTC_USD\",\n         \"h\": \"30821.45\",\n         \"l\": \"28685.11\",\n         \"a\": \"30446.00\",\n         \"v\": \"1767.8734\",\n         \"vv\": \"52436726.42\",\n         \"c\": \"0.0583\",\n         \"b\": \"30442.00\",\n         \"k\": \"30447.66\",\n         \"t\": 1687403045415\n     }",
          "{\n         \"i\": \"AVAXUSD-PERP\",\n         \"h\": \"13.209\",\n         \"l\": \"12.148\",\n         \"a\": \"13.209\",\n         \"v\": \"1109.8\",\n         \"vv\": \"14017.33\",\n         \"c\": \"0.0732\",\n         \"b\": \"13.210\",\n         \"k\": \"13.230\",\n         \"oi\": \"10888.9\",\n         \"t\": 1687402657575\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"i\": \"BTC_USD\",\n        //         \"h\": \"30821.45\",\n        //         \"l\": \"28685.11\",\n        //         \"a\": \"30446.00\",\n        //         \"v\": \"1767.8734\",\n        //         \"vv\": \"52436726.42\",\n        //         \"c\": \"0.0583\",\n        //         \"b\": \"30442.00\",\n        //         \"k\": \"30447.66\",\n        //         \"t\": 1687403045415\n        //     }\n        //\n        // fetchTickers\n        //\n        //     {\n        //         \"i\": \"AVAXUSD-PERP\",\n        //         \"h\": \"13.209\",\n        //         \"l\": \"12.148\",\n        //         \"a\": \"13.209\",\n        //         \"v\": \"1109.8\",\n        //         \"vv\": \"14017.33\",\n        //         \"c\": \"0.0732\",\n        //         \"b\": \"13.210\",\n        //         \"k\": \"13.230\",\n        //         \"oi\": \"10888.9\",\n        //         \"t\": 1687402657575\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 't');\n        const marketId = this.safeString (ticker, 'i');\n        market = this.safeMarket (marketId, market, '_');\n        const quote = this.safeString (market, 'quote');\n        const last = this.safeString (ticker, 'a');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeNumber (ticker, 'h'),\n            'low': this.safeNumber (ticker, 'l'),\n            'bid': this.safeNumber (ticker, 'b'),\n            'bidVolume': undefined,\n            'ask': this.safeNumber (ticker, 'k'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (ticker, 'c'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'v'),\n            'quoteVolume': (quote === 'USD') ? this.safeString (ticker, 'vv') : undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 2384,
        "line_end": 2391,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GOOD_TILL_CANCEL': 'GTC',\n            'IMMEDIATE_OR_CANCEL': 'IOC',\n            'FILL_OR_KILL': 'FOK',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2292,
        "line_end": 2350,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'd', 'trade_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower2 (trade, 's', 'side')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeStringLower (trade, 'taker_side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (trade, 'p', 'traded_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber2 (trade, 'q', 'traded_quantity')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': this.safeCurrencyCode (feeCurrency),\n                'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrency)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (Precise.stringNeg (feeCostString))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"s\": \"sell\",\n         \"p\": \"26386.00\",\n         \"q\": \"0.00453\",\n         \"tn\": 1686944282062,\n         \"tn\": 1704476468851524373,\n         \"d\": \"4611686018455979970\",\n         \"i\": \"BTC_USD\"\n     }",
          "{\n         \"account_id\": \"ds075abc-1234-4321-bd6g-ff9007252r63\",\n         \"event_date\": \"2023-06-16\",\n         \"journal_type\": \"TRADING\",\n         \"side\": \"BUY\",\n         \"instrument_name\": \"BTC_USD\",\n         \"fees\": \"-0.0000000525\",\n         \"trade_id\": \"6142909898247428343\",\n         \"trade_match_id\": \"4611686018455978480\",\n         \"create_time\": 1686941992887,\n         \"traded_price\": \"26347.16\",\n         \"traded_quantity\": \"0.00021\",\n         \"fee_instrument_name\": \"BTC\",\n         \"client_oid\": \"d1c70a60-1234-4c92-b2a0-72b931cb31e0\",\n         \"taker_side\": \"TAKER\",\n         \"order_id\": \"6142909895036331486\",\n         \"create_time_ns\": \"1686941992887207066\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"s\": \"sell\",\n        //         \"p\": \"26386.00\",\n        //         \"q\": \"0.00453\",\n        //         \"tn\": 1686944282062,\n        //         \"tn\": 1704476468851524373,\n        //         \"d\": \"4611686018455979970\",\n        //         \"i\": \"BTC_USD\"\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"account_id\": \"ds075abc-1234-4321-bd6g-ff9007252r63\",\n        //         \"event_date\": \"2023-06-16\",\n        //         \"journal_type\": \"TRADING\",\n        //         \"side\": \"BUY\",\n        //         \"instrument_name\": \"BTC_USD\",\n        //         \"fees\": \"-0.0000000525\",\n        //         \"trade_id\": \"6142909898247428343\",\n        //         \"trade_match_id\": \"4611686018455978480\",\n        //         \"create_time\": 1686941992887,\n        //         \"traded_price\": \"26347.16\",\n        //         \"traded_quantity\": \"0.00021\",\n        //         \"fee_instrument_name\": \"BTC\",\n        //         \"client_oid\": \"d1c70a60-1234-4c92-b2a0-72b931cb31e0\",\n        //         \"taker_side\": \"TAKER\",\n        //         \"order_id\": \"6142909895036331486\",\n        //         \"create_time_ns\": \"1686941992887207066\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 't', 'create_time');\n        const marketId = this.safeString2 (trade, 'i', 'instrument_name');\n        market = this.safeMarket (marketId, market, '_');\n        const feeCurrency = this.safeString (trade, 'fee_instrument_name');\n        const feeCostString = this.safeString (trade, 'fees');\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'd', 'trade_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': this.safeString (trade, 'order_id'),\n            'side': this.safeStringLower2 (trade, 's', 'side'),\n            'takerOrMaker': this.safeStringLower (trade, 'taker_side'),\n            'price': this.safeNumber2 (trade, 'p', 'traded_price'),\n            'amount': this.safeNumber2 (trade, 'q', 'traded_quantity'),\n            'cost': undefined,\n            'type': undefined,\n            'fee': {\n                'currency': this.safeCurrencyCode (feeCurrency),\n                'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n            },\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 3503,
        "line_end": 3521,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_maker_rate_bps'), '10000'))",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_taker_rate_bps'), '10000'))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"instrument_name\": \"BTC_USD\",\n      \"effective_maker_rate_bps\": \"6.5\",\n      \"effective_taker_rate_bps\": \"6.9\"\n }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        // {\n        //      \"instrument_name\": \"BTC_USD\",\n        //      \"effective_maker_rate_bps\": \"6.5\",\n        //      \"effective_taker_rate_bps\": \"6.9\"\n        // }\n        //\n        const marketId = this.safeString (fee, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_maker_rate_bps'), '10000')),\n            'taker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_taker_rate_bps'), '10000')),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTradingFees",
        "signature": "parseTradingFees (response)",
        "line_start": 3471,
        "line_end": 3501,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (response, makerFeeKey), '10000'))",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (response, takerFeeKey), '10000'))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"spot_tier\": \"3\",\n         \"deriv_tier\": \"3\",\n         \"effective_spot_maker_rate_bps\": \"6.5\",\n         \"effective_spot_taker_rate_bps\": \"6.9\",\n         \"effective_deriv_maker_rate_bps\": \"1.1\",\n         \"effective_deriv_taker_rate_bps\": \"3\"\n  }"
        ],
        "source": "parseTradingFees (response) {\n        //\n        // {\n        //         \"spot_tier\": \"3\",\n        //         \"deriv_tier\": \"3\",\n        //         \"effective_spot_maker_rate_bps\": \"6.5\",\n        //         \"effective_spot_taker_rate_bps\": \"6.9\",\n        //         \"effective_deriv_maker_rate_bps\": \"1.1\",\n        //         \"effective_deriv_taker_rate_bps\": \"3\"\n        //  }\n        //\n        const result: Dict = {};\n        result['info'] = response;\n        for (let i = 0; i < this.symbols.length; i++) {\n            const symbol = this.symbols[i];\n            const market = this.market (symbol);\n            const isSwap = market['swap'];\n            const takerFeeKey = isSwap ? 'effective_deriv_taker_rate_bps' : 'effective_spot_taker_rate_bps';\n            const makerFeeKey = isSwap ? 'effective_deriv_maker_rate_bps' : 'effective_spot_maker_rate_bps';\n            const tradingFee = {\n                'info': response,\n                'symbol': symbol,\n                'maker': this.parseNumber (Precise.stringDiv (this.safeString (response, makerFeeKey), '10000')),\n                'taker': this.parseNumber (Precise.stringDiv (this.safeString (response, takerFeeKey), '10000')),\n                'percentage': undefined,\n                'tierBased': undefined,\n            };\n            result[symbol] = tradingFee;\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2515,
        "line_end": 2601,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'update_time')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'client_wid')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"BTC\",\n         \"fee\": 0,\n         \"create_time\": 1688023659000,\n         \"id\": \"6201135\",\n         \"update_time\": 1688178509000,\n         \"amount\": 0.00114571,\n         \"address\": \"1234fggxTSmJ3H4jaMQuWyEiLBzZdAbK6d\",\n         \"status\": \"1\",\n         \"txid\": \"f0ae4202b76eb999c301eccdde44dc639bee42d1fdd5974105286ca3393f6065/2\"\n     }",
          "{\n         \"currency\": \"BTC\",\n         \"client_wid\": \"\",\n         \"fee\": 0.0005,\n         \"create_time\": 1688613850000,\n         \"id\": \"5775977\",\n         \"update_time\": 1688613850000,\n         \"amount\": 0.0005,\n         \"address\": \"1234NMEWbiF8ZkwUMxmfzMxi2A1MQ44bMn\",\n         \"status\": \"1\",\n         \"txid\": \"\",\n         \"network_id\": \"BTC\"\n     }",
          "{\n         \"id\": 2220,\n         \"amount\": 1,\n         \"fee\": 0.0004,\n         \"symbol\": \"BTC\",\n         \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBf\",\n         \"client_wid\": \"my_withdrawal_002\",\n         \"create_time\":1607063412000\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"currency\": \"BTC\",\n        //         \"fee\": 0,\n        //         \"create_time\": 1688023659000,\n        //         \"id\": \"6201135\",\n        //         \"update_time\": 1688178509000,\n        //         \"amount\": 0.00114571,\n        //         \"address\": \"1234fggxTSmJ3H4jaMQuWyEiLBzZdAbK6d\",\n        //         \"status\": \"1\",\n        //         \"txid\": \"f0ae4202b76eb999c301eccdde44dc639bee42d1fdd5974105286ca3393f6065/2\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"currency\": \"BTC\",\n        //         \"client_wid\": \"\",\n        //         \"fee\": 0.0005,\n        //         \"create_time\": 1688613850000,\n        //         \"id\": \"5775977\",\n        //         \"update_time\": 1688613850000,\n        //         \"amount\": 0.0005,\n        //         \"address\": \"1234NMEWbiF8ZkwUMxmfzMxi2A1MQ44bMn\",\n        //         \"status\": \"1\",\n        //         \"txid\": \"\",\n        //         \"network_id\": \"BTC\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": 2220,\n        //         \"amount\": 1,\n        //         \"fee\": 0.0004,\n        //         \"symbol\": \"BTC\",\n        //         \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBf\",\n        //         \"client_wid\": \"my_withdrawal_002\",\n        //         \"create_time\":1607063412000\n        //     }\n        //\n        let type = undefined;\n        const rawStatus = this.safeString (transaction, 'status');\n        let status = undefined;\n        if ('client_wid' in transaction) {\n            type = 'withdrawal';\n            status = this.parseWithdrawalStatus (rawStatus);\n        } else {\n            type = 'deposit';\n            status = this.parseDepositStatus (rawStatus);\n        }\n        const addressString = this.safeString (transaction, 'address');\n        const [ address, tag ] = this.parseAddress (addressString);\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger (transaction, 'create_time');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'txid'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': status,\n            'updated': this.safeInteger (transaction, 'update_time'),\n            'internal': undefined,\n            'comment': this.safeString (transaction, 'client_wid'),\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseWithdrawalStatus",
        "signature": "parseWithdrawalStatus (status)",
        "line_start": 2502,
        "line_end": 2513,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseWithdrawalStatus (status) {\n        const statuses: Dict = {\n            '0': 'pending',\n            '1': 'pending',\n            '2': 'failed',\n            '3': 'pending',\n            '4': 'failed',\n            '5': 'ok',\n            '6': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "cryptomus": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (balance): Balances",
        "line_start": 660,
        "line_end": 681,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"ticker\": \"AVAX\",\n         \"available\": \"0.00000000\",\n         \"held\": \"0.00000000\"\n     }"
        ],
        "source": "parseBalance (balance): Balances {\n        //\n        //     {\n        //         \"ticker\": \"AVAX\",\n        //         \"available\": \"0.00000000\",\n        //         \"held\": \"0.00000000\"\n        //     }\n        //\n        const result: Dict = {\n            'info': balance,\n        };\n        for (let i = 0; i < balance.length; i++) {\n            const balanceEntry = balance[i];\n            const currencyId = this.safeString (balanceEntry, 'ticker');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balanceEntry, 'available');\n            account['used'] = this.safeString (balanceEntry, 'held');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFeeTiers",
        "signature": "parseFeeTiers (feeTiers, market: Market = undefined)",
        "line_start": 1108,
        "line_end": 1125,
        "comment": null,
        "mappings": [
          {
            "key": "maker",
            "value": "makerFees",
            "comment": null
          },
          {
            "key": "taker",
            "value": "takerFees",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFeeTiers (feeTiers, market: Market = undefined) {\n        const takerFees = [];\n        const makerFees = [];\n        for (let i = 0; i < feeTiers.length; i++) {\n            const tier = feeTiers[i];\n            const turnover = this.safeNumber (tier, 'from_turnover');\n            let taker = this.safeString (tier, 'taker_percent');\n            let maker = this.safeString (tier, 'maker_percent');\n            maker = Precise.stringDiv (maker, '100');\n            taker = Precise.stringDiv (taker, '100');\n            makerFees.push ([ turnover, this.parseNumber (maker) ]);\n            takerFees.push ([ turnover, this.parseNumber (taker) ]);\n        }\n        return {\n            'maker': makerFees,\n            'taker': takerFees,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 303,
        "line_end": 380,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "subType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeBool (fees, 'percentage')",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "feeSide",
            "value": "this.safeString (fees, 'feeSide')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrec'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrec'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (market, 'quoteMinSize'),\n                    'max': this.safeNumber (market, 'quoteMaxSize'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'baseMinSize'),\n                    'max': this.safeNumber (market, 'baseMaxSize'),\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrec')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrec')))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'quoteMinSize'),\n                    'max': this.safeNumber (market, 'quoteMaxSize'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'baseMinSize'),\n                    'max': this.safeNumber (market, 'baseMaxSize'),\n                }",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'baseMinSize')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'baseMaxSize')",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"01JHN5EFT64YC4HR9KCGM5M65D\",\n         \"symbol\": \"POL_USDT\",\n         \"baseCurrency\": \"POL\",\n         \"quoteCurrency\": \"USDT\",\n         \"baseMinSize\": \"1.00000000\",\n         \"quoteMinSize\": \"5.00000000\",\n         \"baseMaxSize\": \"50000.00000000\",\n         \"quoteMaxSize\": \"10000000000.00000000\",\n         \"basePrec\": \"1\",\n         \"quotePrec\": \"4\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"id\": \"01JHN5EFT64YC4HR9KCGM5M65D\",\n        //         \"symbol\": \"POL_USDT\",\n        //         \"baseCurrency\": \"POL\",\n        //         \"quoteCurrency\": \"USDT\",\n        //         \"baseMinSize\": \"1.00000000\",\n        //         \"quoteMinSize\": \"5.00000000\",\n        //         \"baseMaxSize\": \"50000.00000000\",\n        //         \"quoteMaxSize\": \"10000000000.00000000\",\n        //         \"basePrec\": \"1\",\n        //         \"quotePrec\": \"4\"\n        //     }\n        //\n        const marketId = this.safeString (market, 'symbol');\n        const parts = marketId.split ('_');\n        const baseId = parts[0];\n        const quoteId = parts[1];\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const fees = this.safeDict (this.fees, 'trading');\n        return this.safeMarketStructure ({\n            'id': marketId,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'active': true,\n            'type': 'spot',\n            'subType': undefined,\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'contract': false,\n            'settle': undefined,\n            'settleId': undefined,\n            'contractSize': undefined,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'percentage': this.safeBool (fees, 'percentage'),\n            'tierBased': undefined,\n            'feeSide': this.safeString (fees, 'feeSide'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrec'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrec'))),\n            },\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (market, 'quoteMinSize'),\n                    'max': this.safeNumber (market, 'quoteMaxSize'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'baseMinSize'),\n                    'max': this.safeNumber (market, 'baseMaxSize'),\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 904,
        "line_end": 1012,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "stopPrice",
            "value": "this.safeString (order, 'stopLossPrice')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stopLossPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "averageFilledPrice",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'filledQuantity')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"01JEXAFCCC5ZVJPZAAHHDKQBNG\"\n     }",
          "{\n         \"id\": \"01JEXAPY04JDFBVFC2D23BCKMK\",\n         \"type\": \"market\",\n         \"direction\": \"sell\",\n         \"symbol\": \"TRX_USDT\",\n         \"quantity\": \"67.5400000000000000\",\n         \"filledQuantity\": \"67.5400000000000000\",\n         \"filledValue\": \"20.0053480000000000\",\n         \"state\": \"completed\",\n         \"internalState\": \"filled\",\n         \"createdAt\": \"2024-12-12 11:40:19\",\n         \"finishedAt\": \"2024-12-12 11:40:21\",\n         \"deal\": {\n             \"id\": \"01JEXAPZ9C9TWENPFZJASZ1YD2\",\n             \"state\": \"completed\",\n             \"createdAt\": \"2024-12-12 11:40:21\",\n             \"completedAt\": \"2024-12-12 11:40:21\",\n             \"averageFilledPrice\": \"0.2962000000000000\",\n             \"transactions\": [\n                 {\n                     \"id\": \"01JEXAPZ9C9TWENPFZJASZ1YD3\",\n                     \"tradeRole\": \"taker\",\n                     \"filledPrice\": \"0.2962000000000000\",\n                     \"filledQuantity\": \"67.5400000000000000\",\n                     \"filledValue\": \"20.0053480000000000\",\n                     \"fee\": \"0.0000000000000000\",\n                     \"feeCurrency\": \"USDT\",\n                     \"committedAt\": \"2024-12-12 11:40:21\"\n                 }\n             ]\n         }\n     },",
          "{\n         \"id\": \"01JFFG72CBRDP68K179KC9DSTG\",\n         \"direction\": \"sell\",\n         \"symbol\": \"BTC_USDT\",\n         \"price\": \"102.0130000000000000\",\n         \"quantity\": \"0.0005000000000000\",\n         \"value\": \"0.0510065000000000\",\n         \"filledQuantity\": \"0.0000000000000000\",\n         \"filledValue\": \"0.0000000000000000\",\n         \"createdAt\": \"2024-12-19 09:02:51\",\n         \"clientOrderId\": \"987654321\",\n         \"stopLossPrice\": \"101.12\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //     {\n        //         \"order_id\": \"01JEXAFCCC5ZVJPZAAHHDKQBNG\"\n        //     }\n        //\n        // fetchOrders\n        //     {\n        //         \"id\": \"01JEXAPY04JDFBVFC2D23BCKMK\",\n        //         \"type\": \"market\",\n        //         \"direction\": \"sell\",\n        //         \"symbol\": \"TRX_USDT\",\n        //         \"quantity\": \"67.5400000000000000\",\n        //         \"filledQuantity\": \"67.5400000000000000\",\n        //         \"filledValue\": \"20.0053480000000000\",\n        //         \"state\": \"completed\",\n        //         \"internalState\": \"filled\",\n        //         \"createdAt\": \"2024-12-12 11:40:19\",\n        //         \"finishedAt\": \"2024-12-12 11:40:21\",\n        //         \"deal\": {\n        //             \"id\": \"01JEXAPZ9C9TWENPFZJASZ1YD2\",\n        //             \"state\": \"completed\",\n        //             \"createdAt\": \"2024-12-12 11:40:21\",\n        //             \"completedAt\": \"2024-12-12 11:40:21\",\n        //             \"averageFilledPrice\": \"0.2962000000000000\",\n        //             \"transactions\": [\n        //                 {\n        //                     \"id\": \"01JEXAPZ9C9TWENPFZJASZ1YD3\",\n        //                     \"tradeRole\": \"taker\",\n        //                     \"filledPrice\": \"0.2962000000000000\",\n        //                     \"filledQuantity\": \"67.5400000000000000\",\n        //                     \"filledValue\": \"20.0053480000000000\",\n        //                     \"fee\": \"0.0000000000000000\",\n        //                     \"feeCurrency\": \"USDT\",\n        //                     \"committedAt\": \"2024-12-12 11:40:21\"\n        //                 }\n        //             ]\n        //         }\n        //     },\n        //     ...\n        //\n        // fetchOpenOrders\n        //     {\n        //         \"id\": \"01JFFG72CBRDP68K179KC9DSTG\",\n        //         \"direction\": \"sell\",\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"price\": \"102.0130000000000000\",\n        //         \"quantity\": \"0.0005000000000000\",\n        //         \"value\": \"0.0510065000000000\",\n        //         \"filledQuantity\": \"0.0000000000000000\",\n        //         \"filledValue\": \"0.0000000000000000\",\n        //         \"createdAt\": \"2024-12-19 09:02:51\",\n        //         \"clientOrderId\": \"987654321\",\n        //         \"stopLossPrice\": \"101.12\"\n        //     }\n        //\n        const id = this.safeString2 (order, 'order_id', 'id');\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const dateTime = this.safeString (order, 'createdAt');\n        const timestamp = this.parse8601 (dateTime);\n        const deal = this.safeDict (order, 'deal', {});\n        const averageFilledPrice = this.safeNumber (deal, 'averageFilledPrice');\n        const type = this.safeString (order, 'type');\n        const side = this.safeString (order, 'direction');\n        let price = this.safeNumber (order, 'price');\n        const transaction = this.safeList (deal, 'transactions', []);\n        let fee = undefined;\n        const firstTx = this.safeDict (transaction, 0);\n        const feeCurrency = this.safeString (firstTx, 'feeCurrency');\n        if (feeCurrency !== undefined) {\n            fee = {\n                'currency': this.safeCurrencyCode (feeCurrency),\n                'cost': this.safeNumber (firstTx, 'fee'),\n            };\n        }\n        if (price === undefined) {\n            price = this.safeNumber (firstTx, 'filledPrice');\n        }\n        const amount = this.safeNumber (order, 'quantity');\n        const cost = this.safeNumber (order, 'value');\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'stopPrice': this.safeString (order, 'stopLossPrice'),\n            'triggerPrice': this.safeString (order, 'stopLossPrice'),\n            'amount': amount,\n            'cost': cost,\n            'average': averageFilledPrice,\n            'filled': this.safeString (order, 'filledQuantity'),\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str = undefined): Str",
        "line_start": 1014,
        "line_end": 1024,
        "comment": null,
        "mappings": [
          {
            "key": "active",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "completed",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "partially_completed",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "cancelled",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "expired",
            "value": "'expired'",
            "comment": null
          },
          {
            "key": "failed",
            "value": "'failed'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status: Str = undefined): Str {\n        const statuses = {\n            'active': 'open',\n            'completed': 'closed',\n            'partially_completed': 'open',\n            'cancelled': 'canceled',\n            'expired': 'expired',\n            'failed': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker, market: Market = undefined): Ticker",
        "line_start": 483,
        "line_end": 518,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'base_volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quote_volume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency_pair\": \"XMR_USDT\",\n         \"last_price\": \"158.04829772\",\n         \"base_volume\": \"0.35185785\",\n         \"quote_volume\": \"55.523761128544\"\n     }"
        ],
        "source": "parseTicker (ticker, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"currency_pair\": \"XMR_USDT\",\n        //         \"last_price\": \"158.04829772\",\n        //         \"base_volume\": \"0.35185785\",\n        //         \"quote_volume\": \"55.523761128544\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'currency_pair');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'last_price');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': undefined,\n            'low': undefined,\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'base_volume'),\n            'quoteVolume': this.safeString (ticker, 'quote_volume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 601,
        "line_end": 631,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (trade, 'trade_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (trade, 'type')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'quote_volume')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': undefined,\n                'cost': undefined,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"trade_id\": \"01J017Q6B3JGHZRP9D2NZHVKFX\",\n         \"price\": \"59498.63487492\",\n         \"base_volume\": \"94.00784310\",\n         \"quote_volume\": \"0.00158000\",\n         \"timestamp\": 1718028573,\n         \"type\": \"sell\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        //     {\n        //         \"trade_id\": \"01J017Q6B3JGHZRP9D2NZHVKFX\",\n        //         \"price\": \"59498.63487492\",\n        //         \"base_volume\": \"94.00784310\",\n        //         \"quote_volume\": \"0.00158000\",\n        //         \"timestamp\": 1718028573,\n        //         \"type\": \"sell\"\n        //     }\n        //\n        const timestamp = this.safeTimestamp (trade, 'timestamp');\n        return this.safeTrade ({\n            'id': this.safeString (trade, 'trade_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'side': this.safeString (trade, 'type'),\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString (trade, 'quote_volume'), // quote_volume is amount\n            'cost': this.safeString (trade, 'base_volume'), // base_volume is cost\n            'takerOrMaker': undefined,\n            'type': undefined,\n            'order': undefined,\n            'fee': {\n                'currency': undefined,\n                'cost': undefined,\n            },\n            'info': trade,\n        }, market);\n    }"
      }
    ],
    "deepcoin": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 939,
        "line_end": 971,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"code\": \"0\",\n         \"msg\": \"\",\n         \"data\": [\n             {\n                 \"ccy\": \"USDT\",\n                 \"bal\": \"74\",\n                 \"frozenBal\": \"0\",\n                 \"availBal\": \"74\"\n             }\n         ]\n     }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        //     {\n        //         \"code\": \"0\",\n        //         \"msg\": \"\",\n        //         \"data\": [\n        //             {\n        //                 \"ccy\": \"USDT\",\n        //                 \"bal\": \"74\",\n        //                 \"frozenBal\": \"0\",\n        //                 \"availBal\": \"74\"\n        //             }\n        //         ]\n        //     }\n        //\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const balances = this.safeList (response, 'data', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const symbol = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (symbol);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'bal');\n            account['used'] = this.safeString (balance, 'frozenBal');\n            account['free'] = this.safeString (balance, 'availBal');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress",
        "line_start": 1212,
        "line_end": 1241,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (chain)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (response, 'memo')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"chain\": \"TRC20\",\n         \"state\": 1,\n         \"remind\": \"Only support deposits and withdrawals via TRC20 network. If you send it via other address by mistake, it will not be credited and will result in the permanent loss of your deposit.\",\n         \"inNotice\": \"\",\n         \"actLogo\": \"\",\n         \"address\": \"TNJYDW9Bk87VwfA6s7FtxURLEMHesQbYgF\",\n         \"hasMemo\": false,\n         \"memo\": \"\",\n         \"estimatedTime\": 1,\n         \"fastConfig\": {\n             \"fastLimitNum\": 0,\n             \"fastBlock\": 10,\n             \"realBlock\": 1\n         }\n     }"
        ],
        "source": "parseDepositAddress (response, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"chain\": \"TRC20\",\n        //         \"state\": 1,\n        //         \"remind\": \"Only support deposits and withdrawals via TRC20 network. If you send it via other address by mistake, it will not be credited and will result in the permanent loss of your deposit.\",\n        //         \"inNotice\": \"\",\n        //         \"actLogo\": \"\",\n        //         \"address\": \"TNJYDW9Bk87VwfA6s7FtxURLEMHesQbYgF\",\n        //         \"hasMemo\": false,\n        //         \"memo\": \"\",\n        //         \"estimatedTime\": 1,\n        //         \"fastConfig\": {\n        //             \"fastLimitNum\": 0,\n        //             \"fastBlock\": 10,\n        //             \"realBlock\": 1\n        //         }\n        //     }\n        //\n        const chain = this.safeString (response, 'chain');\n        const address = this.safeString (response, 'address');\n        this.checkAddress (address);\n        return {\n            'info': response,\n            'currency': undefined,\n            'network': this.networkIdToCode (chain),\n            'address': address,\n            'tag': this.safeString (response, 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 2754,
        "line_end": 2783,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrumentId\": \"ETHUSDT\",\n         \"fundingRate\": 0.0000402356250176\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"instrumentId\": \"ETHUSDT\",\n        //         \"fundingRate\": 0.0000402356250176\n        //     }\n        //\n        const marketId = this.safeString2 (contract, 'instrumentId', 'instrumentID');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (info, market: Market = undefined)",
        "line_start": 2837,
        "line_end": 2856,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (info, 'rate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrumentID\": \"ETHUSD\",\n         \"rate\": \"0.00047949\",\n         \"CreateTime\": 1760832000,\n         \"ratePeriodSec\": 0\n     }"
        ],
        "source": "parseFundingRateHistory (info, market: Market = undefined) {\n        //\n        //     {\n        //         \"instrumentID\": \"ETHUSD\",\n        //         \"rate\": \"0.00047949\",\n        //         \"CreateTime\": 1760832000,\n        //         \"ratePeriodSec\": 0\n        //     }\n        //\n        const timestamp = this.safeTimestamp (info, 'CreateTime');\n        const instrumentID = this.safeString2 (info, 'instrumentID', 'instrumentId');\n        market = this.safeMarket (instrumentID, market, undefined, 'swap');\n        return {\n            'info': info,\n            'symbol': market['symbol'],\n            'fundingRate': this.safeNumber (info, 'rate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1310,
        "line_end": 1346,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'billId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeString (item, 'bal')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"billId\": \"1001044652247714\",\n         \"ccy\": \"USDT\",\n         \"clientId\": \"\",\n         \"balChg\": \"-0.03543537\",\n         \"bal\": \"72.41881427\",\n         \"type\": \"5\",\n         \"ts\": \"1761047448000\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"billId\": \"1001044652247714\",\n        //         \"ccy\": \"USDT\",\n        //         \"clientId\": \"\",\n        //         \"balChg\": \"-0.03543537\",\n        //         \"bal\": \"72.41881427\",\n        //         \"type\": \"5\",\n        //         \"ts\": \"1761047448000\"\n        //     }\n        //\n        const timestamp = this.safeInteger (item, 'ts');\n        const change = this.safeString (item, 'balChg');\n        const amount = Precise.stringAbs (change);\n        const direction = Precise.stringLt (change, '0') ? 'out' : 'in';\n        const currencyId = this.safeString (item, 'ccy');\n        currency = this.safeCurrency (currencyId, currency);\n        const type = this.safeString (item, 'type');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'billId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': undefined,\n            'type': this.parseLedgerEntryType (type),\n            'currency': currency['code'],\n            'amount': amount,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': this.safeString (item, 'bal'),\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1348,
        "line_end": 1357,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            '1': 'trade',\n            '2': 'trade',\n            '3': 'transfer',\n            '4': 'transfer',\n            '5': 'fee',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 450,
        "line_end": 570,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && (Precise.stringGt (maxLeverage, '1'))",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "state === 'live'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "swap",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "swap ? (!isLinear) : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "swap ? this.safeNumber (market, 'ctVal') : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tickSz'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSz')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': maxAmount,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"A-USDT\",\n         \"uly\": \"\",\n         \"baseCcy\": \"A\",\n         \"quoteCcy\": \"USDT\",\n         \"ctVal\": \"1\",\n         \"ctValCcy\": \"\",\n         \"listTime\": \"0\",\n         \"lever\": \"1\",\n         \"tickSz\": \"0.0001\",\n         \"lotSz\": \"0.001\",\n         \"minSz\": \"0.5\",\n         \"ctType\": \"\",\n         \"alias\": \"\",\n         \"state\": \"live\",\n         \"maxLmtSz\": \"7692307\",\n         \"maxMktSz\": \"7692307\"\n     }",
          "{\n         \"instType\": \"SWAP\",\n         \"instId\": \"ZORA-USDT-SWAP\",\n         \"uly\": \"\",\n         \"baseCcy\": \"ZORA\",\n         \"quoteCcy\": \"USDT\",\n         \"ctVal\": \"1\",\n         \"ctValCcy\": \"\",\n         \"listTime\": \"0\",\n         \"lever\": \"20\",\n         \"tickSz\": \"0.00001\",\n         \"lotSz\": \"1\",\n         \"minSz\": \"1685\",\n         \"ctType\": \"\",\n         \"alias\": \"\",\n         \"state\": \"live\",\n         \"maxLmtSz\": \"10000000\",\n         \"maxMktSz\": \"10000000\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        // spot markets\n        //\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"A-USDT\",\n        //         \"uly\": \"\",\n        //         \"baseCcy\": \"A\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"ctVal\": \"1\",\n        //         \"ctValCcy\": \"\",\n        //         \"listTime\": \"0\",\n        //         \"lever\": \"1\",\n        //         \"tickSz\": \"0.0001\",\n        //         \"lotSz\": \"0.001\",\n        //         \"minSz\": \"0.5\",\n        //         \"ctType\": \"\",\n        //         \"alias\": \"\",\n        //         \"state\": \"live\",\n        //         \"maxLmtSz\": \"7692307\",\n        //         \"maxMktSz\": \"7692307\"\n        //     }\n        //\n        // swap markets\n        //\n        //     {\n        //         \"instType\": \"SWAP\",\n        //         \"instId\": \"ZORA-USDT-SWAP\",\n        //         \"uly\": \"\",\n        //         \"baseCcy\": \"ZORA\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"ctVal\": \"1\",\n        //         \"ctValCcy\": \"\",\n        //         \"listTime\": \"0\",\n        //         \"lever\": \"20\",\n        //         \"tickSz\": \"0.00001\",\n        //         \"lotSz\": \"1\",\n        //         \"minSz\": \"1685\",\n        //         \"ctType\": \"\",\n        //         \"alias\": \"\",\n        //         \"state\": \"live\",\n        //         \"maxLmtSz\": \"10000000\",\n        //         \"maxMktSz\": \"10000000\"\n        //     }\n        //\n        const id = this.safeString (market, 'instId');\n        const type = this.safeStringLower (market, 'instType');\n        const spot = (type === 'spot');\n        const swap = (type === 'swap');\n        const baseId = this.safeString (market, 'baseCcy');\n        const quoteId = this.safeString (market, 'quoteCcy', '');\n        let settleId = undefined;\n        let settle = undefined;\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        let isLinear = undefined;\n        if (swap) {\n            isLinear = (quoteId !== 'USD');\n            settleId = isLinear ? quoteId : baseId;\n            settle = this.safeCurrencyCode (settleId);\n            symbol = symbol + ':' + settle;\n        }\n        const fees = this.safeDict2 (this.fees, type, 'trading', {});\n        let maxLeverage = this.safeString (market, 'lever', '1');\n        maxLeverage = Precise.stringMax (maxLeverage, '1');\n        const maxMarketSize = this.safeString (market, 'maxMktSz');\n        const maxLimitSize = this.safeString (market, 'maxLmtSz');\n        const maxAmount = this.parseNumber (Precise.stringMax (maxMarketSize, maxLimitSize));\n        const state = this.safeString (market, 'state');\n        return this.extend (fees, {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': spot && (Precise.stringGt (maxLeverage, '1')),\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': state === 'live',\n            'contract': swap,\n            'linear': isLinear,\n            'inverse': swap ? (!isLinear) : undefined,\n            'contractSize': swap ? this.safeNumber (market, 'ctVal') : undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'created': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tickSz'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2326,
        "line_end": 2442,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'ordId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clOrdId')",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'uTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (state)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (orderType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseOrderTimeInForce (orderType)",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (order, 'px', 'ordPx')",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'sz')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'accFillSz')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.omitZero (this.safeString (order, 'triggerPx'))",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeString2 (order, 'tpTriggerPx', 'tpTriggerPrice')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeString2 (order, 'slTriggerPx', 'slTriggerPrice')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "orderType ? (orderType === 'post_only') : undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-USDT\",\n         \"tgtCcy\": \"\",\n         \"ccy\": \"\",\n         \"ordId\": \"1001434573319675\",\n         \"clOrdId\": \"\",\n         \"tag\": \"\",\n         \"px\": \"4056.620000000000\",\n         \"sz\": \"0.004000\",\n         \"pnl\": \"0.000000\",\n         \"ordType\": \"market\",\n         \"side\": \"buy\",\n         \"posSide\": \"\",\n         \"tdMode\": \"cash\",\n         \"accFillSz\": \"0.004000\",\n         \"fillPx\": \"\",\n         \"tradeId\": \"\",\n         \"fillSz\": \"0.004000\",\n         \"fillTime\": \"1760619119000\",\n         \"avgPx\": \"\",\n         \"state\": \"filled\",\n         \"lever\": \"1.000000\",\n         \"tpTriggerPx\": \"\",\n         \"tpTriggerPxType\": \"\",\n         \"tpOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"slTriggerPxType\": \"\",\n         \"slOrdPx\": \"\",\n         \"feeCcy\": \"USDT\",\n         \"fee\": \"0.000004\",\n         \"rebateCcy\": \"\",\n         \"source\": \"\",\n         \"rebate\": \"\",\n         \"category\": \"normal\",\n         \"uTime\": \"1760619119000\",\n         \"cTime\": \"1760619119000\"\n     }",
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"DOGE-USDT\",\n         \"ordId\": \"1001442305797142\",\n         \"triggerPx\": \"0.01\",\n         \"ordPx\": \"0.01\",\n         \"sz\": \"20\",\n         \"ordType\": \"\",\n         \"side\": \"buy\",\n         \"posSide\": \"\",\n         \"tdMode\": \"cash\",\n         \"triggerOrderType\": \"Conditional\",\n         \"triggerPxType\": \"last\",\n         \"lever\": \"\",\n         \"slPrice\": \"\",\n         \"slTriggerPrice\": \"\",\n         \"tpPrice\": \"\",\n         \"tpTriggerPrice\": \"\",\n         \"closeSLTriggerPrice\": \"\",\n         \"closeTPTriggerPrice\": \"\",\n         \"cTime\": \"1761814167000\",\n         \"uTime\": \"1761814167000\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // regular order\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"tgtCcy\": \"\",\n        //         \"ccy\": \"\",\n        //         \"ordId\": \"1001434573319675\",\n        //         \"clOrdId\": \"\",\n        //         \"tag\": \"\",\n        //         \"px\": \"4056.620000000000\",\n        //         \"sz\": \"0.004000\",\n        //         \"pnl\": \"0.000000\",\n        //         \"ordType\": \"market\",\n        //         \"side\": \"buy\",\n        //         \"posSide\": \"\",\n        //         \"tdMode\": \"cash\",\n        //         \"accFillSz\": \"0.004000\",\n        //         \"fillPx\": \"\",\n        //         \"tradeId\": \"\",\n        //         \"fillSz\": \"0.004000\",\n        //         \"fillTime\": \"1760619119000\",\n        //         \"avgPx\": \"\",\n        //         \"state\": \"filled\",\n        //         \"lever\": \"1.000000\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tpTriggerPxType\": \"\",\n        //         \"tpOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"slTriggerPxType\": \"\",\n        //         \"slOrdPx\": \"\",\n        //         \"feeCcy\": \"USDT\",\n        //         \"fee\": \"0.000004\",\n        //         \"rebateCcy\": \"\",\n        //         \"source\": \"\",\n        //         \"rebate\": \"\",\n        //         \"category\": \"normal\",\n        //         \"uTime\": \"1760619119000\",\n        //         \"cTime\": \"1760619119000\"\n        //     }\n        //\n        // trigger order\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"DOGE-USDT\",\n        //         \"ordId\": \"1001442305797142\",\n        //         \"triggerPx\": \"0.01\",\n        //         \"ordPx\": \"0.01\",\n        //         \"sz\": \"20\",\n        //         \"ordType\": \"\",\n        //         \"side\": \"buy\",\n        //         \"posSide\": \"\",\n        //         \"tdMode\": \"cash\",\n        //         \"triggerOrderType\": \"Conditional\",\n        //         \"triggerPxType\": \"last\",\n        //         \"lever\": \"\",\n        //         \"slPrice\": \"\",\n        //         \"slTriggerPrice\": \"\",\n        //         \"tpPrice\": \"\",\n        //         \"tpTriggerPrice\": \"\",\n        //         \"closeSLTriggerPrice\": \"\",\n        //         \"closeTPTriggerPrice\": \"\",\n        //         \"cTime\": \"1761814167000\",\n        //         \"uTime\": \"1761814167000\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'instId');\n        market = this.safeMarket (marketId, market);\n        let timestamp = this.safeInteger (order, 'cTime');\n        const timestampString = this.safeString (order, 'cTime', '');\n        if (timestampString.length < 13) {\n            timestamp = this.safeTimestamp (order, 'cTime');\n        }\n        const state = this.safeString (order, 'state');\n        const orderType = this.safeString (order, 'ordType');\n        let average = this.safeString (order, 'avgPx');\n        if (average === '') {\n            average = undefined;\n        }\n        const feeCurrencyId = this.safeString (order, 'feeCcy');\n        let fee = undefined;\n        if (feeCurrencyId !== undefined) {\n            const feeCost = this.safeString (order, 'fee');\n            fee = {\n                'cost': this.parseNumber (feeCost),\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n            };\n        }\n        return this.safeOrder ({\n            'id': this.safeString (order, 'ordId'),\n            'clientOrderId': this.safeString (order, 'clOrdId'),\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (order, 'uTime'),\n            'status': this.parseOrderStatus (state),\n            'symbol': market['symbol'],\n            'type': this.parseOrderType (orderType),\n            'timeInForce': this.parseOrderTimeInForce (orderType),\n            'side': this.safeString (order, 'side'),\n            'price': this.safeString2 (order, 'px', 'ordPx'),\n            'average': average,\n            'amount': this.safeString (order, 'sz'),\n            'filled': this.safeString (order, 'accFillSz'),\n            'remaining': undefined,\n            'triggerPrice': this.omitZero (this.safeString (order, 'triggerPx')),\n            'takeProfitPrice': this.safeString2 (order, 'tpTriggerPx', 'tpTriggerPrice'),\n            'stopLossPrice': this.safeString2 (order, 'slTriggerPx', 'slTriggerPrice'),\n            'cost': undefined,\n            'trades': undefined,\n            'fee': fee,\n            'reduceOnly': undefined,\n            'postOnly': orderType ? (orderType === 'post_only') : undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str): Str",
        "line_start": 2444,
        "line_end": 2452,
        "comment": null,
        "mappings": [
          {
            "key": "live",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "filled",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "canceled",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "partially_filled",
            "value": "'open'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status: Str): Str {\n        const statuses = {\n            'live': 'open',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'partially_filled': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (type: Str): Str",
        "line_start": 2465,
        "line_end": 2473,
        "comment": null,
        "mappings": [
          {
            "key": "post_only",
            "value": "'PO'",
            "comment": null
          },
          {
            "key": "ioc",
            "value": "'IOC'",
            "comment": null
          },
          {
            "key": "limit",
            "value": "'GTC'",
            "comment": null
          },
          {
            "key": "market",
            "value": "'GTC'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderTimeInForce (type: Str): Str {\n        const timeInForces = {\n            'post_only': 'PO',\n            'ioc': 'IOC',\n            'limit': 'GTC',\n            'market': 'GTC',\n        };\n        return this.safeString (timeInForces, type, type);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str): Str",
        "line_start": 2454,
        "line_end": 2463,
        "comment": null,
        "mappings": [
          {
            "key": "limit",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "market",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "post_only",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "ioc",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "TPSL",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type: Str): Str {\n        const types = {\n            'limit': 'limit',\n            'market': 'market',\n            'post_only': 'limit',\n            'ioc': 'market',\n            'TPSL': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined): Position",
        "line_start": 2550,
        "line_end": 2602,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'posId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeString (position, 'pos')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (position, 'posSide')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.omitZero (this.safeString (position, 'lever'))",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeString (position, 'avgPx')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeString (position, 'liqPx')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (position, 'mgnMode')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "true",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeString (position, 'useMargin')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'uTime')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "position",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"SWAP\",\n         \"mgnMode\": \"cross\",\n         \"instId\": \"DOGE-USDT-SWAP\",\n         \"posId\": \"1001110099878275\",\n         \"posSide\": \"long\",\n         \"pos\": \"20\",\n         \"avgPx\": \"0.18408\",\n         \"lever\": \"75\",\n         \"liqPx\": \"0.00001\",\n         \"useMargin\": \"0.049088\",\n         \"mrgPosition\": \"merge\",\n         \"ccy\": \"USDT\",\n         \"uTime\": \"1760709419000\",\n         \"cTime\": \"1760709419000\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined): Position {\n        //\n        //     {\n        //         \"instType\": \"SWAP\",\n        //         \"mgnMode\": \"cross\",\n        //         \"instId\": \"DOGE-USDT-SWAP\",\n        //         \"posId\": \"1001110099878275\",\n        //         \"posSide\": \"long\",\n        //         \"pos\": \"20\",\n        //         \"avgPx\": \"0.18408\",\n        //         \"lever\": \"75\",\n        //         \"liqPx\": \"0.00001\",\n        //         \"useMargin\": \"0.049088\",\n        //         \"mrgPosition\": \"merge\",\n        //         \"ccy\": \"USDT\",\n        //         \"uTime\": \"1760709419000\",\n        //         \"cTime\": \"1760709419000\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'instId');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (position, 'cTime');\n        return this.safePosition ({\n            'symbol': market['symbol'],\n            'id': this.safeString (position, 'posId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'contracts': this.safeString (position, 'pos'),\n            'contractSize': undefined,\n            'side': this.safeString (position, 'posSide'),\n            'notional': undefined,\n            'leverage': this.omitZero (this.safeString (position, 'lever')),\n            'unrealizedPnl': undefined,\n            'realizedPnl': undefined,\n            'collateral': undefined,\n            'entryPrice': this.safeString (position, 'avgPx'),\n            'markPrice': undefined,\n            'liquidationPrice': this.safeString (position, 'liqPx'),\n            'marginMode': this.safeString (position, 'mgnMode'),\n            'hedged': true,\n            'maintenanceMargin': this.safeString (position, 'useMargin'),\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'marginRatio': undefined,\n            'lastUpdateTimestamp': this.safeInteger (position, 'uTime'),\n            'lastPrice': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n            'percentage': undefined,\n            'info': position,\n        });\n    }"
      },
      {
        "name": "parseTakerOrMaker",
        "signature": "parseTakerOrMaker (execType: Str)",
        "line_start": 911,
        "line_end": 917,
        "comment": null,
        "mappings": [
          {
            "key": "T",
            "value": "'taker'",
            "comment": null
          },
          {
            "key": "M",
            "value": "'maker'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTakerOrMaker (execType: Str) {\n        const types = {\n            'T': 'taker',\n            'M': 'maker',\n        };\n        return this.safeString (types, execType, execType);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 746,
        "line_end": 806,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPx')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSz')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPx')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSz')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"SWAP\",\n         \"instId\": \"BTC-USD-SWAP\",\n         \"last\": \"114113.3\",\n         \"lastSz\": \"\",\n         \"askPx\": \"114113.5\",\n         \"askSz\": \"56280\",\n         \"bidPx\": \"114113.2\",\n         \"bidSz\": \"63220\",\n         \"open24h\": \"113214.7\",\n         \"high24h\": \"116039.2\",\n         \"low24h\": \"113214.7\",\n         \"volCcy24h\": \"73.31475724\",\n         \"vol24h\": \"8406739\",\n         \"sodUtc0\": \"\",\n         \"sodUtc8\": \"\",\n         \"ts\": \"1760367816000\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"instType\": \"SWAP\",\n        //         \"instId\": \"BTC-USD-SWAP\",\n        //         \"last\": \"114113.3\",\n        //         \"lastSz\": \"\",\n        //         \"askPx\": \"114113.5\",\n        //         \"askSz\": \"56280\",\n        //         \"bidPx\": \"114113.2\",\n        //         \"bidSz\": \"63220\",\n        //         \"open24h\": \"113214.7\",\n        //         \"high24h\": \"116039.2\",\n        //         \"low24h\": \"113214.7\",\n        //         \"volCcy24h\": \"73.31475724\",\n        //         \"vol24h\": \"8406739\",\n        //         \"sodUtc0\": \"\",\n        //         \"sodUtc8\": \"\",\n        //         \"ts\": \"1760367816000\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'ts');\n        const marketId = this.safeString (ticker, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'last');\n        const open = this.safeString (ticker, 'open24h');\n        let quoteVolume = this.safeString (ticker, 'volCcy24h');\n        let baseVolume = this.safeString (ticker, 'vol24h');\n        if (market['swap'] && market['inverse']) {\n            const temp = baseVolume;\n            baseVolume = quoteVolume;\n            quoteVolume = temp;\n        }\n        const high = this.safeString (ticker, 'high24h');\n        const low = this.safeString (ticker, 'low24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': this.safeString (ticker, 'bidPx'),\n            'bidVolume': this.safeString (ticker, 'bidSz'),\n            'ask': this.safeString (ticker, 'askPx'),\n            'askVolume': this.safeString (ticker, 'askSz'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 847,
        "line_end": 909,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'tradeId')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'ordId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.parseTakerOrMaker (execType)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'fillPx', 'px')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString2 (trade, 'fillSz', 'sz')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instId\": \"ETH-USDT\",\n         \"tradeId\": \"1001056388761321\",\n         \"px\": \"4095.66\",\n         \"sz\": \"0.01311251\",\n         \"side\": \"sell\",\n         \"ts\": \"1760367870000\"\n     }",
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-USDT\",\n         \"tradeId\": \"1001056429613610\",\n         \"ordId\": \"1001435238208686\",\n         \"clOrdId\": \"\",\n         \"billId\": \"10010564296136101\",\n         \"tag\": \"\",\n         \"fillPx\": \"3791.15\",\n         \"fillSz\": \"0.004\",\n         \"side\": \"sell\",\n         \"posSide\": \"\",\n         \"execType\": \"\",\n         \"feeCcy\": \"USDT\",\n         \"fee\": \"0.0151646\",\n         \"ts\": \"1760704540000\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"instId\": \"ETH-USDT\",\n        //         \"tradeId\": \"1001056388761321\",\n        //         \"px\": \"4095.66\",\n        //         \"sz\": \"0.01311251\",\n        //         \"side\": \"sell\",\n        //         \"ts\": \"1760367870000\"\n        //     }\n        //\n        // private fetchMyTrades\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"tradeId\": \"1001056429613610\",\n        //         \"ordId\": \"1001435238208686\",\n        //         \"clOrdId\": \"\",\n        //         \"billId\": \"10010564296136101\",\n        //         \"tag\": \"\",\n        //         \"fillPx\": \"3791.15\",\n        //         \"fillSz\": \"0.004\",\n        //         \"side\": \"sell\",\n        //         \"posSide\": \"\",\n        //         \"execType\": \"\",\n        //         \"feeCcy\": \"USDT\",\n        //         \"fee\": \"0.0151646\",\n        //         \"ts\": \"1760704540000\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'instId');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (trade, 'ts');\n        const side = this.safeString (trade, 'side');\n        const execType = this.safeString (trade, 'execType');\n        let fee = undefined;\n        const feeCost = this.safeString (trade, 'fee');\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'id': this.safeString (trade, 'tradeId'),\n            'order': this.safeString (trade, 'ordId'),\n            'type': undefined,\n            'takerOrMaker': this.parseTakerOrMaker (execType),\n            'side': side,\n            'price': this.safeString2 (trade, 'fillPx', 'px'),\n            'amount': this.safeString2 (trade, 'fillSz', 'sz'),\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1065,
        "line_end": 1110,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'address')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': undefined,\n                'cost': undefined,\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"createTime\": 1760368656,\n         \"txHash\": \"03fe3244d89e794586222413c61779380da9e9fe5baaa253c38d01a4199a3499\",\n         \"chainName\": \"TRC20\",\n         \"amount\": \"149\",\n         \"coin\": \"USDT\",\n         \"status\": \"succeed\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //     {\n        //         \"createTime\": 1760368656,\n        //         \"txHash\": \"03fe3244d89e794586222413c61779380da9e9fe5baaa253c38d01a4199a3499\",\n        //         \"chainName\": \"TRC20\",\n        //         \"amount\": \"149\",\n        //         \"coin\": \"USDT\",\n        //         \"status\": \"succeed\"\n        //     }\n        //\n        const txid = this.safeString (transaction, 'txHash');\n        const currencyId = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const amount = this.safeNumber (transaction, 'amount');\n        const timestamp = this.safeTimestamp (transaction, 'createTime');\n        const networkId = this.safeString (transaction, 'chainName');\n        const network = this.networkIdToCode (networkId);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        return {\n            'info': transaction,\n            'id': undefined,\n            'currency': code,\n            'amount': amount,\n            'network': network,\n            'addressFrom': undefined,\n            'addressTo': undefined,\n            'address': this.safeString (transaction, 'address'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'tag': undefined,\n            'status': status,\n            'type': undefined,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': undefined,\n                'cost': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str): Str",
        "line_start": 1112,
        "line_end": 1118,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str): Str {\n        const statuses: Dict = {\n            'confirming': 'pending',\n            'succeed': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1415,
        "line_end": 1436,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"retCode\": 0,\n         \"retMsg\": \"\",\n         \"retData\": {}\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //     {\n        //         \"retCode\": 0,\n        //         \"retMsg\": \"\",\n        //         \"retData\": {}\n        //     }\n        //\n        const status = this.safeString (transfer, 'retCode');\n        const currencyCode = this.safeCurrencyCode (undefined, currency);\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': currencyCode,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 1438,
        "line_end": 1443,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        if (status === '0') {\n            return 'ok';\n        }\n        return 'failed';\n    }"
      }
    ],
    "defx": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (balances): Balances",
        "line_start": 1237,
        "line_end": 1249,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (balances): Balances {\n        const result: Dict = {\n            'info': balances,\n        };\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1174,
        "line_end": 1210,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.parseNumber (fundingRate)",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"markPrice\": \"100.00\",\n     \"indexPrice\": \"100.00\",\n     \"ltp\": \"101.34\",\n     \"movingFundingRate\": \"0.08\",\n     \"payoutFundingRate\": \"-0.03\",\n     \"nextFundingPayout\": 1711555532146\n }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        // {\n        //     \"markPrice\": \"100.00\",\n        //     \"indexPrice\": \"100.00\",\n        //     \"ltp\": \"101.34\",\n        //     \"movingFundingRate\": \"0.08\",\n        //     \"payoutFundingRate\": \"-0.03\",\n        //     \"nextFundingPayout\": 1711555532146\n        // }\n        //\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        const fundingRateRaw = this.safeString (contract, 'payoutFundingRate');\n        const fundingRate = Precise.stringDiv (fundingRateRaw, '100');\n        const fundingTime = this.safeInteger (contract, 'nextFundingPayout');\n        return {\n            'info': contract,\n            'symbol': market['symbol'],\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.parseNumber (fundingRate),\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1928,
        "line_end": 1962,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"01JCSZS6H5VQND3GF5P98SJ29C\",\n     \"timestamp\": 1731744012054,\n     \"type\": \"FundingFee\",\n     \"amount\": \"0.02189287\",\n     \"asset\": \"USDC\",\n     \"operation\": \"CREDIT\"\n }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // {\n        //     \"id\": \"01JCSZS6H5VQND3GF5P98SJ29C\",\n        //     \"timestamp\": 1731744012054,\n        //     \"type\": \"FundingFee\",\n        //     \"amount\": \"0.02189287\",\n        //     \"asset\": \"USDC\",\n        //     \"operation\": \"CREDIT\"\n        // }\n        //\n        const amount = this.safeString (item, 'amount');\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'timestamp');\n        const type = this.safeString (item, 'type');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'direction': undefined,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': undefined,\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1964,
        "line_end": 1976,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'FundingFee': 'fee',\n            'FeeRebate': 'fee',\n            'FeeKickback': 'fee',\n            'RealizedPnl': 'trade',\n            'LiquidationClearance': 'trade',\n            'Transfer': 'transfer',\n            'ReferralPayout': 'referral',\n            'Commission': 'commission',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2075,
        "line_end": 2091,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [
          "\"data\": {\n       \"leverage\": \"11\",\n       \"symbol\": \"BTC_USDC\"\n     }"
        ],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        //\n        //     \"data\": {\n        //       \"leverage\": \"11\",\n        //       \"symbol\": \"BTC_USDC\"\n        //     }\n        //\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': undefined,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 586,
        "line_end": 656,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeString (market, 'status', '') === 'active'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (lotFilter, 'stepSize'),\n                'price': this.safeNumber (priceFilter, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'cappedLeverage'),\n                },\n                'amount': {\n                    'min': this.safeNumber (lotFilter, 'minQty'),\n                    'max': this.safeNumber (lotFilter, 'maxQty'),\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'cost': {\n                    'min': this.safeNumber (notionalFilter, 'minNotional'),\n                    'max': undefined,\n                },\n                'market': {\n                    'min': this.safeNumber (marketLotFilter, 'minQty'),\n                    'max': this.safeNumber (marketLotFilter, 'maxQty'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (lotFilter, 'stepSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (priceFilter, 'tickSize')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'cappedLeverage'),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (lotFilter, 'minQty'),\n                    'max': this.safeNumber (lotFilter, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (notionalFilter, 'minNotional'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "market",
            "value": "{\n                    'min': this.safeNumber (marketLotFilter, 'minQty'),\n                    'max': this.safeNumber (marketLotFilter, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (lotFilter, 'minQty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (lotFilter, 'maxQty')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (priceFilter, 'minPrice')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (priceFilter, 'maxPrice')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (notionalFilter, 'minNotional')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (marketLotFilter, 'minQty')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (marketLotFilter, 'maxQty')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const marketId = this.safeString (market, 'market');\n        const parts = marketId.split ('_');\n        const baseId = this.safeString (parts, 0);\n        const quoteId = this.safeString (parts, 1);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote + ':' + quote;\n        const filters = this.safeList (market, 'filters', []);\n        const fees = this.safeDict (market, 'fees', {});\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const priceFilter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n        const lotFilter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n        const marketLotFilter = this.safeDict (filtersByType, 'MARKET_LOT_SIZE', {});\n        const notionalFilter = this.safeDict (filtersByType, 'NOTIONAL', {});\n        return {\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': quoteId,\n            'type': 'swap',\n            'spot': false,\n            'margin': false,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': this.safeString (market, 'status', '') === 'active',\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'contractSize': this.parseNumber ('1'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (lotFilter, 'stepSize'),\n                'price': this.safeNumber (priceFilter, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'cappedLeverage'),\n                },\n                'amount': {\n                    'min': this.safeNumber (lotFilter, 'minQty'),\n                    'max': this.safeNumber (lotFilter, 'maxQty'),\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'cost': {\n                    'min': this.safeNumber (notionalFilter, 'minNotional'),\n                    'max': undefined,\n                },\n                'market': {\n                    'min': this.safeNumber (marketLotFilter, 'minQty'),\n                    'max': this.safeNumber (marketLotFilter, 'maxQty'),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 905,
        "line_end": 915,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // example response in fetchOHLCV\n        return [\n            this.safeInteger (ohlcv, 'start'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1362,
        "line_end": 1442,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "this.safeBool (order, 'postOnly')",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeString (order, 'totalFee'),\n                'currency': 'USDC',\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'totalFee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "'USDC'",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"orderId\": \"746472647227344528\",\n     \"createdAt\": \"2024-10-25T16:49:31.077Z\",\n     \"updatedAt\": \"2024-10-25T16:49:31.378Z\",\n     \"clientOrderId\": \"0192c495-49c3-71ee-b3d3-7442a2090807\",\n     \"reduceOnly\": false,\n     \"side\": \"SELL\",\n     \"status\": \"FILLED\",\n     \"symbol\": \"SOL_USDC\",\n     \"timeInForce\": \"GTC\",\n     \"type\": \"MARKET\",\n     \"origQty\": \"0.80\",\n     \"executedQty\": \"0.80\",\n     \"cumulativeQuote\": \"137.87440000\",\n     \"avgPrice\": \"172.34300000\",\n     \"totalPnL\": \"0.00000000\",\n     \"totalFee\": \"0.07583092\",\n     \"workingType\": null,\n     \"postOnly\": false,\n     \"linkedOrderParentType\": null,\n     \"isTriggered\": false,\n     \"slippagePercentage\": \"5\"\n }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // {\n        //     \"orderId\": \"746472647227344528\",\n        //     \"createdAt\": \"2024-10-25T16:49:31.077Z\",\n        //     \"updatedAt\": \"2024-10-25T16:49:31.378Z\",\n        //     \"clientOrderId\": \"0192c495-49c3-71ee-b3d3-7442a2090807\",\n        //     \"reduceOnly\": false,\n        //     \"side\": \"SELL\",\n        //     \"status\": \"FILLED\",\n        //     \"symbol\": \"SOL_USDC\",\n        //     \"timeInForce\": \"GTC\",\n        //     \"type\": \"MARKET\",\n        //     \"origQty\": \"0.80\",\n        //     \"executedQty\": \"0.80\",\n        //     \"cumulativeQuote\": \"137.87440000\",\n        //     \"avgPrice\": \"172.34300000\",\n        //     \"totalPnL\": \"0.00000000\",\n        //     \"totalFee\": \"0.07583092\",\n        //     \"workingType\": null,\n        //     \"postOnly\": false,\n        //     \"linkedOrderParentType\": null,\n        //     \"isTriggered\": false,\n        //     \"slippagePercentage\": \"5\"\n        // }\n        //\n        const orderId = this.safeString (order, 'orderId');\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'origQty');\n        const orderType = this.safeStringLower (order, 'type');\n        const status = this.safeString (order, 'status');\n        const side = this.safeStringLower (order, 'side');\n        const filled = this.omitZero (this.safeString (order, 'executedQty'));\n        const average = this.omitZero (this.safeString (order, 'avgPrice'));\n        const timeInForce = this.safeStringLower (order, 'timeInForce');\n        let takeProfitPrice: Str = undefined;\n        let triggerPrice: Str = undefined;\n        if (orderType !== undefined) {\n            if (orderType.indexOf ('take_profit') >= 0) {\n                takeProfitPrice = this.safeString (order, 'stopPrice');\n            } else {\n                triggerPrice = this.safeString (order, 'stopPrice');\n            }\n        }\n        const timestamp = this.parse8601 (this.safeString (order, 'createdAt'));\n        const lastTradeTimestamp = this.parse8601 (this.safeString (order, 'updatedAt'));\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastTradeTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': orderType,\n            'timeInForce': timeInForce,\n            'postOnly': this.safeBool (order, 'postOnly'),\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': undefined,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': {\n                'cost': this.safeString (order, 'totalFee'),\n                'currency': 'USDC',\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1348,
        "line_end": 1360,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'NEW': 'open',\n                'OPEN': 'open',\n                'CANCELLED': 'canceled',\n                'REJECTED': 'rejected',\n                'FILLED': 'closed',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1585,
        "line_end": 1635,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'positionId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPrice)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"positionId\": \"0192c495-4a68-70ee-9081-9d368bd16dfc\",\n     \"symbol\": \"SOL_USDC\",\n     \"positionSide\": \"SHORT\",\n     \"entryPrice\": \"172.34300000\",\n     \"quantity\": \"0.80\",\n     \"marginAmount\": \"20.11561173\",\n     \"marginAsset\": \"USDC\",\n     \"pnl\": \"0.00000000\"\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"positionId\": \"0192c495-4a68-70ee-9081-9d368bd16dfc\",\n        //     \"symbol\": \"SOL_USDC\",\n        //     \"positionSide\": \"SHORT\",\n        //     \"entryPrice\": \"172.34300000\",\n        //     \"quantity\": \"0.80\",\n        //     \"marginAmount\": \"20.11561173\",\n        //     \"marginAsset\": \"USDC\",\n        //     \"pnl\": \"0.00000000\"\n        // }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const size = Precise.stringAbs (this.safeString (position, 'quantity'));\n        const side = this.safeStringLower (position, 'positionSide');\n        const unrealisedPnl = this.omitZero (this.safeString (position, 'pnl'));\n        const entryPrice = this.omitZero (this.safeString (position, 'entryPrice'));\n        const initialMargin = this.safeString (position, 'marginAmount');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'positionId'),\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': undefined,\n            'initialMargin': this.parseNumber (initialMargin),\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': this.parseNumber (entryPrice),\n            'notional': undefined,\n            'leverage': undefined,\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'realizedPnl': undefined,\n            'contracts': this.parseNumber (size),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'marginRatio': undefined,\n            'liquidationPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'collateral': undefined,\n            'marginMode': undefined,\n            'side': side,\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n            'hedged': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 743,
        "line_end": 840,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "ts",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"BTC_USDC\",\n     \"priceChange\": \"0\",\n     \"priceChangePercent\": \"0\",\n     \"weightedAvgPrice\": \"0\",\n     \"lastPrice\": \"2.00\",\n     \"lastQty\": \"10.000\",\n     \"bestBidPrice\": \"1646.00\",\n     \"bestBidQty\": \"10.000\",\n     \"bestAskPrice\": \"1646.00\",\n     \"bestAskQty\": \"10.000\",\n     \"openPrice\": \"0.00\",\n     \"highPrice\": \"0.00\",\n     \"lowPrice\": \"0.00\",\n     \"volume\": \"0.000\",\n     \"quoteVolume\": \"0.00\",\n     \"openTime\": 1700142658697,\n     \"closeTime\": 1700142658697,\n     \"openInterestBase\": \"1.000\",\n     \"openInterestQuote\": \"0.43112300\"\n }",
          "\"ETH_USDC\": {\n       \"priceChange\": \"0\",\n       \"priceChangePercent\": \"0\",\n       \"openPrice\": \"1646.15\",\n       \"highPrice\": \"1646.15\",\n       \"lowPrice\": \"1646.15\",\n       \"lastPrice\": \"1646.15\",\n       \"quoteVolume\": \"13.17\",\n       \"volume\": \"0.008\",\n       \"markPrice\": \"1645.15\"\n     }",
          "{\n     \"markPrice\": \"100.00\",\n     \"indexPrice\": \"100.00\",\n     \"ltp\": \"101.34\",\n     \"movingFundingRate\": \"0.08\",\n     \"payoutFundingRate\": \"-0.03\",\n     \"nextFundingPayout\": 1711555532146\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        // {\n        //     \"symbol\": \"BTC_USDC\",\n        //     \"priceChange\": \"0\",\n        //     \"priceChangePercent\": \"0\",\n        //     \"weightedAvgPrice\": \"0\",\n        //     \"lastPrice\": \"2.00\",\n        //     \"lastQty\": \"10.000\",\n        //     \"bestBidPrice\": \"1646.00\",\n        //     \"bestBidQty\": \"10.000\",\n        //     \"bestAskPrice\": \"1646.00\",\n        //     \"bestAskQty\": \"10.000\",\n        //     \"openPrice\": \"0.00\",\n        //     \"highPrice\": \"0.00\",\n        //     \"lowPrice\": \"0.00\",\n        //     \"volume\": \"0.000\",\n        //     \"quoteVolume\": \"0.00\",\n        //     \"openTime\": 1700142658697,\n        //     \"closeTime\": 1700142658697,\n        //     \"openInterestBase\": \"1.000\",\n        //     \"openInterestQuote\": \"0.43112300\"\n        // }\n        //\n        // fetchTickers\n        //\n        //     \"ETH_USDC\": {\n        //       \"priceChange\": \"0\",\n        //       \"priceChangePercent\": \"0\",\n        //       \"openPrice\": \"1646.15\",\n        //       \"highPrice\": \"1646.15\",\n        //       \"lowPrice\": \"1646.15\",\n        //       \"lastPrice\": \"1646.15\",\n        //       \"quoteVolume\": \"13.17\",\n        //       \"volume\": \"0.008\",\n        //       \"markPrice\": \"1645.15\"\n        //     }\n        //\n        // fetchMarkPrice\n        //\n        // {\n        //     \"markPrice\": \"100.00\",\n        //     \"indexPrice\": \"100.00\",\n        //     \"ltp\": \"101.34\",\n        //     \"movingFundingRate\": \"0.08\",\n        //     \"payoutFundingRate\": \"-0.03\",\n        //     \"nextFundingPayout\": 1711555532146\n        // }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        if (marketId !== undefined) {\n            market = this.market (marketId);\n        }\n        const symbol = market['symbol'];\n        const open = this.safeString (ticker, 'openPrice');\n        const high = this.safeString (ticker, 'highPrice');\n        const low = this.safeString (ticker, 'lowPrice');\n        const close = this.safeString (ticker, 'lastPrice');\n        const quoteVolume = this.safeString (ticker, 'quoteVolume');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const percentage = this.safeString (ticker, 'priceChangePercent');\n        const change = this.safeString (ticker, 'priceChange');\n        let ts = this.safeInteger (ticker, 'closeTime');\n        if (ts === 0) {\n            ts = undefined;\n        }\n        const datetime = this.iso8601 (ts);\n        const bid = this.safeString (ticker, 'bestBidPrice');\n        const bidVolume = this.safeString (ticker, 'bestBidQty');\n        const ask = this.safeString (ticker, 'bestAskPrice');\n        const askVolume = this.safeString (ticker, 'bestAskQty');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': ts,\n            'datetime': datetime,\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': undefined,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1001,
        "line_end": 1063,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "order",
            "value": "oid",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeString (trade, 'fee'),\n                'currency': 'USDC',\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"buyerMaker\": \"false\",\n       \"price\": \"2.0000\",\n       \"qty\": \"10.0000\",\n       \"symbol\": \"BTC_USDC\",\n       \"timestamp\": \"1702453663894\"\n     }",
          "{\n         \"id\": \"0192f665-c05b-7ba0-a080-8b6c99083489\",\n         \"orderId\": \"757730811259651728\",\n         \"time\": \"2024-11-04T08:58:36.474Z\",\n         \"symbol\": \"SOL_USDC\",\n         \"side\": \"SELL\",\n         \"price\": \"160.43600000\",\n         \"qty\": \"1.00\",\n         \"fee\": \"0.08823980\",\n         \"role\": \"TAKER\",\n         \"pnl\": \"0.00000000\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //     {\n        //       \"buyerMaker\": \"false\",\n        //       \"price\": \"2.0000\",\n        //       \"qty\": \"10.0000\",\n        //       \"symbol\": \"BTC_USDC\",\n        //       \"timestamp\": \"1702453663894\"\n        //     }\n        //\n        // fetchMyTrades\n        //     {\n        //         \"id\": \"0192f665-c05b-7ba0-a080-8b6c99083489\",\n        //         \"orderId\": \"757730811259651728\",\n        //         \"time\": \"2024-11-04T08:58:36.474Z\",\n        //         \"symbol\": \"SOL_USDC\",\n        //         \"side\": \"SELL\",\n        //         \"price\": \"160.43600000\",\n        //         \"qty\": \"1.00\",\n        //         \"fee\": \"0.08823980\",\n        //         \"role\": \"TAKER\",\n        //         \"pnl\": \"0.00000000\"\n        //     }\n        //\n        const time = this.safeString (trade, 'time');\n        const timestamp = this.safeInteger (trade, 'timestamp', this.parse8601 (time));\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'qty');\n        const id = this.safeString (trade, 'id');\n        const oid = this.safeString (trade, 'orderId');\n        const takerOrMaker = this.safeStringLower (trade, 'role');\n        const buyerMaker = this.safeBool (trade, 'buyerMaker');\n        let side = this.safeStringLower (trade, 'side');\n        if (buyerMaker !== undefined) {\n            if (buyerMaker) {\n                side = 'sell';\n            } else {\n                side = 'buy';\n            }\n        }\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'order': oid,\n            'takerOrMaker': takerOrMaker,\n            'type': undefined,\n            'fee': {\n                'cost': this.safeString (trade, 'fee'),\n                'currency': 'USDC',\n            },\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2008,
        "line_end": 2039,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"transactionId\": \"0x301e5851e5aefa733abfbc8b30817ca3b61601e0ddf1df8c59656fb888b0bc9c\"\n }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        // {\n        //     \"transactionId\": \"0x301e5851e5aefa733abfbc8b30817ca3b61601e0ddf1df8c59656fb888b0bc9c\"\n        // }\n        //\n        const txid = this.safeString (transaction, 'transactionId');\n        return {\n            'info': transaction,\n            'id': undefined,\n            'txid': txid,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'network': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'status': undefined,\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': undefined,\n        };\n    }"
      }
    ],
    "delta": [
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 3934,
        "line_end": 4112,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeInteger (info, 'adl_level')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"adl_level\": null,\n         \"auto_topup\": false,\n         \"bankruptcy_price\": \"88618.22667\",\n         \"commission\": \"0.03797924\",\n         \"created_at\": \"2026-01-14T11:24:35.801586Z\",\n         \"entry_price\": \"94948.1\",\n         \"liquidation_price\": \"89092.96717\",\n         \"margin\": \"6.32987333\",\n         \"margin_mode\": \"isolated\",\n         \"mark_price\": \"94942.90888022\",\n         \"product\": {\n             \"trading_status\": \"operational\",\n             \"short_description\": null,\n             \"quoting_asset\": {\n                 \"base_withdrawal_fee\": \"0.000000000000000000\",\n                 \"id\": 4,\n                 \"interest_credit\": false,\n                 \"interest_slabs\": null,\n                 \"kyc_deposit_limit\": \"0.000000000000000000\",\n                 \"kyc_withdrawal_limit\": \"0.000000000000000000\",\n                 \"min_withdrawal_amount\": \"0.000000000000000000\",\n                 \"minimum_precision\": 2,\n                 \"name\": \"Tether\",\n                 \"networks\": [],\n                 \"precision\": 8,\n                 \"sort_priority\": null,\n                 \"symbol\": \"USDT\",\n                 \"variable_withdrawal_fee\": \"0.000000000000000000\"\n             },\n             \"symbol\": \"BTCUSDT\",\n             \"taker_commission_rate\": \"0.0004\",\n             \"maintenance_margin_scaling_factor\": \"0\",\n             \"spot_index\": {\n                 \"config\": {\n                     \"impact_size\": {\n                         \"max_impact_size\": 150000,\n                         \"min_impact_size\": 5000,\n                         \"step_value\": 5000\n                     },\n                     \"quoting_asset\": \"USDT\",\n                     \"service_id\": 1,\n                     \"underlying_asset\": \"BTC\"\n                 },\n                 \"constituent_exchanges\": [\n                     {\n                         \"exchange\": \"binance\",\n                         \"health_interval\": 3000,\n                         \"health_priority\": 1,\n                         \"weight\": 1\n                     },\n                     {\n                         \"exchange\": \"gateio\",\n                         \"health_interval\": 3000,\n                         \"health_priority\": 3,\n                         \"weight\": 1\n                     },\n                     {\n                         \"exchange\": \"bybit\",\n                         \"health_interval\": 3000,\n                         \"health_priority\": 2,\n                         \"weight\": 1\n                     }\n                 ],\n                 \"constituent_indices\": null,\n                 \"description\": \"BTC Spot\",\n                 \"health_interval\": 300,\n                 \"id\": 2,\n                 \"impact_size\": \"1.000000000000000000\",\n                 \"index_type\": \"spot_pair\",\n                 \"is_composite\": false,\n                 \"price_method\": \"ltp\",\n                 \"quoting_asset_id\": 4,\n                 \"symbol\": \".DEXBTUSDT\",\n                 \"tick_size\": \"0.100000000000000000\",\n                 \"underlying_asset_id\": 2\n             },\n             \"liquidation_penalty_factor\": \"1\",\n             \"auction_start_time\": \"2025-12-22T12:18:52Z\",\n             \"is_quanto\": false,\n             \"state\": \"live\",\n             \"id\": 84,\n             \"settling_asset\": {\n                 \"base_withdrawal_fee\": \"0.000000000000000000\",\n                 \"id\": 4,\n                 \"interest_credit\": false,\n                 \"interest_slabs\": null,\n                 \"kyc_deposit_limit\": \"0.000000000000000000\",\n                 \"kyc_withdrawal_limit\": \"0.000000000000000000\",\n                 \"min_withdrawal_amount\": \"0.000000000000000000\",\n                 \"minimum_precision\": 2,\n                 \"name\": \"Tether\",\n                 \"networks\": [],\n                 \"precision\": 8,\n                 \"sort_priority\": null,\n                 \"symbol\": \"USDT\",\n                 \"variable_withdrawal_fee\": \"0.000000000000000000\"\n             },\n             \"tick_size\": \"0.1\",\n             \"impact_size\": 4000,\n             \"insurance_fund_margin_contribution\": \"5\",\n             \"maker_commission_rate\": \"0.0002\",\n             \"ui_config\": {\n                 \"default_trading_view_candle\": \"15\",\n                 \"leverage_slider_values\": [1,2,3,5,10,50,100],\n                 \"price_clubbing_values\": [0.1,1,10,50],\n                 \"show_bracket_orders\": false,\n                 \"sort_priority\": 1\n             },\n             \"annualized_funding\": \"0\",\n             \"strike_price\": null,\n             \"price_band\": \"100\",\n             \"funding_method\": \"mark_price\",\n             \"contract_value\": \"0.001\",\n             \"auction_finish_time\": null,\n             \"product_specs\": {\n                 \"vol_expiry_time\": 172800\n             },\n             \"launch_time\": \"2020-04-20T08:37:05Z\",\n             \"basis_factor_max_limit\": \"1000\",\n             \"initial_margin\": \"1\",\n             \"notional_type\": \"vanilla\",\n             \"contract_unit_currency\": \"BTC\",\n             \"disruption_reason\": null,\n             \"underlying_asset\": {\n                 \"base_withdrawal_fee\": \"0.000000000000000000\",\n                 \"id\": 2,\n                 \"interest_credit\": false,\n                 \"interest_slabs\": null,\n                 \"kyc_deposit_limit\": \"0.000000000000000000\",\n                 \"kyc_withdrawal_limit\": \"0.000000000000000000\",\n                 \"min_withdrawal_amount\": \"0.000000000000000000\",\n                 \"minimum_precision\": 4,\n                 \"name\": \"Bitcoin\",\n                 \"networks\": [],\n                 \"precision\": 8,\n                 \"sort_priority\": 1,\n                 \"symbol\": \"BTC\",\n                 \"variable_withdrawal_fee\": \"0.000000000000000000\"\n             },\n             \"initial_margin_scaling_factor\": \"0\",\n             \"position_size_limit\": 10000000,\n             \"max_leverage_notional\": \"10000\",\n             \"settlement_price\": null,\n             \"barrier_price\": null,\n             \"maintenance_margin\": \"0.5\",\n             \"default_leverage\": \"50.000000000000000000\",\n             \"settlement_time\": null,\n             \"description\": \"BTCUSDT-Bitcoin Perpetual futures, quoted,settled & margined in Tether(USDT)\",\n             \"contract_type\": \"perpetual_futures\"\n         },\n         \"product_id\": 84,\n         \"product_symbol\": \"BTCUSDT\",\n         \"realized_cashflow\": \"0.000000000000000000\",\n         \"realized_funding\": \"0\",\n         \"realized_holding_cost\": \"0\",\n         \"realized_pnl\": \"0\",\n         \"size\": 1,\n         \"unrealized_pnl\": \"-0.00519112\",\n         \"updated_at\": \"2026-01-14T11:24:35.801586Z\",\n         \"user_id\": 30084879\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionsADLRank\n        //\n        //     {\n        //         \"adl_level\": null,\n        //         \"auto_topup\": false,\n        //         \"bankruptcy_price\": \"88618.22667\",\n        //         \"commission\": \"0.03797924\",\n        //         \"created_at\": \"2026-01-14T11:24:35.801586Z\",\n        //         \"entry_price\": \"94948.1\",\n        //         \"liquidation_price\": \"89092.96717\",\n        //         \"margin\": \"6.32987333\",\n        //         \"margin_mode\": \"isolated\",\n        //         \"mark_price\": \"94942.90888022\",\n        //         \"product\": {\n        //             \"trading_status\": \"operational\",\n        //             \"short_description\": null,\n        //             \"quoting_asset\": {\n        //                 \"base_withdrawal_fee\": \"0.000000000000000000\",\n        //                 \"id\": 4,\n        //                 \"interest_credit\": false,\n        //                 \"interest_slabs\": null,\n        //                 \"kyc_deposit_limit\": \"0.000000000000000000\",\n        //                 \"kyc_withdrawal_limit\": \"0.000000000000000000\",\n        //                 \"min_withdrawal_amount\": \"0.000000000000000000\",\n        //                 \"minimum_precision\": 2,\n        //                 \"name\": \"Tether\",\n        //                 \"networks\": [],\n        //                 \"precision\": 8,\n        //                 \"sort_priority\": null,\n        //                 \"symbol\": \"USDT\",\n        //                 \"variable_withdrawal_fee\": \"0.000000000000000000\"\n        //             },\n        //             \"symbol\": \"BTCUSDT\",\n        //             \"taker_commission_rate\": \"0.0004\",\n        //             \"maintenance_margin_scaling_factor\": \"0\",\n        //             \"spot_index\": {\n        //                 \"config\": {\n        //                     \"impact_size\": {\n        //                         \"max_impact_size\": 150000,\n        //                         \"min_impact_size\": 5000,\n        //                         \"step_value\": 5000\n        //                     },\n        //                     \"quoting_asset\": \"USDT\",\n        //                     \"service_id\": 1,\n        //                     \"underlying_asset\": \"BTC\"\n        //                 },\n        //                 \"constituent_exchanges\": [\n        //                     {\n        //                         \"exchange\": \"binance\",\n        //                         \"health_interval\": 3000,\n        //                         \"health_priority\": 1,\n        //                         \"weight\": 1\n        //                     },\n        //                     {\n        //                         \"exchange\": \"gateio\",\n        //                         \"health_interval\": 3000,\n        //                         \"health_priority\": 3,\n        //                         \"weight\": 1\n        //                     },\n        //                     {\n        //                         \"exchange\": \"bybit\",\n        //                         \"health_interval\": 3000,\n        //                         \"health_priority\": 2,\n        //                         \"weight\": 1\n        //                     }\n        //                 ],\n        //                 \"constituent_indices\": null,\n        //                 \"description\": \"BTC Spot\",\n        //                 \"health_interval\": 300,\n        //                 \"id\": 2,\n        //                 \"impact_size\": \"1.000000000000000000\",\n        //                 \"index_type\": \"spot_pair\",\n        //                 \"is_composite\": false,\n        //                 \"price_method\": \"ltp\",\n        //                 \"quoting_asset_id\": 4,\n        //                 \"symbol\": \".DEXBTUSDT\",\n        //                 \"tick_size\": \"0.100000000000000000\",\n        //                 \"underlying_asset_id\": 2\n        //             },\n        //             \"liquidation_penalty_factor\": \"1\",\n        //             \"auction_start_time\": \"2025-12-22T12:18:52Z\",\n        //             \"is_quanto\": false,\n        //             \"state\": \"live\",\n        //             \"id\": 84,\n        //             \"settling_asset\": {\n        //                 \"base_withdrawal_fee\": \"0.000000000000000000\",\n        //                 \"id\": 4,\n        //                 \"interest_credit\": false,\n        //                 \"interest_slabs\": null,\n        //                 \"kyc_deposit_limit\": \"0.000000000000000000\",\n        //                 \"kyc_withdrawal_limit\": \"0.000000000000000000\",\n        //                 \"min_withdrawal_amount\": \"0.000000000000000000\",\n        //                 \"minimum_precision\": 2,\n        //                 \"name\": \"Tether\",\n        //                 \"networks\": [],\n        //                 \"precision\": 8,\n        //                 \"sort_priority\": null,\n        //                 \"symbol\": \"USDT\",\n        //                 \"variable_withdrawal_fee\": \"0.000000000000000000\"\n        //             },\n        //             \"tick_size\": \"0.1\",\n        //             \"impact_size\": 4000,\n        //             \"insurance_fund_margin_contribution\": \"5\",\n        //             \"maker_commission_rate\": \"0.0002\",\n        //             \"ui_config\": {\n        //                 \"default_trading_view_candle\": \"15\",\n        //                 \"leverage_slider_values\": [1,2,3,5,10,50,100],\n        //                 \"price_clubbing_values\": [0.1,1,10,50],\n        //                 \"show_bracket_orders\": false,\n        //                 \"sort_priority\": 1\n        //             },\n        //             \"annualized_funding\": \"0\",\n        //             \"strike_price\": null,\n        //             \"price_band\": \"100\",\n        //             \"funding_method\": \"mark_price\",\n        //             \"contract_value\": \"0.001\",\n        //             \"auction_finish_time\": null,\n        //             \"product_specs\": {\n        //                 \"vol_expiry_time\": 172800\n        //             },\n        //             \"launch_time\": \"2020-04-20T08:37:05Z\",\n        //             \"basis_factor_max_limit\": \"1000\",\n        //             \"initial_margin\": \"1\",\n        //             \"notional_type\": \"vanilla\",\n        //             \"contract_unit_currency\": \"BTC\",\n        //             \"disruption_reason\": null,\n        //             \"underlying_asset\": {\n        //                 \"base_withdrawal_fee\": \"0.000000000000000000\",\n        //                 \"id\": 2,\n        //                 \"interest_credit\": false,\n        //                 \"interest_slabs\": null,\n        //                 \"kyc_deposit_limit\": \"0.000000000000000000\",\n        //                 \"kyc_withdrawal_limit\": \"0.000000000000000000\",\n        //                 \"min_withdrawal_amount\": \"0.000000000000000000\",\n        //                 \"minimum_precision\": 4,\n        //                 \"name\": \"Bitcoin\",\n        //                 \"networks\": [],\n        //                 \"precision\": 8,\n        //                 \"sort_priority\": 1,\n        //                 \"symbol\": \"BTC\",\n        //                 \"variable_withdrawal_fee\": \"0.000000000000000000\"\n        //             },\n        //             \"initial_margin_scaling_factor\": \"0\",\n        //             \"position_size_limit\": 10000000,\n        //             \"max_leverage_notional\": \"10000\",\n        //             \"settlement_price\": null,\n        //             \"barrier_price\": null,\n        //             \"maintenance_margin\": \"0.5\",\n        //             \"default_leverage\": \"50.000000000000000000\",\n        //             \"settlement_time\": null,\n        //             \"description\": \"BTCUSDT-Bitcoin Perpetual futures, quoted,settled & margined in Tether(USDT)\",\n        //             \"contract_type\": \"perpetual_futures\"\n        //         },\n        //         \"product_id\": 84,\n        //         \"product_symbol\": \"BTCUSDT\",\n        //         \"realized_cashflow\": \"0.000000000000000000\",\n        //         \"realized_funding\": \"0\",\n        //         \"realized_holding_cost\": \"0\",\n        //         \"realized_pnl\": \"0\",\n        //         \"size\": 1,\n        //         \"unrealized_pnl\": \"-0.00519112\",\n        //         \"updated_at\": \"2026-01-14T11:24:35.801586Z\",\n        //         \"user_id\": 30084879\n        //     }\n        //\n        const marketId = this.safeString (info, 'product_symbol');\n        const datetime = this.safeString (info, 'created_at');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeInteger (info, 'adl_level'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1674,
        "line_end": 1689,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeList (response, 'result', []);\n        const result: Dict = { 'info': response };\n        const currenciesByNumericId = this.safeDict (this.options, 'currenciesByNumericId', {});\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'asset_id');\n            const currency = this.safeDict (currenciesByNumericId, currencyId);\n            const code = (currency === undefined) ? currencyId : currency['code'];\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'balance');\n            account['free'] = this.safeString (balance, 'available_balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2616,
        "line_end": 2642,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (marketId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\": 1915615,\n        \"user_id\": 27854758,\n        \"address\": \"TXYB4GdKsXKEWbeSNPsmGZu4ZVCkhVh1Zz\",\n        \"memo\": \"\",\n        \"status\": \"active\",\n        \"updated_at\": \"2023-01-12T06:03:46.000Z\",\n        \"created_at\": \"2023-01-12T06:03:46.000Z\",\n        \"asset_symbol\": \"USDT\",\n        \"network\": \"TRC20(TRON)\",\n        \"custodian\": \"fireblocks\"\n    }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        \"id\": 1915615,\n        //        \"user_id\": 27854758,\n        //        \"address\": \"TXYB4GdKsXKEWbeSNPsmGZu4ZVCkhVh1Zz\",\n        //        \"memo\": \"\",\n        //        \"status\": \"active\",\n        //        \"updated_at\": \"2023-01-12T06:03:46.000Z\",\n        //        \"created_at\": \"2023-01-12T06:03:46.000Z\",\n        //        \"asset_symbol\": \"USDT\",\n        //        \"network\": \"TRC20(TRON)\",\n        //        \"custodian\": \"fireblocks\"\n        //    }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const marketId = this.safeString (depositAddress, 'asset_symbol');\n        const networkId = this.safeString (depositAddress, 'network');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (marketId, currency),\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'tag': this.safeString (depositAddress, 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 2779,
        "line_end": 2846,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'spot_price')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.parseNumber (fundingRate)",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"close\": 30600.5,\n         \"contract_type\": \"perpetual_futures\",\n         \"funding_rate\": \"0.00602961\",\n         \"greeks\": null,\n         \"high\": 30803.0,\n         \"low\": 30265.5,\n         \"mark_basis\": \"-0.45601594\",\n         \"mark_price\": \"30600.10481568\",\n         \"oi\": \"469.9190\",\n         \"oi_change_usd_6h\": \"2226314.9900\",\n         \"oi_contracts\": \"469919\",\n         \"oi_value\": \"469.9190\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"14385640.6802\",\n         \"open\": 30458.5,\n         \"price_band\": {\n             \"lower_limit\": \"29067.08312627\",\n             \"upper_limit\": \"32126.77608693\"\n         },\n         \"product_id\": 139,\n         \"quotes\": {\n             \"ask_iv\": null,\n             \"ask_size\": \"965\",\n             \"best_ask\": \"30600.5\",\n             \"best_bid\": \"30599.5\",\n             \"bid_iv\": null,\n             \"bid_size\": \"196\",\n             \"impact_mid_price\": null,\n             \"mark_iv\": \"-0.44931641\"\n         },\n         \"size\": 1226303,\n         \"spot_price\": \"30612.85362773\",\n         \"symbol\": \"BTCUSDT\",\n         \"timestamp\": 1689136597460456,\n         \"turnover\": 37392218.45999999,\n         \"turnover_symbol\": \"USDT\",\n         \"turnover_usd\": 37392218.45999999,\n         \"volume\": 1226.3029999999485\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"close\": 30600.5,\n        //         \"contract_type\": \"perpetual_futures\",\n        //         \"funding_rate\": \"0.00602961\",\n        //         \"greeks\": null,\n        //         \"high\": 30803.0,\n        //         \"low\": 30265.5,\n        //         \"mark_basis\": \"-0.45601594\",\n        //         \"mark_price\": \"30600.10481568\",\n        //         \"oi\": \"469.9190\",\n        //         \"oi_change_usd_6h\": \"2226314.9900\",\n        //         \"oi_contracts\": \"469919\",\n        //         \"oi_value\": \"469.9190\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"14385640.6802\",\n        //         \"open\": 30458.5,\n        //         \"price_band\": {\n        //             \"lower_limit\": \"29067.08312627\",\n        //             \"upper_limit\": \"32126.77608693\"\n        //         },\n        //         \"product_id\": 139,\n        //         \"quotes\": {\n        //             \"ask_iv\": null,\n        //             \"ask_size\": \"965\",\n        //             \"best_ask\": \"30600.5\",\n        //             \"best_bid\": \"30599.5\",\n        //             \"bid_iv\": null,\n        //             \"bid_size\": \"196\",\n        //             \"impact_mid_price\": null,\n        //             \"mark_iv\": \"-0.44931641\"\n        //         },\n        //         \"size\": 1226303,\n        //         \"spot_price\": \"30612.85362773\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timestamp\": 1689136597460456,\n        //         \"turnover\": 37392218.45999999,\n        //         \"turnover_symbol\": \"USDT\",\n        //         \"turnover_usd\": 37392218.45999999,\n        //         \"volume\": 1226.3029999999485\n        //     }\n        //\n        const timestamp = this.safeIntegerProduct (contract, 'timestamp', 0.001);\n        const marketId = this.safeString (contract, 'symbol');\n        const fundingRateString = this.safeString (contract, 'funding_rate');\n        const fundingRate = Precise.stringDiv (fundingRateString, '100');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'markPrice': this.safeNumber (contract, 'mark_price'),\n            'indexPrice': this.safeNumber (contract, 'spot_price'),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.parseNumber (fundingRate),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 3403,
        "line_end": 3479,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (stats, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (stats, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (stats, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (stats, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "this.safeNumber (stats, 'rho')",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "this.safeNumber (quotes, 'bid_size')",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "this.safeNumber (quotes, 'ask_size')",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (quotes, 'bid_iv')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (quotes, 'ask_iv')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (quotes, 'mark_iv')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (quotes, 'best_bid')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (quotes, 'best_ask')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (greeks, 'spot_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"close\": 6793.0,\n         \"contract_type\": \"call_options\",\n         \"greeks\": {\n             \"delta\": \"0.94739174\",\n             \"gamma\": \"0.00002206\",\n             \"rho\": \"11.00890725\",\n             \"spot\": \"36839.58124652\",\n             \"theta\": \"-18.18365310\",\n             \"vega\": \"7.85209698\"\n         },\n         \"high\": 7556.0,\n         \"low\": 6793.0,\n         \"mark_price\": \"6955.70698909\",\n         \"mark_vol\": \"0.66916863\",\n         \"oi\": \"1.8980\",\n         \"oi_change_usd_6h\": \"110.4600\",\n         \"oi_contracts\": \"1898\",\n         \"oi_value\": \"1.8980\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"69940.7319\",\n         \"open\": 7.2e3,\n         \"price_band\": {\n             \"lower_limit\": \"5533.89814767\",\n             \"upper_limit\": \"11691.37688371\"\n         },\n         \"product_id\": 129508,\n         \"quotes\": {\n             \"ask_iv\": \"0.90180438\",\n             \"ask_size\": \"1898\",\n             \"best_ask\": \"7210\",\n             \"best_bid\": \"6913\",\n             \"bid_iv\": \"0.60881706\",\n             \"bid_size\": \"3163\",\n             \"impact_mid_price\": null,\n             \"mark_iv\": \"0.66973549\"\n         },\n         \"size\": 5,\n         \"spot_price\": \"36839.58153868\",\n         \"strike_price\": \"30000\",\n         \"symbol\": \"C-BTC-30000-241123\",\n         \"timestamp\": 1699584998504530,\n         \"turnover\": 184.41206804,\n         \"turnover_symbol\": \"USDT\",\n         \"turnover_usd\": 184.41206804,\n         \"volume\": 0.005\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"close\": 6793.0,\n        //         \"contract_type\": \"call_options\",\n        //         \"greeks\": {\n        //             \"delta\": \"0.94739174\",\n        //             \"gamma\": \"0.00002206\",\n        //             \"rho\": \"11.00890725\",\n        //             \"spot\": \"36839.58124652\",\n        //             \"theta\": \"-18.18365310\",\n        //             \"vega\": \"7.85209698\"\n        //         },\n        //         \"high\": 7556.0,\n        //         \"low\": 6793.0,\n        //         \"mark_price\": \"6955.70698909\",\n        //         \"mark_vol\": \"0.66916863\",\n        //         \"oi\": \"1.8980\",\n        //         \"oi_change_usd_6h\": \"110.4600\",\n        //         \"oi_contracts\": \"1898\",\n        //         \"oi_value\": \"1.8980\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"69940.7319\",\n        //         \"open\": 7.2e3,\n        //         \"price_band\": {\n        //             \"lower_limit\": \"5533.89814767\",\n        //             \"upper_limit\": \"11691.37688371\"\n        //         },\n        //         \"product_id\": 129508,\n        //         \"quotes\": {\n        //             \"ask_iv\": \"0.90180438\",\n        //             \"ask_size\": \"1898\",\n        //             \"best_ask\": \"7210\",\n        //             \"best_bid\": \"6913\",\n        //             \"bid_iv\": \"0.60881706\",\n        //             \"bid_size\": \"3163\",\n        //             \"impact_mid_price\": null,\n        //             \"mark_iv\": \"0.66973549\"\n        //         },\n        //         \"size\": 5,\n        //         \"spot_price\": \"36839.58153868\",\n        //         \"strike_price\": \"30000\",\n        //         \"symbol\": \"C-BTC-30000-241123\",\n        //         \"timestamp\": 1699584998504530,\n        //         \"turnover\": 184.41206804,\n        //         \"turnover_symbol\": \"USDT\",\n        //         \"turnover_usd\": 184.41206804,\n        //         \"volume\": 0.005\n        //     }\n        //\n        const timestamp = this.safeIntegerProduct (greeks, 'timestamp', 0.001);\n        const marketId = this.safeString (greeks, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const stats = this.safeDict (greeks, 'greeks', {});\n        const quotes = this.safeDict (greeks, 'quotes', {});\n        return {\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'delta': this.safeNumber (stats, 'delta'),\n            'gamma': this.safeNumber (stats, 'gamma'),\n            'theta': this.safeNumber (stats, 'theta'),\n            'vega': this.safeNumber (stats, 'vega'),\n            'rho': this.safeNumber (stats, 'rho'),\n            'bidSize': this.safeNumber (quotes, 'bid_size'),\n            'askSize': this.safeNumber (quotes, 'ask_size'),\n            'bidImpliedVolatility': this.safeNumber (quotes, 'bid_iv'),\n            'askImpliedVolatility': this.safeNumber (quotes, 'ask_iv'),\n            'markImpliedVolatility': this.safeNumber (quotes, 'mark_iv'),\n            'bidPrice': this.safeNumber (quotes, 'best_bid'),\n            'askPrice': this.safeNumber (quotes, 'best_ask'),\n            'markPrice': this.safeNumber (greeks, 'mark_price'),\n            'lastPrice': undefined,\n            'underlyingPrice': this.safeNumber (greeks, 'spot_price'),\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2517,
        "line_end": 2572,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "referenceAccount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "this.parseNumber (before)",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.parseNumber (after)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\":\"29.889184\",\n         \"asset_id\":5,\n         \"balance\":\"29.889184\",\n         \"created_at\":\"2020-11-15T21:25:01Z\",\n         \"meta_data\":{\n             \"deposit_id\":3884,\n             \"transaction_id\":\"0x41a60174849828530abb5008e98fc63c9b598288743ec4ba9620bcce900a3b8d\"\n         },\n         \"transaction_type\":\"deposit\",\n         \"user_id\":22142,\n         \"uuid\":\"70bb5679da3c4637884e2dc63efaa846\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"amount\":\"29.889184\",\n        //         \"asset_id\":5,\n        //         \"balance\":\"29.889184\",\n        //         \"created_at\":\"2020-11-15T21:25:01Z\",\n        //         \"meta_data\":{\n        //             \"deposit_id\":3884,\n        //             \"transaction_id\":\"0x41a60174849828530abb5008e98fc63c9b598288743ec4ba9620bcce900a3b8d\"\n        //         },\n        //         \"transaction_type\":\"deposit\",\n        //         \"user_id\":22142,\n        //         \"uuid\":\"70bb5679da3c4637884e2dc63efaa846\"\n        //     }\n        //\n        const id = this.safeString (item, 'uuid');\n        let direction = undefined;\n        const account = undefined;\n        const metaData = this.safeDict (item, 'meta_data', {});\n        const referenceId = this.safeString (metaData, 'transaction_id');\n        const referenceAccount = undefined;\n        let type = this.safeString (item, 'transaction_type');\n        if ((type === 'deposit') || (type === 'commission_rebate') || (type === 'referral_bonus') || (type === 'pnl') || (type === 'withdrawal_cancellation') || (type === 'promo_credit')) {\n            direction = 'in';\n        } else if ((type === 'withdrawal') || (type === 'commission') || (type === 'conversion') || (type === 'perpetual_futures_funding')) {\n            direction = 'out';\n        }\n        type = this.parseLedgerEntryType (type);\n        const currencyId = this.safeString (item, 'asset_id');\n        const currenciesByNumericId = this.safeDict (this.options, 'currenciesByNumericId');\n        currency = this.safeValue (currenciesByNumericId, currencyId, currency);\n        const code = (currency === undefined) ? undefined : currency['code'];\n        const amount = this.safeString (item, 'amount');\n        const timestamp = this.parse8601 (this.safeString (item, 'created_at'));\n        const after = this.safeString (item, 'balance');\n        const before = Precise.stringMax ('0', Precise.stringSub (after, amount));\n        const status = 'ok';\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': direction,\n            'account': account,\n            'referenceId': referenceId,\n            'referenceAccount': referenceAccount,\n            'type': type,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'before': this.parseNumber (before),\n            'after': this.parseNumber (after),\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2501,
        "line_end": 2515,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'pnl': 'pnl',\n            'deposit': 'transaction',\n            'withdrawal': 'transaction',\n            'commission': 'fee',\n            'conversion': 'trade',\n            // 'perpetual_futures_funding': 'perpetual_futures_funding',\n            // 'withdrawal_cancellation': 'withdrawal_cancellation',\n            'referral_bonus': 'referral',\n            'commission_rebate': 'rebate',\n            // 'promo_credit': 'promo_credit',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3124,
        "line_end": 3134,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'margin_mode')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'index_symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'margin_mode'),\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 3588,
        "line_end": 3598,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (marginMode, 'margin_mode')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        let symbol = undefined;\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        return {\n            'info': marginMode,\n            'symbol': symbol,\n            'marginMode': this.safeString (marginMode, 'margin_mode'),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 2915,
        "line_end": 2950,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "this.safeNumber (data, 'margin')",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"auto_topup\": false,\n         \"bankruptcy_price\": \"24934.12\",\n         \"commission\": \"0.01197072\",\n         \"created_at\": \"2023-07-20T03:49:09.159401Z\",\n         \"entry_price\": \"29926.8\",\n         \"liquidation_price\": \"25083.754\",\n         \"margin\": \"4.99268\",\n         \"margin_mode\": \"isolated\",\n         \"product_id\": 84,\n         \"product_symbol\": \"BTCUSDT\",\n         \"realized_cashflow\": \"0\",\n         \"realized_funding\": \"0\",\n         \"realized_pnl\": \"0\",\n         \"size\": 1,\n         \"updated_at\": \"2023-07-20T03:49:09.159401Z\",\n         \"user_id\": 30084879\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //     {\n        //         \"auto_topup\": false,\n        //         \"bankruptcy_price\": \"24934.12\",\n        //         \"commission\": \"0.01197072\",\n        //         \"created_at\": \"2023-07-20T03:49:09.159401Z\",\n        //         \"entry_price\": \"29926.8\",\n        //         \"liquidation_price\": \"25083.754\",\n        //         \"margin\": \"4.99268\",\n        //         \"margin_mode\": \"isolated\",\n        //         \"product_id\": 84,\n        //         \"product_symbol\": \"BTCUSDT\",\n        //         \"realized_cashflow\": \"0\",\n        //         \"realized_funding\": \"0\",\n        //         \"realized_pnl\": \"0\",\n        //         \"size\": 1,\n        //         \"updated_at\": \"2023-07-20T03:49:09.159401Z\",\n        //         \"user_id\": 30084879\n        //     }\n        //\n        const marketId = this.safeString (data, 'product_symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': this.safeNumber (data, 'margin'),\n            'code': undefined,\n            'status': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1594,
        "line_end": 1613,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"time\":1605393120,\n         \"open\":15989,\n         \"high\":15989,\n         \"low\":15987.5,\n         \"close\":15987.5,\n         \"volume\":565\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"time\":1605393120,\n        //         \"open\":15989,\n        //         \"high\":15989,\n        //         \"low\":15987.5,\n        //         \"close\":15987.5,\n        //         \"volume\":565\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'time'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3027,
        "line_end": 3089,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (interest, 'oi_value')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (interest, 'oi_value_usd')",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber (interest, 'oi_contracts')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "this.safeNumber (interest, 'oi')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"close\": 894.0,\n         \"contract_type\": \"call_options\",\n         \"greeks\": {\n             \"delta\": \"0.67324861\",\n             \"gamma\": \"0.00022178\",\n             \"rho\": \"4.34638266\",\n             \"spot\": \"30178.53195697\",\n             \"theta\": \"-35.64972577\",\n             \"vega\": \"16.34381277\"\n         },\n         \"high\": 946.0,\n         \"low\": 893.0,\n         \"mark_price\": \"1037.07582681\",\n         \"mark_vol\": \"0.35899491\",\n         \"oi\": \"0.0910\",\n         \"oi_change_usd_6h\": \"-90.5500\",\n         \"oi_contracts\": \"91\",\n         \"oi_value\": \"0.0910\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"2746.3549\",\n         \"open\": 946.0,\n         \"price_band\": {\n             \"lower_limit\": \"133.37794509\",\n             \"upper_limit\": \"5663.66930164\"\n         },\n         \"product_id\": 116171,\n         \"quotes\": {\n             \"ask_iv\": \"0.36932389\",\n             \"ask_size\": \"1321\",\n             \"best_ask\": \"1054\",\n             \"best_bid\": \"1020\",\n             \"bid_iv\": \"0.34851914\",\n             \"bid_size\": \"2202\",\n             \"impact_mid_price\": null,\n             \"mark_iv\": \"0.35896335\"\n         },\n         \"size\": 152,\n         \"spot_price\": \"30178.53195697\",\n         \"strike_price\": \"29500\",\n         \"symbol\": \"C-BTC-29500-280723\",\n         \"timestamp\": 1689834695286094,\n         \"turnover\": 4546.601744940001,\n         \"turnover_symbol\": \"USDT\",\n         \"turnover_usd\": 4546.601744940001,\n         \"volume\": 0.15200000000000002\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"close\": 894.0,\n        //         \"contract_type\": \"call_options\",\n        //         \"greeks\": {\n        //             \"delta\": \"0.67324861\",\n        //             \"gamma\": \"0.00022178\",\n        //             \"rho\": \"4.34638266\",\n        //             \"spot\": \"30178.53195697\",\n        //             \"theta\": \"-35.64972577\",\n        //             \"vega\": \"16.34381277\"\n        //         },\n        //         \"high\": 946.0,\n        //         \"low\": 893.0,\n        //         \"mark_price\": \"1037.07582681\",\n        //         \"mark_vol\": \"0.35899491\",\n        //         \"oi\": \"0.0910\",\n        //         \"oi_change_usd_6h\": \"-90.5500\",\n        //         \"oi_contracts\": \"91\",\n        //         \"oi_value\": \"0.0910\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"2746.3549\",\n        //         \"open\": 946.0,\n        //         \"price_band\": {\n        //             \"lower_limit\": \"133.37794509\",\n        //             \"upper_limit\": \"5663.66930164\"\n        //         },\n        //         \"product_id\": 116171,\n        //         \"quotes\": {\n        //             \"ask_iv\": \"0.36932389\",\n        //             \"ask_size\": \"1321\",\n        //             \"best_ask\": \"1054\",\n        //             \"best_bid\": \"1020\",\n        //             \"bid_iv\": \"0.34851914\",\n        //             \"bid_size\": \"2202\",\n        //             \"impact_mid_price\": null,\n        //             \"mark_iv\": \"0.35896335\"\n        //         },\n        //         \"size\": 152,\n        //         \"spot_price\": \"30178.53195697\",\n        //         \"strike_price\": \"29500\",\n        //         \"symbol\": \"C-BTC-29500-280723\",\n        //         \"timestamp\": 1689834695286094,\n        //         \"turnover\": 4546.601744940001,\n        //         \"turnover_symbol\": \"USDT\",\n        //         \"turnover_usd\": 4546.601744940001,\n        //         \"volume\": 0.15200000000000002\n        //     }\n        //\n        const timestamp = this.safeIntegerProduct (interest, 'timestamp', 0.001);\n        const marketId = this.safeString (interest, 'symbol');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId, market),\n            'baseVolume': this.safeNumber (interest, 'oi_value'),\n            'quoteVolume': this.safeNumber (interest, 'oi_value_usd'),\n            'openInterestAmount': this.safeNumber (interest, 'oi_contracts'),\n            'openInterestValue': this.safeNumber (interest, 'oi'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 3672,
        "line_end": 3745,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "this.safeNumber (quotes, 'mark_iv')",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "this.safeNumber (chain, 'oi')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (quotes, 'best_bid')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (quotes, 'best_ask')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "this.safeNumber (quotes, 'impact_mid_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (chain, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'spot_price')",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"close\": 6793.0,\n         \"contract_type\": \"call_options\",\n         \"greeks\": {\n             \"delta\": \"0.94739174\",\n             \"gamma\": \"0.00002206\",\n             \"rho\": \"11.00890725\",\n             \"spot\": \"36839.58124652\",\n             \"theta\": \"-18.18365310\",\n             \"vega\": \"7.85209698\"\n         },\n         \"high\": 7556.0,\n         \"low\": 6793.0,\n         \"mark_price\": \"6955.70698909\",\n         \"mark_vol\": \"0.66916863\",\n         \"oi\": \"1.8980\",\n         \"oi_change_usd_6h\": \"110.4600\",\n         \"oi_contracts\": \"1898\",\n         \"oi_value\": \"1.8980\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"69940.7319\",\n         \"open\": 7.2e3,\n         \"price_band\": {\n             \"lower_limit\": \"5533.89814767\",\n             \"upper_limit\": \"11691.37688371\"\n         },\n         \"product_id\": 129508,\n         \"quotes\": {\n             \"ask_iv\": \"0.90180438\",\n             \"ask_size\": \"1898\",\n             \"best_ask\": \"7210\",\n             \"best_bid\": \"6913\",\n             \"bid_iv\": \"0.60881706\",\n             \"bid_size\": \"3163\",\n             \"impact_mid_price\": null,\n             \"mark_iv\": \"0.66973549\"\n         },\n         \"size\": 5,\n         \"spot_price\": \"36839.58153868\",\n         \"strike_price\": \"30000\",\n         \"symbol\": \"C-BTC-30000-241123\",\n         \"timestamp\": 1699584998504530,\n         \"turnover\": 184.41206804,\n         \"turnover_symbol\": \"USDT\",\n         \"turnover_usd\": 184.41206804,\n         \"volume\": 0.005\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"close\": 6793.0,\n        //         \"contract_type\": \"call_options\",\n        //         \"greeks\": {\n        //             \"delta\": \"0.94739174\",\n        //             \"gamma\": \"0.00002206\",\n        //             \"rho\": \"11.00890725\",\n        //             \"spot\": \"36839.58124652\",\n        //             \"theta\": \"-18.18365310\",\n        //             \"vega\": \"7.85209698\"\n        //         },\n        //         \"high\": 7556.0,\n        //         \"low\": 6793.0,\n        //         \"mark_price\": \"6955.70698909\",\n        //         \"mark_vol\": \"0.66916863\",\n        //         \"oi\": \"1.8980\",\n        //         \"oi_change_usd_6h\": \"110.4600\",\n        //         \"oi_contracts\": \"1898\",\n        //         \"oi_value\": \"1.8980\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"69940.7319\",\n        //         \"open\": 7.2e3,\n        //         \"price_band\": {\n        //             \"lower_limit\": \"5533.89814767\",\n        //             \"upper_limit\": \"11691.37688371\"\n        //         },\n        //         \"product_id\": 129508,\n        //         \"quotes\": {\n        //             \"ask_iv\": \"0.90180438\",\n        //             \"ask_size\": \"1898\",\n        //             \"best_ask\": \"7210\",\n        //             \"best_bid\": \"6913\",\n        //             \"bid_iv\": \"0.60881706\",\n        //             \"bid_size\": \"3163\",\n        //             \"impact_mid_price\": null,\n        //             \"mark_iv\": \"0.66973549\"\n        //         },\n        //         \"size\": 5,\n        //         \"spot_price\": \"36839.58153868\",\n        //         \"strike_price\": \"30000\",\n        //         \"symbol\": \"C-BTC-30000-241123\",\n        //         \"timestamp\": 1699584998504530,\n        //         \"turnover\": 184.41206804,\n        //         \"turnover_symbol\": \"USDT\",\n        //         \"turnover_usd\": 184.41206804,\n        //         \"volume\": 0.005\n        //     }\n        //\n        const marketId = this.safeString (chain, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const quotes = this.safeDict (chain, 'quotes', {});\n        const timestamp = this.safeIntegerProduct (chain, 'timestamp', 0.001);\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': this.safeNumber (quotes, 'mark_iv'),\n            'openInterest': this.safeNumber (chain, 'oi'),\n            'bidPrice': this.safeNumber (quotes, 'best_bid'),\n            'askPrice': this.safeNumber (quotes, 'best_ask'),\n            'midPrice': this.safeNumber (quotes, 'impact_mid_price'),\n            'markPrice': this.safeNumber (chain, 'mark_price'),\n            'lastPrice': undefined,\n            'underlyingPrice': this.safeNumber (chain, 'spot_price'),\n            'change': undefined,\n            'percentage': undefined,\n            'baseVolume': this.safeNumber (chain, 'volume'),\n            'quoteVolume': undefined,\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1873,
        "line_end": 1990,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"average_fill_price\":null,\n         \"bracket_order\":null,\n         \"bracket_stop_loss_limit_price\":null,\n         \"bracket_stop_loss_price\":null,\n         \"bracket_take_profit_limit_price\":null,\n         \"bracket_take_profit_price\":null,\n         \"bracket_trail_amount\":null,\n         \"cancellation_reason\":null,\n         \"client_order_id\":null,\n         \"close_on_trigger\":\"false\",\n         \"commission\":\"0\",\n         \"created_at\":\"2020-11-16T02:38:26Z\",\n         \"id\":152870626,\n         \"limit_price\":\"10000\",\n         \"meta_data\":{\"source\":\"api\"},\n         \"order_type\":\"limit_order\",\n         \"paid_commission\":\"0\",\n         \"product_id\":139,\n         \"reduce_only\":false,\n         \"side\":\"buy\",\n         \"size\":0,\n         \"state\":\"open\",\n         \"stop_order_type\":null,\n         \"stop_price\":null,\n         \"stop_trigger_method\":\"mark_price\",\n         \"time_in_force\":\"gtc\",\n         \"trail_amount\":null,\n         \"unfilled_size\":0,\n         \"user_id\":22142\n     }",
          "{\n         \"id\": 123,\n         \"user_id\": 453671,\n         \"size\": 10,\n         \"unfilled_size\": 2,\n         \"side\": \"buy\",\n         \"order_type\": \"limit_order\",\n         \"limit_price\": \"59000\",\n         \"stop_order_type\": \"stop_loss_order\",\n         \"stop_price\": \"55000\",\n         \"paid_commission\": \"0.5432\",\n         \"commission\": \"0.5432\",\n         \"reduce_only\": false,\n         \"client_order_id\": \"my_signal_34521712\",\n         \"state\": \"open\",\n         \"created_at\": \"1725865012000000\",\n         \"product_id\": 27,\n         \"product_symbol\": \"BTCUSD\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, cancelOrder, editOrder, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"average_fill_price\":null,\n        //         \"bracket_order\":null,\n        //         \"bracket_stop_loss_limit_price\":null,\n        //         \"bracket_stop_loss_price\":null,\n        //         \"bracket_take_profit_limit_price\":null,\n        //         \"bracket_take_profit_price\":null,\n        //         \"bracket_trail_amount\":null,\n        //         \"cancellation_reason\":null,\n        //         \"client_order_id\":null,\n        //         \"close_on_trigger\":\"false\",\n        //         \"commission\":\"0\",\n        //         \"created_at\":\"2020-11-16T02:38:26Z\",\n        //         \"id\":152870626,\n        //         \"limit_price\":\"10000\",\n        //         \"meta_data\":{\"source\":\"api\"},\n        //         \"order_type\":\"limit_order\",\n        //         \"paid_commission\":\"0\",\n        //         \"product_id\":139,\n        //         \"reduce_only\":false,\n        //         \"side\":\"buy\",\n        //         \"size\":0,\n        //         \"state\":\"open\",\n        //         \"stop_order_type\":null,\n        //         \"stop_price\":null,\n        //         \"stop_trigger_method\":\"mark_price\",\n        //         \"time_in_force\":\"gtc\",\n        //         \"trail_amount\":null,\n        //         \"unfilled_size\":0,\n        //         \"user_id\":22142\n        //     }\n        //\n        // fetchOrder\n        //\n        //     {\n        //         \"id\": 123,\n        //         \"user_id\": 453671,\n        //         \"size\": 10,\n        //         \"unfilled_size\": 2,\n        //         \"side\": \"buy\",\n        //         \"order_type\": \"limit_order\",\n        //         \"limit_price\": \"59000\",\n        //         \"stop_order_type\": \"stop_loss_order\",\n        //         \"stop_price\": \"55000\",\n        //         \"paid_commission\": \"0.5432\",\n        //         \"commission\": \"0.5432\",\n        //         \"reduce_only\": false,\n        //         \"client_order_id\": \"my_signal_34521712\",\n        //         \"state\": \"open\",\n        //         \"created_at\": \"1725865012000000\",\n        //         \"product_id\": 27,\n        //         \"product_symbol\": \"BTCUSD\"\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const clientOrderId = this.safeString (order, 'client_order_id');\n        const createdAt = this.safeString (order, 'created_at');\n        let timestamp = undefined;\n        if (createdAt !== undefined) {\n            if (createdAt.indexOf ('-') >= 0) {\n                timestamp = this.parse8601 (createdAt);\n            } else {\n                timestamp = this.safeIntegerProduct (order, 'created_at', 0.001);\n            }\n        }\n        const marketId = this.safeString (order, 'product_id');\n        const marketsByNumericId = this.safeDict (this.options, 'marketsByNumericId', {});\n        market = this.safeValue (marketsByNumericId, marketId, market);\n        const symbol = (market === undefined) ? marketId : market['symbol'];\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const side = this.safeString (order, 'side');\n        let type = this.safeString (order, 'order_type');\n        if (type !== undefined) {\n            type = type.replace ('_order', '');\n        }\n        const price = this.safeString (order, 'limit_price');\n        const amount = this.safeString (order, 'size');\n        const remaining = this.safeString (order, 'unfilled_size');\n        const average = this.safeString (order, 'average_fill_price');\n        let fee = undefined;\n        const feeCostString = this.safeString (order, 'paid_commission');\n        if (feeCostString !== undefined) {\n            let feeCurrencyCode = undefined;\n            if (market !== undefined) {\n                const settlingAsset = this.safeDict (market['info'], 'settling_asset', {});\n                const feeCurrencyId = this.safeString (settlingAsset, 'symbol');\n                feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'average': average,\n            'filled': undefined,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1863,
        "line_end": 1871,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'open': 'open',\n            'pending': 'open',\n            'closed': 'closed',\n            'cancelled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1793,
        "line_end": 1861,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidation_price')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entry_price')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (sizeString)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"entry_price\":null,\n         \"size\":0,\n         \"timestamp\":1605454074268079\n     }",
          "{\n         \"user_id\": 0,\n         \"size\": 0,\n         \"entry_price\": \"string\",\n         \"margin\": \"string\",\n         \"liquidation_price\": \"string\",\n         \"bankruptcy_price\": \"string\",\n         \"adl_level\": 0,\n         \"product_id\": 0,\n         \"product_symbol\": \"string\",\n         \"commission\": \"string\",\n         \"realized_pnl\": \"string\",\n         \"realized_funding\": \"string\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // fetchPosition\n        //\n        //     {\n        //         \"entry_price\":null,\n        //         \"size\":0,\n        //         \"timestamp\":1605454074268079\n        //     }\n        //\n        //\n        // fetchPositions\n        //\n        //     {\n        //         \"user_id\": 0,\n        //         \"size\": 0,\n        //         \"entry_price\": \"string\",\n        //         \"margin\": \"string\",\n        //         \"liquidation_price\": \"string\",\n        //         \"bankruptcy_price\": \"string\",\n        //         \"adl_level\": 0,\n        //         \"product_id\": 0,\n        //         \"product_symbol\": \"string\",\n        //         \"commission\": \"string\",\n        //         \"realized_pnl\": \"string\",\n        //         \"realized_funding\": \"string\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'product_symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeIntegerProduct (position, 'timestamp', 0.001);\n        const sizeString = this.safeString (position, 'size');\n        let side = undefined;\n        if (sizeString !== undefined) {\n            if (Precise.stringGt (sizeString, '0')) {\n                side = 'buy';\n            } else if (Precise.stringLt (sizeString, '0')) {\n                side = 'sell';\n            }\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'notional': undefined,\n            'marginMode': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liquidation_price'),\n            'entryPrice': this.safeNumber (position, 'entry_price'),\n            'unrealizedPnl': undefined, // todo - realized_pnl ?\n            'percentage': undefined,\n            'contracts': this.parseNumber (sizeString),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'markPrice': undefined,\n            'side': side,\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 3258,
        "line_end": 3321,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'settlement_price')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_value\": \"0.001\",\n         \"basis_factor_max_limit\": \"10.95\",\n         \"maker_commission_rate\": \"0.0003\",\n         \"launch_time\": \"2023-07-19T04:30:03Z\",\n         \"trading_status\": \"operational\",\n         \"product_specs\": {\n             \"backup_vol_expiry_time\": 31536000,\n             \"max_deviation_from_external_vol\": 0.75,\n             \"max_lower_deviation_from_external_vol\": 0.75,\n             \"max_upper_deviation_from_external_vol\": 0.5,\n             \"max_volatility\": 3,\n             \"min_volatility\": 0.1,\n             \"premium_commission_rate\": 0.1,\n             \"settlement_index_price\": \"29993.536675710806\",\n             \"vol_calculation_method\": \"orderbook\",\n             \"vol_expiry_time\": 31536000\n         },\n         \"description\": \"BTC call option expiring on 19-7-2023\",\n         \"settlement_price\": \"0\",\n         \"disruption_reason\": null,\n         \"settling_asset\": {},\n         \"initial_margin\": \"1\",\n         \"tick_size\": \"0.1\",\n         \"maintenance_margin\": \"0.5\",\n         \"id\": 117542,\n         \"notional_type\": \"vanilla\",\n         \"ui_config\": {},\n         \"contract_unit_currency\": \"BTC\",\n         \"symbol\": \"C-BTC-30900-190723\",\n         \"insurance_fund_margin_contribution\": \"1\",\n         \"price_band\": \"2\",\n         \"annualized_funding\": \"10.95\",\n         \"impact_size\": 200,\n         \"contract_type\": \"call_options\",\n         \"position_size_limit\": 255633,\n         \"max_leverage_notional\": \"200000\",\n         \"initial_margin_scaling_factor\": \"0.000002\",\n         \"strike_price\": \"30900\",\n         \"is_quanto\": false,\n         \"settlement_time\": \"2023-07-19T12:00:00Z\",\n         \"liquidation_penalty_factor\": \"0.5\",\n         \"funding_method\": \"mark_price\",\n         \"taker_commission_rate\": \"0.0003\",\n         \"default_leverage\": \"100.000000000000000000\",\n         \"state\": \"expired\",\n         \"auction_start_time\": null,\n         \"short_description\": \"BTC  Call\",\n         \"quoting_asset\": {},\n         \"maintenance_margin_scaling_factor\":\"0.000002\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        //     {\n        //         \"contract_value\": \"0.001\",\n        //         \"basis_factor_max_limit\": \"10.95\",\n        //         \"maker_commission_rate\": \"0.0003\",\n        //         \"launch_time\": \"2023-07-19T04:30:03Z\",\n        //         \"trading_status\": \"operational\",\n        //         \"product_specs\": {\n        //             \"backup_vol_expiry_time\": 31536000,\n        //             \"max_deviation_from_external_vol\": 0.75,\n        //             \"max_lower_deviation_from_external_vol\": 0.75,\n        //             \"max_upper_deviation_from_external_vol\": 0.5,\n        //             \"max_volatility\": 3,\n        //             \"min_volatility\": 0.1,\n        //             \"premium_commission_rate\": 0.1,\n        //             \"settlement_index_price\": \"29993.536675710806\",\n        //             \"vol_calculation_method\": \"orderbook\",\n        //             \"vol_expiry_time\": 31536000\n        //         },\n        //         \"description\": \"BTC call option expiring on 19-7-2023\",\n        //         \"settlement_price\": \"0\",\n        //         \"disruption_reason\": null,\n        //         \"settling_asset\": {},\n        //         \"initial_margin\": \"1\",\n        //         \"tick_size\": \"0.1\",\n        //         \"maintenance_margin\": \"0.5\",\n        //         \"id\": 117542,\n        //         \"notional_type\": \"vanilla\",\n        //         \"ui_config\": {},\n        //         \"contract_unit_currency\": \"BTC\",\n        //         \"symbol\": \"C-BTC-30900-190723\",\n        //         \"insurance_fund_margin_contribution\": \"1\",\n        //         \"price_band\": \"2\",\n        //         \"annualized_funding\": \"10.95\",\n        //         \"impact_size\": 200,\n        //         \"contract_type\": \"call_options\",\n        //         \"position_size_limit\": 255633,\n        //         \"max_leverage_notional\": \"200000\",\n        //         \"initial_margin_scaling_factor\": \"0.000002\",\n        //         \"strike_price\": \"30900\",\n        //         \"is_quanto\": false,\n        //         \"settlement_time\": \"2023-07-19T12:00:00Z\",\n        //         \"liquidation_penalty_factor\": \"0.5\",\n        //         \"funding_method\": \"mark_price\",\n        //         \"taker_commission_rate\": \"0.0003\",\n        //         \"default_leverage\": \"100.000000000000000000\",\n        //         \"state\": \"expired\",\n        //         \"auction_start_time\": null,\n        //         \"short_description\": \"BTC  Call\",\n        //         \"quoting_asset\": {},\n        //         \"maintenance_margin_scaling_factor\":\"0.000002\"\n        //     }\n        //\n        const datetime = this.safeString (settlement, 'settlement_time');\n        const marketId = this.safeString (settlement, 'symbol');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'settlement_price'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 3323,
        "line_end": 3329,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSettlements (settlements, market) {\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 971,
        "line_end": 1116,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (quotes, 'best_bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeNumber (quotes, 'bid_size')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (quotes, 'best_ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeNumber (quotes, 'ask_size')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (ticker, 'turnover')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (ticker, 'spot_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"close\": 30634.0,\n         \"contract_type\": \"spot\",\n         \"greeks\": null,\n         \"high\": 30780.0,\n         \"low\": 30340.5,\n         \"mark_price\": \"48000\",\n         \"oi\": \"0.0000\",\n         \"oi_change_usd_6h\": \"0.0000\",\n         \"oi_contracts\": \"0\",\n         \"oi_value\": \"0.0000\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"0.0000\",\n         \"open\": 30464.0,\n         \"price_band\": null,\n         \"product_id\": 8320,\n         \"quotes\": {},\n         \"size\": 2.6816639999999996,\n         \"spot_price\": \"30637.91465121\",\n         \"symbol\": \"BTC_USDT\",\n         \"timestamp\": 1689139767621299,\n         \"turnover\": 2.6816639999999996,\n         \"turnover_symbol\": \"BTC\",\n         \"turnover_usd\": 81896.45613400004,\n         \"volume\": 2.6816639999999996\n     }",
          "{\n         \"close\": 30600.5,\n         \"contract_type\": \"perpetual_futures\",\n         \"funding_rate\": \"0.00602961\",\n         \"greeks\": null,\n         \"high\": 30803.0,\n         \"low\": 30265.5,\n         \"mark_basis\": \"-0.45601594\",\n         \"mark_price\": \"30600.10481568\",\n         \"oi\": \"469.9190\",\n         \"oi_change_usd_6h\": \"2226314.9900\",\n         \"oi_contracts\": \"469919\",\n         \"oi_value\": \"469.9190\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"14385640.6802\",\n         \"open\": 30458.5,\n         \"price_band\": {\n             \"lower_limit\": \"29067.08312627\",\n             \"upper_limit\": \"32126.77608693\"\n         },\n         \"product_id\": 139,\n         \"quotes\": {\n             \"ask_iv\": null,\n             \"ask_size\": \"965\",\n             \"best_ask\": \"30600.5\",\n             \"best_bid\": \"30599.5\",\n             \"bid_iv\": null,\n             \"bid_size\": \"196\",\n             \"impact_mid_price\": null,\n             \"mark_iv\": \"-0.44931641\"\n         },\n         \"size\": 1226303,\n         \"spot_price\": \"30612.85362773\",\n         \"symbol\": \"BTCUSDT\",\n         \"timestamp\": 1689136597460456,\n         \"turnover\": 37392218.45999999,\n         \"turnover_symbol\": \"USDT\",\n         \"turnover_usd\": 37392218.45999999,\n         \"volume\": 1226.3029999999485\n     }",
          "{\n         \"contract_type\": \"call_options\",\n         \"greeks\": {\n             \"delta\": \"0.60873994\",\n             \"gamma\": \"0.00014854\",\n             \"rho\": \"7.71808010\",\n             \"spot\": \"30598.49040622\",\n             \"theta\": \"-30.44743017\",\n             \"vega\": \"24.83508248\"\n         },\n         \"mark_price\": \"1347.74819696\",\n         \"mark_vol\": \"0.39966303\",\n         \"oi\": \"2.7810\",\n         \"oi_change_usd_6h\": \"0.0000\",\n         \"oi_contracts\": \"2781\",\n         \"oi_value\": \"2.7810\",\n         \"oi_value_symbol\": \"BTC\",\n         \"oi_value_usd\": \"85127.4337\",\n         \"price_band\": {\n             \"lower_limit\": \"91.27423497\",\n             \"upper_limit\": \"7846.19454697\"\n         },\n         \"product_id\": 107150,\n         \"quotes\": {\n             \"ask_iv\": \"0.41023239\",\n             \"ask_size\": \"2397\",\n             \"best_ask\": \"1374\",\n             \"best_bid\": \"1322\",\n             \"bid_iv\": \"0.38929375\",\n             \"bid_size\": \"3995\",\n             \"impact_mid_price\": null,\n             \"mark_iv\": \"0.39965618\"\n         },\n         \"spot_price\": \"30598.43379314\",\n         \"strike_price\": \"30000\",\n         \"symbol\": \"C-BTC-30000-280723\",\n         \"timestamp\": 1689136932893181,\n         \"turnover_symbol\": \"USDT\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"close\": 30634.0,\n        //         \"contract_type\": \"spot\",\n        //         \"greeks\": null,\n        //         \"high\": 30780.0,\n        //         \"low\": 30340.5,\n        //         \"mark_price\": \"48000\",\n        //         \"oi\": \"0.0000\",\n        //         \"oi_change_usd_6h\": \"0.0000\",\n        //         \"oi_contracts\": \"0\",\n        //         \"oi_value\": \"0.0000\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"0.0000\",\n        //         \"open\": 30464.0,\n        //         \"price_band\": null,\n        //         \"product_id\": 8320,\n        //         \"quotes\": {},\n        //         \"size\": 2.6816639999999996,\n        //         \"spot_price\": \"30637.91465121\",\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"timestamp\": 1689139767621299,\n        //         \"turnover\": 2.6816639999999996,\n        //         \"turnover_symbol\": \"BTC\",\n        //         \"turnover_usd\": 81896.45613400004,\n        //         \"volume\": 2.6816639999999996\n        //     }\n        //\n        // swap: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"close\": 30600.5,\n        //         \"contract_type\": \"perpetual_futures\",\n        //         \"funding_rate\": \"0.00602961\",\n        //         \"greeks\": null,\n        //         \"high\": 30803.0,\n        //         \"low\": 30265.5,\n        //         \"mark_basis\": \"-0.45601594\",\n        //         \"mark_price\": \"30600.10481568\",\n        //         \"oi\": \"469.9190\",\n        //         \"oi_change_usd_6h\": \"2226314.9900\",\n        //         \"oi_contracts\": \"469919\",\n        //         \"oi_value\": \"469.9190\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"14385640.6802\",\n        //         \"open\": 30458.5,\n        //         \"price_band\": {\n        //             \"lower_limit\": \"29067.08312627\",\n        //             \"upper_limit\": \"32126.77608693\"\n        //         },\n        //         \"product_id\": 139,\n        //         \"quotes\": {\n        //             \"ask_iv\": null,\n        //             \"ask_size\": \"965\",\n        //             \"best_ask\": \"30600.5\",\n        //             \"best_bid\": \"30599.5\",\n        //             \"bid_iv\": null,\n        //             \"bid_size\": \"196\",\n        //             \"impact_mid_price\": null,\n        //             \"mark_iv\": \"-0.44931641\"\n        //         },\n        //         \"size\": 1226303,\n        //         \"spot_price\": \"30612.85362773\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"timestamp\": 1689136597460456,\n        //         \"turnover\": 37392218.45999999,\n        //         \"turnover_symbol\": \"USDT\",\n        //         \"turnover_usd\": 37392218.45999999,\n        //         \"volume\": 1226.3029999999485\n        //     }\n        //\n        // option: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"contract_type\": \"call_options\",\n        //         \"greeks\": {\n        //             \"delta\": \"0.60873994\",\n        //             \"gamma\": \"0.00014854\",\n        //             \"rho\": \"7.71808010\",\n        //             \"spot\": \"30598.49040622\",\n        //             \"theta\": \"-30.44743017\",\n        //             \"vega\": \"24.83508248\"\n        //         },\n        //         \"mark_price\": \"1347.74819696\",\n        //         \"mark_vol\": \"0.39966303\",\n        //         \"oi\": \"2.7810\",\n        //         \"oi_change_usd_6h\": \"0.0000\",\n        //         \"oi_contracts\": \"2781\",\n        //         \"oi_value\": \"2.7810\",\n        //         \"oi_value_symbol\": \"BTC\",\n        //         \"oi_value_usd\": \"85127.4337\",\n        //         \"price_band\": {\n        //             \"lower_limit\": \"91.27423497\",\n        //             \"upper_limit\": \"7846.19454697\"\n        //         },\n        //         \"product_id\": 107150,\n        //         \"quotes\": {\n        //             \"ask_iv\": \"0.41023239\",\n        //             \"ask_size\": \"2397\",\n        //             \"best_ask\": \"1374\",\n        //             \"best_bid\": \"1322\",\n        //             \"bid_iv\": \"0.38929375\",\n        //             \"bid_size\": \"3995\",\n        //             \"impact_mid_price\": null,\n        //             \"mark_iv\": \"0.39965618\"\n        //         },\n        //         \"spot_price\": \"30598.43379314\",\n        //         \"strike_price\": \"30000\",\n        //         \"symbol\": \"C-BTC-30000-280723\",\n        //         \"timestamp\": 1689136932893181,\n        //         \"turnover_symbol\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.safeIntegerProduct (ticker, 'timestamp', 0.001);\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString (ticker, 'close');\n        const quotes = this.safeDict (ticker, 'quotes', {});\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeNumber (ticker, 'high'),\n            'low': this.safeNumber (ticker, 'low'),\n            'bid': this.safeNumber (quotes, 'best_bid'),\n            'bidVolume': this.safeNumber (quotes, 'bid_size'),\n            'ask': this.safeNumber (quotes, 'best_ask'),\n            'askVolume': this.safeNumber (quotes, 'ask_size'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeNumber (ticker, 'volume'),\n            'quoteVolume': this.safeNumber (ticker, 'turnover'),\n            'markPrice': this.safeNumber (ticker, 'mark_price'),\n            'indexPrice': this.safeNumber (ticker, 'spot_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1457,
        "line_end": 1555,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"buyer_role\":\"maker\",\n         \"price\":\"15896.5\",\n         \"seller_role\":\"taker\",\n         \"size\":241,\n         \"symbol\":\"BTCUSDT\",\n         \"timestamp\":1605376684714595\n     }",
          "{\n         \"commission\":\"0.008335000000000000\",\n         \"created_at\":\"2020-11-16T19:07:19Z\",\n         \"fill_type\":\"normal\",\n         \"id\":\"e7ff05c233a74245b72381f8dd91d1ce\",\n         \"meta_data\":{\n             \"effective_commission_rate\":\"0.0005\",\n             \"order_price\":\"16249\",\n             \"order_size\":1,\n             \"order_type\":\"market_order\",\n             \"order_unfilled_size\":0,\n             \"trading_fee_credits_used\":\"0\"\n         },\n         \"order_id\":\"152999629\",\n         \"price\":\"16669\",\n         \"product\":{\n             \"contract_type\":\"perpetual_futures\",\n             \"contract_unit_currency\":\"BTC\",\n             \"contract_value\":\"0.001\",\n             \"id\":139,\n             \"notional_type\":\"vanilla\",\n             \"quoting_asset\":{\"minimum_precision\":2,\"precision\":6,\"symbol\":\"USDT\"},\n             \"settling_asset\":{\"minimum_precision\":2,\"precision\":6,\"symbol\":\"USDT\"},\n             \"symbol\":\"BTCUSDT\",\n             \"tick_size\":\"0.5\",\n             \"underlying_asset\":{\"minimum_precision\":4,\"precision\":8,\"symbol\":\"BTC\"}\n         },\n         \"product_id\":139,\n         \"role\":\"taker\",\n         \"side\":\"sell\",\n         \"size\":1\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"buyer_role\":\"maker\",\n        //         \"price\":\"15896.5\",\n        //         \"seller_role\":\"taker\",\n        //         \"size\":241,\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"timestamp\":1605376684714595\n        //     }\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"commission\":\"0.008335000000000000\",\n        //         \"created_at\":\"2020-11-16T19:07:19Z\",\n        //         \"fill_type\":\"normal\",\n        //         \"id\":\"e7ff05c233a74245b72381f8dd91d1ce\",\n        //         \"meta_data\":{\n        //             \"effective_commission_rate\":\"0.0005\",\n        //             \"order_price\":\"16249\",\n        //             \"order_size\":1,\n        //             \"order_type\":\"market_order\",\n        //             \"order_unfilled_size\":0,\n        //             \"trading_fee_credits_used\":\"0\"\n        //         },\n        //         \"order_id\":\"152999629\",\n        //         \"price\":\"16669\",\n        //         \"product\":{\n        //             \"contract_type\":\"perpetual_futures\",\n        //             \"contract_unit_currency\":\"BTC\",\n        //             \"contract_value\":\"0.001\",\n        //             \"id\":139,\n        //             \"notional_type\":\"vanilla\",\n        //             \"quoting_asset\":{\"minimum_precision\":2,\"precision\":6,\"symbol\":\"USDT\"},\n        //             \"settling_asset\":{\"minimum_precision\":2,\"precision\":6,\"symbol\":\"USDT\"},\n        //             \"symbol\":\"BTCUSDT\",\n        //             \"tick_size\":\"0.5\",\n        //             \"underlying_asset\":{\"minimum_precision\":4,\"precision\":8,\"symbol\":\"BTC\"}\n        //         },\n        //         \"product_id\":139,\n        //         \"role\":\"taker\",\n        //         \"side\":\"sell\",\n        //         \"size\":1\n        //     }\n        //\n        const id = this.safeString (trade, 'id');\n        const orderId = this.safeString (trade, 'order_id');\n        let timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n        timestamp = this.safeIntegerProduct (trade, 'timestamp', 0.001, timestamp);\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'size');\n        const product = this.safeDict (trade, 'product', {});\n        const marketId = this.safeString (product, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const sellerRole = this.safeString (trade, 'seller_role');\n        let side = this.safeString (trade, 'side');\n        if (side === undefined) {\n            if (sellerRole === 'taker') {\n                side = 'sell';\n            } else if (sellerRole === 'maker') {\n                side = 'buy';\n            }\n        }\n        const takerOrMaker = this.safeString (trade, 'role');\n        const metaData = this.safeDict (trade, 'meta_data', {});\n        let type = this.safeString (metaData, 'order_type');\n        if (type !== undefined) {\n            type = type.replace ('_order', '');\n        }\n        const feeCostString = this.safeString (trade, 'commission');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const settlingAsset = this.safeDict (product, 'settling_asset', {});\n            const feeCurrencyId = this.safeString (settlingAsset, 'symbol');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      }
    ],
    "deribit": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 771,
        "line_end": 792,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "account",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (account, 'id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (account, 'type')",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"username\": \"someusername_1\",\n          \"type\": \"subaccount\",\n          \"system_name\": \"someusername_1\",\n          \"security_keys_enabled\": false,\n          \"security_keys_assignments\": [],\n          \"receive_notifications\": false,\n          \"login_enabled\": false,\n          \"is_password\": false,\n          \"id\": \"245499\",\n          \"email\": \"pablo@abcdef.com\"\n      }"
        ],
        "source": "parseAccount (account) {\n        //\n        //      {\n        //          \"username\": \"someusername_1\",\n        //          \"type\": \"subaccount\",\n        //          \"system_name\": \"someusername_1\",\n        //          \"security_keys_enabled\": false,\n        //          \"security_keys_assignments\": [],\n        //          \"receive_notifications\": false,\n        //          \"login_enabled\": false,\n        //          \"is_password\": false,\n        //          \"id\": \"245499\",\n        //          \"email\": \"pablo@abcdef.com\"\n        //      }\n        //\n        return {\n            'info': account,\n            'id': this.safeString (account, 'id'),\n            'type': this.safeString (account, 'type'),\n            'code': undefined,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (balance): Balances",
        "line_start": 1032,
        "line_end": 1053,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (balance): Balances {\n        const result: Dict = {\n            'info': balance,\n        };\n        let summaries = [];\n        if ('summaries' in balance) {\n            summaries = this.safeList (balance, 'summaries');\n        } else {\n            summaries = [ balance ];\n        }\n        for (let i = 0; i < summaries.length; i++) {\n            const data = summaries[i];\n            const currencyId = this.safeString (data, 'currency');\n            const currencyCode = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (data, 'available_funds');\n            account['used'] = this.safeString (data, 'maintenance_margin');\n            account['total'] = this.safeString (data, 'equity');\n            result[currencyCode] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 3102,
        "line_end": 3127,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': this.safeNumber (fee, 'withdrawal_fee'),\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"withdrawal_priorities\": [],\n      \"withdrawal_fee\": 0.01457324,\n      \"min_withdrawal_fee\": 0.000001,\n      \"min_confirmations\": 1,\n      \"fee_precision\": 8,\n      \"currency_long\": \"Solana\",\n      \"currency\": \"SOL\",\n      \"coin_type\": \"SOL\"\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //      \"withdrawal_priorities\": [],\n        //      \"withdrawal_fee\": 0.01457324,\n        //      \"min_withdrawal_fee\": 0.000001,\n        //      \"min_confirmations\": 1,\n        //      \"fee_precision\": 8,\n        //      \"currency_long\": \"Solana\",\n        //      \"currency\": \"SOL\",\n        //      \"coin_type\": \"SOL\"\n        //    }\n        //\n        return {\n            'info': fee,\n            'withdraw': {\n                'fee': this.safeNumber (fee, 'withdrawal_fee'),\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3275,
        "line_end": 3317,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'index_price')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "result",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "'8h'",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"jsonrpc\":\"2.0\",\n       \"result\":\"0\",\n       \"usIn\":\"1691161645596519\",\n       \"usOut\":\"1691161645597149\",\n       \"usDiff\":\"630\",\n       \"testnet\":false\n   }",
          "{\n     \"timestamp\": 1569891600000,\n     \"index_price\": 8222.87,\n     \"prev_index_price\": 8305.72,\n     \"interest_8h\": -0.00009234260068476106,\n     \"interest_1h\": -4.739622041017375e-7\n   }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //   {\n        //       \"jsonrpc\":\"2.0\",\n        //       \"result\":\"0\",\n        //       \"usIn\":\"1691161645596519\",\n        //       \"usOut\":\"1691161645597149\",\n        //       \"usDiff\":\"630\",\n        //       \"testnet\":false\n        //   }\n        // history\n        //   {\n        //     \"timestamp\": 1569891600000,\n        //     \"index_price\": 8222.87,\n        //     \"prev_index_price\": 8305.72,\n        //     \"interest_8h\": -0.00009234260068476106,\n        //     \"interest_1h\": -4.739622041017375e-7\n        //   }\n        //\n        const timestamp = this.safeInteger (contract, 'timestamp');\n        const datetime = this.iso8601 (timestamp);\n        const result = this.safeNumber2 (contract, 'result', 'interest_8h');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': undefined,\n            'indexPrice': this.safeNumber (contract, 'index_price'),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'fundingRate': result,\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': '8h',\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 3552,
        "line_end": 3617,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (stats, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (stats, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (stats, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (stats, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "this.safeNumber (stats, 'rho')",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "this.safeNumber (greeks, 'best_bid_amount')",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "this.safeNumber (greeks, 'best_ask_amount')",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bid_iv')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'ask_iv')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'mark_iv')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (greeks, 'best_bid_price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (greeks, 'best_ask_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (greeks, 'last_price')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (greeks, 'underlying_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"estimated_delivery_price\": 36552.72,\n         \"best_bid_amount\": 0.2,\n         \"best_ask_amount\": 9.1,\n         \"interest_rate\": 0.0,\n         \"best_bid_price\": 0.214,\n         \"best_ask_price\": 0.219,\n         \"open_interest\": 368.8,\n         \"settlement_price\": 0.22103022,\n         \"last_price\": 0.215,\n         \"bid_iv\": 60.51,\n         \"ask_iv\": 61.88,\n         \"mark_iv\": 61.27,\n         \"underlying_index\": \"BTC-27SEP24\",\n         \"underlying_price\": 38992.71,\n         \"min_price\": 0.1515,\n         \"max_price\": 0.326,\n         \"mark_price\": 0.2168,\n         \"instrument_name\": \"BTC-27SEP24-40000-C\",\n         \"index_price\": 36552.72,\n         \"greeks\": {\n             \"rho\": 130.63998,\n             \"theta\": -13.48784,\n             \"vega\": 141.90146,\n             \"gamma\": 0.00002,\n             \"delta\": 0.59621\n         },\n         \"stats\": {\n             \"volume_usd\": 100453.9,\n             \"volume\": 12.0,\n             \"price_change\": -2.2727,\n             \"low\": 0.2065,\n             \"high\": 0.238\n         },\n         \"state\": \"open\",\n         \"timestamp\": 1699578548021\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"estimated_delivery_price\": 36552.72,\n        //         \"best_bid_amount\": 0.2,\n        //         \"best_ask_amount\": 9.1,\n        //         \"interest_rate\": 0.0,\n        //         \"best_bid_price\": 0.214,\n        //         \"best_ask_price\": 0.219,\n        //         \"open_interest\": 368.8,\n        //         \"settlement_price\": 0.22103022,\n        //         \"last_price\": 0.215,\n        //         \"bid_iv\": 60.51,\n        //         \"ask_iv\": 61.88,\n        //         \"mark_iv\": 61.27,\n        //         \"underlying_index\": \"BTC-27SEP24\",\n        //         \"underlying_price\": 38992.71,\n        //         \"min_price\": 0.1515,\n        //         \"max_price\": 0.326,\n        //         \"mark_price\": 0.2168,\n        //         \"instrument_name\": \"BTC-27SEP24-40000-C\",\n        //         \"index_price\": 36552.72,\n        //         \"greeks\": {\n        //             \"rho\": 130.63998,\n        //             \"theta\": -13.48784,\n        //             \"vega\": 141.90146,\n        //             \"gamma\": 0.00002,\n        //             \"delta\": 0.59621\n        //         },\n        //         \"stats\": {\n        //             \"volume_usd\": 100453.9,\n        //             \"volume\": 12.0,\n        //             \"price_change\": -2.2727,\n        //             \"low\": 0.2065,\n        //             \"high\": 0.238\n        //         },\n        //         \"state\": \"open\",\n        //         \"timestamp\": 1699578548021\n        //     }\n        //\n        const timestamp = this.safeInteger (greeks, 'timestamp');\n        const marketId = this.safeString (greeks, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        const stats = this.safeValue (greeks, 'greeks', {});\n        return {\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'delta': this.safeNumber (stats, 'delta'),\n            'gamma': this.safeNumber (stats, 'gamma'),\n            'theta': this.safeNumber (stats, 'theta'),\n            'vega': this.safeNumber (stats, 'vega'),\n            'rho': this.safeNumber (stats, 'rho'),\n            'bidSize': this.safeNumber (greeks, 'best_bid_amount'),\n            'askSize': this.safeNumber (greeks, 'best_ask_amount'),\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bid_iv'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'ask_iv'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'mark_iv'),\n            'bidPrice': this.safeNumber (greeks, 'best_bid_price'),\n            'askPrice': this.safeNumber (greeks, 'best_ask_price'),\n            'markPrice': this.safeNumber (greeks, 'mark_price'),\n            'lastPrice': this.safeNumber (greeks, 'last_price'),\n            'underlyingPrice': this.safeNumber (greeks, 'underlying_price'),\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 3459,
        "line_end": 3484,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'session_bankrupcy')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"type\": \"bankruptcy\",\n         \"timestamp\": 1696579200041,\n         \"funded\": 1,\n         \"session_bankrupcy\": 0.001,\n         \"session_profit_loss\": 0.001,\n         \"session_tax\": 0.0015,\n         \"session_tax_rate\": 0.0015,\n         \"socialized\": 0.001,\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"type\": \"bankruptcy\",\n        //         \"timestamp\": 1696579200041,\n        //         \"funded\": 1,\n        //         \"session_bankrupcy\": 0.001,\n        //         \"session_profit_loss\": 0.001,\n        //         \"session_tax\": 0.0015,\n        //         \"session_tax_rate\": 0.0015,\n        //         \"socialized\": 0.001,\n        //     }\n        //\n        const timestamp = this.safeInteger (liquidation, 'timestamp');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (undefined, market),\n            'contracts': undefined,\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': undefined,\n            'baseValue': this.safeNumber (liquidation, 'session_bankrupcy'),\n            'quoteValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3831,
        "line_end": 3874,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "openInterestAmount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openInterestValue",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"high\": 93099.5,\n         \"low\": 81773.0,\n         \"last\": 87197.0,\n         \"instrument_name\": \"BTC-PERPETUAL\",\n         \"bid_price\": 87083.0,\n         \"ask_price\": 87149.5,\n         \"open_interest\": 9978911260,\n         \"mark_price\": 87102.01,\n         \"creation_timestamp\": 1763674177068,\n         \"price_change\": -3.2032,\n         \"volume\": 7377.18657991,\n         \"estimated_delivery_price\": 87047.2,\n         \"base_currency\": \"BTC\",\n         \"quote_currency\": \"USD\",\n         \"volume_usd\": 661040250.0,\n         \"volume_notional\": 661040250.0,\n         \"current_funding\": 1.2966e-4,\n         \"funding_8h\": -8.1069e-4,\n         \"mid_price\": 87116.25\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"high\": 93099.5,\n        //         \"low\": 81773.0,\n        //         \"last\": 87197.0,\n        //         \"instrument_name\": \"BTC-PERPETUAL\",\n        //         \"bid_price\": 87083.0,\n        //         \"ask_price\": 87149.5,\n        //         \"open_interest\": 9978911260,\n        //         \"mark_price\": 87102.01,\n        //         \"creation_timestamp\": 1763674177068,\n        //         \"price_change\": -3.2032,\n        //         \"volume\": 7377.18657991,\n        //         \"estimated_delivery_price\": 87047.2,\n        //         \"base_currency\": \"BTC\",\n        //         \"quote_currency\": \"USD\",\n        //         \"volume_usd\": 661040250.0,\n        //         \"volume_notional\": 661040250.0,\n        //         \"current_funding\": 1.2966e-4,\n        //         \"funding_8h\": -8.1069e-4,\n        //         \"mid_price\": 87116.25\n        //     }\n        //\n        const timestamp = this.safeInteger (interest, 'creation_timestamp');\n        const marketId = this.safeString (interest, 'instrument_name');\n        market = this.safeMarket (marketId, market);\n        const openInterest = this.safeNumber (interest, 'open_interest');\n        let openInterestAmount = undefined;\n        let openInterestValue = undefined;\n        if (market['option'] || (market['future'] && market['linear'])) {\n            openInterestAmount = openInterest;\n        } else {\n            openInterestValue = openInterest;\n        }\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId, market),\n            'openInterestAmount': openInterestAmount,\n            'openInterestValue': openInterestValue,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 3725,
        "line_end": 3773,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "this.safeNumber (chain, 'open_interest')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bid_price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'ask_price')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "this.safeNumber (chain, 'mid_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (chain, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'last')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'underlying_price')",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (chain, 'price_change')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (chain, 'volume_usd')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"mid_price\": 0.04025,\n         \"volume_usd\": 11045.12,\n         \"quote_currency\": \"BTC\",\n         \"estimated_delivery_price\": 65444.72,\n         \"creation_timestamp\": 1711100949273,\n         \"base_currency\": \"BTC\",\n         \"underlying_index\": \"BTC-27DEC24\",\n         \"underlying_price\": 73742.14,\n         \"volume\": 4.0,\n         \"interest_rate\": 0.0,\n         \"price_change\": -6.9767,\n         \"open_interest\": 274.2,\n         \"ask_price\": 0.042,\n         \"bid_price\": 0.0385,\n         \"instrument_name\": \"BTC-27DEC24-240000-C\",\n         \"mark_price\": 0.04007735,\n         \"last\": 0.04,\n         \"low\": 0.04,\n         \"high\": 0.043\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"mid_price\": 0.04025,\n        //         \"volume_usd\": 11045.12,\n        //         \"quote_currency\": \"BTC\",\n        //         \"estimated_delivery_price\": 65444.72,\n        //         \"creation_timestamp\": 1711100949273,\n        //         \"base_currency\": \"BTC\",\n        //         \"underlying_index\": \"BTC-27DEC24\",\n        //         \"underlying_price\": 73742.14,\n        //         \"volume\": 4.0,\n        //         \"interest_rate\": 0.0,\n        //         \"price_change\": -6.9767,\n        //         \"open_interest\": 274.2,\n        //         \"ask_price\": 0.042,\n        //         \"bid_price\": 0.0385,\n        //         \"instrument_name\": \"BTC-27DEC24-240000-C\",\n        //         \"mark_price\": 0.04007735,\n        //         \"last\": 0.04,\n        //         \"low\": 0.04,\n        //         \"high\": 0.043\n        //     }\n        //\n        const marketId = this.safeString (chain, 'instrument_name');\n        market = this.safeMarket (marketId, market);\n        const currencyId = this.safeString (chain, 'base_currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger (chain, 'timestamp');\n        return {\n            'info': chain,\n            'currency': code,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': undefined,\n            'openInterest': this.safeNumber (chain, 'open_interest'),\n            'bidPrice': this.safeNumber (chain, 'bid_price'),\n            'askPrice': this.safeNumber (chain, 'ask_price'),\n            'midPrice': this.safeNumber (chain, 'mid_price'),\n            'markPrice': this.safeNumber (chain, 'mark_price'),\n            'lastPrice': this.safeNumber (chain, 'last'),\n            'underlyingPrice': this.safeNumber (chain, 'underlying_price'),\n            'change': undefined,\n            'percentage': this.safeNumber (chain, 'price_change'),\n            'baseVolume': this.safeNumber (chain, 'volume'),\n            'quoteVolume': this.safeNumber (chain, 'volume_usd'),\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1871,
        "line_end": 1966,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeValue (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "averageString",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filledString",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time_in_force\": \"good_til_cancelled\",\n         \"reduce_only\": false,\n         \"profit_loss\": 0,\n         \"price\": \"market_price\",\n         \"post_only\": false,\n         \"order_type\": \"market\",\n         \"order_state\": \"filled\",\n         \"order_id\": \"ETH-349249\",\n         \"max_show\": 40,\n         \"last_update_timestamp\": 1550657341322,\n         \"label\": \"market0000234\",\n         \"is_liquidation\": false,\n         \"instrument_name\": \"ETH-PERPETUAL\",\n         \"filled_amount\": 40,\n         \"direction\": \"buy\",\n         \"creation_timestamp\": 1550657341322,\n         \"commission\": 0.000139,\n         \"average_price\": 143.81,\n         \"api\": true,\n         \"amount\": 40,\n         \"trades\": [], // injected by createOrder\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"time_in_force\": \"good_til_cancelled\",\n        //         \"reduce_only\": false,\n        //         \"profit_loss\": 0,\n        //         \"price\": \"market_price\",\n        //         \"post_only\": false,\n        //         \"order_type\": \"market\",\n        //         \"order_state\": \"filled\",\n        //         \"order_id\": \"ETH-349249\",\n        //         \"max_show\": 40,\n        //         \"last_update_timestamp\": 1550657341322,\n        //         \"label\": \"market0000234\",\n        //         \"is_liquidation\": false,\n        //         \"instrument_name\": \"ETH-PERPETUAL\",\n        //         \"filled_amount\": 40,\n        //         \"direction\": \"buy\",\n        //         \"creation_timestamp\": 1550657341322,\n        //         \"commission\": 0.000139,\n        //         \"average_price\": 143.81,\n        //         \"api\": true,\n        //         \"amount\": 40,\n        //         \"trades\": [], // injected by createOrder\n        //     }\n        //\n        const marketId = this.safeString (order, 'instrument_name');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (order, 'creation_timestamp');\n        const lastUpdate = this.safeInteger (order, 'last_update_timestamp');\n        const id = this.safeString (order, 'order_id');\n        let priceString = this.safeString (order, 'price');\n        if (priceString === 'market_price') {\n            priceString = undefined;\n        }\n        const averageString = this.safeString (order, 'average_price');\n        // Inverse contracts amount is in USD which in ccxt is the cost\n        // For options and Linear contracts amount is in corresponding cryptocurrency, e.g., BTC or ETH\n        const filledString = this.safeString (order, 'filled_amount');\n        const amount = this.safeString (order, 'amount');\n        let cost = Precise.stringMul (filledString, averageString);\n        if (this.safeBool (market, 'inverse')) {\n            if (averageString !== '0') {\n                cost = Precise.stringDiv (amount, averageString);\n            }\n        }\n        let lastTradeTimestamp = undefined;\n        if (filledString !== undefined) {\n            const isFilledPositive = Precise.stringGt (filledString, '0');\n            if (isFilledPositive) {\n                lastTradeTimestamp = lastUpdate;\n            }\n        }\n        const status = this.parseOrderStatus (this.safeString (order, 'order_state'));\n        const side = this.safeStringLower (order, 'direction');\n        let feeCostString = this.safeString (order, 'commission');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            feeCostString = Precise.stringAbs (feeCostString);\n            fee = {\n                'cost': feeCostString,\n                'currency': market['base'],\n            };\n        }\n        const rawType = this.safeString (order, 'order_type');\n        const type = this.parseOrderType (rawType);\n        // injected in createOrder\n        const trades = this.safeValue (order, 'trades');\n        const timeInForce = this.parseTimeInForce (this.safeString (order, 'time_in_force'));\n        const postOnly = this.safeValue (order, 'post_only');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': priceString,\n            'triggerPrice': this.safeValue (order, 'stop_price'),\n            'amount': amount,\n            'cost': cost,\n            'average': averageString,\n            'filled': filledString,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': trades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1841,
        "line_end": 1850,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'open': 'open',\n            'cancelled': 'canceled',\n            'filled': 'closed',\n            'rejected': 'rejected',\n            'untriggered': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (orderType)",
        "line_start": 1861,
        "line_end": 1869,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (orderType) {\n        const orderTypes: Dict = {\n            'stop_limit': 'limit',\n            'take_limit': 'limit',\n            'stop_market': 'market',\n            'take_market': 'market',\n        };\n        return this.safeString (orderTypes, orderType, orderType);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2681,
        "line_end": 2747,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (Precise.stringMul (Precise.stringDiv (initialMarginString, notionalStringAbs), '100'))",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMarginString)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (Precise.stringMul (Precise.stringDiv (maintenanceMarginString, notionalStringAbs), '100'))",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'average_price')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notionalStringAbs)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeInteger (position, 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealizedPnl)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realized_profit_loss')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'size')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (position, 'contractSize')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'estimated_liquidation_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"jsonrpc\": \"2.0\",\n         \"id\": 404,\n         \"result\": {\n             \"average_price\": 0,\n             \"delta\": 0,\n             \"direction\": \"buy\",\n             \"estimated_liquidation_price\": 0,\n             \"floating_profit_loss\": 0,\n             \"index_price\": 3555.86,\n             \"initial_margin\": 0,\n             \"instrument_name\": \"BTC-PERPETUAL\",\n             \"leverage\": 100,\n             \"kind\": \"future\",\n             \"maintenance_margin\": 0,\n             \"mark_price\": 3556.62,\n             \"open_orders_margin\": 0.000165889,\n             \"realized_profit_loss\": 0,\n             \"settlement_price\": 3555.44,\n             \"size\": 0,\n             \"size_currency\": 0,\n             \"total_profit_loss\": 0\n         }\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"jsonrpc\": \"2.0\",\n        //         \"id\": 404,\n        //         \"result\": {\n        //             \"average_price\": 0,\n        //             \"delta\": 0,\n        //             \"direction\": \"buy\",\n        //             \"estimated_liquidation_price\": 0,\n        //             \"floating_profit_loss\": 0,\n        //             \"index_price\": 3555.86,\n        //             \"initial_margin\": 0,\n        //             \"instrument_name\": \"BTC-PERPETUAL\",\n        //             \"leverage\": 100,\n        //             \"kind\": \"future\",\n        //             \"maintenance_margin\": 0,\n        //             \"mark_price\": 3556.62,\n        //             \"open_orders_margin\": 0.000165889,\n        //             \"realized_profit_loss\": 0,\n        //             \"settlement_price\": 3555.44,\n        //             \"size\": 0,\n        //             \"size_currency\": 0,\n        //             \"total_profit_loss\": 0\n        //         }\n        //     }\n        //\n        const contract = this.safeString (position, 'instrument_name');\n        market = this.safeMarket (contract, market);\n        let side = this.safeString (position, 'direction');\n        side = (side === 'buy') ? 'long' : 'short';\n        const unrealizedPnl = this.safeString (position, 'floating_profit_loss');\n        const initialMarginString = this.safeString (position, 'initial_margin');\n        const notionalString = this.safeString (position, 'size_currency');\n        const notionalStringAbs = Precise.stringAbs (notionalString);\n        const maintenanceMarginString = this.safeString (position, 'maintenance_margin');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': undefined,\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (Precise.stringMul (Precise.stringDiv (initialMarginString, notionalStringAbs), '100')),\n            'maintenanceMargin': this.parseNumber (maintenanceMarginString),\n            'maintenanceMarginPercentage': this.parseNumber (Precise.stringMul (Precise.stringDiv (maintenanceMarginString, notionalStringAbs), '100')),\n            'entryPrice': this.safeNumber (position, 'average_price'),\n            'notional': this.parseNumber (notionalStringAbs),\n            'leverage': this.safeInteger (position, 'leverage'),\n            'unrealizedPnl': this.parseNumber (unrealizedPnl),\n            'realizedPnl': this.safeNumber (position, 'realized_profit_loss'),\n            'contracts': this.safeNumber (position, 'size'),\n            'contractSize': this.safeNumber (position, 'contractSize'),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'estimated_liquidation_price'),\n            'markPrice': this.safeNumber (position, 'mark_price'),\n            'lastPrice': undefined,\n            'collateral': undefined,\n            'marginMode': undefined,\n            'side': side,\n            'percentage': undefined,\n            'hedged': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1211,
        "line_end": 1287,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (stats, 'high', 'max_price')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (stats, 'low', 'min_price')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'best_bid_price', 'bid_price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'best_bid_amount')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'best_ask_price', 'ask_price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'best_ask_amount')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (stats, 'volume')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'index_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"timestamp\": 1583778859480,\n         \"stats\": { volume: 60627.57263769, low: 7631.5, high: 8311.5 },\n         \"state\": \"open\",\n         \"settlement_price\": 7903.21,\n         \"open_interest\": 111543850,\n         \"min_price\": 7634,\n         \"max_price\": 7866.51,\n         \"mark_price\": 7750.02,\n         \"last_price\": 7750.5,\n         \"instrument_name\": \"BTC-PERPETUAL\",\n         \"index_price\": 7748.01,\n         \"funding_8h\": 0.0000026,\n         \"current_funding\": 0,\n         \"best_bid_price\": 7750,\n         \"best_bid_amount\": 19470,\n         \"best_ask_price\": 7750.5,\n         \"best_ask_amount\": 343280\n     }",
          "{\n         \"volume\": 124.1,\n         \"underlying_price\": 7856.445926872601,\n         \"underlying_index\": \"SYN.BTC-10MAR20\",\n         \"quote_currency\": \"USD\",\n         \"open_interest\": 121.8,\n         \"mid_price\": 0.01975,\n         \"mark_price\": 0.01984559,\n         \"low\": 0.0095,\n         \"last\": 0.0205,\n         \"interest_rate\": 0,\n         \"instrument_name\": \"BTC-10MAR20-7750-C\",\n         \"high\": 0.0295,\n         \"estimated_delivery_price\": 7856.29,\n         \"creation_timestamp\": 1583783678366,\n         \"bid_price\": 0.0185,\n         \"base_currency\": \"BTC\",\n         \"ask_price\": 0.021\n     },"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker /public/ticker\n        //\n        //     {\n        //         \"timestamp\": 1583778859480,\n        //         \"stats\": { volume: 60627.57263769, low: 7631.5, high: 8311.5 },\n        //         \"state\": \"open\",\n        //         \"settlement_price\": 7903.21,\n        //         \"open_interest\": 111543850,\n        //         \"min_price\": 7634,\n        //         \"max_price\": 7866.51,\n        //         \"mark_price\": 7750.02,\n        //         \"last_price\": 7750.5,\n        //         \"instrument_name\": \"BTC-PERPETUAL\",\n        //         \"index_price\": 7748.01,\n        //         \"funding_8h\": 0.0000026,\n        //         \"current_funding\": 0,\n        //         \"best_bid_price\": 7750,\n        //         \"best_bid_amount\": 19470,\n        //         \"best_ask_price\": 7750.5,\n        //         \"best_ask_amount\": 343280\n        //     }\n        //\n        // fetchTicker /public/get_book_summary_by_instrument\n        // fetchTickers /public/get_book_summary_by_currency\n        //\n        //     {\n        //         \"volume\": 124.1,\n        //         \"underlying_price\": 7856.445926872601,\n        //         \"underlying_index\": \"SYN.BTC-10MAR20\",\n        //         \"quote_currency\": \"USD\",\n        //         \"open_interest\": 121.8,\n        //         \"mid_price\": 0.01975,\n        //         \"mark_price\": 0.01984559,\n        //         \"low\": 0.0095,\n        //         \"last\": 0.0205,\n        //         \"interest_rate\": 0,\n        //         \"instrument_name\": \"BTC-10MAR20-7750-C\",\n        //         \"high\": 0.0295,\n        //         \"estimated_delivery_price\": 7856.29,\n        //         \"creation_timestamp\": 1583783678366,\n        //         \"bid_price\": 0.0185,\n        //         \"base_currency\": \"BTC\",\n        //         \"ask_price\": 0.021\n        //     },\n        //\n        const timestamp = this.safeInteger2 (ticker, 'timestamp', 'creation_timestamp');\n        const marketId = this.safeString (ticker, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString2 (ticker, 'last_price', 'last');\n        const stats = this.safeValue (ticker, 'stats', ticker);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (stats, 'high', 'max_price'),\n            'low': this.safeString2 (stats, 'low', 'min_price'),\n            'bid': this.safeString2 (ticker, 'best_bid_price', 'bid_price'),\n            'bidVolume': this.safeString (ticker, 'best_bid_amount'),\n            'ask': this.safeString2 (ticker, 'best_ask_price', 'ask_price'),\n            'askVolume': this.safeString (ticker, 'best_ask_amount'),\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': this.safeString (stats, 'volume'),\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'indexPrice': this.safeString (ticker, 'index_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1852,
        "line_end": 1859,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'good_til_cancelled': 'GTC',\n            'fill_or_kill': 'FOK',\n            'immediate_or_cancel': 'IOC',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1499,
        "line_end": 1587,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (trade, 'order_type')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"trade_seq\":132564271,\n          \"trade_id\":\"195402220\",\n          \"timestamp\":1639684927932,\n          \"tick_direction\":0,\n          \"price\":47946.5,\n          \"mark_price\":47944.13,\n          \"instrument_name\":\"BTC-PERPETUAL\",\n          \"index_price\":47925.45,\n          \"direction\":\"buy\",\n          \"amount\":580.0\n      }",
          "{\n         \"trade_seq\": 3,\n         \"trade_id\": \"ETH-34066\",\n         \"timestamp\": 1550219814585,\n         \"tick_direction\": 1,\n         \"state\": \"open\",\n         \"self_trade\": false,\n         \"reduce_only\": false,\n         \"price\": 0.04,\n         \"post_only\": false,\n         \"order_type\": \"limit\",\n         \"order_id\": \"ETH-334607\",\n         \"matching_id\": null,\n         \"liquidity\": \"M\",\n         \"iv\": 56.83,\n         \"instrument_name\": \"ETH-22FEB19-120-C\",\n         \"index_price\": 121.37,\n         \"fee_currency\": \"ETH\",\n         \"fee\": 0.0011,\n         \"direction\": \"buy\",\n         \"amount\": 11\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"trade_seq\":132564271,\n        //          \"trade_id\":\"195402220\",\n        //          \"timestamp\":1639684927932,\n        //          \"tick_direction\":0,\n        //          \"price\":47946.5,\n        //          \"mark_price\":47944.13,\n        //          \"instrument_name\":\"BTC-PERPETUAL\",\n        //          \"index_price\":47925.45,\n        //          \"direction\":\"buy\",\n        //          \"amount\":580.0\n        //      }\n        //\n        //\n        // fetchMyTrades, fetchOrderTrades (private)\n        //\n        //     {\n        //         \"trade_seq\": 3,\n        //         \"trade_id\": \"ETH-34066\",\n        //         \"timestamp\": 1550219814585,\n        //         \"tick_direction\": 1,\n        //         \"state\": \"open\",\n        //         \"self_trade\": false,\n        //         \"reduce_only\": false,\n        //         \"price\": 0.04,\n        //         \"post_only\": false,\n        //         \"order_type\": \"limit\",\n        //         \"order_id\": \"ETH-334607\",\n        //         \"matching_id\": null,\n        //         \"liquidity\": \"M\",\n        //         \"iv\": 56.83,\n        //         \"instrument_name\": \"ETH-22FEB19-120-C\",\n        //         \"index_price\": 121.37,\n        //         \"fee_currency\": \"ETH\",\n        //         \"fee\": 0.0011,\n        //         \"direction\": \"buy\",\n        //         \"amount\": 11\n        //     }\n        //\n        const id = this.safeString (trade, 'trade_id');\n        const marketId = this.safeString (trade, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const side = this.safeString (trade, 'direction');\n        const priceString = this.safeString (trade, 'price');\n        market = this.safeMarket (marketId, market);\n        // Amount for inverse perpetual and futures is in USD which in ccxt is the cost\n        // For options amount and linear is in corresponding cryptocurrency contracts, e.g., BTC or ETH\n        const amount = this.safeString (trade, 'amount');\n        let cost = Precise.stringMul (amount, priceString);\n        if (market['inverse']) {\n            cost = Precise.stringDiv (amount, priceString);\n        }\n        const liquidity = this.safeString (trade, 'liquidity');\n        let takerOrMaker = undefined;\n        if (liquidity !== undefined) {\n            // M = maker, T = taker, MT = both\n            takerOrMaker = (liquidity === 'M') ? 'maker' : 'taker';\n        }\n        const feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fee_currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': this.safeString (trade, 'order_id'),\n            'type': this.safeString (trade, 'order_type'),\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2611,
        "line_end": 2679,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transaction_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n         \"amount\": 0.5,\n         \"confirmed_timestamp\": null,\n         \"created_timestamp\": 1550571443070,\n         \"currency\": \"BTC\",\n         \"fee\": 0.0001,\n         \"id\": 1,\n         \"priority\": 0.15,\n         \"state\": \"unconfirmed\",\n         \"transaction_id\": null,\n         \"updated_timestamp\": 1550571443070\n     }",
          "{\n         \"address\": \"2N35qDKDY22zmJq9eSyiAerMD4enJ1xx6ax\",\n         \"amount\": 5,\n         \"currency\": \"BTC\",\n         \"received_timestamp\": 1549295017670,\n         \"state\": \"completed\",\n         \"transaction_id\": \"230669110fdaf0a0dbcdc079b6b8b43d5af29cc73683835b9bc6b3406c065fda\",\n         \"updated_timestamp\": 1549295130159\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n        //         \"amount\": 0.5,\n        //         \"confirmed_timestamp\": null,\n        //         \"created_timestamp\": 1550571443070,\n        //         \"currency\": \"BTC\",\n        //         \"fee\": 0.0001,\n        //         \"id\": 1,\n        //         \"priority\": 0.15,\n        //         \"state\": \"unconfirmed\",\n        //         \"transaction_id\": null,\n        //         \"updated_timestamp\": 1550571443070\n        //     }\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"address\": \"2N35qDKDY22zmJq9eSyiAerMD4enJ1xx6ax\",\n        //         \"amount\": 5,\n        //         \"currency\": \"BTC\",\n        //         \"received_timestamp\": 1549295017670,\n        //         \"state\": \"completed\",\n        //         \"transaction_id\": \"230669110fdaf0a0dbcdc079b6b8b43d5af29cc73683835b9bc6b3406c065fda\",\n        //         \"updated_timestamp\": 1549295130159\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger2 (transaction, 'created_timestamp', 'received_timestamp');\n        const updated = this.safeInteger (transaction, 'updated_timestamp');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const address = this.safeString (transaction, 'address');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let type = 'deposit';\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            type = 'withdrawal';\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'transaction_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'network': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2603,
        "line_end": 2609,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'completed': 'ok',\n            'unconfirmed': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 3029,
        "line_end": 3059,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "direction !== 'payment' ? account : undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "direction === 'payment' ? account : undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"updated_timestamp\": 1550232862350,\n         \"type\": \"user\",\n         \"state\": \"prepared\",\n         \"other_side\": \"0x4aa0753d798d668056920094d65321a8e8913e26\",\n         \"id\": 3,\n         \"direction\": \"payment\",\n         \"currency\": \"ETH\",\n         \"created_timestamp\": 1550232862350,\n         \"amount\": 13.456\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //     {\n        //         \"updated_timestamp\": 1550232862350,\n        //         \"type\": \"user\",\n        //         \"state\": \"prepared\",\n        //         \"other_side\": \"0x4aa0753d798d668056920094d65321a8e8913e26\",\n        //         \"id\": 3,\n        //         \"direction\": \"payment\",\n        //         \"currency\": \"ETH\",\n        //         \"created_timestamp\": 1550232862350,\n        //         \"amount\": 13.456\n        //     }\n        //\n        const timestamp = this.safeTimestamp (transfer, 'created_timestamp');\n        const status = this.safeString (transfer, 'state');\n        const account = this.safeString (transfer, 'other_side');\n        const direction = this.safeString (transfer, 'direction');\n        const currencyId = this.safeString (transfer, 'currency');\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'id'),\n            'status': this.parseTransferStatus (status),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'fromAccount': direction !== 'payment' ? account : undefined,\n            'toAccount': direction === 'payment' ? account : undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 3061,
        "line_end": 3069,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'prepared': 'pending',\n            'confirmed': 'ok',\n            'cancelled': 'cancelled',\n            'waiting_for_admin': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseVolatilityHistory",
        "signature": "parseVolatilityHistory (volatility)",
        "line_start": 2883,
        "line_end": 2911,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "volatilityObj",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "volatility",
            "value": "volatilityObj",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"jsonrpc\": \"2.0\",\n         \"result\": [\n             [1640142000000,63.828320460740585],\n             [1640142000000,63.828320460740585],\n             [1640145600000,64.03821964123213]\n         ],\n         \"usIn\": 1641515379467734,\n         \"usOut\": 1641515379468095,\n         \"usDiff\": 361,\n         \"testnet\": false\n     }"
        ],
        "source": "parseVolatilityHistory (volatility) {\n        //\n        //     {\n        //         \"jsonrpc\": \"2.0\",\n        //         \"result\": [\n        //             [1640142000000,63.828320460740585],\n        //             [1640142000000,63.828320460740585],\n        //             [1640145600000,64.03821964123213]\n        //         ],\n        //         \"usIn\": 1641515379467734,\n        //         \"usOut\": 1641515379468095,\n        //         \"usDiff\": 361,\n        //         \"testnet\": false\n        //     }\n        //\n        const volatilityResult = this.safeValue (volatility, 'result', []);\n        const result = [];\n        for (let i = 0; i < volatilityResult.length; i++) {\n            const timestamp = this.safeInteger (volatilityResult[i], 0);\n            const volatilityObj = this.safeNumber (volatilityResult[i], 1);\n            result.push ({\n                'info': volatilityObj,\n                'timestamp': timestamp,\n                'datetime': this.iso8601 (timestamp),\n                'volatility': volatilityObj,\n            });\n        }\n        return result;\n    }"
      }
    ],
    "derive": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2462,
        "line_end": 2484,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const subaccount = response[i];\n            const collaterals = this.safeList (subaccount, 'collaterals', []);\n            for (let j = 0; j < collaterals.length; j++) {\n                const balance = collaterals[j];\n                const code = this.safeCurrencyCode (this.safeString (balance, 'currency'));\n                let account = this.safeDict (result, code);\n                if (account === undefined) {\n                    account = this.account ();\n                    account['total'] = this.safeString (balance, 'amount');\n                } else {\n                    const amount = this.safeString (balance, 'amount');\n                    account['total'] = Precise.stringAdd (account['total'], amount);\n                }\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1115,
        "line_end": 1138,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        const symbol = this.safeString (contract, 'symbol');\n        const fundingTimestamp = this.safeInteger (contract, 'timestamp');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 2368,
        "line_end": 2392,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"instrument_name\": \"BTC-PERP\",\n     \"timestamp\": 1738065307565,\n     \"funding\": \"0\",\n     \"pnl\": \"-0.39547479770461644\"\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        // {\n        //     \"instrument_name\": \"BTC-PERP\",\n        //     \"timestamp\": 1738065307565,\n        //     \"funding\": \"0\",\n        //     \"pnl\": \"-0.39547479770461644\"\n        // }\n        //\n        const marketId = this.safeString (income, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        const rate = this.safeString (income, 'funding');\n        const code = this.safeCurrencyCode ('USDC');\n        const timestamp = this.safeInteger (income, 'timestamp');\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': undefined,\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 636,
        "line_end": 739,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "margin",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeBool (market, 'is_active')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "(swap || option)",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "(spot) ? undefined : 1",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (market, 'taker_fee_rate')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (market, 'maker_fee_rate')",
            "comment": null
          },
          {
            "key": "strike",
            "value": "strike",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "optionType",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'amount_step'),\n                'price': this.safeNumber (market, 'tick_size'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minimum_amount'),\n                    'max': this.safeNumber (market, 'maximum_amount'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'amount_step')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tick_size')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minimum_amount'),\n                    'max': this.safeNumber (market, 'maximum_amount'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const type = this.safeString (market, 'instrument_type');\n        let marketType: MarketType;\n        let spot = false;\n        let margin = true;\n        let swap = false;\n        let option = false;\n        let linear: Bool = undefined;\n        let inverse: Bool = undefined;\n        const baseId = this.safeString (market, 'base_currency');\n        const quoteId = this.safeString (market, 'quote_currency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const marketId = this.safeString (market, 'instrument_name');\n        let symbol = base + '/' + quote;\n        let settleId: Str = undefined;\n        let settle: Str = undefined;\n        let expiry: Num = undefined;\n        let strike: Num = undefined;\n        let optionType: Str = undefined;\n        let optionLetter: Str = undefined;\n        if (type === 'erc20') {\n            spot = true;\n            marketType = 'spot';\n        } else if (type === 'perp') {\n            margin = false;\n            settleId = 'USDC';\n            settle = this.safeCurrencyCode (settleId);\n            symbol = base + '/' + quote + ':' + settle;\n            swap = true;\n            linear = true;\n            inverse = false;\n            marketType = 'swap';\n        } else if (type === 'option') {\n            settleId = 'USDC';\n            settle = this.safeCurrencyCode (settleId);\n            margin = false;\n            option = true;\n            marketType = 'option';\n            const optionDetails = this.safeDict (market, 'option_details');\n            expiry = this.safeTimestamp (optionDetails, 'expiry');\n            strike = this.safeInteger (optionDetails, 'strike');\n            optionLetter = this.safeString (optionDetails, 'option_type');\n            symbol = base + '/' + quote + ':' + settle + '-' + this.yymmdd (expiry) + '-' + this.numberToString (strike) + '-' + optionLetter;\n            if (optionLetter === 'P') {\n                optionType = 'put';\n            } else {\n                optionType = 'call';\n            }\n            linear = true;\n            inverse = false;\n        }\n        return this.safeMarketStructure ({\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': spot,\n            'margin': margin,\n            'swap': swap,\n            'future': false,\n            'option': option,\n            'active': this.safeBool (market, 'is_active'),\n            'contract': (swap || option),\n            'linear': linear,\n            'inverse': inverse,\n            'contractSize': (spot) ? undefined : 1,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'taker': this.safeNumber (market, 'taker_fee_rate'),\n            'maker': this.safeNumber (market, 'maker_fee_rate'),\n            'strike': strike,\n            'optionType': optionType,\n            'precision': {\n                'amount': this.safeNumber (market, 'amount_step'),\n                'price': this.safeNumber (market, 'tick_size'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minimum_amount'),\n                    'max': this.safeNumber (market, 'maximum_amount'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (rawOrder: Dict, market: Market = undefined): Order",
        "line_start": 1864,
        "line_end": 1987,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'label')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (timeInForce)",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': fee,\n                'currency': 'USDC',\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "'USDC'",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"subaccount_id\": 130837,\n     \"nonce\": 1736923517552,\n     \"module\": \"0x87F2863866D85E3192a35A73b388BD625D83f2be\",\n     \"expiry\": 86400,\n     \"owner\": \"0x108b9aF9279a525b8A8AeAbE7AC2bA925Bc50075\",\n     \"signer\": \"0x108b9aF9279a525b8A8AeAbE7AC2bA925Bc50075\",\n     \"signature\": \"0xaa4f42b2f3da33c668fa703ea872d4c3a6b55aca66025b5119e3bebb6679fe2e2794638db51dcace21fc39a498047835994f07eb59f311bb956ce057e66793d1c\",\n     \"data\": {\n         \"asset\": \"0xAFB6Bb95cd70D5367e2C39e9dbEb422B9815339D\",\n         \"sub_id\": 0,\n         \"limit_price\": \"10000\",\n         \"desired_amount\": \"0.001\",\n         \"worst_fee\": \"0\",\n         \"recipient_id\": 130837,\n         \"is_bid\": true,\n         \"trade_id\": \"\"\n     }\n }",
          "{\n     \"subaccount_id\": 130837,\n     \"order_id\": \"96349ebb-7d46-43ae-81c7-7ab390444293\",\n     \"instrument_name\": \"BTC-PERP\",\n     \"direction\": \"buy\",\n     \"label\": \"\",\n     \"quote_id\": null,\n     \"creation_timestamp\": 1737467576257,\n     \"last_update_timestamp\": 1737467576257,\n     \"limit_price\": \"10000\",\n     \"amount\": \"0.01\",\n     \"filled_amount\": \"0\",\n     \"average_price\": \"0\",\n     \"order_fee\": \"0\",\n     \"order_type\": \"limit\",\n     \"time_in_force\": \"gtc\",\n     \"order_status\": \"open\",\n     \"max_fee\": \"210\",\n     \"signature_expiry_sec\": 1737468175989,\n     \"nonce\": 1737467575989,\n     \"signer\": \"0x30CB7B06AdD6749BbE146A6827502B8f2a79269A\",\n     \"signature\": \"0xd1ca49df1fa06bd805bb59b132ff6c0de29bf973a3e01705abe0a01cc956e4945ed9eb99ab68f3df4c037908113cac5a5bfc3a954a0b7103cdab285962fa6a51c\",\n     \"cancel_reason\": \"\",\n     \"mmp\": false,\n     \"is_transfer\": false,\n     \"replaced_order_id\": null,\n     \"trigger_type\": null,\n     \"trigger_price_type\": null,\n     \"trigger_price\": null,\n     \"trigger_reject_message\": null\n }"
        ],
        "source": "parseOrder (rawOrder: Dict, market: Market = undefined): Order {\n        //\n        // {\n        //     \"subaccount_id\": 130837,\n        //     \"nonce\": 1736923517552,\n        //     \"module\": \"0x87F2863866D85E3192a35A73b388BD625D83f2be\",\n        //     \"expiry\": 86400,\n        //     \"owner\": \"0x108b9aF9279a525b8A8AeAbE7AC2bA925Bc50075\",\n        //     \"signer\": \"0x108b9aF9279a525b8A8AeAbE7AC2bA925Bc50075\",\n        //     \"signature\": \"0xaa4f42b2f3da33c668fa703ea872d4c3a6b55aca66025b5119e3bebb6679fe2e2794638db51dcace21fc39a498047835994f07eb59f311bb956ce057e66793d1c\",\n        //     \"data\": {\n        //         \"asset\": \"0xAFB6Bb95cd70D5367e2C39e9dbEb422B9815339D\",\n        //         \"sub_id\": 0,\n        //         \"limit_price\": \"10000\",\n        //         \"desired_amount\": \"0.001\",\n        //         \"worst_fee\": \"0\",\n        //         \"recipient_id\": 130837,\n        //         \"is_bid\": true,\n        //         \"trade_id\": \"\"\n        //     }\n        // }\n        // {\n        //     \"subaccount_id\": 130837,\n        //     \"order_id\": \"96349ebb-7d46-43ae-81c7-7ab390444293\",\n        //     \"instrument_name\": \"BTC-PERP\",\n        //     \"direction\": \"buy\",\n        //     \"label\": \"\",\n        //     \"quote_id\": null,\n        //     \"creation_timestamp\": 1737467576257,\n        //     \"last_update_timestamp\": 1737467576257,\n        //     \"limit_price\": \"10000\",\n        //     \"amount\": \"0.01\",\n        //     \"filled_amount\": \"0\",\n        //     \"average_price\": \"0\",\n        //     \"order_fee\": \"0\",\n        //     \"order_type\": \"limit\",\n        //     \"time_in_force\": \"gtc\",\n        //     \"order_status\": \"open\",\n        //     \"max_fee\": \"210\",\n        //     \"signature_expiry_sec\": 1737468175989,\n        //     \"nonce\": 1737467575989,\n        //     \"signer\": \"0x30CB7B06AdD6749BbE146A6827502B8f2a79269A\",\n        //     \"signature\": \"0xd1ca49df1fa06bd805bb59b132ff6c0de29bf973a3e01705abe0a01cc956e4945ed9eb99ab68f3df4c037908113cac5a5bfc3a954a0b7103cdab285962fa6a51c\",\n        //     \"cancel_reason\": \"\",\n        //     \"mmp\": false,\n        //     \"is_transfer\": false,\n        //     \"replaced_order_id\": null,\n        //     \"trigger_type\": null,\n        //     \"trigger_price_type\": null,\n        //     \"trigger_price\": null,\n        //     \"trigger_reject_message\": null\n        // }\n        let order = this.safeDict (rawOrder, 'data');\n        if (order === undefined) {\n            order = rawOrder;\n        }\n        const timestamp = this.safeInteger2 (rawOrder, 'creation_timestamp', 'nonce');\n        const orderId = this.safeString (order, 'order_id');\n        const marketId = this.safeString (order, 'instrument_name');\n        if (marketId !== undefined) {\n            market = this.safeMarket (marketId, market);\n        }\n        const symbol = market['symbol'];\n        const price = this.safeString (order, 'limit_price');\n        const average = this.safeString (order, 'average_price');\n        const amount = this.safeString (order, 'desired_amount');\n        const filled = this.safeString (order, 'filled_amount');\n        const fee = this.safeString (order, 'order_fee');\n        const orderType = this.safeStringLower (order, 'order_type');\n        const isBid = this.safeBool (order, 'is_bid');\n        let side = this.safeString (order, 'direction');\n        if (side === undefined) {\n            if (isBid) {\n                side = 'buy';\n            } else {\n                side = 'sell';\n            }\n        }\n        const triggerType = this.safeString (order, 'trigger_type');\n        let stopLossPrice = undefined;\n        let takeProfitPrice = undefined;\n        let triggerPrice = undefined;\n        if (triggerType !== undefined) {\n            triggerPrice = this.safeString (order, 'trigger_price');\n            if (triggerType === 'stoploss') {\n                stopLossPrice = triggerPrice;\n            } else {\n                takeProfitPrice = triggerPrice;\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger (rawOrder, 'last_update_timestamp');\n        const status = this.safeString (order, 'order_status');\n        const timeInForce = this.safeString (order, 'time_in_force');\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': this.safeString (order, 'label'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': orderType,\n            'timeInForce': this.parseTimeInForce (timeInForce),\n            'postOnly': undefined, // handled in safeOrder\n            'reduceOnly': this.safeBool (order, 'reduce_only'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': {\n                'cost': fee,\n                'currency': 'USDC',\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1850,
        "line_end": 1862,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'open': 'open',\n                'untriggered': 'open',\n                'filled': 'closed',\n                'cancelled': 'canceled',\n                'expired': 'rejected',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2211,
        "line_end": 2286,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeString (position, 'initial_margin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeString (position, 'maintenance_margin')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidation_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPrice)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"instrument_type\": \"perp\",\n     \"instrument_name\": \"BTC-PERP\",\n     \"amount\": \"-0.02\",\n     \"average_price\": \"102632.9105389869500088\",\n     \"realized_pnl\": \"0\",\n     \"unrealized_pnl\": \"-2.6455959784245548835819950103759765625\",\n     \"total_fees\": \"2.255789220260999824\",\n     \"average_price_excl_fees\": \"102745.7\",\n     \"realized_pnl_excl_fees\": \"0\",\n     \"unrealized_pnl_excl_fees\": \"-0.3898067581635550595819950103759765625\",\n     \"net_settlements\": \"-4.032902047219498639\",\n     \"cumulative_funding\": \"-0.004677736347850093\",\n     \"pending_funding\": \"0\",\n     \"mark_price\": \"102765.190337908177752979099750518798828125\",\n     \"index_price\": \"102767.657193800017641472\",\n     \"delta\": \"1\",\n     \"gamma\": \"0\",\n     \"vega\": \"0\",\n     \"theta\": \"0\",\n     \"mark_value\": \"1.38730606879471451975405216217041015625\",\n     \"maintenance_margin\": \"-101.37788426911356509663164615631103515625\",\n     \"initial_margin\": \"-132.2074413704858670826070010662078857421875\",\n     \"open_orders_margin\": \"264.116085900726830004714429378509521484375\",\n     \"leverage\": \"8.6954476205089299495699106539379941746377322586618\",\n     \"liquidation_price\": \"109125.705451984322280623018741607666015625\",\n     \"creation_timestamp\": 1738065303840\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"instrument_type\": \"perp\",\n        //     \"instrument_name\": \"BTC-PERP\",\n        //     \"amount\": \"-0.02\",\n        //     \"average_price\": \"102632.9105389869500088\",\n        //     \"realized_pnl\": \"0\",\n        //     \"unrealized_pnl\": \"-2.6455959784245548835819950103759765625\",\n        //     \"total_fees\": \"2.255789220260999824\",\n        //     \"average_price_excl_fees\": \"102745.7\",\n        //     \"realized_pnl_excl_fees\": \"0\",\n        //     \"unrealized_pnl_excl_fees\": \"-0.3898067581635550595819950103759765625\",\n        //     \"net_settlements\": \"-4.032902047219498639\",\n        //     \"cumulative_funding\": \"-0.004677736347850093\",\n        //     \"pending_funding\": \"0\",\n        //     \"mark_price\": \"102765.190337908177752979099750518798828125\",\n        //     \"index_price\": \"102767.657193800017641472\",\n        //     \"delta\": \"1\",\n        //     \"gamma\": \"0\",\n        //     \"vega\": \"0\",\n        //     \"theta\": \"0\",\n        //     \"mark_value\": \"1.38730606879471451975405216217041015625\",\n        //     \"maintenance_margin\": \"-101.37788426911356509663164615631103515625\",\n        //     \"initial_margin\": \"-132.2074413704858670826070010662078857421875\",\n        //     \"open_orders_margin\": \"264.116085900726830004714429378509521484375\",\n        //     \"leverage\": \"8.6954476205089299495699106539379941746377322586618\",\n        //     \"liquidation_price\": \"109125.705451984322280623018741607666015625\",\n        //     \"creation_timestamp\": 1738065303840\n        // }\n        //\n        const contract = this.safeString (position, 'instrument_name');\n        market = this.safeMarket (contract, market);\n        let size = this.safeString (position, 'amount');\n        let side: Str = undefined;\n        if (Precise.stringGt (size, '0')) {\n            side = 'long';\n        } else {\n            side = 'short';\n        }\n        const contractSize = this.safeString (market, 'contractSize');\n        const markPrice = this.safeString (position, 'mark_price');\n        const timestamp = this.safeInteger (position, 'creation_timestamp');\n        const unrealisedPnl = this.safeString (position, 'unrealized_pnl');\n        size = Precise.stringAbs (size);\n        const notional = Precise.stringMul (size, markPrice);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'initialMargin': this.safeString (position, 'initial_margin'),\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': this.safeString (position, 'maintenance_margin'),\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': undefined,\n            'notional': this.parseNumber (notional),\n            'leverage': this.safeNumber (position, 'leverage'),\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'contracts': this.parseNumber (size),\n            'contractSize': this.parseNumber (contractSize),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liquidation_price'),\n            'markPrice': this.parseNumber (markPrice),\n            'lastPrice': undefined,\n            'collateral': undefined,\n            'marginMode': undefined,\n            'side': side,\n            'percentage': undefined,\n            'hedged': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 821,
        "line_end": 906,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (stats, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (stats, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'best_bid_price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'best_bid_amount')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'best_ask_price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'best_ask_amount')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "last",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "Precise.stringMul (change, '100')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'index_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"instrument_type\": \"perp\",\n     \"instrument_name\": \"BTC-PERP\",\n     \"scheduled_activation\": 1701840228,\n     \"scheduled_deactivation\": 9223372036854776000,\n     \"is_active\": true,\n     \"tick_size\": \"0.1\",\n     \"minimum_amount\": \"0.01\",\n     \"maximum_amount\": \"10000\",\n     \"amount_step\": \"0.001\",\n     \"mark_price_fee_rate_cap\": \"0\",\n     \"maker_fee_rate\": \"0.00005\",\n     \"taker_fee_rate\": \"0.0003\",\n     \"base_fee\": \"0.1\",\n     \"base_currency\": \"BTC\",\n     \"quote_currency\": \"USD\",\n     \"option_details\": null,\n     \"perp_details\": {\n         \"index\": \"BTC-USD\",\n         \"max_rate_per_hour\": \"0.004\",\n         \"min_rate_per_hour\": \"-0.004\",\n         \"static_interest_rate\": \"0.0000125\",\n         \"aggregate_funding\": \"10512.580833189805742522\",\n         \"funding_rate\": \"-0.000022223906766867\"\n     },\n     \"erc20_details\": null,\n     \"base_asset_address\": \"0xDBa83C0C654DB1cd914FA2710bA743e925B53086\",\n     \"base_asset_sub_id\": \"0\",\n     \"pro_rata_fraction\": \"0\",\n     \"fifo_min_allocation\": \"0\",\n     \"pro_rata_amount_step\": \"0.1\",\n     \"best_ask_amount\": \"0.012\",\n     \"best_ask_price\": \"99567.9\",\n     \"best_bid_amount\": \"0.129\",\n     \"best_bid_price\": \"99554.5\",\n     \"five_percent_bid_depth\": \"11.208\",\n     \"five_percent_ask_depth\": \"11.42\",\n     \"option_pricing\": null,\n     \"index_price\": \"99577.2\",\n     \"mark_price\": \"99543.642926357933902181684970855712890625\",\n     \"stats\": {\n         \"contract_volume\": \"464.712\",\n         \"num_trades\": \"10681\",\n         \"open_interest\": \"72.804739389481989861\",\n         \"high\": \"99519.1\",\n         \"low\": \"97254.1\",\n         \"percent_change\": \"0.0128\",\n         \"usd_change\": \"1258.1\"\n     },\n     \"timestamp\": 1736140984000,\n     \"min_price\": \"97591.2\",\n     \"max_price\": \"101535.1\"\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // {\n        //     \"instrument_type\": \"perp\",\n        //     \"instrument_name\": \"BTC-PERP\",\n        //     \"scheduled_activation\": 1701840228,\n        //     \"scheduled_deactivation\": 9223372036854776000,\n        //     \"is_active\": true,\n        //     \"tick_size\": \"0.1\",\n        //     \"minimum_amount\": \"0.01\",\n        //     \"maximum_amount\": \"10000\",\n        //     \"amount_step\": \"0.001\",\n        //     \"mark_price_fee_rate_cap\": \"0\",\n        //     \"maker_fee_rate\": \"0.00005\",\n        //     \"taker_fee_rate\": \"0.0003\",\n        //     \"base_fee\": \"0.1\",\n        //     \"base_currency\": \"BTC\",\n        //     \"quote_currency\": \"USD\",\n        //     \"option_details\": null,\n        //     \"perp_details\": {\n        //         \"index\": \"BTC-USD\",\n        //         \"max_rate_per_hour\": \"0.004\",\n        //         \"min_rate_per_hour\": \"-0.004\",\n        //         \"static_interest_rate\": \"0.0000125\",\n        //         \"aggregate_funding\": \"10512.580833189805742522\",\n        //         \"funding_rate\": \"-0.000022223906766867\"\n        //     },\n        //     \"erc20_details\": null,\n        //     \"base_asset_address\": \"0xDBa83C0C654DB1cd914FA2710bA743e925B53086\",\n        //     \"base_asset_sub_id\": \"0\",\n        //     \"pro_rata_fraction\": \"0\",\n        //     \"fifo_min_allocation\": \"0\",\n        //     \"pro_rata_amount_step\": \"0.1\",\n        //     \"best_ask_amount\": \"0.012\",\n        //     \"best_ask_price\": \"99567.9\",\n        //     \"best_bid_amount\": \"0.129\",\n        //     \"best_bid_price\": \"99554.5\",\n        //     \"five_percent_bid_depth\": \"11.208\",\n        //     \"five_percent_ask_depth\": \"11.42\",\n        //     \"option_pricing\": null,\n        //     \"index_price\": \"99577.2\",\n        //     \"mark_price\": \"99543.642926357933902181684970855712890625\",\n        //     \"stats\": {\n        //         \"contract_volume\": \"464.712\",\n        //         \"num_trades\": \"10681\",\n        //         \"open_interest\": \"72.804739389481989861\",\n        //         \"high\": \"99519.1\",\n        //         \"low\": \"97254.1\",\n        //         \"percent_change\": \"0.0128\",\n        //         \"usd_change\": \"1258.1\"\n        //     },\n        //     \"timestamp\": 1736140984000,\n        //     \"min_price\": \"97591.2\",\n        //     \"max_price\": \"101535.1\"\n        // }\n        //\n        const marketId = this.safeString (ticker, 'instrument_name');\n        const timestamp = this.safeIntegerOmitZero (ticker, 'timestamp');\n        const symbol = this.safeSymbol (marketId, market);\n        const stats = this.safeDict (ticker, 'stats');\n        const change = this.safeString (stats, 'percent_change');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (stats, 'high'),\n            'low': this.safeString (stats, 'low'),\n            'bid': this.safeString (ticker, 'best_bid_price'),\n            'bidVolume': this.safeString (ticker, 'best_bid_amount'),\n            'ask': this.safeString (ticker, 'best_ask_price'),\n            'askVolume': this.safeString (ticker, 'best_ask_amount'),\n            'vwap': undefined,\n            'open': undefined,\n            'close': undefined,\n            'last': undefined,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': Precise.stringMul (change, '100'),\n            'average': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': undefined,\n            'indexPrice': this.safeString (ticker, 'index_price'),\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1840,
        "line_end": 1848,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'ioc': 'IOC',\n            'fok': 'FOK',\n            'gtc': 'GTC',\n            'post_only': 'PO',\n        };\n        return this.safeString (timeInForces, timeInForce, undefined);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 980,
        "line_end": 1027,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "'USDC'",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'trade_fee')",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'trade_id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (trade, 'direction')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeString (trade, 'liquidity_role')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'trade_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'trade_amount')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"subaccount_id\": 130837,\n     \"order_id\": \"30c48194-8d48-43ac-ad00-0d5ba29eddc9\",\n     \"instrument_name\": \"BTC-PERP\",\n     \"direction\": \"sell\",\n     \"label\": \"test1234\",\n     \"quote_id\": null,\n     \"trade_id\": \"f8a30740-488c-4c2d-905d-e17057bafde1\",\n     \"timestamp\": 1738065303708,\n     \"mark_price\": \"102740.137375457314192317\",\n     \"index_price\": \"102741.553409299981533184\",\n     \"trade_price\": \"102700.6\",\n     \"trade_amount\": \"0.01\",\n     \"liquidity_role\": \"taker\",\n     \"realized_pnl\": \"0\",\n     \"realized_pnl_excl_fees\": \"0\",\n     \"is_transfer\": false,\n     \"tx_status\": \"settled\",\n     \"trade_fee\": \"1.127415534092999815\",\n     \"tx_hash\": \"0xc55df1f07330faf86579bd8a6385391fbe9e73089301149d8550e9d29c9ead74\",\n     \"transaction_id\": \"e18b9426-3fa5-41bb-99d3-8b54fb4d51bb\"\n }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // {\n        //     \"subaccount_id\": 130837,\n        //     \"order_id\": \"30c48194-8d48-43ac-ad00-0d5ba29eddc9\",\n        //     \"instrument_name\": \"BTC-PERP\",\n        //     \"direction\": \"sell\",\n        //     \"label\": \"test1234\",\n        //     \"quote_id\": null,\n        //     \"trade_id\": \"f8a30740-488c-4c2d-905d-e17057bafde1\",\n        //     \"timestamp\": 1738065303708,\n        //     \"mark_price\": \"102740.137375457314192317\",\n        //     \"index_price\": \"102741.553409299981533184\",\n        //     \"trade_price\": \"102700.6\",\n        //     \"trade_amount\": \"0.01\",\n        //     \"liquidity_role\": \"taker\",\n        //     \"realized_pnl\": \"0\",\n        //     \"realized_pnl_excl_fees\": \"0\",\n        //     \"is_transfer\": false,\n        //     \"tx_status\": \"settled\",\n        //     \"trade_fee\": \"1.127415534092999815\",\n        //     \"tx_hash\": \"0xc55df1f07330faf86579bd8a6385391fbe9e73089301149d8550e9d29c9ead74\",\n        //     \"transaction_id\": \"e18b9426-3fa5-41bb-99d3-8b54fb4d51bb\"\n        // }\n        //\n        const marketId = this.safeString (trade, 'instrument_name');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const fee = {\n            'currency': 'USDC',\n            'cost': this.safeString (trade, 'trade_fee'),\n        };\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString (trade, 'trade_id'),\n            'order': this.safeString (trade, 'order_id'),\n            'symbol': symbol,\n            'side': this.safeStringLower (trade, 'direction'),\n            'type': undefined,\n            'takerOrMaker': this.safeString (trade, 'liquidity_role'),\n            'price': this.safeString (trade, 'trade_price'),\n            'amount': this.safeString (trade, 'trade_amount'),\n            'cost': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2580,
        "line_end": 2620,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'tx_status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"timestamp\": 1736860533599,\n     \"transaction_id\": \"f2069395-ec00-49f5-925a-87202a5d240f\",\n     \"asset\": \"ETH\",\n     \"amount\": \"0.1\",\n     \"tx_status\": \"settled\",\n     \"tx_hash\": \"0xeda21a315c59302a19c42049b4cef05a10b685302b6cc3edbaf49102d91166d4\",\n     \"error_log\": {}\n }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // {\n        //     \"timestamp\": 1736860533599,\n        //     \"transaction_id\": \"f2069395-ec00-49f5-925a-87202a5d240f\",\n        //     \"asset\": \"ETH\",\n        //     \"amount\": \"0.1\",\n        //     \"tx_status\": \"settled\",\n        //     \"tx_hash\": \"0xeda21a315c59302a19c42049b4cef05a10b685302b6cc3edbaf49102d91166d4\",\n        //     \"error_log\": {}\n        // }\n        //\n        const code = this.safeString (transaction, 'asset');\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        let txId = this.safeString (transaction, 'tx_hash');\n        if (txId === '0x0') {\n            txId = undefined;\n        }\n        return {\n            'info': transaction,\n            'id': undefined,\n            'txid': txId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': undefined,\n            'addressFrom': undefined,\n            'addressTo': undefined,\n            'tag': undefined,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'type': undefined,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'tx_status')),\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'network': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2622,
        "line_end": 2628,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'settled': 'ok',\n            'reverted': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseUnits",
        "signature": "parseUnits (num: string, dec = '1000000000000000000')",
        "line_start": 1178,
        "line_end": 1180,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseUnits (num: string, dec = '1000000000000000000') {\n        return Precise.stringMul (num, dec);\n    }"
      }
    ],
    "digifinex": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 818,
        "line_end": 857,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"currency\": \"BTC\",\n         \"free\": 4723846.89208129,\n         \"total\": 0\n     }",
          "{\n         \"equity\": \"0\",\n         \"currency\": \"BTC\",\n         \"margin\": \"0\",\n         \"frozen_margin\": \"0\",\n         \"frozen_money\": \"0\",\n         \"margin_ratio\": \"0\",\n         \"realized_pnl\": \"0\",\n         \"avail_balance\": \"0\",\n         \"unrealized_pnl\": \"0\",\n         \"time_stamp\": 1661487402396\n     }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // spot and margin\n        //\n        //     {\n        //         \"currency\": \"BTC\",\n        //         \"free\": 4723846.89208129,\n        //         \"total\": 0\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"equity\": \"0\",\n        //         \"currency\": \"BTC\",\n        //         \"margin\": \"0\",\n        //         \"frozen_margin\": \"0\",\n        //         \"frozen_money\": \"0\",\n        //         \"margin_ratio\": \"0\",\n        //         \"realized_pnl\": \"0\",\n        //         \"avail_balance\": \"0\",\n        //         \"unrealized_pnl\": \"0\",\n        //         \"time_stamp\": 1661487402396\n        //     }\n        //\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            const free = this.safeString2 (balance, 'free', 'avail_balance');\n            const total = this.safeString2 (balance, 'total', 'equity');\n            account['free'] = free;\n            account['used'] = Precise.stringSub (total, free);\n            account['total'] = total;\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 3148,
        "line_end": 3180,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency",
            "comment": null
          },
          {
            "key": "interest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "0.001",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 0.0006103,\n         \"side\": \"go_long\",\n         \"entry_price\": 31428.72,\n         \"liquidation_rate\": 0.3,\n         \"liquidation_price\": 10225.335481159,\n         \"unrealized_roe\": -0.0076885829266987,\n         \"symbol\": \"BTC_USDT\",\n         \"unrealized_pnl\": -0.049158102631999,\n         \"leverage_ratio\": 3\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        //     {\n        //         \"amount\": 0.0006103,\n        //         \"side\": \"go_long\",\n        //         \"entry_price\": 31428.72,\n        //         \"liquidation_rate\": 0.3,\n        //         \"liquidation_price\": 10225.335481159,\n        //         \"unrealized_roe\": -0.0076885829266987,\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"unrealized_pnl\": -0.049158102631999,\n        //         \"leverage_ratio\": 3\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const amountString = this.safeString (info, 'amount');\n        const leverageString = this.safeString (info, 'leverage_ratio');\n        const amountInvested = Precise.stringDiv (amountString, leverageString);\n        const amountBorrowed = Precise.stringSub (amountString, amountInvested);\n        const currency = (market === undefined) ? undefined : market['base'];\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': currency,\n            'interest': undefined,\n            'interestRate': 0.001, // all interest rates on digifinex are 0.1%\n            'amountBorrowed': this.parseNumber (amountBorrowed),\n            'marginMode': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 3256,
        "line_end": 3275,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "0.001",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"valuation_rate\": 1,\n         \"total\": 1.92012186174,\n         \"free\": 1.92012186174,\n         \"currency\": \"USDT\"\n     }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"valuation_rate\": 1,\n        //         \"total\": 1.92012186174,\n        //         \"free\": 1.92012186174,\n        //         \"currency\": \"USDT\"\n        //     }\n        //\n        const timestamp = this.milliseconds ();\n        const currencyId = this.safeString (info, 'currency');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': 0.001, // all interest rates on digifinex are 0.1%\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseBorrowRates",
        "signature": "parseBorrowRates (info, codeKey)",
        "line_start": 3277,
        "line_end": 3295,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"valuation_rate\": 1,\n         \"total\": 1.92012186174,\n         \"free\": 1.92012186174,\n         \"currency\": \"USDT\"\n     },"
        ],
        "source": "parseBorrowRates (info, codeKey) {\n        //\n        //     {\n        //         \"valuation_rate\": 1,\n        //         \"total\": 1.92012186174,\n        //         \"free\": 1.92012186174,\n        //         \"currency\": \"USDT\"\n        //     },\n        //\n        const result: Dict = {};\n        for (let i = 0; i < info.length; i++) {\n            const item = info[i];\n            const currency = this.safeString (item, codeKey);\n            const code = this.safeCurrencyCode (currency);\n            const borrowRate = this.parseBorrowRate (item);\n            result[code] = borrowRate;\n        }\n        return result as any;\n    }"
      },
      {
        "name": "parseCancelOrders",
        "signature": "parseCancelOrders (response)",
        "line_start": 1989,
        "line_end": 2011,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'order-id', 'order_id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'failed'",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client-order-id')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCancelOrders (response) {\n        const success = this.safeList (response, 'success');\n        const error = this.safeList (response, 'error');\n        const result = [];\n        for (let i = 0; i < success.length; i++) {\n            const order = success[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': order,\n                'status': 'canceled',\n            }));\n        }\n        for (let i = 0; i < error.length; i++) {\n            const order = error[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': this.safeString2 (order, 'order-id', 'order_id'),\n                'status': 'failed',\n                'clientOrderId': this.safeString (order, 'client-order-id'),\n            }));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2749,
        "line_end": 2769,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"addressTag\":\"\",\n         \"address\":\"0xf1104d9f8624f89775a3e9d480fc0e75a8ef4373\",\n         \"currency\":\"USDT\",\n         \"chain\":\"ERC20\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"addressTag\":\"\",\n        //         \"address\":\"0xf1104d9f8624f89775a3e9d480fc0e75a8ef4373\",\n        //         \"currency\":\"USDT\",\n        //         \"chain\":\"ERC20\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const tag = this.safeString (depositAddress, 'addressTag');\n        const currencyId = this.safeStringUpper (depositAddress, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': undefined,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 4109,
        "line_end": 4179,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"deposit_status\": 0,\n             \"min_withdraw_fee\": 5,\n             \"withdraw_fee_currency\": \"USDT\",\n             \"chain\": \"OMNI\",\n             \"withdraw_fee_rate\": 0,\n             \"min_withdraw_amount\": 10,\n             \"currency\": \"USDT\",\n             \"withdraw_status\": 0,\n             \"min_deposit_amount\": 10\n         },\n         {\n             \"deposit_status\": 1,\n             \"min_withdraw_fee\": 5,\n             \"withdraw_fee_currency\": \"USDT\",\n             \"chain\": \"ERC20\",\n             \"withdraw_fee_rate\": 0,\n             \"min_withdraw_amount\": 10,\n             \"currency\": \"USDT\",\n             \"withdraw_status\": 1,\n             \"min_deposit_amount\": 10\n         },\n     ]"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        //     [\n        //         {\n        //             \"deposit_status\": 0,\n        //             \"min_withdraw_fee\": 5,\n        //             \"withdraw_fee_currency\": \"USDT\",\n        //             \"chain\": \"OMNI\",\n        //             \"withdraw_fee_rate\": 0,\n        //             \"min_withdraw_amount\": 10,\n        //             \"currency\": \"USDT\",\n        //             \"withdraw_status\": 0,\n        //             \"min_deposit_amount\": 10\n        //         },\n        //         {\n        //             \"deposit_status\": 1,\n        //             \"min_withdraw_fee\": 5,\n        //             \"withdraw_fee_currency\": \"USDT\",\n        //             \"chain\": \"ERC20\",\n        //             \"withdraw_fee_rate\": 0,\n        //             \"min_withdraw_amount\": 10,\n        //             \"currency\": \"USDT\",\n        //             \"withdraw_status\": 1,\n        //             \"min_deposit_amount\": 10\n        //         },\n        //     ]\n        //\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const currencyId = this.safeString (entry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                const depositWithdrawFee = this.safeValue (depositWithdrawFees, code);\n                if (depositWithdrawFee === undefined) {\n                    depositWithdrawFees[code] = this.depositWithdrawFee ({});\n                    depositWithdrawFees[code]['info'] = [];\n                }\n                const depositWithdrawInfo = depositWithdrawFees[code]['info'];\n                depositWithdrawInfo.push (entry);\n                const networkId = this.safeString (entry, 'chain');\n                const withdrawFee = this.safeValue (entry, 'min_withdraw_fee');\n                const withdrawResult: Dict = {\n                    'fee': withdrawFee,\n                    'percentage': (withdrawFee !== undefined) ? false : undefined,\n                };\n                const depositResult: Dict = {\n                    'fee': undefined,\n                    'percentage': undefined,\n                };\n                if (networkId !== undefined) {\n                    const networkCode = this.networkIdToCode (networkId);\n                    depositWithdrawFees[code]['networks'][networkCode] = {\n                        'withdraw': withdrawResult,\n                        'deposit': depositResult,\n                    };\n                } else {\n                    depositWithdrawFees[code]['withdraw'] = withdrawResult;\n                    depositWithdrawFees[code]['deposit'] = depositResult;\n                }\n            }\n        }\n        const depositWithdrawCodes = Object.keys (depositWithdrawFees);\n        for (let i = 0; i < depositWithdrawCodes.length; i++) {\n            const code = depositWithdrawCodes[i];\n            const currency = this.currency (code);\n            depositWithdrawFees[code] = this.assignDefaultDepositWithdrawFees (depositWithdrawFees[code], currency);\n        }\n        return depositWithdrawFees;\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 3383,
        "line_end": 3392,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3345,
        "line_end": 3381,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'next_funding_rate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"funding_rate\": \"-0.00012\",\n         \"funding_time\": 1662710400000,\n         \"next_funding_rate\": \"0.0001049907085171607\",\n         \"next_funding_time\": 1662739200000\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"funding_rate\": \"-0.00012\",\n        //         \"funding_time\": 1662710400000,\n        //         \"next_funding_rate\": \"0.0001049907085171607\",\n        //         \"next_funding_time\": 1662739200000\n        //     }\n        //\n        const marketId = this.safeString (contract, 'instrument_id');\n        const timestamp = this.safeInteger (contract, 'funding_time');\n        const nextTimestamp = this.safeInteger (contract, 'next_funding_time');\n        const fundingTimeString = this.safeString (contract, 'funding_time');\n        const nextFundingTimeString = this.safeString (contract, 'next_funding_time');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': timestamp,\n            'fundingDatetime': this.iso8601 (timestamp),\n            'nextFundingRate': this.safeNumber (contract, 'next_funding_rate'),\n            'nextFundingTimestamp': nextTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 4315,
        "line_end": 4336,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (income, 'amount')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"currency\": \"USDT\",\n         \"amount\": \"-0.000342814\",\n         \"timestamp\": 1698768009440\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"-0.000342814\",\n        //         \"timestamp\": 1698768009440\n        //     }\n        //\n        const marketId = this.safeString (income, 'instrument_id');\n        const currencyId = this.safeString (income, 'currency');\n        const timestamp = this.safeInteger (income, 'timestamp');\n        return {\n            'info': income,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': this.safeCurrencyCode (currencyId),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.safeNumber (income, 'amount'),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2608,
        "line_end": 2656,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "direction",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency_mark\": \"BTC\",\n         \"type\": 100234,\n         \"num\": -10,\n         \"balance\": 0.1,\n         \"time\": 1546272000\n     }",
          "{\n         \"currency\": \"USDT\",\n         \"finance_type\": 17,\n         \"change\": \"-3.01\",\n         \"timestamp\": 1650809432000\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // spot and margin\n        //\n        //     {\n        //         \"currency_mark\": \"BTC\",\n        //         \"type\": 100234,\n        //         \"num\": -10,\n        //         \"balance\": 0.1,\n        //         \"time\": 1546272000\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"currency\": \"USDT\",\n        //         \"finance_type\": 17,\n        //         \"change\": \"-3.01\",\n        //         \"timestamp\": 1650809432000\n        //     }\n        //\n        const type = this.parseLedgerEntryType (this.safeString2 (item, 'type', 'finance_type'));\n        const currencyId = this.safeString2 (item, 'currency_mark', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amount = this.safeNumber2 (item, 'num', 'change');\n        const after = this.safeNumber (item, 'balance');\n        let timestamp = this.safeTimestamp (item, 'time');\n        if (timestamp === undefined) {\n            timestamp = this.safeInteger (item, 'timestamp');\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': undefined,\n            'direction': undefined,\n            'account': undefined,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'amount': amount,\n            'before': undefined,\n            'after': after,\n            'status': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2603,
        "line_end": 2606,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {};\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 4245,
        "line_end": 4268,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "type",
            "value": "(rawType === 1) ? 'add' : 'reduce'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amount')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"side\": \"long\",\n         \"type\": 1,\n         \"amount\": \"3.6834\"\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"side\": \"long\",\n        //         \"type\": 1,\n        //         \"amount\": \"3.6834\"\n        //     }\n        //\n        const marketId = this.safeString (data, 'instrument_id');\n        const rawType = this.safeInteger (data, 'type');\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'type': (rawType === 1) ? 'add' : 'reduce',\n            'marginMode': 'isolated',\n            'amount': this.safeNumber (data, 'amount'),\n            'total': undefined,\n            'code': market['settle'],\n            'status': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 3995,
        "line_end": 4038,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'max_limit')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'leverage')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"type\": \"REAL\",\n         \"contract_type\": \"PERPETUAL\",\n         \"base_currency\": \"BTC\",\n         \"quote_currency\": \"USDT\",\n         \"clear_currency\": \"USDT\",\n         \"contract_value\": \"0.001\",\n         \"contract_value_currency\": \"BTC\",\n         \"is_inverse\": false,\n         \"is_trading\": true,\n         \"status\": \"ONLINE\",\n         \"price_precision\": 1,\n         \"tick_size\": \"0.1\",\n         \"min_order_amount\": 1,\n         \"open_max_limits\": [\n             {\n                 \"leverage\": \"50\",\n                 \"max_limit\": \"1000000\"\n             }\n         ]\n     }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"type\": \"REAL\",\n        //         \"contract_type\": \"PERPETUAL\",\n        //         \"base_currency\": \"BTC\",\n        //         \"quote_currency\": \"USDT\",\n        //         \"clear_currency\": \"USDT\",\n        //         \"contract_value\": \"0.001\",\n        //         \"contract_value_currency\": \"BTC\",\n        //         \"is_inverse\": false,\n        //         \"is_trading\": true,\n        //         \"status\": \"ONLINE\",\n        //         \"price_precision\": 1,\n        //         \"tick_size\": \"0.1\",\n        //         \"min_order_amount\": 1,\n        //         \"open_max_limits\": [\n        //             {\n        //                 \"leverage\": \"50\",\n        //                 \"max_limit\": \"1000000\"\n        //             }\n        //         ]\n        //     }\n        //\n        const tiers = [];\n        const brackets = this.safeValue (info, 'open_max_limits', {});\n        for (let i = 0; i < brackets.length; i++) {\n            const tier = brackets[i];\n            const marketId = this.safeString (info, 'instrument_id');\n            market = this.safeMarket (marketId, market);\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n                'currency': market['settle'],\n                'minNotional': undefined,\n                'maxNotional': this.safeNumber (tier, 'max_limit'),\n                'maintenanceMarginRate': undefined,\n                'maxLeverage': this.safeNumber (tier, 'leverage'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1501,
        "line_end": 1531,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1556712900,\n         2205.899,\n         0.029967,\n         0.02997,\n         0.029871,\n         0.029927\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1556712900,\n        //         2205.899,\n        //         0.029967,\n        //         0.02997,\n        //         0.029871,\n        //         0.029927\n        //     ]\n        //\n        if (market['swap']) {\n            return [\n                this.safeInteger (ohlcv, 0),\n                this.safeNumber (ohlcv, 1), // open\n                this.safeNumber (ohlcv, 2), // high\n                this.safeNumber (ohlcv, 3), // low\n                this.safeNumber (ohlcv, 4), // close\n                this.safeNumber (ohlcv, 5), // volume\n            ];\n        } else {\n            return [\n                this.safeTimestamp (ohlcv, 0),\n                this.safeNumber (ohlcv, 5), // open\n                this.safeNumber (ohlcv, 3), // high\n                this.safeNumber (ohlcv, 4), // low\n                this.safeNumber (ohlcv, 2), // close\n                this.safeNumber (ohlcv, 1), // volume\n            ];\n        }\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2058,
        "line_end": 2196,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'order_id', 'data')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber2 (order, 'amount', 'size')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeNumber2 (order, 'executed_amount', 'filled_qty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber2 (order, 'avg_price', 'price_avg')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString2 (order, 'status', 'state'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (order, 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 0,\n         \"order_id\": \"198361cecdc65f9c8c9bb2fa68faec40\"\n     }",
          "{\n         \"code\": 0,\n         \"data\": \"1590873693003714560\"\n     }",
          "{\n         \"order_id\": \"d64d92a5e0a120f792f385485bc3d95b\",\n         \"instrument_id\": \"BTC_USDT\",\n         \"amount\": 0.0001,\n         \"price\": 27000\n     }",
          "{\n         \"symbol\": \"BTC_USDT\",\n         \"order_id\": \"dd3164b333a4afa9d5730bb87f6db8b3\",\n         \"created_date\": 1562303547,\n         \"finished_date\": 0,\n         \"price\": 0.1,\n         \"amount\": 1,\n         \"cash_amount\": 1,\n         \"executed_amount\": 0,\n         \"avg_price\": 0,\n         \"status\": 1,\n         \"type\": \"buy\",\n         \"kind\": \"margin\"\n     }",
          "{\n         \"order_id\": \"1590898207657824256\",\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"margin_mode\": \"crossed\",\n         \"contract_val\": \"0.001\",\n         \"type\": 1,\n         \"order_type\": 0,\n         \"price\": \"14000\",\n         \"size\": \"6\",\n         \"filled_qty\": \"0\",\n         \"price_avg\": \"0\",\n         \"fee\": \"0\",\n         \"state\": 0,\n         \"leverage\": \"20\",\n         \"turnover\": \"0\",\n         \"has_stop\": 0,\n         \"insert_time\": 1668134664828,\n         \"time_stamp\": 1668134664828\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot: createOrder\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"order_id\": \"198361cecdc65f9c8c9bb2fa68faec40\"\n        //     }\n        //\n        // swap: createOrder\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"data\": \"1590873693003714560\"\n        //     }\n        //\n        // spot and swap: createOrders\n        //\n        //     {\n        //         \"order_id\": \"d64d92a5e0a120f792f385485bc3d95b\",\n        //         \"instrument_id\": \"BTC_USDT\",\n        //         \"amount\": 0.0001,\n        //         \"price\": 27000\n        //     }\n        //\n        // spot: fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"order_id\": \"dd3164b333a4afa9d5730bb87f6db8b3\",\n        //         \"created_date\": 1562303547,\n        //         \"finished_date\": 0,\n        //         \"price\": 0.1,\n        //         \"amount\": 1,\n        //         \"cash_amount\": 1,\n        //         \"executed_amount\": 0,\n        //         \"avg_price\": 0,\n        //         \"status\": 1,\n        //         \"type\": \"buy\",\n        //         \"kind\": \"margin\"\n        //     }\n        //\n        // swap: fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"order_id\": \"1590898207657824256\",\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"margin_mode\": \"crossed\",\n        //         \"contract_val\": \"0.001\",\n        //         \"type\": 1,\n        //         \"order_type\": 0,\n        //         \"price\": \"14000\",\n        //         \"size\": \"6\",\n        //         \"filled_qty\": \"0\",\n        //         \"price_avg\": \"0\",\n        //         \"fee\": \"0\",\n        //         \"state\": 0,\n        //         \"leverage\": \"20\",\n        //         \"turnover\": \"0\",\n        //         \"has_stop\": 0,\n        //         \"insert_time\": 1668134664828,\n        //         \"time_stamp\": 1668134664828\n        //     }\n        //\n        let timestamp = undefined;\n        let lastTradeTimestamp = undefined;\n        let timeInForce = undefined;\n        let type = undefined;\n        let side = this.safeString (order, 'type');\n        const marketId = this.safeString2 (order, 'symbol', 'instrument_id');\n        const symbol = this.safeSymbol (marketId, market);\n        market = this.market (symbol);\n        if (market['type'] === 'swap') {\n            const orderType = this.safeInteger (order, 'order_type');\n            if (orderType !== undefined) {\n                if ((orderType === 9) || (orderType === 10) || (orderType === 11) || (orderType === 12) || (orderType === 15)) {\n                    timeInForce = 'FOK';\n                } else if ((orderType === 1) || (orderType === 2) || (orderType === 3) || (orderType === 4) || (orderType === 13)) {\n                    timeInForce = 'IOC';\n                } else if ((orderType === 6) || (orderType === 7) || (orderType === 8) || (orderType === 14)) {\n                    timeInForce = 'GTC';\n                }\n                if ((orderType === 0) || (orderType === 1) || (orderType === 4) || (orderType === 5) || (orderType === 9) || (orderType === 10)) {\n                    type = 'limit';\n                } else {\n                    type = 'market';\n                }\n            }\n            if (side === '1') {\n                side = 'open long';\n            } else if (side === '2') {\n                side = 'open short';\n            } else if (side === '3') {\n                side = 'close long';\n            } else if (side === '4') {\n                side = 'close short';\n            }\n            timestamp = this.safeInteger (order, 'insert_time');\n            lastTradeTimestamp = this.safeInteger (order, 'time_stamp');\n        } else {\n            timestamp = this.safeTimestamp (order, 'created_date');\n            lastTradeTimestamp = this.safeTimestamp (order, 'finished_date');\n            if (side !== undefined) {\n                const parts = side.split ('_');\n                const numParts = parts.length;\n                if (numParts > 1) {\n                    side = parts[0];\n                    type = parts[1];\n                } else {\n                    type = 'limit';\n                }\n            }\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString2 (order, 'order_id', 'data'),\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': undefined,\n            'side': side,\n            'price': this.safeNumber (order, 'price'),\n            'triggerPrice': undefined,\n            'amount': this.safeNumber2 (order, 'amount', 'size'),\n            'filled': this.safeNumber2 (order, 'executed_amount', 'filled_qty'),\n            'remaining': undefined,\n            'cost': undefined,\n            'average': this.safeNumber2 (order, 'avg_price', 'price_avg'),\n            'status': this.parseOrderStatus (this.safeString2 (order, 'status', 'state')),\n            'fee': {\n                'cost': this.safeNumber (order, 'fee'),\n            },\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2047,
        "line_end": 2056,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '0': 'open',\n            '1': 'open', // partially filled\n            '2': 'closed',\n            '3': 'canceled',\n            '4': 'canceled', // partially filled and canceled\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3712,
        "line_end": 3794,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'amount')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidation_price')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber2 (position, 'avg_cost', 'entry_price')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealized_pnl')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'avail_position')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'last')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (position, 'margin')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.safeNumber (position, 'maint_margin_ratio')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber2 (position, 'leverage', 'leverage_ratio')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.safeNumber (position, 'margin_ratio')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"margin_mode\": \"crossed\",\n         \"avail_position\": \"1\",\n         \"avg_cost\": \"18369.3\",\n         \"last\": \"18388.9\",\n         \"leverage\": \"20\",\n         \"liquidation_price\": \"383.38712921065553\",\n         \"maint_margin_ratio\": \"0.005\",\n         \"margin\": \"0.918465\",\n         \"position\": \"1\",\n         \"realized_pnl\": \"0\",\n         \"unrealized_pnl\": \"0.021100000000004115\",\n         \"unrealized_pnl_rate\": \"0.02297311274790451\",\n         \"side\": \"long\",\n         \"open_outstanding\": \"0\",\n         \"risk_score\": \"0.4901960784313725\",\n         \"margin_ratio\": \"0.40486964045976204\",\n         \"timestamp\": 1667960241758\n     }",
          "{\n         \"amount\": 0.0010605,\n         \"side\": \"go_long\",\n         \"entry_price\": 18321.39,\n         \"liquidation_rate\": 0.3,\n         \"liquidation_price\": -52754.371758471,\n         \"unrealized_roe\": -0.002784390267332,\n         \"symbol\": \"BTC_USDT\",\n         \"unrealized_pnl\": -0.010820048189999,\n         \"leverage_ratio\": 5\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // swap\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"margin_mode\": \"crossed\",\n        //         \"avail_position\": \"1\",\n        //         \"avg_cost\": \"18369.3\",\n        //         \"last\": \"18388.9\",\n        //         \"leverage\": \"20\",\n        //         \"liquidation_price\": \"383.38712921065553\",\n        //         \"maint_margin_ratio\": \"0.005\",\n        //         \"margin\": \"0.918465\",\n        //         \"position\": \"1\",\n        //         \"realized_pnl\": \"0\",\n        //         \"unrealized_pnl\": \"0.021100000000004115\",\n        //         \"unrealized_pnl_rate\": \"0.02297311274790451\",\n        //         \"side\": \"long\",\n        //         \"open_outstanding\": \"0\",\n        //         \"risk_score\": \"0.4901960784313725\",\n        //         \"margin_ratio\": \"0.40486964045976204\",\n        //         \"timestamp\": 1667960241758\n        //     }\n        //\n        // margin\n        //\n        //     {\n        //         \"amount\": 0.0010605,\n        //         \"side\": \"go_long\",\n        //         \"entry_price\": 18321.39,\n        //         \"liquidation_rate\": 0.3,\n        //         \"liquidation_price\": -52754.371758471,\n        //         \"unrealized_roe\": -0.002784390267332,\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"unrealized_pnl\": -0.010820048189999,\n        //         \"leverage_ratio\": 5\n        //     }\n        //\n        const marketId = this.safeString2 (position, 'instrument_id', 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let marginMode = this.safeString (position, 'margin_mode');\n        if (marginMode !== undefined) {\n            marginMode = (marginMode === 'crossed') ? 'cross' : 'isolated';\n        } else {\n            marginMode = 'crossed';\n        }\n        const timestamp = this.safeInteger (position, 'timestamp');\n        let side = this.safeString (position, 'side');\n        if (side === 'go_long') {\n            side = 'long';\n        } else if (side === 'go_short') {\n            side = 'short';\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'notional': this.safeNumber (position, 'amount'),\n            'marginMode': marginMode,\n            'liquidationPrice': this.safeNumber (position, 'liquidation_price'),\n            'entryPrice': this.safeNumber2 (position, 'avg_cost', 'entry_price'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealized_pnl'),\n            'contracts': this.safeNumber (position, 'avail_position'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'markPrice': this.safeNumber (position, 'last'),\n            'side': side,\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'maintenanceMargin': this.safeNumber (position, 'margin'),\n            'maintenanceMarginPercentage': this.safeNumber (position, 'maint_margin_ratio'),\n            'collateral': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber2 (position, 'leverage', 'leverage_ratio'),\n            'marginRatio': this.safeNumber (position, 'margin_ratio'),\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1172,
        "line_end": 1246,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'high', 'high_24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'low', 'low_24h')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'buy', 'best_bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'best_bid_size')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'sell', 'best_ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'best_ask_size')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open_24h')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString2 (ticker, 'change', 'price_change_percent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'vol', 'volume_24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'base_vol')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"last\":0.021957,\n         \"symbol\": \"btc_usdt\",\n         \"base_vol\":2249.3521732227,\n         \"change\":-0.6,\n         \"vol\":102443.5111,\n         \"sell\":0.021978,\n         \"low\":0.021791,\n         \"buy\":0.021946,\n         \"high\":0.022266,\n         \"date\"1564518452, // injected from fetchTicker/fetchTickers\n     }",
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"index_price\": \"20141.9967\",\n         \"mark_price\": \"20139.3404\",\n         \"max_buy_price\": \"21146.4838\",\n         \"min_sell_price\": \"19132.2725\",\n         \"best_bid\": \"20140.0998\",\n         \"best_bid_size\": \"3116\",\n         \"best_ask\": \"20140.0999\",\n         \"best_ask_size\": \"9004\",\n         \"high_24h\": \"20410.6496\",\n         \"open_24h\": \"20308.6998\",\n         \"low_24h\": \"19600\",\n         \"last\": \"20140.0999\",\n         \"last_qty\": \"2\",\n         \"volume_24h\": \"49382816\",\n         \"price_change_percent\": \"-0.008301855936636448\",\n         \"open_interest\": \"-\",\n         \"timestamp\": 1663221614998\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"last\":0.021957,\n        //         \"symbol\": \"btc_usdt\",\n        //         \"base_vol\":2249.3521732227,\n        //         \"change\":-0.6,\n        //         \"vol\":102443.5111,\n        //         \"sell\":0.021978,\n        //         \"low\":0.021791,\n        //         \"buy\":0.021946,\n        //         \"high\":0.022266,\n        //         \"date\"1564518452, // injected from fetchTicker/fetchTickers\n        //     }\n        //\n        // swap: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"index_price\": \"20141.9967\",\n        //         \"mark_price\": \"20139.3404\",\n        //         \"max_buy_price\": \"21146.4838\",\n        //         \"min_sell_price\": \"19132.2725\",\n        //         \"best_bid\": \"20140.0998\",\n        //         \"best_bid_size\": \"3116\",\n        //         \"best_ask\": \"20140.0999\",\n        //         \"best_ask_size\": \"9004\",\n        //         \"high_24h\": \"20410.6496\",\n        //         \"open_24h\": \"20308.6998\",\n        //         \"low_24h\": \"19600\",\n        //         \"last\": \"20140.0999\",\n        //         \"last_qty\": \"2\",\n        //         \"volume_24h\": \"49382816\",\n        //         \"price_change_percent\": \"-0.008301855936636448\",\n        //         \"open_interest\": \"-\",\n        //         \"timestamp\": 1663221614998\n        //     }\n        //\n        const indexPrice = this.safeNumber (ticker, 'index_price');\n        const marketType = (indexPrice !== undefined) ? 'contract' : 'spot';\n        const marketId = this.safeStringUpper2 (ticker, 'symbol', 'instrument_id');\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        let timestamp = this.safeTimestamp (ticker, 'date');\n        if (market['swap']) {\n            timestamp = this.safeInteger (ticker, 'timestamp');\n        }\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'high', 'high_24h'),\n            'low': this.safeString2 (ticker, 'low', 'low_24h'),\n            'bid': this.safeString2 (ticker, 'buy', 'best_bid'),\n            'bidVolume': this.safeString (ticker, 'best_bid_size'),\n            'ask': this.safeString2 (ticker, 'sell', 'best_ask'),\n            'askVolume': this.safeString (ticker, 'best_ask_size'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open_24h'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString2 (ticker, 'change', 'price_change_percent'),\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'vol', 'volume_24h'),\n            'quoteVolume': this.safeString (ticker, 'base_vol'),\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'indexPrice': indexPrice,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1248,
        "line_end": 1383,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"date\":1564520003,\n         \"id\":1596149203,\n         \"amount\":0.7073,\n         \"type\":\"buy\",\n         \"price\":0.02193,\n     }",
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"trade_id\": \"1595190773677035521\",\n         \"direction\": \"4\",\n         \"volume\": \"4\",\n         \"price\": \"16188.3\",\n         \"trade_time\": 1669158092314\n     }",
          "{\n         \"symbol\": \"BTC_USDT\",\n         \"order_id\": \"6707cbdcda0edfaa7f4ab509e4cbf966\",\n         \"id\": 28457,\n         \"price\": 0.1,\n         \"amount\": 0,\n         \"fee\": 0.096,\n         \"fee_currency\": \"USDT\",\n         \"timestamp\": 1499865549,\n         \"side\": \"buy\", // or \"side\": \"sell_market\"\n         \"is_maker\": true\n     }",
          "{\n         \"trade_id\": \"1590136768424841218\",\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"order_id\": \"1590136768156405760\",\n         \"type\": 1,\n         \"order_type\": 8,\n         \"price\": \"18514.5\",\n         \"size\": \"1\",\n         \"fee\": \"0.00925725\",\n         \"close_profit\": \"0\",\n         \"leverage\": \"20\",\n         \"trade_type\": 0,\n         \"match_role\": 1,\n         \"trade_time\": 1667953123562\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // spot: fetchTrades\n        //\n        //     {\n        //         \"date\":1564520003,\n        //         \"id\":1596149203,\n        //         \"amount\":0.7073,\n        //         \"type\":\"buy\",\n        //         \"price\":0.02193,\n        //     }\n        //\n        // swap: fetchTrades\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"trade_id\": \"1595190773677035521\",\n        //         \"direction\": \"4\",\n        //         \"volume\": \"4\",\n        //         \"price\": \"16188.3\",\n        //         \"trade_time\": 1669158092314\n        //     }\n        //\n        // spot: fetchMyTrades\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"order_id\": \"6707cbdcda0edfaa7f4ab509e4cbf966\",\n        //         \"id\": 28457,\n        //         \"price\": 0.1,\n        //         \"amount\": 0,\n        //         \"fee\": 0.096,\n        //         \"fee_currency\": \"USDT\",\n        //         \"timestamp\": 1499865549,\n        //         \"side\": \"buy\", // or \"side\": \"sell_market\"\n        //         \"is_maker\": true\n        //     }\n        //\n        // swap: fetchMyTrades\n        //\n        //     {\n        //         \"trade_id\": \"1590136768424841218\",\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"order_id\": \"1590136768156405760\",\n        //         \"type\": 1,\n        //         \"order_type\": 8,\n        //         \"price\": \"18514.5\",\n        //         \"size\": \"1\",\n        //         \"fee\": \"0.00925725\",\n        //         \"close_profit\": \"0\",\n        //         \"leverage\": \"20\",\n        //         \"trade_type\": 0,\n        //         \"match_role\": 1,\n        //         \"trade_time\": 1667953123562\n        //     }\n        //\n        const id = this.safeString2 (trade, 'id', 'trade_id');\n        const orderId = this.safeString (trade, 'order_id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeStringN (trade, [ 'amount', 'volume', 'size' ]);\n        const marketId = this.safeStringUpper2 (trade, 'symbol', 'instrument_id');\n        const symbol = this.safeSymbol (marketId, market);\n        if (market === undefined) {\n            market = this.safeMarket (marketId);\n        }\n        let timestamp = this.safeTimestamp2 (trade, 'date', 'timestamp');\n        let side = this.safeString2 (trade, 'type', 'side');\n        let type = undefined;\n        let takerOrMaker = undefined;\n        if (market['type'] === 'swap') {\n            timestamp = this.safeInteger (trade, 'trade_time');\n            const orderType = this.safeString (trade, 'order_type');\n            const tradeRole = this.safeString (trade, 'match_role');\n            const direction = this.safeString (trade, 'direction');\n            if (orderType !== undefined) {\n                type = (orderType === '0') ? 'limit' : undefined;\n            }\n            if (tradeRole === '1') {\n                takerOrMaker = 'taker';\n            } else if (tradeRole === '2') {\n                takerOrMaker = 'maker';\n            } else {\n                takerOrMaker = undefined;\n            }\n            if ((side === '1') || (direction === '1')) {\n                // side = 'open long';\n                side = 'buy';\n            } else if ((side === '2') || (direction === '2')) {\n                // side = 'open short';\n                side = 'sell';\n            } else if ((side === '3') || (direction === '3')) {\n                // side = 'close long';\n                side = 'sell';\n            } else if ((side === '4') || (direction === '4')) {\n                // side = 'close short';\n                side = 'buy';\n            }\n        } else {\n            const parts = side.split ('_');\n            side = this.safeString (parts, 0);\n            type = this.safeString (parts, 1);\n            if (type === undefined) {\n                type = 'limit';\n            }\n            const isMaker = this.safeValue (trade, 'is_maker');\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fee_currency');\n            let feeCurrencyCode = undefined;\n            if (feeCurrencyId !== undefined) {\n                feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'order': orderId,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 3491,
        "line_end": 3509,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'maker_fee_rate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'taker_fee_rate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_id\": \"BTCUSDTPERP\",\n         \"taker_fee_rate\": \"0.0005\",\n         \"maker_fee_rate\": \"0.0003\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"instrument_id\": \"BTCUSDTPERP\",\n        //         \"taker_fee_rate\": \"0.0005\",\n        //         \"maker_fee_rate\": \"0.0003\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'instrument_id');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'maker_fee_rate'),\n            'taker': this.safeNumber (fee, 'taker_fee_rate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2894,
        "line_end": 2957,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 200,\n         \"withdraw_id\": 700\n     }",
          "{\n         \"id\": 1171,\n         \"currency\": \"xrp\",\n         \"hash\": \"ed03094b84eafbe4bc16e7ef766ee959885ee5bcb265872baaa9c64e1cf86c2b\",\n         \"chain\": \"\",\n         \"amount\": 7.457467,\n         \"address\": \"rae93V8d2mdoUQHwBDBdM4NHCMehRJAsbm\",\n         \"memo\": \"100040\",\n         \"fee\": 0,\n         \"state\": \"safe\",\n         \"created_date\": \"2020-04-20 11:23:00\",\n         \"finished_date\": \"2020-04-20 13:23:00\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"code\": 200,\n        //         \"withdraw_id\": 700\n        //     }\n        //\n        // fetchDeposits, fetchWithdrawals\n        //\n        //     {\n        //         \"id\": 1171,\n        //         \"currency\": \"xrp\",\n        //         \"hash\": \"ed03094b84eafbe4bc16e7ef766ee959885ee5bcb265872baaa9c64e1cf86c2b\",\n        //         \"chain\": \"\",\n        //         \"amount\": 7.457467,\n        //         \"address\": \"rae93V8d2mdoUQHwBDBdM4NHCMehRJAsbm\",\n        //         \"memo\": \"100040\",\n        //         \"fee\": 0,\n        //         \"state\": \"safe\",\n        //         \"created_date\": \"2020-04-20 11:23:00\",\n        //         \"finished_date\": \"2020-04-20 13:23:00\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'id', 'withdraw_id');\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'memo');\n        const txid = this.safeString (transaction, 'hash');\n        const currencyId = this.safeStringUpper (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_date'));\n        const updated = this.parse8601 (this.safeString (transaction, 'finished_date'));\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const amount = this.safeNumber (transaction, 'amount');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        const network = this.safeString (transaction, 'chain');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2882,
        "line_end": 2892,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        // deposit state includes: 1 (in deposit), 2 (to be confirmed), 3 (successfully deposited), 4 (stopped)\n        // withdrawal state includes: 1 (application in progress), 2 (to be confirmed), 3 (completed), 4 (rejected)\n        const statuses: Dict = {\n            '1': 'pending', // in Progress\n            '2': 'pending', // to be confirmed\n            '3': 'ok', // Completed\n            '4': 'failed', // Rejected\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2966,
        "line_end": 3018,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'transfer_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (data, 'currency'), currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber2 (data, 'amount', 'transfer_amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'code'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 0\n     }",
          "{\n         \"code\": 0,\n         \"data\": {\n             \"type\": 2,\n             \"currency\": \"USDT\",\n             \"transfer_amount\": \"5\"\n         }\n     }",
          "{\n         \"transfer_id\": 130524,\n         \"type\": 1,\n         \"currency\": \"USDT\",\n         \"amount\": \"24\",\n         \"timestamp\": 1666505659000\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer between spot, margin and OTC\n        //\n        //     {\n        //         \"code\": 0\n        //     }\n        //\n        // transfer between spot and swap\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"data\": {\n        //             \"type\": 2,\n        //             \"currency\": \"USDT\",\n        //             \"transfer_amount\": \"5\"\n        //         }\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"transfer_id\": 130524,\n        //         \"type\": 1,\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"24\",\n        //         \"timestamp\": 1666505659000\n        //     }\n        //\n        let fromAccount = undefined;\n        let toAccount = undefined;\n        const data = this.safeDict (transfer, 'data', transfer);\n        const type = this.safeInteger (data, 'type');\n        if (type === 1) {\n            fromAccount = 'spot';\n            toAccount = 'swap';\n        } else if (type === 2) {\n            fromAccount = 'swap';\n            toAccount = 'spot';\n        }\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'transfer_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (this.safeString (data, 'currency'), currency),\n            'amount': this.safeNumber2 (data, 'amount', 'transfer_amount'),\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': this.parseTransferStatus (this.safeString (transfer, 'code')),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 2959,
        "line_end": 2964,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            '0': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "dydx": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2413,
        "line_end": 2421,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "USDC",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const account = this.account ();\n        account['free'] = this.safeString (response, 'freeCollateral');\n        const result: Dict = {\n            'info': response,\n            'USDC': account,\n        };\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1723,
        "line_end": 1776,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (sender, 'address')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "this.safeString (recipient, 'address')",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'transactionHash')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n     \"sender\": {\n         \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n         \"subaccountNumber\": 0\n     },\n     \"recipient\": {\n         \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n         \"subaccountNumber\": 1\n     },\n     \"size\": \"0.000001\",\n     \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n     \"createdAtHeight\": \"45116125\",\n     \"symbol\": \"USDC\",\n     \"type\": \"TRANSFER_OUT\",\n     \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // {\n        //     \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n        //     \"sender\": {\n        //         \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n        //         \"subaccountNumber\": 0\n        //     },\n        //     \"recipient\": {\n        //         \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n        //         \"subaccountNumber\": 1\n        //     },\n        //     \"size\": \"0.000001\",\n        //     \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n        //     \"createdAtHeight\": \"45116125\",\n        //     \"symbol\": \"USDC\",\n        //     \"type\": \"TRANSFER_OUT\",\n        //     \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n        // }\n        //\n        const currencyId = this.safeString (item, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const type = this.safeStringUpper (item, 'type');\n        let direction = undefined;\n        if (type !== undefined) {\n            if (type === 'TRANSFER_IN' || type === 'DEPOSIT') {\n                direction = 'in';\n            } else if (type === 'TRANSFER_OUT' || type === 'WITHDRAWAL') {\n                direction = 'out';\n            }\n        }\n        const amount = this.safeString (item, 'size');\n        const timestamp = this.parse8601 (this.safeString (item, 'createdAt'));\n        const sender = this.safeDict (item, 'sender');\n        const recipient = this.safeDict (item, 'recipient');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'direction': direction,\n            'account': this.safeString (sender, 'address'),\n            'referenceAccount': this.safeString (recipient, 'address'),\n            'referenceId': this.safeString (item, 'transactionHash'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1778,
        "line_end": 1786,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'TRANSFER_IN': 'transfer',\n            'TRANSFER_OUT': 'transfer',\n            'DEPOSIT': 'deposit',\n            'WITHDRAWAL': 'withdrawal',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 479,
        "line_end": 577,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (market, 'ticker')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "baseName",
            "value": "baseName",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (amountPrecisionStr),\n                'price': this.parseNumber (pricePrecisionStr),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountPrecisionStr)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (pricePrecisionStr)",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"clobPairId\": \"0\",\n     \"ticker\": \"BTC-USD\",\n     \"status\": \"ACTIVE\",\n     \"oraclePrice\": \"118976.5376\",\n     \"priceChange24H\": \"659.9736\",\n     \"volume24H\": \"1292729.3605\",\n     \"trades24H\": 9387,\n     \"nextFundingRate\": \"0\",\n     \"initialMarginFraction\": \"0.02\",\n     \"maintenanceMarginFraction\": \"0.012\",\n     \"openInterest\": \"52.0691\",\n     \"atomicResolution\": -10,\n     \"quantumConversionExponent\": -9,\n     \"tickSize\": \"1\",\n     \"stepSize\": \"0.0001\",\n     \"stepBaseQuantums\": 1000000,\n     \"subticksPerTick\": 100000,\n     \"marketType\": \"CROSS\",\n     \"openInterestLowerCap\": \"0\",\n     \"openInterestUpperCap\": \"0\",\n     \"baseOpenInterest\": \"50.3776\",\n     \"defaultFundingRate1H\": \"0\"\n }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        // {\n        //     \"clobPairId\": \"0\",\n        //     \"ticker\": \"BTC-USD\",\n        //     \"status\": \"ACTIVE\",\n        //     \"oraclePrice\": \"118976.5376\",\n        //     \"priceChange24H\": \"659.9736\",\n        //     \"volume24H\": \"1292729.3605\",\n        //     \"trades24H\": 9387,\n        //     \"nextFundingRate\": \"0\",\n        //     \"initialMarginFraction\": \"0.02\",\n        //     \"maintenanceMarginFraction\": \"0.012\",\n        //     \"openInterest\": \"52.0691\",\n        //     \"atomicResolution\": -10,\n        //     \"quantumConversionExponent\": -9,\n        //     \"tickSize\": \"1\",\n        //     \"stepSize\": \"0.0001\",\n        //     \"stepBaseQuantums\": 1000000,\n        //     \"subticksPerTick\": 100000,\n        //     \"marketType\": \"CROSS\",\n        //     \"openInterestLowerCap\": \"0\",\n        //     \"openInterestUpperCap\": \"0\",\n        //     \"baseOpenInterest\": \"50.3776\",\n        //     \"defaultFundingRate1H\": \"0\"\n        // }\n        //\n        const quoteId = 'USDC';\n        const marketId = this.safeString (market, 'ticker');\n        const parts = marketId.split ('-');\n        const baseName = this.safeString (parts, 0);\n        const baseId = this.safeString (market, 'baseId', baseName); // idk where 'baseId' comes from, but leaving as is\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settleId = 'USDC';\n        const settle = this.safeCurrencyCode (settleId);\n        const symbol = base + '/' + quote + ':' + settle;\n        const contract = true;\n        const swap = true;\n        const amountPrecisionStr = this.safeString (market, 'stepSize');\n        const pricePrecisionStr = this.safeString (market, 'tickSize');\n        const status = this.safeString (market, 'status');\n        let active = true;\n        if (status !== 'ACTIVE') {\n            active = false;\n        }\n        return this.safeMarketStructure ({\n            'id': this.safeString (market, 'ticker'),\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'baseName': baseName,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': 'swap',\n            'spot': false,\n            'margin': undefined,\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': contract,\n            'contractSize': this.parseNumber ('1'), // trades seem in absolute size\n            'linear': true,\n            'inverse': false,\n            'taker': undefined,\n            'maker': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (amountPrecisionStr),\n                'price': this.parseNumber (pricePrecisionStr),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 702,
        "line_end": 728,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n     \"startedAt\": \"2025-07-25T09:47:00.000Z\",\n     \"ticker\": \"BTC-USD\",\n     \"resolution\": \"1MIN\",\n     \"low\": \"116099\",\n     \"high\": \"116099\",\n     \"open\": \"116099\",\n     \"close\": \"116099\",\n     \"baseTokenVolume\": \"0\",\n     \"usdVolume\": \"0\",\n     \"trades\": 0,\n     \"startingOpenInterest\": \"54.0594\",\n     \"orderbookMidPriceOpen\": \"115845.5\",\n     \"orderbookMidPriceClose\": \"115845.5\"\n }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // {\n        //     \"startedAt\": \"2025-07-25T09:47:00.000Z\",\n        //     \"ticker\": \"BTC-USD\",\n        //     \"resolution\": \"1MIN\",\n        //     \"low\": \"116099\",\n        //     \"high\": \"116099\",\n        //     \"open\": \"116099\",\n        //     \"close\": \"116099\",\n        //     \"baseTokenVolume\": \"0\",\n        //     \"usdVolume\": \"0\",\n        //     \"trades\": 0,\n        //     \"startingOpenInterest\": \"54.0594\",\n        //     \"orderbookMidPriceOpen\": \"115845.5\",\n        //     \"orderbookMidPriceClose\": \"115845.5\"\n        // }\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'startedAt')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'baseTokenVolume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 861,
        "line_end": 922,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "this.safeBool (order, 'postOnly')",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"dad46410-3444-5566-a129-19a619300fb7\",\n     \"subaccountId\": \"8586bcf6-1f58-5ec9-a0bc-e53db273e7b0\",\n     \"clientId\": \"716238006\",\n     \"clobPairId\": \"0\",\n     \"side\": \"BUY\",\n     \"size\": \"0.001\",\n     \"totalFilled\": \"0.001\",\n     \"price\": \"400000\",\n     \"type\": \"LIMIT\",\n     \"status\": \"FILLED\",\n     \"timeInForce\": \"GTT\",\n     \"reduceOnly\": false,\n     \"orderFlags\": \"64\",\n     \"goodTilBlockTime\": \"2025-07-28T12:07:33.000Z\",\n     \"createdAtHeight\": \"45058325\",\n     \"clientMetadata\": \"2\",\n     \"updatedAt\": \"2025-07-28T12:06:35.330Z\",\n     \"updatedAtHeight\": \"45058326\",\n     \"postOnly\": false,\n     \"ticker\": \"BTC-USD\",\n     \"subaccountNumber\": 0\n }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // {\n        //     \"id\": \"dad46410-3444-5566-a129-19a619300fb7\",\n        //     \"subaccountId\": \"8586bcf6-1f58-5ec9-a0bc-e53db273e7b0\",\n        //     \"clientId\": \"716238006\",\n        //     \"clobPairId\": \"0\",\n        //     \"side\": \"BUY\",\n        //     \"size\": \"0.001\",\n        //     \"totalFilled\": \"0.001\",\n        //     \"price\": \"400000\",\n        //     \"type\": \"LIMIT\",\n        //     \"status\": \"FILLED\",\n        //     \"timeInForce\": \"GTT\",\n        //     \"reduceOnly\": false,\n        //     \"orderFlags\": \"64\",\n        //     \"goodTilBlockTime\": \"2025-07-28T12:07:33.000Z\",\n        //     \"createdAtHeight\": \"45058325\",\n        //     \"clientMetadata\": \"2\",\n        //     \"updatedAt\": \"2025-07-28T12:06:35.330Z\",\n        //     \"updatedAtHeight\": \"45058326\",\n        //     \"postOnly\": false,\n        //     \"ticker\": \"BTC-USD\",\n        //     \"subaccountNumber\": 0\n        // }\n        //\n        const status = this.parseOrderStatus (this.safeStringUpper (order, 'status'));\n        const marketId = this.safeString (order, 'ticker');\n        const symbol = this.safeSymbol (marketId, market);\n        const filled = this.safeString (order, 'totalFilled');\n        const timestamp = this.parse8601 (this.safeString (order, 'updatedAt'));\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'size');\n        const type = this.parseOrderType (this.safeStringUpper (order, 'type'));\n        const side = this.safeStringLower (order, 'side');\n        const timeInForce = this.safeStringUpper (order, 'timeInForce');\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'id'),\n            'clientOrderId': this.safeString (order, 'clientId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': timestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': this.safeBool (order, 'postOnly'),\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'average': undefined,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 924,
        "line_end": 933,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'UNTRIGGERED': 'open',\n            'OPEN': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'BEST_EFFORT_CANCELED': 'canceling',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 935,
        "line_end": 946,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'LIMIT',\n            'STOP_LIMIT': 'LIMIT',\n            'TAKE_PROFIT_LIMIT': 'LIMIT',\n            'MARKET': 'MARKET',\n            'STOP_MARKET': 'MARKET',\n            'TAKE_PROFIT_MARKET': 'MARKET',\n            'TRAILING_STOP': 'MARKET',\n        };\n        return this.safeStringUpper (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1069,
        "line_end": 1124,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPnl')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"market\": \"BTC-USD\",\n     \"status\": \"OPEN\",\n     \"side\": \"SHORT\",\n     \"size\": \"-0.407\",\n     \"maxSize\": \"-0.009\",\n     \"entryPrice\": \"118692.04840909090909090909\",\n     \"exitPrice\": \"119526.565625\",\n     \"realizedPnl\": \"476.42665909090909090909088\",\n     \"unrealizedPnl\": \"-57.26681734000000000000037\",\n     \"createdAt\": \"2025-07-14T07:53:55.631Z\",\n     \"createdAtHeight\": \"44140908\",\n     \"closedAt\": null,\n     \"sumOpen\": \"0.44\",\n     \"sumClose\": \"0.032\",\n     \"netFunding\": \"503.13121\",\n     \"subaccountNumber\": 0\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"market\": \"BTC-USD\",\n        //     \"status\": \"OPEN\",\n        //     \"side\": \"SHORT\",\n        //     \"size\": \"-0.407\",\n        //     \"maxSize\": \"-0.009\",\n        //     \"entryPrice\": \"118692.04840909090909090909\",\n        //     \"exitPrice\": \"119526.565625\",\n        //     \"realizedPnl\": \"476.42665909090909090909088\",\n        //     \"unrealizedPnl\": \"-57.26681734000000000000037\",\n        //     \"createdAt\": \"2025-07-14T07:53:55.631Z\",\n        //     \"createdAtHeight\": \"44140908\",\n        //     \"closedAt\": null,\n        //     \"sumOpen\": \"0.44\",\n        //     \"sumClose\": \"0.032\",\n        //     \"netFunding\": \"503.13121\",\n        //     \"subaccountNumber\": 0\n        // }\n        //\n        const marketId = this.safeString (position, 'market');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        let quantity = this.safeString (position, 'size');\n        if (side !== 'long') {\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        const timestamp = this.parse8601 (this.safeString (position, 'createdAt'));\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'markPrice': undefined,\n            'notional': undefined,\n            'collateral': undefined,\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPnl'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 627,
        "line_end": 660,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"02ac5b1f0000000200000002\",\n     \"side\": \"BUY\",\n     \"size\": \"0.0501\",\n     \"price\": \"115732\",\n     \"type\": \"LIMIT\",\n     \"createdAt\": \"2025-07-25T05:11:09.800Z\",\n     \"createdAtHeight\": \"44849951\"\n }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // {\n        //     \"id\": \"02ac5b1f0000000200000002\",\n        //     \"side\": \"BUY\",\n        //     \"size\": \"0.0501\",\n        //     \"price\": \"115732\",\n        //     \"type\": \"LIMIT\",\n        //     \"createdAt\": \"2025-07-25T05:11:09.800Z\",\n        //     \"createdAtHeight\": \"44849951\"\n        // }\n        //\n        const timestamp = this.parse8601 (this.safeString (trade, 'createdAt'));\n        const symbol = market['symbol'];\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'size');\n        const side = this.safeStringLower (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'order': undefined,\n            'takerOrMaker': undefined,\n            'type': undefined,\n            'fee': undefined,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2024,
        "line_end": 2076,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (transaction, 'type')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n     \"sender\": {\n         \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n         \"subaccountNumber\": 0\n     },\n     \"recipient\": {\n         \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n         \"subaccountNumber\": 1\n     },\n     \"size\": \"0.000001\",\n     \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n     \"createdAtHeight\": \"45116125\",\n     \"symbol\": \"USDC\",\n     \"type\": \"TRANSFER_OUT\",\n     \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // {\n        //     \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n        //     \"sender\": {\n        //         \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n        //         \"subaccountNumber\": 0\n        //     },\n        //     \"recipient\": {\n        //         \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n        //         \"subaccountNumber\": 1\n        //     },\n        //     \"size\": \"0.000001\",\n        //     \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n        //     \"createdAtHeight\": \"45116125\",\n        //     \"symbol\": \"USDC\",\n        //     \"type\": \"TRANSFER_OUT\",\n        //     \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n        // }\n        //\n        const id = this.safeString (transaction, 'id');\n        const sender = this.safeDict (transaction, 'sender');\n        const recipient = this.safeDict (transaction, 'recipient');\n        const addressTo = this.safeString (recipient, 'address');\n        const addressFrom = this.safeString (sender, 'address');\n        const txid = this.safeString (transaction, 'transactionHash');\n        const currencyId = this.safeString (transaction, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.parse8601 (this.safeString (transaction, 'createdAt'));\n        const amount = this.safeNumber (transaction, 'size');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': addressTo,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': this.safeStringLower (transaction, 'type'), // 'deposit', 'withdrawal'\n            'amount': amount,\n            'currency': code,\n            'status': undefined,\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1956,
        "line_end": 1996,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromAccount",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toAccount",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n     \"sender\": {\n         \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n         \"subaccountNumber\": 0\n     },\n     \"recipient\": {\n         \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n         \"subaccountNumber\": 1\n     },\n     \"size\": \"0.000001\",\n     \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n     \"createdAtHeight\": \"45116125\",\n     \"symbol\": \"USDC\",\n     \"type\": \"TRANSFER_OUT\",\n     \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // {\n        //     \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n        //     \"sender\": {\n        //         \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n        //         \"subaccountNumber\": 0\n        //     },\n        //     \"recipient\": {\n        //         \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n        //         \"subaccountNumber\": 1\n        //     },\n        //     \"size\": \"0.000001\",\n        //     \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n        //     \"createdAtHeight\": \"45116125\",\n        //     \"symbol\": \"USDC\",\n        //     \"type\": \"TRANSFER_OUT\",\n        //     \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n        // }\n        //\n        const id = this.safeString (transfer, 'id');\n        const currencyId = this.safeString (transfer, 'symbol');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const amount = this.safeNumber (transfer, 'size');\n        const sender = this.safeDict (transfer, 'sender');\n        const recipient = this.safeDict (transfer, 'recipient');\n        const fromAccount = this.safeString (sender, 'address');\n        const toAccount = this.safeString (recipient, 'address');\n        const timestamp = this.parse8601 (this.safeString (transfer, 'createdAt'));\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': fromAccount,\n            'toAccount': toAccount,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "exmo": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1035,
        "line_end": 1068,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const wallets = this.safeValue (response, 'wallets');\n        if (wallets !== undefined) {\n            const currencyIds = Object.keys (wallets);\n            for (let i = 0; i < currencyIds.length; i++) {\n                const currencyId = currencyIds[i];\n                const item = wallets[currencyId];\n                const currency = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['used'] = this.safeString (item, 'used');\n                account['free'] = this.safeString (item, 'free');\n                account['total'] = this.safeString (item, 'balance');\n                result[currency] = account;\n            }\n        } else {\n            const free = this.safeValue (response, 'balances', {});\n            const used = this.safeValue (response, 'reserved', {});\n            const currencyIds = Object.keys (free);\n            for (let i = 0; i < currencyIds.length; i++) {\n                const currencyId = currencyIds[i];\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                if (currencyId in free) {\n                    account['free'] = this.safeString (free, currencyId);\n                }\n                if (currencyId in used) {\n                    account['used'] = this.safeString (used, currencyId);\n                }\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 623,
        "line_end": 673,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        {\n            \"type\": \"deposit\", // or \"withdraw\"\n            \"name\": \"BTC\",\n            \"currency_name\": \"BTC\",\n            \"min\": \"0.001\",\n            \"max\": \"0\",\n            \"enabled\": true,\n            \"comment\": \"Minimum deposit amount is 0.001 BTC. We do not support BSC and BEP20 network, please consider this when sending funds\",\n            \"commission_desc\": \"0%\",\n            \"currency_confirmations\": 1\n        },\n        ...\n    ]"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    [\n        //        {\n        //            \"type\": \"deposit\", // or \"withdraw\"\n        //            \"name\": \"BTC\",\n        //            \"currency_name\": \"BTC\",\n        //            \"min\": \"0.001\",\n        //            \"max\": \"0\",\n        //            \"enabled\": true,\n        //            \"comment\": \"Minimum deposit amount is 0.001 BTC. We do not support BSC and BEP20 network, please consider this when sending funds\",\n        //            \"commission_desc\": \"0%\",\n        //            \"currency_confirmations\": 1\n        //        },\n        //        ...\n        //    ]\n        //\n        const result = this.depositWithdrawFee (fee);\n        for (let i = 0; i < fee.length; i++) {\n            const provider = fee[i];\n            const type = this.safeString (provider, 'type');\n            const networkId = this.safeString (provider, 'name');\n            const networkCode = this.networkIdToCode (networkId, this.safeString (currency, 'code'));\n            const commissionDesc = this.safeString (provider, 'commission_desc');\n            let splitCommissionDesc = [];\n            let percentage = undefined;\n            if (commissionDesc !== undefined) {\n                splitCommissionDesc = commissionDesc.split ('%');\n                const splitCommissionDescLength = splitCommissionDesc.length;\n                percentage = splitCommissionDescLength >= 2;\n            }\n            const network = this.safeValue (result['networks'], networkCode);\n            if (network === undefined) {\n                result['networks'][networkCode] = {\n                    'withdraw': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                    'deposit': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                };\n            }\n            result['networks'][networkCode][type] = {\n                'fee': this.parseFixedFloatValue (this.safeString (splitCommissionDesc, 0)),\n                'percentage': percentage,\n            };\n        }\n        return this.assignDefaultDepositWithdrawFees (result);\n    }"
      },
      {
        "name": "parseFixedFloatValue",
        "signature": "parseFixedFloatValue (input)",
        "line_start": 494,
        "line_end": 509,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFixedFloatValue (input) {\n        if ((input === undefined) || (input === '-')) {\n            return undefined;\n        }\n        if (input === '') {\n            return 0;\n        }\n        const isPercentage = (input.indexOf ('%') >= 0);\n        const parts = input.split (' ');\n        const value = parts[0].replace ('%', '');\n        const result = parseFloat (value);\n        if ((result > 0) && isPercentage) {\n            throw new ExchangeError (this.id + ' parseFixedFloatValue() detected an unsupported non-zero percentage-based fee ' + input);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 334,
        "line_end": 350,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeValue (market, 'quote')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //      {}\n        //\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (undefined, market),\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': this.safeValue (market, 'quote'),\n            'status': 'ok',\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1014,
        "line_end": 1033,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"t\":1584057600000,\n         \"o\":0.02235144,\n         \"c\":0.02400233,\n         \"h\":0.025171,\n         \"l\":0.02221,\n         \"v\":5988.34031761\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"t\":1584057600000,\n        //         \"o\":0.02235144,\n        //         \"c\":0.02400233,\n        //         \"h\":0.025171,\n        //         \"l\":0.02221,\n        //         \"v\":5988.34031761\n        //     }\n        //\n        return [\n            this.safeInteger (ohlcv, 't'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber (ohlcv, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1980,
        "line_end": 2117,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeIntegerProduct (order, 'updated', 0.000001)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseStatus (this.safeString (order, 'order_status'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "transactions",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"14\",\n         \"created\": \"1435517311\",\n         \"type\": \"buy\",\n         \"pair\": \"BTC_USD\",\n         \"price\": \"100\",\n         \"quantity\": \"1\",\n         \"amount\": \"100\"\n     }",
          "{\n         \"type\": \"buy\",\n         \"in_currency\": \"BTC\",\n         \"in_amount\": \"1\",\n         \"out_currency\": \"USD\",\n         \"out_amount\": \"100\",\n         \"trades\": [\n             {\n                 \"trade_id\": 3,\n                 \"date\": 1435488248,\n                 \"type\": \"buy\",\n                 \"pair\": \"BTC_USD\",\n                 \"order_id\": 12345,\n                 \"quantity\": 1,\n                 \"price\": 100,\n                 \"amount\": 100\n             }\n         ]\n     }",
          "{\n        \"client_id\": \"0\",\n        \"comment\": \"\",\n        \"created\": \"1619068707985325495\",\n        \"distance\": \"0\",\n        \"expire\": 0,\n        \"funding_currency\": \"BTC\",\n        \"funding_quantity\": \"0.01\",\n        \"funding_rate\": \"0.02\",\n        \"leverage\": \"2\",\n        \"order_id\": \"123\",\n        \"pair\": \"BTC_USD\",\n        \"previous_type\": \"limit_sell\",\n        \"price\": \"58000\",\n        \"quantity\": \"0.01\",\n        \"src\": 0,\n        \"stop_price\": \"0\",\n        \"trigger_price\": \"58000\",\n        \"type\": \"limit_sell\",\n        \"updated\": 1619068707989411800\n    }",
          "{\n        \"distance\": \"0\",\n        \"event_id\": \"692842802860022508\",\n        \"event_time\": \"1619069531190173720\",\n        \"event_type\": \"OrderCancelStarted\",\n        \"order_id\": \"123\",\n        \"order_status\": \"cancel_started\",\n        \"order_type\": \"limit_sell\",\n        \"pair\": \"BTC_USD\",\n        \"price\": \"54115\",\n        \"quantity\": \"0.001\",\n        \"stop_price\": \"0\",\n        \"trade_id\": \"0\",\n        \"trade_price\": \"0\",\n        \"trade_quantity\": \"0\",\n        \"trade_type\": \"\"\n    },"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n        //\n        //     {\n        //         \"order_id\": \"14\",\n        //         \"created\": \"1435517311\",\n        //         \"type\": \"buy\",\n        //         \"pair\": \"BTC_USD\",\n        //         \"price\": \"100\",\n        //         \"quantity\": \"1\",\n        //         \"amount\": \"100\"\n        //     }\n        //\n        // fetchOrder\n        //\n        //     {\n        //         \"type\": \"buy\",\n        //         \"in_currency\": \"BTC\",\n        //         \"in_amount\": \"1\",\n        //         \"out_currency\": \"USD\",\n        //         \"out_amount\": \"100\",\n        //         \"trades\": [\n        //             {\n        //                 \"trade_id\": 3,\n        //                 \"date\": 1435488248,\n        //                 \"type\": \"buy\",\n        //                 \"pair\": \"BTC_USD\",\n        //                 \"order_id\": 12345,\n        //                 \"quantity\": 1,\n        //                 \"price\": 100,\n        //                 \"amount\": 100\n        //             }\n        //         ]\n        //     }\n        //\n        // Margin fetchOpenOrders\n        //\n        //    {\n        //        \"client_id\": \"0\",\n        //        \"comment\": \"\",\n        //        \"created\": \"1619068707985325495\",\n        //        \"distance\": \"0\",\n        //        \"expire\": 0,\n        //        \"funding_currency\": \"BTC\",\n        //        \"funding_quantity\": \"0.01\",\n        //        \"funding_rate\": \"0.02\",\n        //        \"leverage\": \"2\",\n        //        \"order_id\": \"123\",\n        //        \"pair\": \"BTC_USD\",\n        //        \"previous_type\": \"limit_sell\",\n        //        \"price\": \"58000\",\n        //        \"quantity\": \"0.01\",\n        //        \"src\": 0,\n        //        \"stop_price\": \"0\",\n        //        \"trigger_price\": \"58000\",\n        //        \"type\": \"limit_sell\",\n        //        \"updated\": 1619068707989411800\n        //    }\n        //\n        // Margin fetchClosedOrders\n        //\n        //    {\n        //        \"distance\": \"0\",\n        //        \"event_id\": \"692842802860022508\",\n        //        \"event_time\": \"1619069531190173720\",\n        //        \"event_type\": \"OrderCancelStarted\",\n        //        \"order_id\": \"123\",\n        //        \"order_status\": \"cancel_started\",\n        //        \"order_type\": \"limit_sell\",\n        //        \"pair\": \"BTC_USD\",\n        //        \"price\": \"54115\",\n        //        \"quantity\": \"0.001\",\n        //        \"stop_price\": \"0\",\n        //        \"trade_id\": \"0\",\n        //        \"trade_price\": \"0\",\n        //        \"trade_quantity\": \"0\",\n        //        \"trade_type\": \"\"\n        //    },\n        //\n        const id = this.safeString2 (order, 'order_id', 'parent_order_id');\n        const eventTime = this.safeIntegerProduct2 (order, 'event_time', 'created', 0.000001);\n        const timestamp = this.safeTimestamp (order, 'created', eventTime);\n        const orderType = this.safeString2 (order, 'type', 'order_type');\n        const side = this.parseSide (orderType);\n        let marketId = undefined;\n        if ('pair' in order) {\n            marketId = order['pair'];\n        } else if (('in_currency' in order) && ('out_currency' in order)) {\n            if (side === 'buy') {\n                marketId = order['in_currency'] + '_' + order['out_currency'];\n            } else {\n                marketId = order['out_currency'] + '_' + order['in_currency'];\n            }\n        }\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let amount = this.safeString (order, 'quantity');\n        if (amount === undefined) {\n            const amountField = (side === 'buy') ? 'in_amount' : 'out_amount';\n            amount = this.safeString (order, amountField);\n        }\n        const price = this.safeString (order, 'price');\n        const cost = this.safeString (order, 'amount');\n        const transactions = this.safeValue (order, 'trades', []);\n        const clientOrderId = this.safeInteger (order, 'client_id');\n        let triggerPrice = this.safeString (order, 'stop_price');\n        if (triggerPrice === '0') {\n            triggerPrice = undefined;\n        }\n        let type = undefined;\n        if ((orderType !== 'buy') && (orderType !== 'sell')) {\n            type = orderType;\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': this.safeIntegerProduct (order, 'updated', 0.000001),\n            'status': this.parseStatus (this.safeString (order, 'order_status')),\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'cost': cost,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': undefined,\n            'average': undefined,\n            'trades': transactions,\n            'fee': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseSide",
        "signature": "parseSide (orderType)",
        "line_start": 1960,
        "line_end": 1978,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSide (orderType) {\n        const side: Dict = {\n            'limit_buy': 'buy',\n            'limit_sell': 'sell',\n            'market_buy': 'buy',\n            'market_sell': 'sell',\n            'stop_buy': 'buy',\n            'stop_sell': 'sell',\n            'stop_limit_buy': 'buy',\n            'stop_limit_sell': 'sell',\n            'trailing_stop_buy': 'buy',\n            'trailing_stop_sell': 'sell',\n            'stop_market_sell': 'sell',\n            'stop_market_buy': 'buy',\n            'buy': 'buy',\n            'sell': 'sell',\n        };\n        return this.safeString (side, orderType, orderType);\n    }"
      },
      {
        "name": "parseStatus",
        "signature": "parseStatus (status)",
        "line_start": 1947,
        "line_end": 1958,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseStatus (status) {\n        if (status === undefined) {\n            return undefined;\n        }\n        const statuses: Dict = {\n            'cancel_started': 'canceled',\n        };\n        if (status.indexOf ('cancel') >= 0) {\n            status = 'canceled';\n        }\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1184,
        "line_end": 1223,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy_price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell_price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'avg')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'vol')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'vol_curr')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"buy_price\":\"0.00002996\",\n         \"sell_price\":\"0.00003002\",\n         \"last_trade\":\"0.00002992\",\n         \"high\":\"0.00003028\",\n         \"low\":\"0.00002935\",\n         \"avg\":\"0.00002963\",\n         \"vol\":\"1196546.3163222\",\n         \"vol_curr\":\"35.80066578\",\n         \"updated\":1642291733\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"buy_price\":\"0.00002996\",\n        //         \"sell_price\":\"0.00003002\",\n        //         \"last_trade\":\"0.00002992\",\n        //         \"high\":\"0.00003028\",\n        //         \"low\":\"0.00002935\",\n        //         \"avg\":\"0.00002963\",\n        //         \"vol\":\"1196546.3163222\",\n        //         \"vol_curr\":\"35.80066578\",\n        //         \"updated\":1642291733\n        //     }\n        //\n        const timestamp = this.safeTimestamp (ticker, 'updated');\n        market = this.safeMarket (undefined, market);\n        const last = this.safeString (ticker, 'last_trade');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy_price'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell_price'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': this.safeString (ticker, 'avg'),\n            'baseVolume': this.safeString (ticker, 'vol'),\n            'quoteVolume': this.safeString (ticker, 'vol_curr'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1281,
        "line_end": 1370,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"trade_id\":165087520,\n         \"date\":1587470005,\n         \"type\":\"buy\",\n         \"quantity\":\"1.004\",\n         \"price\":\"0.02491461\",\n         \"amount\":\"0.02501426\"\n     },",
          "{\n         \"trade_id\": 3,\n         \"date\": 1435488248,\n         \"type\": \"buy\",\n         \"pair\": \"BTC_USD\",\n         \"order_id\": 12345,\n         \"quantity\": 1,\n         \"price\": 100,\n         \"amount\": 100,\n         \"exec_type\": \"taker\",\n         \"commission_amount\": \"0.02\",\n         \"commission_currency\": \"BTC\",\n         \"commission_percent\": \"0.2\"\n     }",
          "{\n        \"trade_id\": \"692861757015952517\",\n        \"trade_dt\": \"1693951853197811824\",\n        \"trade_type\": \"buy\",\n        \"pair\": \"ADA_USDT\",\n        \"quantity\": \"1.96607879\",\n        \"price\": \"0.2568\",\n        \"amount\": \"0.50488903\"\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"trade_id\":165087520,\n        //         \"date\":1587470005,\n        //         \"type\":\"buy\",\n        //         \"quantity\":\"1.004\",\n        //         \"price\":\"0.02491461\",\n        //         \"amount\":\"0.02501426\"\n        //     },\n        //\n        // fetchMyTrades, fetchOrderTrades\n        //\n        //     {\n        //         \"trade_id\": 3,\n        //         \"date\": 1435488248,\n        //         \"type\": \"buy\",\n        //         \"pair\": \"BTC_USD\",\n        //         \"order_id\": 12345,\n        //         \"quantity\": 1,\n        //         \"price\": 100,\n        //         \"amount\": 100,\n        //         \"exec_type\": \"taker\",\n        //         \"commission_amount\": \"0.02\",\n        //         \"commission_currency\": \"BTC\",\n        //         \"commission_percent\": \"0.2\"\n        //     }\n        //\n        // fetchMyTrades (margin)\n        //\n        //    {\n        //        \"trade_id\": \"692861757015952517\",\n        //        \"trade_dt\": \"1693951853197811824\",\n        //        \"trade_type\": \"buy\",\n        //        \"pair\": \"ADA_USDT\",\n        //        \"quantity\": \"1.96607879\",\n        //        \"price\": \"0.2568\",\n        //        \"amount\": \"0.50488903\"\n        //    }\n        //\n        const timestamp = this.safeTimestamp (trade, 'date');\n        const id = this.safeString (trade, 'trade_id');\n        const orderId = this.safeString (trade, 'order_id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'quantity');\n        const costString = this.safeString (trade, 'amount');\n        const side = this.safeString2 (trade, 'type', 'trade_type');\n        const type = undefined;\n        const marketId = this.safeString (trade, 'pair');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = market['symbol'];\n        const isMaker = this.safeValue (trade, 'is_maker');\n        let takerOrMakerDefault = undefined;\n        if (isMaker !== undefined) {\n            takerOrMakerDefault = isMaker ? 'maker' : 'taker';\n        }\n        const takerOrMaker = this.safeString (trade, 'exec_type', takerOrMakerDefault);\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'commission_amount');\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'commission_currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            let feeRateString = this.safeString (trade, 'commission_percent');\n            if (feeRateString !== undefined) {\n                feeRateString = Precise.stringDiv (feeRateString, '1000', 18);\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n                'rate': feeRateString,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2358,
        "line_end": 2492,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'order_id', 'task_id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (transaction, 'provider')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeStringLower (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeTimestamp (transaction, 'updated')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "comment",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"dt\": 1461841192,\n        \"type\": \"deposit\",\n        \"curr\": \"RUB\",\n        \"status\": \"processing\",\n        \"provider\": \"Qiwi (LA) [12345]\",\n        \"amount\": \"1\",\n        \"account\": \"\",\n        \"txid\": \"ec46f784ad976fd7f7539089d1a129fe46...\",\n    }",
          "{\n        \"operation_id\": 47412538520634344,\n        \"created\": 1573760013,\n        \"updated\": 1573760013,\n        \"type\": \"withdraw\",\n        \"currency\": \"DOGE\",\n        \"status\": \"Paid\",\n        \"amount\": \"300\",\n        \"provider\": \"DOGE\",\n        \"commission\": \"0\",\n        \"account\": \"DOGE: DBVy8pF1f8yxaCVEHqHeR7kkcHecLQ8nRS\",\n        \"order_id\": 69670170,\n        \"provider_type\": \"crypto\",\n        \"crypto_address\": \"DBVy8pF1f8yxaCVEHqHeR7kkcHecLQ8nRS\",\n        \"card_number\": \"\",\n        \"wallet_address\": \"\",\n        \"email\": \"\",\n        \"phone\": \"\",\n        \"extra\": {\n            \"txid\": \"f2b66259ae1580f371d38dd27e31a23fff8c04122b65ee3ab5a3f612d579c792\",\n            \"confirmations\": null,\n            \"excode\": \"\",\n            \"invoice\": \"\"\n        },\n        \"error\": \"\"\n    }",
          "{\n        \"result\": true,\n        \"error\": \"\",\n        \"task_id\": 11775077\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDepositsWithdrawals\n        //\n        //    {\n        //        \"dt\": 1461841192,\n        //        \"type\": \"deposit\",\n        //        \"curr\": \"RUB\",\n        //        \"status\": \"processing\",\n        //        \"provider\": \"Qiwi (LA) [12345]\",\n        //        \"amount\": \"1\",\n        //        \"account\": \"\",\n        //        \"txid\": \"ec46f784ad976fd7f7539089d1a129fe46...\",\n        //    }\n        //\n        // fetchWithdrawals\n        //\n        //    {\n        //        \"operation_id\": 47412538520634344,\n        //        \"created\": 1573760013,\n        //        \"updated\": 1573760013,\n        //        \"type\": \"withdraw\",\n        //        \"currency\": \"DOGE\",\n        //        \"status\": \"Paid\",\n        //        \"amount\": \"300\",\n        //        \"provider\": \"DOGE\",\n        //        \"commission\": \"0\",\n        //        \"account\": \"DOGE: DBVy8pF1f8yxaCVEHqHeR7kkcHecLQ8nRS\",\n        //        \"order_id\": 69670170,\n        //        \"provider_type\": \"crypto\",\n        //        \"crypto_address\": \"DBVy8pF1f8yxaCVEHqHeR7kkcHecLQ8nRS\",\n        //        \"card_number\": \"\",\n        //        \"wallet_address\": \"\",\n        //        \"email\": \"\",\n        //        \"phone\": \"\",\n        //        \"extra\": {\n        //            \"txid\": \"f2b66259ae1580f371d38dd27e31a23fff8c04122b65ee3ab5a3f612d579c792\",\n        //            \"confirmations\": null,\n        //            \"excode\": \"\",\n        //            \"invoice\": \"\"\n        //        },\n        //        \"error\": \"\"\n        //    }\n        //\n        // withdraw\n        //\n        //    {\n        //        \"result\": true,\n        //        \"error\": \"\",\n        //        \"task_id\": 11775077\n        //    }\n        //\n        const timestamp = this.safeTimestamp2 (transaction, 'dt', 'created');\n        let amountString = this.safeString (transaction, 'amount');\n        if (amountString !== undefined) {\n            amountString = Precise.stringAbs (amountString);\n        }\n        let txid = this.safeString (transaction, 'txid');\n        if (txid === undefined) {\n            const extra = this.safeValue (transaction, 'extra', {});\n            const extraTxid = this.safeString (extra, 'txid');\n            if (extraTxid !== '') {\n                txid = extraTxid;\n            }\n        }\n        const type = this.safeString (transaction, 'type');\n        const currencyId = this.safeString2 (transaction, 'curr', 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let address = undefined;\n        let comment = undefined;\n        const account = this.safeString (transaction, 'account');\n        if (type === 'deposit') {\n            comment = account;\n        } else if (type === 'withdrawal') {\n            address = account;\n            if (address !== undefined) {\n                const parts = address.split (':');\n                const numParts = parts.length;\n                if (numParts === 2) {\n                    address = this.safeString (parts, 1);\n                    address = address.replace (' ', '');\n                }\n            }\n        }\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        // fixed funding fees only (for now)\n        if (!this.fees['transaction']['percentage']) {\n            const key = (type === 'withdrawal') ? 'withdraw' : 'deposit';\n            let feeCost = this.safeString (transaction, 'commission');\n            if (feeCost === undefined) {\n                const transactionFees = this.safeValue (this.options, 'transactionFees', {});\n                const codeFees = this.safeValue (transactionFees, code, {});\n                feeCost = this.safeString (codeFees, key);\n            }\n            // users don't pay for cashbacks, no fees for that\n            const provider = this.safeString (transaction, 'provider');\n            if (provider === 'cashback') {\n                feeCost = '0';\n            }\n            if (feeCost !== undefined) {\n                // withdrawal amount includes the fee\n                if (type === 'withdrawal') {\n                    amountString = Precise.stringSub (amountString, feeCost);\n                }\n                fee['cost'] = this.parseNumber (feeCost);\n                fee['currency'] = code;\n            }\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'order_id', 'task_id'),\n            'txid': txid,\n            'type': type,\n            'currency': code,\n            'network': this.safeString (transaction, 'provider'),\n            'amount': this.parseNumber (amountString),\n            'status': this.parseTransactionStatus (this.safeStringLower (transaction, 'status')),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': undefined,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'updated': this.safeTimestamp (transaction, 'updated'),\n            'comment': comment,\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2347,
        "line_end": 2356,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'transferred': 'ok',\n            'paid': 'ok',\n            'pending': 'pending',\n            'processing': 'pending',\n            'verifying': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "fmfwio": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1095,
        "line_end": 1107,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const currencyId = this.safeString (entry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (entry, 'available');\n            account['used'] = this.safeString (entry, 'reserved');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 3663,
        "line_end": 3712,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"full_name\": \"ConnectWealth\",\n         \"payin_enabled\": false,\n         \"payout_enabled\": false,\n         \"transfer_enabled\": true,\n         \"precision_transfer\": \"0.001\",\n         \"networks\": [\n           {\n             \"network\": \"ETH\",\n             \"protocol\": \"ERC20\",\n             \"default\": true,\n             \"payin_enabled\": false,\n             \"payout_enabled\": false,\n             \"precision_payout\": \"0.001\",\n             \"payout_fee\": \"0.016800000000\",\n             \"payout_is_payment_id\": false,\n             \"payin_payment_id\": false,\n             \"payin_confirmations\": \"2\"\n           }\n         ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //         \"full_name\": \"ConnectWealth\",\n        //         \"payin_enabled\": false,\n        //         \"payout_enabled\": false,\n        //         \"transfer_enabled\": true,\n        //         \"precision_transfer\": \"0.001\",\n        //         \"networks\": [\n        //           {\n        //             \"network\": \"ETH\",\n        //             \"protocol\": \"ERC20\",\n        //             \"default\": true,\n        //             \"payin_enabled\": false,\n        //             \"payout_enabled\": false,\n        //             \"precision_payout\": \"0.001\",\n        //             \"payout_fee\": \"0.016800000000\",\n        //             \"payout_is_payment_id\": false,\n        //             \"payin_payment_id\": false,\n        //             \"payin_confirmations\": \"2\"\n        //           }\n        //         ]\n        //    }\n        //\n        const networks = this.safeValue (fee, 'networks', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networks.length; j++) {\n            const networkEntry = networks[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            let networkCode = this.networkIdToCode (networkId);\n            networkCode = (networkCode !== undefined) ? networkCode.toUpperCase () : undefined;\n            const withdrawFee = this.safeNumber (networkEntry, 'payout_fee');\n            const isDefault = this.safeValue (networkEntry, 'default');\n            const withdrawResult: Dict = {\n                'fee': withdrawFee,\n                'percentage': (withdrawFee !== undefined) ? false : undefined,\n            };\n            if (isDefault === true) {\n                result['withdraw'] = withdrawResult;\n            }\n            result['networks'][networkCode] = {\n                'withdraw': withdrawResult,\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3332,
        "line_end": 3370,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'index_price')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (contract, 'interest_rate')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "this.parse8601 (fundingDateTime)",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "fundingDateTime",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'indicative_funding_rate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_type\": \"perpetual\",\n         \"mark_price\": \"42307.43\",\n         \"index_price\": \"42303.27\",\n         \"funding_rate\": \"0.0001\",\n         \"open_interest\": \"30.9826\",\n         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n         \"indicative_funding_rate\": \"0.0001\",\n         \"premium_index\": \"0\",\n         \"avg_premium_index\": \"0.000029587712038098\",\n         \"interest_rate\": \"0.0001\",\n         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"contract_type\": \"perpetual\",\n        //         \"mark_price\": \"42307.43\",\n        //         \"index_price\": \"42303.27\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"open_interest\": \"30.9826\",\n        //         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n        //         \"indicative_funding_rate\": \"0.0001\",\n        //         \"premium_index\": \"0\",\n        //         \"avg_premium_index\": \"0.000029587712038098\",\n        //         \"interest_rate\": \"0.0001\",\n        //         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n        //     }\n        //\n        const fundingDateTime = this.safeString (contract, 'next_funding_time');\n        const datetime = this.safeString (contract, 'timestamp');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': this.safeNumber (contract, 'mark_price'),\n            'indexPrice': this.safeNumber (contract, 'index_price'),\n            'interestRate': this.safeNumber (contract, 'interest_rate'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': this.parse8601 (fundingDateTime),\n            'fundingDatetime': fundingDateTime,\n            'nextFundingRate': this.safeNumber (contract, 'indicative_funding_rate'),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3575,
        "line_end": 3585,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'type')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'type'),\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 2669,
        "line_end": 2676,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (marginMode, 'margin_mode')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (marginMode, 'margin_mode'),\n        } as MarginMode;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 3432,
        "line_end": 3468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (currencyInfo, 'code')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT_PERP\",\n         \"type\": \"isolated\",\n         \"leverage\": \"8.00\",\n         \"created_at\": \"2022-03-30T23:34:27.161Z\",\n         \"updated_at\": \"2022-03-30T23:34:27.161Z\",\n         \"currencies\": [\n             {\n                 \"code\": \"USDT\",\n                 \"margin_balance\": \"7.000000000000\",\n                 \"reserved_orders\": \"0\",\n                 \"reserved_positions\": \"0\"\n             }\n         ],\n         \"positions\": null\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT_PERP\",\n        //         \"type\": \"isolated\",\n        //         \"leverage\": \"8.00\",\n        //         \"created_at\": \"2022-03-30T23:34:27.161Z\",\n        //         \"updated_at\": \"2022-03-30T23:34:27.161Z\",\n        //         \"currencies\": [\n        //             {\n        //                 \"code\": \"USDT\",\n        //                 \"margin_balance\": \"7.000000000000\",\n        //                 \"reserved_orders\": \"0\",\n        //                 \"reserved_positions\": \"0\"\n        //             }\n        //         ],\n        //         \"positions\": null\n        //     }\n        //\n        const currencies = this.safeValue (data, 'currencies', []);\n        const currencyInfo = this.safeValue (currencies, 0);\n        const datetime = this.safeString (data, 'updated_at');\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': this.safeString (currencyInfo, 'code'),\n            'status': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        };\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1892,
        "line_end": 1924,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"timestamp\":\"2015-08-20T19:01:00.000Z\",\n         \"open\":\"0.006\",\n         \"close\":\"0.006\",\n         \"min\":\"0.006\",\n         \"max\":\"0.006\",\n         \"volume\":\"0.003\",\n         \"volume_quote\":\"0.000018\"\n     }",
          "{\n         \"timestamp\": \"2022-04-01T01:28:00.000Z\",\n         \"open\": \"45146.39\",\n         \"close\": \"45219.43\",\n         \"min\": \"45146.39\",\n         \"max\": \"45219.43\"\n     },"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // Spot and Swap\n        //\n        //     {\n        //         \"timestamp\":\"2015-08-20T19:01:00.000Z\",\n        //         \"open\":\"0.006\",\n        //         \"close\":\"0.006\",\n        //         \"min\":\"0.006\",\n        //         \"max\":\"0.006\",\n        //         \"volume\":\"0.003\",\n        //         \"volume_quote\":\"0.000018\"\n        //     }\n        //\n        // Mark, Index and Premium Index\n        //\n        //     {\n        //         \"timestamp\": \"2022-04-01T01:28:00.000Z\",\n        //         \"open\": \"45146.39\",\n        //         \"close\": \"45219.43\",\n        //         \"min\": \"45146.39\",\n        //         \"max\": \"45219.43\"\n        //     },\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'timestamp')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'max'),\n            this.safeNumber (ohlcv, 'min'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3184,
        "line_end": 3210,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_type\": \"perpetual\",\n         \"mark_price\": \"42307.43\",\n         \"index_price\": \"42303.27\",\n         \"funding_rate\": \"0.0001\",\n         \"open_interest\": \"30.9826\",\n         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n         \"indicative_funding_rate\": \"0.0001\",\n         \"premium_index\": \"0\",\n         \"avg_premium_index\": \"0.000029587712038098\",\n         \"interest_rate\": \"0.0001\",\n         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"contract_type\": \"perpetual\",\n        //         \"mark_price\": \"42307.43\",\n        //         \"index_price\": \"42303.27\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"open_interest\": \"30.9826\",\n        //         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n        //         \"indicative_funding_rate\": \"0.0001\",\n        //         \"premium_index\": \"0\",\n        //         \"avg_premium_index\": \"0.000029587712038098\",\n        //         \"interest_rate\": \"0.0001\",\n        //         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n        //     }\n        //\n        const datetime = this.safeString (interest, 'timestamp');\n        const value = this.safeNumber (interest, 'open_interest');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (undefined, market),\n            'openInterestAmount': undefined,\n            'openInterestValue': value,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2485,
        "line_end": 2602,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeValue (order, 'reduce_only')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": 488953123149,\n       \"client_order_id\": \"103ad305301e4c3590045b13de15b36e\",\n       \"symbol\": \"BTCUSDT\",\n       \"side\": \"buy\",\n       \"status\": \"new\",\n       \"type\": \"limit\",\n       \"time_in_force\": \"GTC\",\n       \"quantity\": \"0.00001\",\n       \"quantity_cumulative\": \"0\",\n       \"price\": \"0.01\",\n       \"price_average\": \"0.01\",\n       \"post_only\": false,\n       \"created_at\": \"2021-04-13T13:06:16.567Z\",\n       \"updated_at\": \"2021-04-13T13:06:16.567Z\"\n     }",
          "{\n       \"id\": \"685877626834\",\n       \"client_order_id\": \"Yshl7G-EjaREyXQYaGbsmdtVbW-nzQwu\",\n       \"symbol\": \"BTCUSDT\",\n       \"side\": \"buy\",\n       \"status\": \"filled\",\n       \"type\": \"market\",\n       \"time_in_force\": \"GTC\",\n       \"quantity\": \"0.00010\",\n       \"quantity_cumulative\": \"0.00010\",\n       \"post_only\": false,\n       \"created_at\": \"2021-10-26T08:55:55.1Z\",\n       \"updated_at\": \"2021-10-26T08:55:55.1Z\",\n       \"trades\": [\n         {\n           \"id\": \"1437229630\",\n           \"position_id\": \"0\",\n           \"quantity\": \"0.00010\",\n           \"price\": \"62884.78\",\n           \"fee\": \"0.005659630200\",\n           \"timestamp\": \"2021-10-26T08:55:55.1Z\",\n           \"taker\": true\n         }\n       ]\n     }",
          "{\n         \"id\": 58418961892,\n         \"client_order_id\": \"r42gdPjNMZN-H_xs8RKl2wljg_dfgdg4\",\n         \"symbol\": \"BTCUSDT_PERP\",\n         \"side\": \"buy\",\n         \"status\": \"new\",\n         \"type\": \"limit\",\n         \"time_in_force\": \"GTC\",\n         \"quantity\": \"0.0005\",\n         \"quantity_cumulative\": \"0\",\n         \"price\": \"30000.00\",\n         \"post_only\": false,\n         \"reduce_only\": false,\n         \"created_at\": \"2022-03-16T08:16:53.039Z\",\n         \"updated_at\": \"2022-03-16T08:16:53.039Z\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // limit\n        //     {\n        //       \"id\": 488953123149,\n        //       \"client_order_id\": \"103ad305301e4c3590045b13de15b36e\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"side\": \"buy\",\n        //       \"status\": \"new\",\n        //       \"type\": \"limit\",\n        //       \"time_in_force\": \"GTC\",\n        //       \"quantity\": \"0.00001\",\n        //       \"quantity_cumulative\": \"0\",\n        //       \"price\": \"0.01\",\n        //       \"price_average\": \"0.01\",\n        //       \"post_only\": false,\n        //       \"created_at\": \"2021-04-13T13:06:16.567Z\",\n        //       \"updated_at\": \"2021-04-13T13:06:16.567Z\"\n        //     }\n        //\n        // market\n        //     {\n        //       \"id\": \"685877626834\",\n        //       \"client_order_id\": \"Yshl7G-EjaREyXQYaGbsmdtVbW-nzQwu\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"side\": \"buy\",\n        //       \"status\": \"filled\",\n        //       \"type\": \"market\",\n        //       \"time_in_force\": \"GTC\",\n        //       \"quantity\": \"0.00010\",\n        //       \"quantity_cumulative\": \"0.00010\",\n        //       \"post_only\": false,\n        //       \"created_at\": \"2021-10-26T08:55:55.1Z\",\n        //       \"updated_at\": \"2021-10-26T08:55:55.1Z\",\n        //       \"trades\": [\n        //         {\n        //           \"id\": \"1437229630\",\n        //           \"position_id\": \"0\",\n        //           \"quantity\": \"0.00010\",\n        //           \"price\": \"62884.78\",\n        //           \"fee\": \"0.005659630200\",\n        //           \"timestamp\": \"2021-10-26T08:55:55.1Z\",\n        //           \"taker\": true\n        //         }\n        //       ]\n        //     }\n        //\n        // swap and margin\n        //\n        //     {\n        //         \"id\": 58418961892,\n        //         \"client_order_id\": \"r42gdPjNMZN-H_xs8RKl2wljg_dfgdg4\",\n        //         \"symbol\": \"BTCUSDT_PERP\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"new\",\n        //         \"type\": \"limit\",\n        //         \"time_in_force\": \"GTC\",\n        //         \"quantity\": \"0.0005\",\n        //         \"quantity_cumulative\": \"0\",\n        //         \"price\": \"30000.00\",\n        //         \"post_only\": false,\n        //         \"reduce_only\": false,\n        //         \"created_at\": \"2022-03-16T08:16:53.039Z\",\n        //         \"updated_at\": \"2022-03-16T08:16:53.039Z\"\n        //     }\n        //\n        const id = this.safeString (order, 'client_order_id');\n        // we use clientOrderId as the order id with this exchange intentionally\n        // because most of their endpoints will require clientOrderId\n        // explained here: https://github.com/ccxt/ccxt/issues/5674\n        const side = this.safeString (order, 'side');\n        const type = this.safeString (order, 'type');\n        const amount = this.safeString (order, 'quantity');\n        const price = this.safeString (order, 'price');\n        const average = this.safeString (order, 'price_average');\n        const created = this.safeString (order, 'created_at');\n        const timestamp = this.parse8601 (created);\n        const updated = this.safeString (order, 'updated_at');\n        let lastTradeTimestamp = undefined;\n        if (updated !== created) {\n            lastTradeTimestamp = this.parse8601 (updated);\n        }\n        const filled = this.safeString (order, 'quantity_cumulative');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const postOnly = this.safeValue (order, 'post_only');\n        const timeInForce = this.safeString (order, 'time_in_force');\n        const rawTrades = this.safeValue (order, 'trades');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'price': price,\n            'amount': amount,\n            'type': type,\n            'side': side,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeValue (order, 'reduce_only'),\n            'filled': filled,\n            'remaining': undefined,\n            'cost': undefined,\n            'status': status,\n            'average': average,\n            'trades': rawTrades,\n            'fee': undefined,\n            'triggerPrice': this.safeString (order, 'stop_price'),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2473,
        "line_end": 2483,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'open',\n            'suspended': 'open',\n            'partiallyFilled': 'open',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'expired': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3097,
        "line_end": 3182,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETHUSDT_PERP\",\n             \"type\": \"isolated\",\n             \"leverage\": \"10.00\",\n             \"created_at\": \"2022-03-19T07:54:35.24Z\",\n             \"updated_at\": \"2022-03-19T07:54:58.922Z\",\n             currencies\": [\n                 {\n                     \"code\": \"USDT\",\n                     \"margin_balance\": \"7.478100643043\",\n                     \"reserved_orders\": \"0\",\n                     \"reserved_positions\": \"0.303530761300\"\n                 }\n             ],\n             \"positions\": [\n                 {\n                     \"id\": 2470568,\n                     \"symbol\": \"ETHUSDT_PERP\",\n                     \"quantity\": \"0.001\",\n                     \"price_entry\": \"2927.509\",\n                     \"price_margin_call\": \"0\",\n                     \"price_liquidation\": \"0\",\n                     \"pnl\": \"0\",\n                     \"created_at\": \"2022-03-19T07:54:35.24Z\",\n                     \"updated_at\": \"2022-03-19T07:54:58.922Z\"\n                 }\n             ]\n         },\n     ]"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETHUSDT_PERP\",\n        //             \"type\": \"isolated\",\n        //             \"leverage\": \"10.00\",\n        //             \"created_at\": \"2022-03-19T07:54:35.24Z\",\n        //             \"updated_at\": \"2022-03-19T07:54:58.922Z\",\n        //             currencies\": [\n        //                 {\n        //                     \"code\": \"USDT\",\n        //                     \"margin_balance\": \"7.478100643043\",\n        //                     \"reserved_orders\": \"0\",\n        //                     \"reserved_positions\": \"0.303530761300\"\n        //                 }\n        //             ],\n        //             \"positions\": [\n        //                 {\n        //                     \"id\": 2470568,\n        //                     \"symbol\": \"ETHUSDT_PERP\",\n        //                     \"quantity\": \"0.001\",\n        //                     \"price_entry\": \"2927.509\",\n        //                     \"price_margin_call\": \"0\",\n        //                     \"price_liquidation\": \"0\",\n        //                     \"pnl\": \"0\",\n        //                     \"created_at\": \"2022-03-19T07:54:35.24Z\",\n        //                     \"updated_at\": \"2022-03-19T07:54:58.922Z\"\n        //                 }\n        //             ]\n        //         },\n        //     ]\n        //\n        const marginMode = this.safeString (position, 'type');\n        const leverage = this.safeNumber (position, 'leverage');\n        const datetime = this.safeString (position, 'updated_at');\n        const positions = this.safeValue (position, 'positions', []);\n        let liquidationPrice = undefined;\n        let entryPrice = undefined;\n        let contracts = undefined;\n        for (let i = 0; i < positions.length; i++) {\n            const entry = positions[i];\n            liquidationPrice = this.safeNumber (entry, 'price_liquidation');\n            entryPrice = this.safeNumber (entry, 'price_entry');\n            contracts = this.safeNumber (entry, 'quantity');\n        }\n        const currencies = this.safeValue (position, 'currencies', []);\n        let collateral = undefined;\n        for (let i = 0; i < currencies.length; i++) {\n            const entry = currencies[i];\n            collateral = this.safeNumber (entry, 'margin_balance');\n        }\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'notional': undefined,\n            'marginMode': marginMode,\n            'marginType': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': entryPrice,\n            'unrealizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': contracts,\n            'contractSize': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': undefined,\n            'hedged': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': collateral,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': leverage,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1227,
        "line_end": 1269,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"ask\": \"62756.01\",\n       \"bid\": \"62754.09\",\n       \"last\": \"62755.87\",\n       \"low\": \"62010.00\",\n       \"high\": \"66657.99\",\n       \"open\": \"65089.27\",\n       \"volume\": \"16719.50366\",\n       \"volume_quote\": \"1063422878.8156828\",\n       \"timestamp\": \"2021-10-22T07:29:14.585Z\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //       \"ask\": \"62756.01\",\n        //       \"bid\": \"62754.09\",\n        //       \"last\": \"62755.87\",\n        //       \"low\": \"62010.00\",\n        //       \"high\": \"66657.99\",\n        //       \"open\": \"65089.27\",\n        //       \"volume\": \"16719.50366\",\n        //       \"volume_quote\": \"1063422878.8156828\",\n        //       \"timestamp\": \"2021-10-22T07:29:14.585Z\"\n        //     }\n        //\n        const timestamp = this.parse8601 (ticker['timestamp']);\n        const symbol = this.safeSymbol (undefined, market);\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = this.safeString (ticker, 'volume_quote');\n        const open = this.safeString (ticker, 'open');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1366,
        "line_end": 1468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"id\": \"1569252895\",\n      \"position_id\": \"0\",\n      \"quantity\": \"10\",\n      \"price\": \"0.03919424\",\n      \"fee\": \"0.000979856000\",\n      \"timestamp\": \"2022-01-25T19:38:36.153Z\",\n      \"taker\": true\n  }",
          "{\n      \"id\": 974786185,\n      \"price\": \"0.032462\",\n      \"qty\": \"0.3673\",\n      \"side\": \"buy\",\n      \"timestamp\": \"2020-10-16T12:57:39.846Z\"\n  }",
          "{\n      \"id\": 277210397,\n      \"clientOrderId\": \"6e102f3e7f3f4e04aeeb1cdc95592f1a\",\n      \"orderId\": 28102855393,\n      \"symbol\": \"ETHBTC\",\n      \"side\": \"sell\",\n      \"quantity\": \"0.002\",\n      \"price\": \"0.073365\",\n      \"fee\": \"0.000000147\",\n      \"timestamp\": \"2018-04-28T18:39:55.345Z\",\n      \"taker\": true\n  }",
          "{\n      \"id\": 4718564,\n      \"order_id\": 58730811958,\n      \"client_order_id\": \"475c47d97f867f09726186eb22b4c3d4\",\n      \"symbol\": \"BTCUSDT_PERP\",\n      \"side\": \"sell\",\n      \"quantity\": \"0.0001\",\n      \"price\": \"41118.51\",\n      \"fee\": \"0.002055925500\",\n      \"timestamp\": \"2022-03-17T05:23:17.795Z\",\n      \"taker\": true,\n      \"position_id\": 2350122,\n      \"pnl\": \"0.002255000000\",\n      \"liquidation\": false\n  }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // createOrder (market)\n        //\n        //  {\n        //      \"id\": \"1569252895\",\n        //      \"position_id\": \"0\",\n        //      \"quantity\": \"10\",\n        //      \"price\": \"0.03919424\",\n        //      \"fee\": \"0.000979856000\",\n        //      \"timestamp\": \"2022-01-25T19:38:36.153Z\",\n        //      \"taker\": true\n        //  }\n        //\n        // fetchTrades\n        //\n        //  {\n        //      \"id\": 974786185,\n        //      \"price\": \"0.032462\",\n        //      \"qty\": \"0.3673\",\n        //      \"side\": \"buy\",\n        //      \"timestamp\": \"2020-10-16T12:57:39.846Z\"\n        //  }\n        //\n        // fetchMyTrades spot\n        //\n        //  {\n        //      \"id\": 277210397,\n        //      \"clientOrderId\": \"6e102f3e7f3f4e04aeeb1cdc95592f1a\",\n        //      \"orderId\": 28102855393,\n        //      \"symbol\": \"ETHBTC\",\n        //      \"side\": \"sell\",\n        //      \"quantity\": \"0.002\",\n        //      \"price\": \"0.073365\",\n        //      \"fee\": \"0.000000147\",\n        //      \"timestamp\": \"2018-04-28T18:39:55.345Z\",\n        //      \"taker\": true\n        //  }\n        //\n        // fetchMyTrades swap and margin\n        //\n        //  {\n        //      \"id\": 4718564,\n        //      \"order_id\": 58730811958,\n        //      \"client_order_id\": \"475c47d97f867f09726186eb22b4c3d4\",\n        //      \"symbol\": \"BTCUSDT_PERP\",\n        //      \"side\": \"sell\",\n        //      \"quantity\": \"0.0001\",\n        //      \"price\": \"41118.51\",\n        //      \"fee\": \"0.002055925500\",\n        //      \"timestamp\": \"2022-03-17T05:23:17.795Z\",\n        //      \"taker\": true,\n        //      \"position_id\": 2350122,\n        //      \"pnl\": \"0.002255000000\",\n        //      \"liquidation\": false\n        //  }\n        //\n        const timestamp = this.parse8601 (trade['timestamp']);\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        const taker = this.safeValue (trade, 'taker');\n        let takerOrMaker: string;\n        if (taker !== undefined) {\n            takerOrMaker = taker ? 'taker' : 'maker';\n        } else {\n            takerOrMaker = 'taker'; // the only case when `taker` field is missing, is public fetchTrades and it must be taker\n        }\n        if (feeCostString !== undefined) {\n            const info = this.safeValue (market, 'info', {});\n            const feeCurrency = this.safeString (info, 'fee_currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrency);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        // we use clientOrderId as the order id with this exchange intentionally\n        // because most of their endpoints will require clientOrderId\n        // explained here: https://github.com/ccxt/ccxt/issues/5674\n        const orderId = this.safeString2 (trade, 'clientOrderId', 'client_order_id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString2 (trade, 'quantity', 'qty');\n        const side = this.safeString (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1721,
        "line_end": 1741,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"ARVUSDT\", // returned from fetchTradingFees only\n         \"take_rate\":\"0.0009\",\n         \"make_rate\":\"0.0009\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\":\"ARVUSDT\", // returned from fetchTradingFees only\n        //         \"take_rate\":\"0.0009\",\n        //         \"make_rate\":\"0.0009\"\n        //     }\n        //\n        const taker = this.safeNumber (fee, 'take_rate');\n        const maker = this.safeNumber (fee, 'make_rate');\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'taker': taker,\n            'maker': maker,\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1533,
        "line_end": 1617,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txhash",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": \"101609495\",\n       \"created_at\": \"2018-03-06T22:05:06.507Z\",\n       \"updated_at\": \"2018-03-06T22:11:45.03Z\",\n       \"status\": \"SUCCESS\",\n       \"type\": \"DEPOSIT\", // DEPOSIT, WITHDRAW, ..\n       \"subtype\": \"BLOCKCHAIN\",\n       \"native\": {\n         \"tx_id\": \"e20b0965-4024-44d0-b63f-7fb8996a6706\",\n         \"index\": \"881652766\",\n         \"currency\": \"ETH\",\n         \"amount\": \"0.01418088\",\n         \"hash\": \"d95dbbff3f9234114f1211ab0ba2a94f03f394866fd5749d74a1edab80e6c5d3\",\n         \"address\": \"0xd9259302c32c0a0295d86a39185c9e14f6ba0a0d\",\n         \"confirmations\": \"20\",\n         \"senders\": [\n           \"0x243bec9256c9a3469da22103891465b47583d9f1\"\n         ],\n         \"fee\": \"1.22\" // only for WITHDRAW\n       }\n     },",
          "{\n         \"id\":\"084cfcd5-06b9-4826-882e-fdb75ec3625d\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // transaction\n        //\n        //     {\n        //       \"id\": \"101609495\",\n        //       \"created_at\": \"2018-03-06T22:05:06.507Z\",\n        //       \"updated_at\": \"2018-03-06T22:11:45.03Z\",\n        //       \"status\": \"SUCCESS\",\n        //       \"type\": \"DEPOSIT\", // DEPOSIT, WITHDRAW, ..\n        //       \"subtype\": \"BLOCKCHAIN\",\n        //       \"native\": {\n        //         \"tx_id\": \"e20b0965-4024-44d0-b63f-7fb8996a6706\",\n        //         \"index\": \"881652766\",\n        //         \"currency\": \"ETH\",\n        //         \"amount\": \"0.01418088\",\n        //         \"hash\": \"d95dbbff3f9234114f1211ab0ba2a94f03f394866fd5749d74a1edab80e6c5d3\",\n        //         \"address\": \"0xd9259302c32c0a0295d86a39185c9e14f6ba0a0d\",\n        //         \"confirmations\": \"20\",\n        //         \"senders\": [\n        //           \"0x243bec9256c9a3469da22103891465b47583d9f1\"\n        //         ],\n        //         \"fee\": \"1.22\" // only for WITHDRAW\n        //       }\n        //     },\n        //     \"operation_id\": \"084cfcd5-06b9-4826-882e-fdb75ec3625d\", // only for WITHDRAW\n        //     \"commit_risk\": {}\n        // withdraw\n        //\n        //     {\n        //         \"id\":\"084cfcd5-06b9-4826-882e-fdb75ec3625d\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'operation_id', 'id');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n        const updated = this.parse8601 (this.safeString (transaction, 'updated_at'));\n        const type = this.parseTransactionType (this.safeString (transaction, 'type'));\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const native = this.safeValue (transaction, 'native', {});\n        const currencyId = this.safeString (native, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const txhash = this.safeString (native, 'hash');\n        const address = this.safeString (native, 'address');\n        const addressTo = address;\n        const tag = this.safeString (native, 'payment_id');\n        const tagTo = tag;\n        const sender = this.safeValue (native, 'senders');\n        const addressFrom = this.safeString (sender, 0);\n        const amount = this.safeNumber (native, 'amount');\n        const subType = this.safeString (transaction, 'subtype');\n        const internal = subType === 'OFFCHAIN';\n        // https://api.hitbtc.com/#check-if-offchain-is-available\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        const feeCost = this.safeNumber (native, 'fee');\n        if (feeCost !== undefined) {\n            fee['currency'] = code;\n            fee['cost'] = feeCost;\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txhash,\n            'type': type,\n            'currency': code,\n            'network': undefined,\n            'amount': amount,\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'updated': updated,\n            'comment': undefined,\n            'internal': internal,\n            'fee': fee,\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1514,
        "line_end": 1523,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'CREATED': 'pending',\n            'PENDING': 'pending',\n            'FAILED': 'failed',\n            'ROLLED_BACK': 'failed',\n            'SUCCESS': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 1525,
        "line_end": 1531,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'DEPOSIT': 'deposit',\n            'WITHDRAW': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2718,
        "line_end": 2737,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 0)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "[\n         \"2db6ebab-fb26-4537-9ef8-1a689472d236\"\n     ]"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     [\n        //         \"2db6ebab-fb26-4537-9ef8-1a689472d236\"\n        //     ]\n        //\n        return {\n            'id': this.safeString (transfer, 0),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n            'info': transfer,\n        };\n    }",
        "inherited": true,
        "inherited_from": "hitbtc"
      }
    ],
    "foxbit": [
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined)",
        "line_start": 1830,
        "line_end": 1842,
        "comment": null,
        "mappings": [
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'tag')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "network",
            "value": "unifiedNetwork",
            "comment": null
          },
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined) {\n        const network = this.safeDict (depositAddress, 'network');\n        const networkId = this.safeString (network, 'code');\n        const currencyCode = this.safeCurrencyCode (undefined, currency);\n        const unifiedNetwork = this.networkIdToCode (networkId, currencyCode);\n        return {\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': this.safeString (depositAddress, 'tag'),\n            'currency': currencyCode,\n            'network': unifiedNetwork,\n            'info': depositAddress,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined)",
        "line_start": 1927,
        "line_end": 1975,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencySymbol",
            "comment": null
          },
          {
            "key": "amount",
            "value": "realAmount",
            "comment": null
          },
          {
            "key": "before",
            "value": "balance - amount",
            "comment": null
          },
          {
            "key": "after",
            "value": "balance",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (item, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"uuid\": \"f8e9f2d6-3c1e-4f2d-8f8e-9f2d6c1e4f2d\",\n     \"amount\": \"0.0001\",\n     \"balance\": \"0.0002\",\n     \"created_at\": \"2021-07-01T12:00:00Z\",\n     \"currency_symbol\": \"btc\",\n     \"fee\": \"0.0001\",\n     \"locked\": \"0.0001\",\n     \"locked_amount\": \"0.0001\",\n     \"reason_type\": \"DEPOSITING\"\n }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined) {\n        // {\n        //     \"uuid\": \"f8e9f2d6-3c1e-4f2d-8f8e-9f2d6c1e4f2d\",\n        //     \"amount\": \"0.0001\",\n        //     \"balance\": \"0.0002\",\n        //     \"created_at\": \"2021-07-01T12:00:00Z\",\n        //     \"currency_symbol\": \"btc\",\n        //     \"fee\": \"0.0001\",\n        //     \"locked\": \"0.0001\",\n        //     \"locked_amount\": \"0.0001\",\n        //     \"reason_type\": \"DEPOSITING\"\n        // }\n        const id = this.safeString (item, 'uuid');\n        const createdAt = this.safeString (item, 'created_at');\n        const timestamp = this.parse8601 (createdAt);\n        const reasonType = this.safeString (item, 'reason_type');\n        const type = this.parseLedgerEntryType (reasonType);\n        const exchangeSymbol = this.safeString (item, 'currency_symbol');\n        const currencySymbol = this.safeCurrencyCode (exchangeSymbol);\n        let direction = 'in';\n        const amount = this.safeNumber (item, 'amount');\n        let realAmount = amount;\n        const balance = this.safeNumber (item, 'balance');\n        const fee = {\n            'cost': this.safeNumber (item, 'fee'),\n            'currency': currencySymbol,\n        };\n        if (amount < 0) {\n            direction = 'out';\n            realAmount = amount * -1;\n        }\n        return {\n            'id': id,\n            'info': item,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': undefined,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': currencySymbol,\n            'amount': realAmount,\n            'before': balance - amount,\n            'after': balance,\n            'status': 'ok',\n            'fee': fee,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1916,
        "line_end": 1925,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'DEPOSITING': 'transaction',\n            'WITHDRAWING': 'transaction',\n            'TRADING': 'trade',\n            'INTERNAL_TRANSFERING': 'transfer',\n            'OTHERS': 'transaction',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1609,
        "line_end": 1673,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "false",
            "comment": null
          },
          {
            "key": "feeSide",
            "value": "'get'",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'price': this.safeInteger (quoteAssets, 'precision'),\n                'amount': this.safeInteger (baseAssets, 'precision'),\n                'cost': this.safeInteger (quoteAssets, 'precision'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (market, 'quantity_min'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'price_min'),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeInteger (quoteAssets, 'precision')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeInteger (baseAssets, 'precision')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeInteger (quoteAssets, 'precision')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'quantity_min'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'price_min'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'price_min')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        const baseAssets = this.safeDict (market, 'base');\n        const baseId = this.safeString (baseAssets, 'symbol');\n        const quoteAssets = this.safeDict (market, 'quote');\n        const quoteId = this.safeString (quoteAssets, 'symbol');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote;\n        const fees = this.safeDict (market, 'default_fees');\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'active': true,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'future': false,\n            'swap': false,\n            'option': false,\n            'contract': false,\n            'settle': undefined,\n            'settleId': undefined,\n            'contractSize': undefined,\n            'linear': undefined,\n            'inverse': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'percentage': true,\n            'tierBased': false,\n            'feeSide': 'get',\n            'precision': {\n                'price': this.safeInteger (quoteAssets, 'precision'),\n                'amount': this.safeInteger (baseAssets, 'precision'),\n                'cost': this.safeInteger (quoteAssets, 'precision'),\n            },\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (market, 'quantity_min'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'price_min'),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1719,
        "line_end": 1728,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 6),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order, market = undefined): Order",
        "line_start": 1771,
        "line_end": 1828,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'id')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'state'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (order, 'type')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'time_in_force')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "this.safeBool (order, 'post_only')",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (price)",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (cost)",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber (order, 'price_avg')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.parseNumber (filled)",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.parseNumber (remaining)",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCurrency,\n                'cost': this.safeNumber (order, 'fee_paid'),\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'fee_paid')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order, market = undefined): Order {\n        let symbol = this.safeString (order, 'market_symbol');\n        if (market === undefined && symbol !== undefined) {\n            market = this.market (symbol);\n        }\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        const timestamp = this.parseDate (this.safeString (order, 'created_at'));\n        const price = this.safeString (order, 'price');\n        const filled = this.safeString (order, 'quantity_executed');\n        const remaining = this.safeString (order, 'quantity');\n        // TODO: validate logic of amount here, should this be calculated?\n        let amount = undefined;\n        if (remaining !== undefined && filled !== undefined) {\n            amount = Precise.stringAdd (remaining, filled);\n        }\n        let cost = this.safeString (order, 'funds_received');\n        if (!cost) {\n            const priceAverage = this.safeString (order, 'price_avg');\n            const priceToCalculate = this.safeString (order, 'price', priceAverage);\n            cost = Precise.stringMul (priceToCalculate, amount);\n        }\n        const side = this.safeStringLower (order, 'side');\n        let feeCurrency = this.safeStringUpper (market, 'quoteId');\n        if (side === 'buy') {\n            feeCurrency = this.safeStringUpper (market, 'baseId');\n        }\n        return this.safeOrder ({\n            'id': this.safeString (order, 'id'),\n            'info': order,\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': this.parseOrderStatus (this.safeString (order, 'state')),\n            'symbol': this.safeString (market, 'symbol'),\n            'type': this.safeString (order, 'type'),\n            'timeInForce': this.safeString (order, 'time_in_force'),\n            'postOnly': this.safeBool (order, 'post_only'),\n            'reduceOnly': undefined,\n            'side': side,\n            'price': this.parseNumber (price),\n            'triggerPrice': this.safeNumber (order, 'stop_price'),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n            'cost': this.parseNumber (cost),\n            'average': this.safeNumber (order, 'price_avg'),\n            'amount': this.parseNumber (amount),\n            'filled': this.parseNumber (filled),\n            'remaining': this.parseNumber (remaining),\n            'trades': undefined,\n            'fee': {\n                'currency': feeCurrency,\n                'cost': this.safeNumber (order, 'fee_paid'),\n            },\n        });\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1759,
        "line_end": 1769,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'PARTIALLY_CANCELED': 'open',\n            'ACTIVE': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'PENDING_CANCEL': 'canceled',\n            'CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1686,
        "line_end": 1717,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parseDate (this.safeString (lastTrade, 'date'))",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (this.parseDate (this.safeString (lastTrade, 'date')))",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (rolling_24h, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (rolling_24h, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (bestBid, 'price')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeNumber (bestBid, 'volume')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (bestAsk, 'price')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeNumber (bestAsk, 'volume')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeNumber (rolling_24h, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "lastPrice",
            "comment": null
          },
          {
            "key": "last",
            "value": "lastPrice",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (rolling_24h, 'price_change')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (rolling_24h, 'price_change_percent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (rolling_24h, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (rolling_24h, 'quote_volume')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const marketId = this.safeString (ticker, 'market_symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'spot');\n        const rolling_24h = ticker['rolling_24h'];\n        const best = this.safeDict (ticker, 'best');\n        const bestAsk = this.safeDict (best, 'ask');\n        const bestBid = this.safeDict (best, 'bid');\n        const lastTrade = ticker['last_trade'];\n        const lastPrice = this.safeString (lastTrade, 'price');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': this.parseDate (this.safeString (lastTrade, 'date')),\n            'datetime': this.iso8601 (this.parseDate (this.safeString (lastTrade, 'date'))),\n            'high': this.safeNumber (rolling_24h, 'high'),\n            'low': this.safeNumber (rolling_24h, 'low'),\n            'bid': this.safeNumber (bestBid, 'price'),\n            'bidVolume': this.safeNumber (bestBid, 'volume'),\n            'ask': this.safeNumber (bestAsk, 'price'),\n            'askVolume': this.safeNumber (bestAsk, 'volume'),\n            'vwap': undefined,\n            'open': this.safeNumber (rolling_24h, 'open'),\n            'close': lastPrice,\n            'last': lastPrice,\n            'previousClose': undefined,\n            'change': this.safeString (rolling_24h, 'price_change'),\n            'percentage': this.safeString (rolling_24h, 'price_change_percent'),\n            'average': undefined,\n            'baseVolume': this.safeString (rolling_24h, 'volume'),\n            'quoteVolume': this.safeString (rolling_24h, 'quote_volume'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade, market = undefined): Trade",
        "line_start": 1730,
        "line_end": 1757,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeSymbol (this.safeString (trade, 'fee_currency_symbol'))",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (trade, 'fee')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'id')",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTrade (trade, market = undefined): Trade {\n        const timestamp = this.parseDate (this.safeString (trade, 'created_at'));\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'volume', this.safeString (trade, 'quantity'));\n        const privateSideField = this.safeStringLower (trade, 'side');\n        const side = this.safeStringLower (trade, 'taker_side', privateSideField);\n        const cost = Precise.stringMul (price, amount);\n        const fee = {\n            'currency': this.safeSymbol (this.safeString (trade, 'fee_currency_symbol')),\n            'cost': this.safeNumber (trade, 'fee'),\n            'rate': undefined,\n        };\n        return this.safeTrade ({\n            'id': this.safeString (trade, 'id'),\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': undefined,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (entry: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1675,
        "line_end": 1684,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "entry",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (entry, 'maker')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (entry, 'taker')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "true",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (entry: Dict, market: Market = undefined): TradingFeeInterface {\n        return {\n            'info': entry,\n            'symbol': market['symbol'],\n            'maker': this.safeNumber (entry, 'maker'),\n            'taker': this.safeNumber (entry, 'taker'),\n            'percentage': true,\n            'tierBased': true,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction, currency: Currency = undefined, since: Int = undefined, limit: Int = undefined): Transaction",
        "line_start": 1865,
        "line_end": 1914,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'sn')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (cryptoDetails, 'transaction_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (transaction, 'network_code')",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'destination_tag')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "this.safeString (transaction, 'destination_tag')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "feeObj",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (fee)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.parseNumber (feeRate)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransaction (transaction, currency: Currency = undefined, since: Int = undefined, limit: Int = undefined): Transaction {\n        const cryptoDetails = this.safeDict (transaction, 'details_crypto');\n        const address = this.safeString2 (cryptoDetails, 'receiving_address', 'destination_address');\n        const sn = this.safeString (transaction, 'sn');\n        let type = 'withdrawal';\n        if (sn !== undefined && sn[0] === 'D') {\n            type = 'deposit';\n        }\n        const fee = this.safeString (transaction, 'fee', '0');\n        const amount = this.safeString (transaction, 'amount');\n        const currencySymbol = this.safeString (transaction, 'currency_symbol');\n        let actualAmount = amount;\n        const currencyCode = this.safeCurrencyCode (currencySymbol);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const created_at = this.safeString (transaction, 'created_at');\n        const timestamp = this.parseDate (created_at);\n        const datetime = this.iso8601 (timestamp);\n        if (fee !== undefined && amount !== undefined) {\n            // actualAmount = amount - fee;\n            actualAmount = Precise.stringSub (amount, fee);\n        }\n        const feeRate = Precise.stringDiv (fee, actualAmount);\n        const feeObj = {\n            'cost': this.parseNumber (fee),\n            'currency': currencyCode,\n            'rate': this.parseNumber (feeRate),\n        };\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'sn'),\n            'txid': this.safeString (cryptoDetails, 'transaction_id'),\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'network': this.safeString (transaction, 'network_code'),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': this.safeString (transaction, 'destination_tag'),\n            'tagTo': this.safeString (transaction, 'destination_tag'),\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.parseNumber (amount),\n            'currency': currencyCode,\n            'status': status,\n            'updated': undefined,\n            'fee': feeObj,\n            'comment': undefined,\n            'internal': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1844,
        "line_end": 1863,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // BOTH\n            'SUBMITTING': 'pending',\n            'SUBMITTED': 'pending',\n            'REJECTED': 'failed',\n            // DEPOSIT-SPECIFIC\n            'CANCELLED': 'canceled',\n            'ACCEPTED': 'ok',\n            'WARNING': 'pending',\n            'UNBLOCKED': 'pending',\n            'BLOCKED': 'pending',\n            // WITHDRAWAL-SPECIFIC\n            'PROCESSING': 'pending',\n            'CANCELED': 'canceled',\n            'FAILED': 'failed',\n            'DONE': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "gate": [
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3026,
        "line_end": 3035,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString2 (entry, 'freeze', 'locked');\n        account['free'] = this.safeString (entry, 'available');\n        account['total'] = this.safeString (entry, 'total');\n        if ('borrowed' in entry) {\n            account['debt'] = this.safeString (entry, 'borrowed');\n        }\n        return account;\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 6837,
        "line_end": 6853,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'currency'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'actual_rate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const marketId = this.safeString (info, 'currency_pair');\n        market = this.safeMarket (marketId, market);\n        const marginMode = (marketId !== undefined) ? 'isolated' : 'cross';\n        const timestamp = this.safeInteger (info, 'create_time');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'currency')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'actual_rate'),\n            'amountBorrowed': undefined,\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseContractMarket",
        "signature": "parseContractMarket (market, settleId)",
        "line_start": 1499,
        "line_end": 1669,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "marketType === 'swap'",
            "comment": null
          },
          {
            "key": "future",
            "value": "marketType === 'future'",
            "comment": null
          },
          {
            "key": "option",
            "value": "marketType === 'option'",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "!isLinear",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber ('0.0005')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber ('1')",
            "comment": "all contracts have this step size\n                'price': this.safeNumber (market, 'order_price_round'),\n            }"
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.safeNumber (market, 'leverage_min'),\n                    'max': this.safeNumber (market, 'leverage_max'),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'order_size_min'),\n                    'max': this.safeNumber (market, 'order_size_max'),\n                },\n                'price': {\n                    'min': this.parseNumber (minPrice),\n                    'max': this.parseNumber (maxPrice),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeIntegerProduct (market, 'create_time', 1000)",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.safeNumber (market, 'leverage_min'),\n                    'max': this.safeNumber (market, 'leverage_max'),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'order_size_min'),\n                    'max': this.safeNumber (market, 'order_size_max'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.parseNumber (minPrice),\n                    'max': this.parseNumber (maxPrice),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'order_size_min')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'order_size_max')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.parseNumber (minPrice)",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.parseNumber (maxPrice)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"name\": \"BTC_USDT\",\n        \"type\": \"direct\",\n        \"quanto_multiplier\": \"0.0001\",\n        \"ref_discount_rate\": \"0\",\n        \"order_price_deviate\": \"0.5\",\n        \"maintenance_rate\": \"0.005\",\n        \"mark_type\": \"index\",\n        \"last_price\": \"38026\",\n        \"mark_price\": \"37985.6\",\n        \"index_price\": \"37954.92\",\n        \"funding_rate_indicative\": \"0.000219\",\n        \"mark_price_round\": \"0.01\",\n        \"funding_offset\": 0,\n        \"in_delisting\": false,\n        \"risk_limit_base\": \"1000000\",\n        \"interest_rate\": \"0.0003\",\n        \"order_price_round\": \"0.1\",\n        \"order_size_min\": 1,\n        \"ref_rebate_rate\": \"0.2\",\n        \"funding_interval\": 28800,\n        \"risk_limit_step\": \"1000000\",\n        \"leverage_min\": \"1\",\n        \"leverage_max\": \"100\",\n        \"risk_limit_max\": \"8000000\",\n        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        \"funding_rate\": \"0.002053\",\n        \"order_size_max\": 1000000,\n        \"funding_next_apply\": 1610035200,\n        \"short_users\": 977,\n        \"config_change_time\": 1609899548,\n        \"create_time\": 1609800048,\n        \"trade_size\": 28530850594,\n        \"position_size\": 5223816,\n        \"long_users\": 455,\n        \"funding_impact_value\": \"60000\",\n        \"orders_limit\": 50,\n        \"trade_id\": 10851092,\n        \"orderbook_id\": 2129638396\n    }",
          "{\n        \"name\": \"BTC_USDT_20200814\",\n        \"underlying\": \"BTC_USDT\",\n        \"cycle\": \"WEEKLY\",\n        \"type\": \"direct\",\n        \"quanto_multiplier\": \"0.0001\",\n        \"mark_type\": \"index\",\n        \"last_price\": \"9017\",\n        \"mark_price\": \"9019\",\n        \"index_price\": \"9005.3\",\n        \"basis_rate\": \"0.185095\",\n        \"basis_value\": \"13.7\",\n        \"basis_impact_value\": \"100000\",\n        \"settle_price\": \"0\",\n        \"settle_price_interval\": 60,\n        \"settle_price_duration\": 1800,\n        \"settle_fee_rate\": \"0.0015\",\n        \"expire_time\": 1593763200,\n        \"order_price_round\": \"0.1\",\n        \"mark_price_round\": \"0.1\",\n        \"leverage_min\": \"1\",\n        \"leverage_max\": \"100\",\n        \"maintenance_rate\": \"1000000\",\n        \"risk_limit_base\": \"140.726652109199\",\n        \"risk_limit_step\": \"1000000\",\n        \"risk_limit_max\": \"8000000\",\n        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        \"ref_discount_rate\": \"0\",\n        \"ref_rebate_rate\": \"0.2\",\n        \"order_price_deviate\": \"0.5\",\n        \"order_size_min\": 1,\n        \"order_size_max\": 1000000,\n        \"orders_limit\": 50,\n        \"orderbook_id\": 63,\n        \"trade_id\": 26,\n        \"trade_size\": 435,\n        \"position_size\": 130,\n        \"config_change_time\": 1593158867,\n        \"in_delisting\": false\n    }"
        ],
        "source": "parseContractMarket (market, settleId) {\n        //\n        //  Perpetual swap\n        //\n        //    {\n        //        \"name\": \"BTC_USDT\",\n        //        \"type\": \"direct\",\n        //        \"quanto_multiplier\": \"0.0001\",\n        //        \"ref_discount_rate\": \"0\",\n        //        \"order_price_deviate\": \"0.5\",\n        //        \"maintenance_rate\": \"0.005\",\n        //        \"mark_type\": \"index\",\n        //        \"last_price\": \"38026\",\n        //        \"mark_price\": \"37985.6\",\n        //        \"index_price\": \"37954.92\",\n        //        \"funding_rate_indicative\": \"0.000219\",\n        //        \"mark_price_round\": \"0.01\",\n        //        \"funding_offset\": 0,\n        //        \"in_delisting\": false,\n        //        \"risk_limit_base\": \"1000000\",\n        //        \"interest_rate\": \"0.0003\",\n        //        \"order_price_round\": \"0.1\",\n        //        \"order_size_min\": 1,\n        //        \"ref_rebate_rate\": \"0.2\",\n        //        \"funding_interval\": 28800,\n        //        \"risk_limit_step\": \"1000000\",\n        //        \"leverage_min\": \"1\",\n        //        \"leverage_max\": \"100\",\n        //        \"risk_limit_max\": \"8000000\",\n        //        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        //        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        //        \"funding_rate\": \"0.002053\",\n        //        \"order_size_max\": 1000000,\n        //        \"funding_next_apply\": 1610035200,\n        //        \"short_users\": 977,\n        //        \"config_change_time\": 1609899548,\n        //        \"create_time\": 1609800048,\n        //        \"trade_size\": 28530850594,\n        //        \"position_size\": 5223816,\n        //        \"long_users\": 455,\n        //        \"funding_impact_value\": \"60000\",\n        //        \"orders_limit\": 50,\n        //        \"trade_id\": 10851092,\n        //        \"orderbook_id\": 2129638396\n        //    }\n        //\n        //  Delivery Futures\n        //\n        //    {\n        //        \"name\": \"BTC_USDT_20200814\",\n        //        \"underlying\": \"BTC_USDT\",\n        //        \"cycle\": \"WEEKLY\",\n        //        \"type\": \"direct\",\n        //        \"quanto_multiplier\": \"0.0001\",\n        //        \"mark_type\": \"index\",\n        //        \"last_price\": \"9017\",\n        //        \"mark_price\": \"9019\",\n        //        \"index_price\": \"9005.3\",\n        //        \"basis_rate\": \"0.185095\",\n        //        \"basis_value\": \"13.7\",\n        //        \"basis_impact_value\": \"100000\",\n        //        \"settle_price\": \"0\",\n        //        \"settle_price_interval\": 60,\n        //        \"settle_price_duration\": 1800,\n        //        \"settle_fee_rate\": \"0.0015\",\n        //        \"expire_time\": 1593763200,\n        //        \"order_price_round\": \"0.1\",\n        //        \"mark_price_round\": \"0.1\",\n        //        \"leverage_min\": \"1\",\n        //        \"leverage_max\": \"100\",\n        //        \"maintenance_rate\": \"1000000\",\n        //        \"risk_limit_base\": \"140.726652109199\",\n        //        \"risk_limit_step\": \"1000000\",\n        //        \"risk_limit_max\": \"8000000\",\n        //        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        //        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        //        \"ref_discount_rate\": \"0\",\n        //        \"ref_rebate_rate\": \"0.2\",\n        //        \"order_price_deviate\": \"0.5\",\n        //        \"order_size_min\": 1,\n        //        \"order_size_max\": 1000000,\n        //        \"orders_limit\": 50,\n        //        \"orderbook_id\": 63,\n        //        \"trade_id\": 26,\n        //        \"trade_size\": 435,\n        //        \"position_size\": 130,\n        //        \"config_change_time\": 1593158867,\n        //        \"in_delisting\": false\n        //    }\n        //\n        const id = this.safeString (market, 'name');\n        const parts = id.split ('_');\n        const baseId = this.safeString (parts, 0);\n        const quoteId = this.safeString (parts, 1);\n        const date = this.safeString (parts, 2);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settle = this.safeCurrencyCode (settleId);\n        const expiry = this.safeTimestamp (market, 'expire_time');\n        let symbol = '';\n        let marketType = 'swap';\n        if (date !== undefined) {\n            symbol = base + '/' + quote + ':' + settle + '-' + this.yymmdd (expiry, '');\n            marketType = 'future';\n        } else {\n            symbol = base + '/' + quote + ':' + settle;\n        }\n        const priceDeviate = this.safeString (market, 'order_price_deviate');\n        const markPrice = this.safeString (market, 'mark_price');\n        const minMultiplier = Precise.stringSub ('1', priceDeviate);\n        const maxMultiplier = Precise.stringAdd ('1', priceDeviate);\n        const minPrice = Precise.stringMul (minMultiplier, markPrice);\n        const maxPrice = Precise.stringMul (maxMultiplier, markPrice);\n        const isLinear = quote === settle;\n        let contractSize = this.safeString (market, 'quanto_multiplier');\n        // exception only for one market: https://api.gateio.ws/api/v4/futures/btc/contracts\n        if (contractSize === '0') {\n            contractSize = '1'; // 1 USD in WEB: https://i.imgur.com/MBBUI04.png\n        }\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': false,\n            'margin': false,\n            'swap': marketType === 'swap',\n            'future': marketType === 'future',\n            'option': marketType === 'option',\n            'active': true,\n            'contract': true,\n            'linear': isLinear,\n            'inverse': !isLinear,\n            'taker': this.parseNumber ('0.0005'), // 0.05% vip0\n            'maker': this.parseNumber ('0.0002'), // 0.02% vip0\n            'contractSize': this.parseNumber (contractSize),\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber ('1'), // all contracts have this step size\n                'price': this.safeNumber (market, 'order_price_round'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.safeNumber (market, 'leverage_min'),\n                    'max': this.safeNumber (market, 'leverage_max'),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'order_size_min'),\n                    'max': this.safeNumber (market, 'order_size_max'),\n                },\n                'price': {\n                    'min': this.parseNumber (minPrice),\n                    'max': this.parseNumber (maxPrice),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': this.safeIntegerProduct (market, 'create_time', 1000),\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency = undefined)",
        "line_start": 2345,
        "line_end": 2364,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'payment_id')",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (depositAddress, 'chain'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         chain: \"BTC\",\n         address: \"1Nxu.......Ys\",\n         payment_id: \"\",\n         payment_name: \"\",\n         obtain_failed: \"0\",\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency = undefined) {\n        //\n        //     {\n        //         chain: \"BTC\",\n        //         address: \"1Nxu.......Ys\",\n        //         payment_id: \"\",\n        //         payment_name: \"\",\n        //         obtain_failed: \"0\",\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeString (currency, 'code'),\n            'address': address,\n            'tag': this.safeString (depositAddress, 'payment_id'),\n            'network': this.networkIdToCode (this.safeString (depositAddress, 'chain')),\n        };\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2562,
        "line_end": 2611,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': this.safeNumber (fee, 'withdraw_fix'),\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': this.safeNumber (fee, 'deposit'),\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (fee, 'deposit')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                        'fee': this.parseNumber (withdrawFixOnChains[chainKey]),\n                        'percentage': false,\n                    }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'fee': undefined,\n                        'percentage': undefined,\n                    }",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\": \"MTN\",\n        \"name\": \"Medicalchain\",\n        \"name_cn\": \"Medicalchain\",\n        \"deposit\": \"0\",\n        \"withdraw_percent\": \"0%\",\n        \"withdraw_fix\": \"900\",\n        \"withdraw_day_limit\": \"500000\",\n        \"withdraw_day_limit_remain\": \"500000\",\n        \"withdraw_amount_mini\": \"900.1\",\n        \"withdraw_eachtime_limit\": \"90000000000\",\n        \"withdraw_fix_on_chains\": {\n            \"ETH\": \"900\"\n        }\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"currency\": \"MTN\",\n        //        \"name\": \"Medicalchain\",\n        //        \"name_cn\": \"Medicalchain\",\n        //        \"deposit\": \"0\",\n        //        \"withdraw_percent\": \"0%\",\n        //        \"withdraw_fix\": \"900\",\n        //        \"withdraw_day_limit\": \"500000\",\n        //        \"withdraw_day_limit_remain\": \"500000\",\n        //        \"withdraw_amount_mini\": \"900.1\",\n        //        \"withdraw_eachtime_limit\": \"90000000000\",\n        //        \"withdraw_fix_on_chains\": {\n        //            \"ETH\": \"900\"\n        //        }\n        //    }\n        //\n        const withdrawFixOnChains = this.safeValue (fee, 'withdraw_fix_on_chains');\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': this.safeNumber (fee, 'withdraw_fix'),\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': this.safeNumber (fee, 'deposit'),\n                'percentage': false,\n            },\n            'networks': {},\n        };\n        if (withdrawFixOnChains !== undefined) {\n            const chainKeys = Object.keys (withdrawFixOnChains);\n            for (let i = 0; i < chainKeys.length; i++) {\n                const chainKey = chainKeys[i];\n                const networkCode = this.networkIdToCode (chainKey, this.safeString (fee, 'currency'));\n                result['networks'][networkCode] = {\n                    'withdraw': {\n                        'fee': this.parseNumber (withdrawFixOnChains[chainKey]),\n                        'percentage': false,\n                    },\n                    'deposit': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                };\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseEmulatedLeverageTiers",
        "signature": "parseEmulatedLeverageTiers (info, market = undefined): LeverageTier[]",
        "line_start": 6489,
        "line_end": 6517,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseEmulatedLeverageTiers (info, market = undefined): LeverageTier[] {\n        const marketId = this.safeString (info, 'name');\n        const maintenanceMarginUnit = this.safeString (info, 'maintenance_rate'); // '0.005',\n        const leverageMax = this.safeString (info, 'leverage_max'); // '100',\n        const riskLimitStep = this.safeString (info, 'risk_limit_step'); // '1000000',\n        const riskLimitMax = this.safeString (info, 'risk_limit_max'); // '16000000',\n        const initialMarginUnit = Precise.stringDiv ('1', leverageMax);\n        let maintenanceMarginRate = maintenanceMarginUnit;\n        let initialMarginRatio = initialMarginUnit;\n        let floor = '0';\n        const tiers = [];\n        while (Precise.stringLt (floor, riskLimitMax)) {\n            const cap = Precise.stringAdd (floor, riskLimitStep);\n            tiers.push ({\n                'tier': this.parseNumber (Precise.stringDiv (cap, riskLimitStep)),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n                'currency': this.safeString (market, 'settle'),\n                'minNotional': this.parseNumber (floor),\n                'maxNotional': this.parseNumber (cap),\n                'maintenanceMarginRate': this.parseNumber (maintenanceMarginRate),\n                'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMarginRatio)),\n                'info': info,\n            });\n            maintenanceMarginRate = Precise.stringAdd (maintenanceMarginRate, maintenanceMarginUnit);\n            initialMarginRatio = Precise.stringAdd (initialMarginRatio, initialMarginUnit);\n            floor = cap;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseFundingHistories",
        "signature": "parseFundingHistories (response, symbol, since, limit): FundingHistory[]",
        "line_start": 2666,
        "line_end": 2675,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingHistories (response, symbol, since, limit): FundingHistory[] {\n        const result = [];\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const funding = this.parseFundingHistory (entry);\n            result.push (funding);\n        }\n        const sorted = this.sortBy (result, 'timestamp');\n        return this.filterBySymbolSinceLimit (sorted, symbol, since, limit);\n    }"
      },
      {
        "name": "parseFundingHistory",
        "signature": "parseFundingHistory (info, market: Market = undefined)",
        "line_start": 2677,
        "line_end": 2699,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (market, 'settle')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'change')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"time\": 1646899200,\n        \"change\": \"-0.027722\",\n        \"balance\": \"11.653120591841\",\n        \"text\": \"XRP_USDT\",\n        \"type\": \"fund\"\n    }"
        ],
        "source": "parseFundingHistory (info, market: Market = undefined) {\n        //\n        //    {\n        //        \"time\": 1646899200,\n        //        \"change\": \"-0.027722\",\n        //        \"balance\": \"11.653120591841\",\n        //        \"text\": \"XRP_USDT\",\n        //        \"type\": \"fund\"\n        //    }\n        //\n        const timestamp = this.safeTimestamp (info, 'time');\n        const marketId = this.safeString (info, 'text');\n        market = this.safeMarket (marketId, market, '_', 'swap');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'code': this.safeString (market, 'settle'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.safeNumber (info, 'change'),\n        };\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 2253,
        "line_end": 2262,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 2179,
        "line_end": 2251,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "fundingRateIndicative",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (fundingInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"name\": \"BTC_USDT\",\n        \"type\": \"direct\",\n        \"quanto_multiplier\": \"0.0001\",\n        \"ref_discount_rate\": \"0\",\n        \"order_price_deviate\": \"0.5\",\n        \"maintenance_rate\": \"0.005\",\n        \"mark_type\": \"index\",\n        \"last_price\": \"38026\",\n        \"mark_price\": \"37985.6\",\n        \"index_price\": \"37954.92\",\n        \"funding_rate_indicative\": \"0.000219\",\n        \"mark_price_round\": \"0.01\",\n        \"funding_offset\": 0,\n        \"in_delisting\": false,\n        \"risk_limit_base\": \"1000000\",\n        \"interest_rate\": \"0.0003\",\n        \"order_price_round\": \"0.1\",\n        \"order_size_min\": 1,\n        \"ref_rebate_rate\": \"0.2\",\n        \"funding_interval\": 28800,\n        \"risk_limit_step\": \"1000000\",\n        \"leverage_min\": \"1\",\n        \"leverage_max\": \"100\",\n        \"risk_limit_max\": \"8000000\",\n        \"maker_fee_rate\": \"-0.00025\",\n        \"taker_fee_rate\": \"0.00075\",\n        \"funding_rate\": \"0.002053\",\n        \"order_size_max\": 1000000,\n        \"funding_next_apply\": 1610035200,\n        \"short_users\": 977,\n        \"config_change_time\": 1609899548,\n        \"trade_size\": 28530850594,\n        \"position_size\": 5223816,\n        \"long_users\": 455,\n        \"funding_impact_value\": \"60000\",\n        \"orders_limit\": 50,\n        \"trade_id\": 10851092,\n        \"orderbook_id\": 2129638396\n    }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"name\": \"BTC_USDT\",\n        //        \"type\": \"direct\",\n        //        \"quanto_multiplier\": \"0.0001\",\n        //        \"ref_discount_rate\": \"0\",\n        //        \"order_price_deviate\": \"0.5\",\n        //        \"maintenance_rate\": \"0.005\",\n        //        \"mark_type\": \"index\",\n        //        \"last_price\": \"38026\",\n        //        \"mark_price\": \"37985.6\",\n        //        \"index_price\": \"37954.92\",\n        //        \"funding_rate_indicative\": \"0.000219\",\n        //        \"mark_price_round\": \"0.01\",\n        //        \"funding_offset\": 0,\n        //        \"in_delisting\": false,\n        //        \"risk_limit_base\": \"1000000\",\n        //        \"interest_rate\": \"0.0003\",\n        //        \"order_price_round\": \"0.1\",\n        //        \"order_size_min\": 1,\n        //        \"ref_rebate_rate\": \"0.2\",\n        //        \"funding_interval\": 28800,\n        //        \"risk_limit_step\": \"1000000\",\n        //        \"leverage_min\": \"1\",\n        //        \"leverage_max\": \"100\",\n        //        \"risk_limit_max\": \"8000000\",\n        //        \"maker_fee_rate\": \"-0.00025\",\n        //        \"taker_fee_rate\": \"0.00075\",\n        //        \"funding_rate\": \"0.002053\",\n        //        \"order_size_max\": 1000000,\n        //        \"funding_next_apply\": 1610035200,\n        //        \"short_users\": 977,\n        //        \"config_change_time\": 1609899548,\n        //        \"trade_size\": 28530850594,\n        //        \"position_size\": 5223816,\n        //        \"long_users\": 455,\n        //        \"funding_impact_value\": \"60000\",\n        //        \"orders_limit\": 50,\n        //        \"trade_id\": 10851092,\n        //        \"orderbook_id\": 2129638396\n        //    }\n        //\n        const marketId = this.safeString (contract, 'name');\n        const symbol = this.safeSymbol (marketId, market, '_', 'swap');\n        const markPrice = this.safeNumber (contract, 'mark_price');\n        const indexPrice = this.safeNumber (contract, 'index_price');\n        const interestRate = this.safeNumber (contract, 'interest_rate');\n        const fundingRate = this.safeNumber (contract, 'funding_rate');\n        const fundingTime = this.safeTimestamp (contract, 'funding_next_apply');\n        const fundingRateIndicative = this.safeNumber (contract, 'funding_rate_indicative');\n        const fundingInterval = Precise.stringMul ('1000', this.safeString (contract, 'funding_interval'));\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': fundingRateIndicative,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (fundingInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 7875,
        "line_end": 7919,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "this.safeNumber (greeks, 'bid1_size')",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "this.safeNumber (greeks, 'ask1_size')",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bid_iv')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'ask_iv')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'mark_iv')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (greeks, 'bid1_price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (greeks, 'ask1_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (greeks, 'last_price')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.parseNumber (market['info']['underlying_price'])",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"vega\": \"1.78992\",\n         \"leverage\": \"6.2096777055417\",\n         \"ask_iv\": \"0.6245\",\n         \"delta\": \"-0.69397\",\n         \"last_price\": \"0\",\n         \"theta\": \"-2.5723\",\n         \"bid1_price\": \"222.9\",\n         \"mark_iv\": \"0.5909\",\n         \"name\": \"ETH_USDT-20231201-2300-P\",\n         \"bid_iv\": \"0.5065\",\n         \"ask1_price\": \"243.6\",\n         \"mark_price\": \"236.57\",\n         \"position_size\": 0,\n         \"bid1_size\": 368,\n         \"ask1_size\": -335,\n         \"gamma\": \"0.00116\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"vega\": \"1.78992\",\n        //         \"leverage\": \"6.2096777055417\",\n        //         \"ask_iv\": \"0.6245\",\n        //         \"delta\": \"-0.69397\",\n        //         \"last_price\": \"0\",\n        //         \"theta\": \"-2.5723\",\n        //         \"bid1_price\": \"222.9\",\n        //         \"mark_iv\": \"0.5909\",\n        //         \"name\": \"ETH_USDT-20231201-2300-P\",\n        //         \"bid_iv\": \"0.5065\",\n        //         \"ask1_price\": \"243.6\",\n        //         \"mark_price\": \"236.57\",\n        //         \"position_size\": 0,\n        //         \"bid1_size\": 368,\n        //         \"ask1_size\": -335,\n        //         \"gamma\": \"0.00116\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'name');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': this.safeNumber (greeks, 'bid1_size'),\n            'askSize': this.safeNumber (greeks, 'ask1_size'),\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bid_iv'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'ask_iv'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'mark_iv'),\n            'bidPrice': this.safeNumber (greeks, 'bid1_price'),\n            'askPrice': this.safeNumber (greeks, 'ask1_price'),\n            'markPrice': this.safeNumber (greeks, 'mark_price'),\n            'lastPrice': this.safeNumber (greeks, 'last_price'),\n            'underlyingPrice': this.parseNumber (market['info']['underlying_price']),\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 7432,
        "line_end": 7515,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "before",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'balance')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"123456\",\n         \"time\": 1547633726123,\n         \"currency\": \"BTC\",\n         \"change\": \"1.03\",\n         \"balance\": \"4.59316525194\",\n         \"type\": \"margin_in\"\n     }",
          "{\n         \"id\": \"123456\",\n         \"time\": \"1547633726\",\n         \"time_ms\": 1547633726123,\n         \"currency\": \"BTC\",\n         \"currency_pair\": \"BTC_USDT\",\n         \"change\": \"1.03\",\n         \"balance\": \"4.59316525194\"\n     }",
          "{\n         \"time\": 1682294400.123456,\n         \"change\": \"0.000010152188\",\n         \"balance\": \"4.59316525194\",\n         \"text\": \"ETH_USD:6086261\",\n         \"type\": \"fee\"\n     }",
          "{\n         \"time\": 1685594770,\n         \"change\": \"3.33\",\n         \"balance\": \"29.87911771\",\n         \"text\": \"BTC_USDT-20230602-26500-C:2611026125\",\n         \"type\": \"prem\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // spot\n        //\n        //     {\n        //         \"id\": \"123456\",\n        //         \"time\": 1547633726123,\n        //         \"currency\": \"BTC\",\n        //         \"change\": \"1.03\",\n        //         \"balance\": \"4.59316525194\",\n        //         \"type\": \"margin_in\"\n        //     }\n        //\n        // margin\n        //\n        //     {\n        //         \"id\": \"123456\",\n        //         \"time\": \"1547633726\",\n        //         \"time_ms\": 1547633726123,\n        //         \"currency\": \"BTC\",\n        //         \"currency_pair\": \"BTC_USDT\",\n        //         \"change\": \"1.03\",\n        //         \"balance\": \"4.59316525194\"\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"time\": 1682294400.123456,\n        //         \"change\": \"0.000010152188\",\n        //         \"balance\": \"4.59316525194\",\n        //         \"text\": \"ETH_USD:6086261\",\n        //         \"type\": \"fee\"\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"time\": 1685594770,\n        //         \"change\": \"3.33\",\n        //         \"balance\": \"29.87911771\",\n        //         \"text\": \"BTC_USDT-20230602-26500-C:2611026125\",\n        //         \"type\": \"prem\"\n        //     }\n        //\n        let direction = undefined;\n        let amount = this.safeString (item, 'change');\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringAbs (amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const type = this.safeString (item, 'type');\n        const rawTimestamp = this.safeString (item, 'time');\n        let timestamp = undefined;\n        if (rawTimestamp.length > 10) {\n            timestamp = parseInt (rawTimestamp);\n        } else {\n            timestamp = parseInt (rawTimestamp) * 1000;\n        }\n        const balanceString = this.safeString (item, 'balance');\n        const changeString = this.safeString (item, 'change');\n        const before = this.parseNumber (Precise.stringSub (balanceString, changeString));\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': undefined,\n            'type': this.parseLedgerEntryType (type),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': before,\n            'after': this.safeNumber (item, 'balance'),\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 7517,
        "line_end": 7559,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'sub_account_transfer': 'transfer',\n            'margin_in': 'transfer',\n            'margin_out': 'transfer',\n            'margin_funding_in': 'transfer',\n            'margin_funding_out': 'transfer',\n            'cross_margin_in': 'transfer',\n            'cross_margin_out': 'transfer',\n            'copy_trading_in': 'transfer',\n            'copy_trading_out': 'transfer',\n            'quant_in': 'transfer',\n            'quant_out': 'transfer',\n            'futures_in': 'transfer',\n            'futures_out': 'transfer',\n            'delivery_in': 'transfer',\n            'delivery_out': 'transfer',\n            'new_order': 'trade',\n            'order_fill': 'trade',\n            'referral_fee': 'rebate',\n            'order_fee': 'fee',\n            'interest': 'interest',\n            'lend': 'loan',\n            'redeem': 'loan',\n            'profit': 'interest',\n            'flash_swap_buy': 'trade',\n            'flash_swap_sell': 'trade',\n            'unknown': 'unknown',\n            'set': 'settlement',\n            'prem': 'trade',\n            'point_refr': 'rebate',\n            'point_fee': 'fee',\n            'point_dnw': 'deposit/withdraw',\n            'fund': 'fee',\n            'refr': 'rebate',\n            'fee': 'fee',\n            'pnl': 'trade',\n            'dnw': 'deposit/withdraw',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 8103,
        "line_end": 8113,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '_', 'spot')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString2 (leverage, 'currency_pair', 'id');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market, '_', 'spot'),\n            'marginMode': undefined,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 7742,
        "line_end": 7824,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contractsString)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSizeString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (priceString)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.parseNumber (baseValueString)",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (Precise.stringAbs (quoteValueString))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract\": \"BTC_USDT\",\n         \"left\": 0,\n         \"size\": -165,\n         \"fill_price\": \"28070\",\n         \"order_price\": \"28225\",\n         \"time\": 1696736132\n     }",
          "{\n         \"time\": 1548654951,\n         \"contract\": \"BTC_USDT\",\n         \"size\": 600,\n         \"leverage\": \"25\",\n         \"margin\": \"0.006705256878\",\n         \"entry_price\": \"3536.123\",\n         \"liq_price\": \"3421.54\",\n         \"mark_price\": \"3420.27\",\n         \"order_id\": 317393847,\n         \"order_price\": \"3405\",\n         \"fill_price\": \"3424\",\n         \"left\": 0\n     }",
          "{\n         \"time\": 1631764800,\n         \"pnl\": \"-42914.291\",\n         \"settle_size\": \"-10001\",\n         \"side\": \"short\",\n         \"contract\": \"BTC_USDT-20210916-5000-C\",\n         \"text\": \"settled\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // fetchLiquidations\n        //\n        //     {\n        //         \"contract\": \"BTC_USDT\",\n        //         \"left\": 0,\n        //         \"size\": -165,\n        //         \"fill_price\": \"28070\",\n        //         \"order_price\": \"28225\",\n        //         \"time\": 1696736132\n        //     }\n        //\n        // swap and future: fetchMyLiquidations\n        //\n        //     {\n        //         \"time\": 1548654951,\n        //         \"contract\": \"BTC_USDT\",\n        //         \"size\": 600,\n        //         \"leverage\": \"25\",\n        //         \"margin\": \"0.006705256878\",\n        //         \"entry_price\": \"3536.123\",\n        //         \"liq_price\": \"3421.54\",\n        //         \"mark_price\": \"3420.27\",\n        //         \"order_id\": 317393847,\n        //         \"order_price\": \"3405\",\n        //         \"fill_price\": \"3424\",\n        //         \"left\": 0\n        //     }\n        //\n        // option: fetchMyLiquidations\n        //\n        //     {\n        //         \"time\": 1631764800,\n        //         \"pnl\": \"-42914.291\",\n        //         \"settle_size\": \"-10001\",\n        //         \"side\": \"short\",\n        //         \"contract\": \"BTC_USDT-20210916-5000-C\",\n        //         \"text\": \"settled\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'contract');\n        const timestamp = this.safeTimestamp (liquidation, 'time');\n        const size = this.safeString2 (liquidation, 'size', 'settle_size');\n        const left = this.safeString (liquidation, 'left', '0');\n        const contractsString = Precise.stringAbs (Precise.stringSub (size, left));\n        const contractSizeString = this.safeString (market, 'contractSize');\n        const priceString = this.safeString2 (liquidation, 'liq_price', 'fill_price');\n        const baseValueString = Precise.stringMul (contractsString, contractSizeString);\n        let quoteValueString = this.safeString (liquidation, 'pnl');\n        if (quoteValueString === undefined) {\n            quoteValueString = Precise.stringMul (baseValueString, priceString);\n        }\n        // --- derive side ---\n        // 1) options payload has explicit 'side': 'long' | 'short'\n        const optPos = this.safeStringLower (liquidation, 'side');\n        let side: Str = undefined;\n        if (optPos === 'long') {\n            side = 'buy';\n        } else if (optPos === 'short') {\n            side = 'sell';\n        } else {\n            if (size !== undefined) { // 2) futures/perpetual (and fallback for options): infer from size\n                if (Precise.stringGt (size, '0')) {\n                    side = 'buy';\n                } else if (Precise.stringLt (size, '0')) {\n                    side = 'sell';\n                }\n            }\n        }\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.parseNumber (contractsString),\n            'contractSize': this.parseNumber (contractSizeString),\n            'price': this.parseNumber (priceString),\n            'side': side,\n            'baseValue': this.parseNumber (baseValueString),\n            'quoteValue': this.parseNumber (Precise.stringAbs (quoteValueString)),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 6728,
        "line_end": 6781,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, undefined, '_', 'margin')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"17\",\n         \"create_time\": 1620381696159,\n         \"update_time\": 1620381696159,\n         \"currency\": \"EOS\",\n         \"amount\": \"110.553635\",\n         \"text\": \"web\",\n         \"status\": 2,\n         \"repaid\": \"110.506649705159\",\n         \"repaid_interest\": \"0.046985294841\",\n         \"unpaid_interest\": \"0.0000074393366667\"\n     }",
          "{\n         \"id\": \"34267567\",\n         \"create_time\": \"1656394778\",\n         \"expire_time\": \"1657258778\",\n         \"status\": \"loaned\",\n         \"side\": \"borrow\",\n         \"currency\": \"USDT\",\n         \"rate\": \"0.0002\",\n         \"amount\": \"100\",\n         \"days\": 10,\n         \"auto_renew\": false,\n         \"currency_pair\": \"LTC_USDT\",\n         \"left\": \"0\",\n         \"repaid\": \"0\",\n         \"paid_interest\": \"0\",\n         \"unpaid_interest\": \"0.003333333333\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        // Cross\n        //\n        //     {\n        //         \"id\": \"17\",\n        //         \"create_time\": 1620381696159,\n        //         \"update_time\": 1620381696159,\n        //         \"currency\": \"EOS\",\n        //         \"amount\": \"110.553635\",\n        //         \"text\": \"web\",\n        //         \"status\": 2,\n        //         \"repaid\": \"110.506649705159\",\n        //         \"repaid_interest\": \"0.046985294841\",\n        //         \"unpaid_interest\": \"0.0000074393366667\"\n        //     }\n        //\n        // Isolated\n        //\n        //     {\n        //         \"id\": \"34267567\",\n        //         \"create_time\": \"1656394778\",\n        //         \"expire_time\": \"1657258778\",\n        //         \"status\": \"loaned\",\n        //         \"side\": \"borrow\",\n        //         \"currency\": \"USDT\",\n        //         \"rate\": \"0.0002\",\n        //         \"amount\": \"100\",\n        //         \"days\": 10,\n        //         \"auto_renew\": false,\n        //         \"currency_pair\": \"LTC_USDT\",\n        //         \"left\": \"0\",\n        //         \"repaid\": \"0\",\n        //         \"paid_interest\": \"0\",\n        //         \"unpaid_interest\": \"0.003333333333\"\n        //     }\n        //\n        const marginMode = this.safeString2 (this.options, 'defaultMarginMode', 'marginMode', 'cross');\n        let timestamp = this.safeInteger (info, 'create_time');\n        if (marginMode === 'isolated') {\n            timestamp = this.safeTimestamp (info, 'create_time');\n        }\n        const currencyId = this.safeString (info, 'currency');\n        const marketId = this.safeString (info, 'currency_pair');\n        return {\n            'id': this.safeInteger (info, 'id'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amount'),\n            'symbol': this.safeSymbol (marketId, undefined, '_', 'margin'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 6969,
        "line_end": 7012,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "total",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeValue (market, 'quote')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"value\": \"11.9257\",\n         \"leverage\": \"5\",\n         \"mode\": \"single\",\n         \"realised_point\": \"0\",\n         \"contract\": \"ETH_USDT\",\n         \"entry_price\": \"1203.45\",\n         \"mark_price\": \"1192.57\",\n         \"history_point\": \"0\",\n         \"realised_pnl\": \"-0.00577656\",\n         \"close_order\": null,\n         \"size\": \"1\",\n         \"cross_leverage_limit\": \"0\",\n         \"pending_orders\": \"0\",\n         \"adl_ranking\": \"5\",\n         \"maintenance_rate\": \"0.005\",\n         \"unrealised_pnl\": \"-0.1088\",\n         \"user\": \"1486602\",\n         \"leverage_max\": \"100\",\n         \"history_pnl\": \"0\",\n         \"risk_limit\": \"1000000\",\n         \"margin\": \"5.415925875\",\n         \"last_close_pnl\": \"0\",\n         \"liq_price\": \"665.69\"\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //     {\n        //         \"value\": \"11.9257\",\n        //         \"leverage\": \"5\",\n        //         \"mode\": \"single\",\n        //         \"realised_point\": \"0\",\n        //         \"contract\": \"ETH_USDT\",\n        //         \"entry_price\": \"1203.45\",\n        //         \"mark_price\": \"1192.57\",\n        //         \"history_point\": \"0\",\n        //         \"realised_pnl\": \"-0.00577656\",\n        //         \"close_order\": null,\n        //         \"size\": \"1\",\n        //         \"cross_leverage_limit\": \"0\",\n        //         \"pending_orders\": \"0\",\n        //         \"adl_ranking\": \"5\",\n        //         \"maintenance_rate\": \"0.005\",\n        //         \"unrealised_pnl\": \"-0.1088\",\n        //         \"user\": \"1486602\",\n        //         \"leverage_max\": \"100\",\n        //         \"history_pnl\": \"0\",\n        //         \"risk_limit\": \"1000000\",\n        //         \"margin\": \"5.415925875\",\n        //         \"last_close_pnl\": \"0\",\n        //         \"liq_price\": \"665.69\"\n        //     }\n        //\n        const contract = this.safeString (data, 'contract');\n        market = this.safeMarket (contract, market, '_', 'contract');\n        const total = this.safeNumber (data, 'margin');\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': total,\n            'code': this.safeValue (market, 'quote'),\n            'status': 'ok',\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 6519,
        "line_end": 6552,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['base']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "maxNotional",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (item, 'maintenance_rate')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (item, 'leverage_max')",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"maintenance_rate\": \"0.004\",\n             \"tier\": 1,\n             \"initial_rate\": \"0.008\",\n             \"leverage_max\": \"125\",\n             \"risk_limit\": \"1000000\"\n         }\n     ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //     [\n        //         {\n        //             \"maintenance_rate\": \"0.004\",\n        //             \"tier\": 1,\n        //             \"initial_rate\": \"0.008\",\n        //             \"leverage_max\": \"125\",\n        //             \"risk_limit\": \"1000000\"\n        //         }\n        //     ]\n        //\n        if (!Array.isArray (info)) {\n            return this.parseEmulatedLeverageTiers (info, market);\n        }\n        let minNotional = 0;\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const item = info[i];\n            const maxNotional = this.safeNumber (item, 'risk_limit');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': market['symbol'],\n                'currency': market['base'],\n                'minNotional': minNotional,\n                'maxNotional': maxNotional,\n                'maintenanceMarginRate': this.safeNumber (item, 'maintenance_rate'),\n                'maxLeverage': this.safeNumber (item, 'leverage_max'),\n                'info': item,\n            });\n            minNotional = maxNotional;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 3480,
        "line_end": 3525,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        \"1660957920\", // timestamp\n        \"6227.070147198573\", // quote volume\n        \"0.0000133485\", // close\n        \"0.0000133615\", // high\n        \"0.0000133347\", // low\n        \"0.0000133468\", // open\n        \"466641934.99\" // base volume\n    ]",
          "{\n          \"t\":1632873600,         // Unix timestamp in seconds\n          \"o\": \"41025\",           // Open price\n          \"h\": \"41882.17\",        // Highest price\n          \"c\": \"41776.92\",        // Close price\n          \"l\": \"40783.94\"         // Lowest price\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // Spot market candles\n        //\n        //    [\n        //        \"1660957920\", // timestamp\n        //        \"6227.070147198573\", // quote volume\n        //        \"0.0000133485\", // close\n        //        \"0.0000133615\", // high\n        //        \"0.0000133347\", // low\n        //        \"0.0000133468\", // open\n        //        \"466641934.99\" // base volume\n        //    ]\n        //\n        //\n        // Swap, Future, Option, Mark and Index price candles\n        //\n        //     {\n        //          \"t\":1632873600,         // Unix timestamp in seconds\n        //          \"o\": \"41025\",           // Open price\n        //          \"h\": \"41882.17\",        // Highest price\n        //          \"c\": \"41776.92\",        // Close price\n        //          \"l\": \"40783.94\"         // Lowest price\n        //     }\n        //\n        if (Array.isArray (ohlcv)) {\n            return [\n                this.safeTimestamp (ohlcv, 0),   // unix timestamp in seconds\n                this.safeNumber (ohlcv, 5),      // open price\n                this.safeNumber (ohlcv, 3),      // highest price\n                this.safeNumber (ohlcv, 4),      // lowest price\n                this.safeNumber (ohlcv, 2),      // close price\n                this.safeNumber (ohlcv, 6),      // trading volume\n            ];\n        } else {\n            // Swap, Future, Option, Mark and Index price candles\n            return [\n                this.safeTimestamp (ohlcv, 't'), // unix timestamp in seconds\n                this.safeNumber (ohlcv, 'o'),    // open price\n                this.safeNumber (ohlcv, 'h'),    // highest price\n                this.safeNumber (ohlcv, 'l'),    // lowest price\n                this.safeNumber (ohlcv, 'c'),    // close price\n                this.safeNumber (ohlcv, 'v'),    // trading volume, undefined for mark or index price\n            ];\n        }\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 7104,
        "line_end": 7132,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber (interest, 'open_interest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "this.safeNumber (interest, 'open_interest_usd')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"long_liq_size\": \"0\",\n        \"short_liq_size\": \"0\",\n        \"short_liq_usd\": \"0\",\n        \"lsr_account\": \"3.2808988764045\",\n        \"mark_price\": \"0.34619\",\n        \"top_lsr_size\": \"0\",\n        \"time\": \"1674057000\",\n        \"short_liq_amount\": \"0\",\n        \"long_liq_amount\": \"0\",\n        \"open_interest_usd\": \"9872386.7775\",\n        \"top_lsr_account\": \"0\",\n        \"open_interest\": \"2851725\",\n        \"long_liq_usd\": \"0\",\n        \"lsr_taker\": \"9.3765153315902\"\n    }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //    {\n        //        \"long_liq_size\": \"0\",\n        //        \"short_liq_size\": \"0\",\n        //        \"short_liq_usd\": \"0\",\n        //        \"lsr_account\": \"3.2808988764045\",\n        //        \"mark_price\": \"0.34619\",\n        //        \"top_lsr_size\": \"0\",\n        //        \"time\": \"1674057000\",\n        //        \"short_liq_amount\": \"0\",\n        //        \"long_liq_amount\": \"0\",\n        //        \"open_interest_usd\": \"9872386.7775\",\n        //        \"top_lsr_account\": \"0\",\n        //        \"open_interest\": \"2851725\",\n        //        \"long_liq_usd\": \"0\",\n        //        \"lsr_taker\": \"9.3765153315902\"\n        //    }\n        //\n        const timestamp = this.safeTimestamp (interest, 'time');\n        return {\n            'symbol': this.safeString (market, 'symbol'),\n            'openInterestAmount': this.safeNumber (interest, 'open_interest'),\n            'openInterestValue': this.safeNumber (interest, 'open_interest_usd'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        };\n    }"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 8237,
        "line_end": 8300,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bid1_price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'ask1_price')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (chain, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'last_price')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'underlying_price')",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"is_active\": true,\n         \"mark_price_round\": \"0.1\",\n         \"settle_fee_rate\": \"0.00015\",\n         \"bid1_size\": 434,\n         \"taker_fee_rate\": \"0.0003\",\n         \"price_limit_fee_rate\": \"0.1\",\n         \"order_price_round\": \"1\",\n         \"tag\": \"day\",\n         \"ref_rebate_rate\": \"0\",\n         \"name\": \"BTC_USDT-20240324-63500-P\",\n         \"strike_price\": \"63500\",\n         \"ask1_price\": \"387\",\n         \"ref_discount_rate\": \"0\",\n         \"order_price_deviate\": \"0.15\",\n         \"ask1_size\": -454,\n         \"mark_price_down\": \"124.3\",\n         \"orderbook_id\": 29600,\n         \"is_call\": false,\n         \"last_price\": \"0\",\n         \"mark_price\": \"366.6\",\n         \"underlying\": \"BTC_USDT\",\n         \"create_time\": 1711118829,\n         \"settle_limit_fee_rate\": \"0.1\",\n         \"orders_limit\": 10,\n         \"mark_price_up\": \"630\",\n         \"position_size\": 0,\n         \"order_size_max\": 10000,\n         \"position_limit\": 10000,\n         \"multiplier\": \"0.01\",\n         \"order_size_min\": 1,\n         \"trade_size\": 0,\n         \"underlying_price\": \"64084.65\",\n         \"maker_fee_rate\": \"0.0003\",\n         \"expiration_time\": 1711267200,\n         \"trade_id\": 0,\n         \"bid1_price\": \"307\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"is_active\": true,\n        //         \"mark_price_round\": \"0.1\",\n        //         \"settle_fee_rate\": \"0.00015\",\n        //         \"bid1_size\": 434,\n        //         \"taker_fee_rate\": \"0.0003\",\n        //         \"price_limit_fee_rate\": \"0.1\",\n        //         \"order_price_round\": \"1\",\n        //         \"tag\": \"day\",\n        //         \"ref_rebate_rate\": \"0\",\n        //         \"name\": \"BTC_USDT-20240324-63500-P\",\n        //         \"strike_price\": \"63500\",\n        //         \"ask1_price\": \"387\",\n        //         \"ref_discount_rate\": \"0\",\n        //         \"order_price_deviate\": \"0.15\",\n        //         \"ask1_size\": -454,\n        //         \"mark_price_down\": \"124.3\",\n        //         \"orderbook_id\": 29600,\n        //         \"is_call\": false,\n        //         \"last_price\": \"0\",\n        //         \"mark_price\": \"366.6\",\n        //         \"underlying\": \"BTC_USDT\",\n        //         \"create_time\": 1711118829,\n        //         \"settle_limit_fee_rate\": \"0.1\",\n        //         \"orders_limit\": 10,\n        //         \"mark_price_up\": \"630\",\n        //         \"position_size\": 0,\n        //         \"order_size_max\": 10000,\n        //         \"position_limit\": 10000,\n        //         \"multiplier\": \"0.01\",\n        //         \"order_size_min\": 1,\n        //         \"trade_size\": 0,\n        //         \"underlying_price\": \"64084.65\",\n        //         \"maker_fee_rate\": \"0.0003\",\n        //         \"expiration_time\": 1711267200,\n        //         \"trade_id\": 0,\n        //         \"bid1_price\": \"307\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'name');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeTimestamp (chain, 'create_time');\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bid1_price'),\n            'askPrice': this.safeNumber (chain, 'ask1_price'),\n            'midPrice': undefined,\n            'markPrice': this.safeNumber (chain, 'mark_price'),\n            'lastPrice': this.safeNumber (chain, 'last_price'),\n            'underlyingPrice': this.safeNumber (chain, 'underlying_price'),\n            'change': undefined,\n            'percentage': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': undefined,\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 4839,
        "line_end": 5147,
        "comment": null,
        "mappings": [
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'text')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeValue (order, 'is_reduce_only')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "Precise.stringAbs (amount)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "Precise.stringAbs (cost)",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "fee",
            "value": "multipleFeeCurrencies ? undefined : this.safeValue (fees, 0)",
            "comment": null
          },
          {
            "key": "fees",
            "value": "multipleFeeCurrencies ? fees : []",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\": \"62364648575\",\n        \"text\": \"apiv4\",\n        \"create_time\": \"1626354834\",\n        \"update_time\": \"1626354834\",\n        \"create_time_ms\": \"1626354833544\",\n        \"update_time_ms\": \"1626354833544\",\n        \"status\": \"open\",\n        \"currency_pair\": \"BTC_USDT\",\n        \"type\": \"limit\",\n        \"account\": \"spot\",\n        \"side\": \"buy\",\n        \"amount\": \"0.0001\",\n        \"price\": \"30000\",\n        \"time_in_force\": \"gtc\",\n        \"iceberg\": \"0\",\n        \"left\": \"0.0001\",\n        \"fill_price\": \"0\",\n        \"filled_total\": \"0\",\n        \"fee\": \"0\",\n        \"fee_currency\": \"BTC\",\n        \"point_fee\": \"0\",\n        \"gt_fee\": \"0\",\n        \"gt_discount\": true,\n        \"rebated_fee\": \"0\",\n        \"rebated_fee_currency\": \"USDT\"\n     }",
          "{\n        \"id\": 12604556\n    }",
          "{\n        \"market\": \"ADA_USDT\",\n        \"user\": 6392049,\n        \"trigger\": {\n            \"price\": \"1.08\", // stopPrice\n            \"rule\": \"\\u003e=\",\n            \"expiration\": 86400\n        },\n        \"put\": {\n            \"type\": \"limit\",\n            \"side\": \"buy\",\n            \"price\": \"1.08\", // order price\n            \"amount\": \"1.00000000000000000000\",\n            \"account\": \"normal\",\n            \"time_in_force\": \"gtc\"\n        },\n        \"id\": 71639298,\n        \"ctime\": 1643945985,\n        \"status\": \"open\"\n    }",
          "{\n        \"id\": 123028481731,\n        \"contract\": \"ADA_USDT\",\n        \"mkfr\": \"-0.00005\",\n        \"tkfr\": \"0.00048\",\n        \"tif\": \"ioc\",\n        \"is_reduce_only\": false,\n        \"create_time\": 1643950262.68,\n        \"finish_time\": 1643950262.68,\n        \"price\": \"0\",\n        \"size\": 1,\n        \"refr\": \"0\",\n        \"left\":0,\n        \"text\": \"api\",\n        \"fill_price\": \"1.05273\",\n        \"user\":6329238,\n        \"finish_as\": \"filled\",\n        \"status\": \"finished\",\n        \"is_liq\": false,\n        \"refu\":0,\n        \"is_close\": false,\n        \"iceberg\": 0\n    }",
          "{\n        \"user\": 6320300,\n        \"trigger\": {\n            \"strategy_type\": 0,\n            \"price_type\": 0,\n            \"price\": \"1.03\", // stopPrice\n            \"rule\": 2,\n            \"expiration\": 0\n        },\n        \"initial\": {\n            \"contract\": \"ADA_USDT\",\n            \"size\": -1,\n            \"price\": \"1.02\",\n            \"tif\": \"gtc\",\n            \"text\": \"\",\n            \"iceberg\": 0,\n            \"is_close\": false,\n            \"is_reduce_only\": false,\n            \"auto_size\": \"\"\n        },\n        \"id\": 126393906,\n        \"trade_id\": 0,\n        \"status\": \"open\",\n        \"reason\": \"\",\n        \"create_time\": 1643953482,\n        \"finish_time\": 1643953482,\n        \"is_stop_order\": false,\n        \"stop_trigger\": {\n            \"rule\": 0,\n            \"trigger_price\": \"\",\n            \"order_price\": \"\"\n        },\n        \"me_order_id\": 0,\n        \"order_type\": \"\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // SPOT\n        // createOrder/cancelOrder/fetchOrder/editOrder\n        //\n        //    {\n        //        \"id\": \"62364648575\",\n        //        \"text\": \"apiv4\",\n        //        \"create_time\": \"1626354834\",\n        //        \"update_time\": \"1626354834\",\n        //        \"create_time_ms\": \"1626354833544\",\n        //        \"update_time_ms\": \"1626354833544\",\n        //        \"status\": \"open\",\n        //        \"currency_pair\": \"BTC_USDT\",\n        //        \"type\": \"limit\",\n        //        \"account\": \"spot\",\n        //        \"side\": \"buy\",\n        //        \"amount\": \"0.0001\",\n        //        \"price\": \"30000\",\n        //        \"time_in_force\": \"gtc\",\n        //        \"iceberg\": \"0\",\n        //        \"left\": \"0.0001\",\n        //        \"fill_price\": \"0\",\n        //        \"filled_total\": \"0\",\n        //        \"fee\": \"0\",\n        //        \"fee_currency\": \"BTC\",\n        //        \"point_fee\": \"0\",\n        //        \"gt_fee\": \"0\",\n        //        \"gt_discount\": true,\n        //        \"rebated_fee\": \"0\",\n        //        \"rebated_fee_currency\": \"USDT\"\n        //     }\n        //\n        // SPOT TRIGGER ORDERS\n        // createOrder\n        //\n        //    {\n        //        \"id\": 12604556\n        //    }\n        //\n        // fetchOrder/cancelOrder\n        //\n        //    {\n        //        \"market\": \"ADA_USDT\",\n        //        \"user\": 6392049,\n        //        \"trigger\": {\n        //            \"price\": \"1.08\", // stopPrice\n        //            \"rule\": \"\\u003e=\",\n        //            \"expiration\": 86400\n        //        },\n        //        \"put\": {\n        //            \"type\": \"limit\",\n        //            \"side\": \"buy\",\n        //            \"price\": \"1.08\", // order price\n        //            \"amount\": \"1.00000000000000000000\",\n        //            \"account\": \"normal\",\n        //            \"time_in_force\": \"gtc\"\n        //        },\n        //        \"id\": 71639298,\n        //        \"ctime\": 1643945985,\n        //        \"status\": \"open\"\n        //    }\n        //\n        // FUTURE, SWAP AND OPTION\n        // createOrder/cancelOrder/fetchOrder\n        //\n        //    {\n        //        \"id\": 123028481731,\n        //        \"contract\": \"ADA_USDT\",\n        //        \"mkfr\": \"-0.00005\",\n        //        \"tkfr\": \"0.00048\",\n        //        \"tif\": \"ioc\",\n        //        \"is_reduce_only\": false,\n        //        \"create_time\": 1643950262.68,\n        //        \"finish_time\": 1643950262.68,\n        //        \"price\": \"0\",\n        //        \"size\": 1,\n        //        \"refr\": \"0\",\n        //        \"left\":0,\n        //        \"text\": \"api\",\n        //        \"fill_price\": \"1.05273\",\n        //        \"user\":6329238,\n        //        \"finish_as\": \"filled\",\n        //        \"status\": \"finished\",\n        //        \"is_liq\": false,\n        //        \"refu\":0,\n        //        \"is_close\": false,\n        //        \"iceberg\": 0\n        //    }\n        //\n        // TRIGGER ORDERS (FUTURE AND SWAP)\n        // createOrder\n        //\n        //    {\n        //        \"id\": 12604556\n        //    }\n        //\n        // fetchOrder/cancelOrder\n        //\n        //    {\n        //        \"user\": 6320300,\n        //        \"trigger\": {\n        //            \"strategy_type\": 0,\n        //            \"price_type\": 0,\n        //            \"price\": \"1.03\", // stopPrice\n        //            \"rule\": 2,\n        //            \"expiration\": 0\n        //        },\n        //        \"initial\": {\n        //            \"contract\": \"ADA_USDT\",\n        //            \"size\": -1,\n        //            \"price\": \"1.02\",\n        //            \"tif\": \"gtc\",\n        //            \"text\": \"\",\n        //            \"iceberg\": 0,\n        //            \"is_close\": false,\n        //            \"is_reduce_only\": false,\n        //            \"auto_size\": \"\"\n        //        },\n        //        \"id\": 126393906,\n        //        \"trade_id\": 0,\n        //        \"status\": \"open\",\n        //        \"reason\": \"\",\n        //        \"create_time\": 1643953482,\n        //        \"finish_time\": 1643953482,\n        //        \"is_stop_order\": false,\n        //        \"stop_trigger\": {\n        //            \"rule\": 0,\n        //            \"trigger_price\": \"\",\n        //            \"order_price\": \"\"\n        //        },\n        //        \"me_order_id\": 0,\n        //        \"order_type\": \"\"\n        //    }\n        //\n        //    {\n        //        \"text\": \"t-d18baf9ac44d82e2\",\n        //        \"succeeded\": false,\n        //        \"label\": \"BALANCE_NOT_ENOUGH\",\n        //        \"message\": \"Not enough balance\"\n        //    }\n        //\n        //  {\"user_id\":10406147,\"id\":\"id\",\"succeeded\":false,\"message\":\"INVALID_PROTOCOL\",\"label\":\"INVALID_PROTOCOL\"}\n        //\n        // cancel trigger order returns timestamps in ms\n        //   id: '2007047737421336576',\n        //   id_string: '2007047737421336576',\n        //   trigger_time: '0',\n        //   trade_id: '0',\n        //   trade_id_string: '',\n        //   status: 'finished',\n        //   finish_as: 'cancelled',\n        //   reason: '',\n        //   create_time: '1767352444402496'\n        //   finish_time: '1767352509535790',\n        //   is_stop_order: false,\n        //   stop_trigger: { rule: '0', trigger_price: '', order_price: '' },\n        //   me_order_id: '0',\n        //   me_order_id_string: '',\n        //   order_type: '',\n        //   in_dual_mode: false,\n        //   parent_id: '0',\n        const succeeded = this.safeBool (order, 'succeeded', true);\n        if (!succeeded) {\n            // cancelOrders response\n            return this.safeOrder ({\n                'clientOrderId': this.safeString (order, 'text'),\n                'info': order,\n                'status': 'rejected',\n                'id': this.safeString (order, 'id'),\n            });\n        }\n        const put = this.safeValue2 (order, 'put', 'initial', {});\n        const trigger = this.safeValue (order, 'trigger', {});\n        let contract = this.safeString (put, 'contract');\n        let type = this.safeString (put, 'type');\n        let timeInForce = this.safeStringUpper2 (put, 'time_in_force', 'tif');\n        let amount = this.safeString2 (put, 'amount', 'size');\n        let side = this.safeString (put, 'side');\n        let price = this.safeString (put, 'price');\n        contract = this.safeString (order, 'contract', contract);\n        type = this.safeString (order, 'type', type);\n        timeInForce = this.safeStringUpper2 (order, 'time_in_force', 'tif', timeInForce);\n        if (timeInForce === 'POC') {\n            timeInForce = 'PO';\n        }\n        const postOnly = (timeInForce === 'PO');\n        amount = this.safeString2 (order, 'amount', 'size', amount);\n        side = this.safeString (order, 'side', side);\n        price = this.safeString (order, 'price', price);\n        let remainingString = this.safeString (order, 'left');\n        let cost = this.safeString (order, 'filled_total');\n        const triggerPrice = this.safeNumber (trigger, 'price');\n        let average = this.safeNumber2 (order, 'avg_deal_price', 'fill_price');\n        if (triggerPrice) {\n            remainingString = amount;\n            cost = '0';\n        }\n        if (contract) {\n            const isMarketOrder = Precise.stringEquals (price, '0') && (timeInForce === 'IOC');\n            type = isMarketOrder ? 'market' : 'limit';\n            side = Precise.stringGt (amount, '0') ? 'buy' : 'sell';\n        }\n        const rawStatus = this.safeStringN (order, [ 'finish_as', 'status', 'open' ]);\n        let timestampStr = this.safeString (order, 'create_time_ms');\n        if (timestampStr === undefined) {\n            timestampStr = this.safeString2 (order, 'create_time', 'ctime');\n            if (timestampStr !== undefined) {\n                if (timestampStr.length === 10 || timestampStr.indexOf ('.') >= 0) {\n                    // ts in seconds, multiply to ms\n                    timestampStr = Precise.stringMul (timestampStr, '1000');\n                } else if (timestampStr.length === 16) {\n                    // ts in microseconds, divide to ms\n                    timestampStr = Precise.stringDiv (timestampStr, '1000');\n                }\n            }\n        }\n        let lastTradeTimestampStr = this.safeString (order, 'update_time_ms');\n        if (lastTradeTimestampStr === undefined) {\n            lastTradeTimestampStr = this.safeString2 (order, 'update_time', 'finish_time');\n            if (lastTradeTimestampStr !== undefined) {\n                if (lastTradeTimestampStr.length === 10 || lastTradeTimestampStr.indexOf ('.') >= 0) {\n                    // ts in seconds, multiply to ms\n                    lastTradeTimestampStr = Precise.stringMul (lastTradeTimestampStr, '1000');\n                } else if (lastTradeTimestampStr.length === 16) {\n                    // ts in microseconds, divide to ms\n                    lastTradeTimestampStr = Precise.stringDiv (lastTradeTimestampStr, '1000');\n                }\n            }\n        }\n        let marketType = 'contract';\n        if (('currency_pair' in order) || ('market' in order)) {\n            marketType = 'spot';\n        }\n        const exchangeSymbol = this.safeString2 (order, 'currency_pair', 'market', contract);\n        const symbol = this.safeSymbol (exchangeSymbol, market, '_', marketType);\n        // Everything below this(above return) is related to fees\n        const fees = [];\n        const gtFee = this.safeString (order, 'gt_fee');\n        if (gtFee !== undefined) {\n            fees.push ({\n                'currency': 'GT',\n                'cost': gtFee,\n            });\n        }\n        const fee = this.safeString (order, 'fee');\n        if (fee !== undefined) {\n            fees.push ({\n                'currency': this.safeCurrencyCode (this.safeString (order, 'fee_currency')),\n                'cost': fee,\n            });\n        }\n        const rebate = this.safeString (order, 'rebated_fee');\n        if (rebate !== undefined) {\n            fees.push ({\n                'currency': this.safeCurrencyCode (this.safeString (order, 'rebated_fee_currency')),\n                'cost': Precise.stringNeg (rebate),\n            });\n        }\n        const numFeeCurrencies = fees.length;\n        const multipleFeeCurrencies = numFeeCurrencies > 1;\n        const status = this.parseOrderStatus (rawStatus);\n        let remaining = Precise.stringAbs (remainingString);\n        // handle spot market buy\n        const account = this.safeString (order, 'account'); // using this instead of market type because of the conflicting ids\n        if (account === 'spot') {\n            const averageString = this.safeString (order, 'avg_deal_price');\n            average = this.parseNumber (averageString);\n            if ((type === 'market') && (side === 'buy')) {\n                remaining = Precise.stringDiv (remainingString, averageString);\n                price = undefined; // arrives as 0\n                cost = amount;\n                amount = Precise.stringDiv (amount, averageString);\n            }\n        }\n        let timestamp = undefined;\n        let lastTradeTimestamp = undefined;\n        if (timestampStr !== undefined) {\n            timestamp = this.parseToInt (timestampStr);\n        }\n        if (lastTradeTimestampStr !== undefined) {\n            lastTradeTimestamp = this.parseToInt (lastTradeTimestampStr);\n        }\n        return this.safeOrder ({\n            'id': this.safeString (order, 'id'),\n            'clientOrderId': this.safeString (order, 'text'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeValue (order, 'is_reduce_only'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'average': average,\n            'amount': Precise.stringAbs (amount),\n            'cost': Precise.stringAbs (cost),\n            'filled': undefined,\n            'remaining': remaining,\n            'fee': multipleFeeCurrencies ? undefined : this.safeValue (fees, 0),\n            'fees': multipleFeeCurrencies ? fees : [],\n            'trades': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 4822,
        "line_end": 4837,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'open': 'open',\n            '_new': 'open',\n            'filled': 'closed',\n            'cancelled': 'canceled',\n            'liquidated': 'closed',\n            'ioc': 'canceled',\n            'failed': 'canceled',\n            'expired': 'canceled',\n            'finished': 'closed',\n            'finish': 'closed',\n            'succeeded': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 5999,
        "line_end": 6139,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeTimestamp2 (position, 'update_time', 'time')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (Precise.stringDiv (initialMarginString, notional))",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (Precise.stringMul (maintenanceRate, notional))",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceRate)",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entry_price')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealised_pnl')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber2 (position, 'realised_pnl', 'pnl')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (Precise.stringAbs (size))",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liq_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'margin')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"value\": \"4.60516\",\n         \"leverage\": \"0\",\n         \"mode\": \"single\",\n         \"realised_point\": \"0\",\n         \"contract\": \"BTC_USDT\",\n         \"entry_price\": \"46030.3\",\n         \"mark_price\": \"46051.6\",\n         \"history_point\": \"0\",\n         \"realised_pnl\": \"-0.002301515\",\n         \"close_order\": null,\n         \"size\": 1,\n         \"cross_leverage_limit\": \"0\",\n         \"pending_orders\": 0,\n         \"adl_ranking\": 5,\n         \"maintenance_rate\": \"0.004\",\n         \"unrealised_pnl\": \"0.00213\",\n         \"user\": 5691076,\n         \"leverage_max\": \"125\",\n         \"history_pnl\": \"0\",\n         \"risk_limit\": \"1000000\",\n         \"margin\": \"8.997698485\",\n         \"last_close_pnl\": \"0\",\n         \"liq_price\": \"0\",\n         \"update_time\": 1705034246,\n         \"update_id\": 1,\n         \"initial_margin\": \"0\",\n         \"maintenance_margin\": \"0\",\n         \"open_time\": 1705034246,\n         \"trade_max_size\": \"0\"\n     }",
          "{\n         \"close_order\": null,\n         \"size\": 1,\n         \"vega\": \"5.29756\",\n         \"theta\": \"-98.98917\",\n         \"gamma\": \"0.00056\",\n         \"delta\": \"0.68691\",\n         \"contract\": \"BTC_USDT-20230602-26500-C\",\n         \"entry_price\": \"529\",\n         \"unrealised_pnl\": \"-1.0131\",\n         \"user\": 5691076,\n         \"mark_price\": \"427.69\",\n         \"underlying_price\": \"26810.2\",\n         \"underlying\": \"BTC_USDT\",\n         \"realised_pnl\": \"-0.08042877\",\n         \"mark_iv\": \"0.4224\",\n         \"pending_orders\": 0\n     }",
          "{\n        \"contract\": \"SLERF_USDT\",         // Futures contract\n        \"text\": \"web\",                    // Text of close order\n        \"long_price\": \"0.766306\",         // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price.\n        \"pnl\": \"-23.41702352\",            // PNL\n        \"pnl_pnl\": \"-22.7187\",            // Position P/L\n        \"pnl_fee\": \"-0.06527125\",         // Transaction Fees\n        \"pnl_fund\": \"-0.63305227\",        // Funding Fees\n        \"accum_size\": \"100\",\n        \"time\": 1711279263,               // Position close time\n        \"short_price\": \"0.539119\",        // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price\n        \"side\": \"long\",                   // Position side, long or short\n        \"max_size\": \"100\",                // Max Trade Size\n        \"first_open_time\": 1711037985     // First Open Time\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // swap and future\n        //\n        //     {\n        //         \"value\": \"4.60516\",\n        //         \"leverage\": \"0\",\n        //         \"mode\": \"single\",\n        //         \"realised_point\": \"0\",\n        //         \"contract\": \"BTC_USDT\",\n        //         \"entry_price\": \"46030.3\",\n        //         \"mark_price\": \"46051.6\",\n        //         \"history_point\": \"0\",\n        //         \"realised_pnl\": \"-0.002301515\",\n        //         \"close_order\": null,\n        //         \"size\": 1,\n        //         \"cross_leverage_limit\": \"0\",\n        //         \"pending_orders\": 0,\n        //         \"adl_ranking\": 5,\n        //         \"maintenance_rate\": \"0.004\",\n        //         \"unrealised_pnl\": \"0.00213\",\n        //         \"user\": 5691076,\n        //         \"leverage_max\": \"125\",\n        //         \"history_pnl\": \"0\",\n        //         \"risk_limit\": \"1000000\",\n        //         \"margin\": \"8.997698485\",\n        //         \"last_close_pnl\": \"0\",\n        //         \"liq_price\": \"0\",\n        //         \"update_time\": 1705034246,\n        //         \"update_id\": 1,\n        //         \"initial_margin\": \"0\",\n        //         \"maintenance_margin\": \"0\",\n        //         \"open_time\": 1705034246,\n        //         \"trade_max_size\": \"0\"\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"close_order\": null,\n        //         \"size\": 1,\n        //         \"vega\": \"5.29756\",\n        //         \"theta\": \"-98.98917\",\n        //         \"gamma\": \"0.00056\",\n        //         \"delta\": \"0.68691\",\n        //         \"contract\": \"BTC_USDT-20230602-26500-C\",\n        //         \"entry_price\": \"529\",\n        //         \"unrealised_pnl\": \"-1.0131\",\n        //         \"user\": 5691076,\n        //         \"mark_price\": \"427.69\",\n        //         \"underlying_price\": \"26810.2\",\n        //         \"underlying\": \"BTC_USDT\",\n        //         \"realised_pnl\": \"-0.08042877\",\n        //         \"mark_iv\": \"0.4224\",\n        //         \"pending_orders\": 0\n        //     }\n        //\n        // fetchPositionsHistory (swap and future)\n        //\n        //    {\n        //        \"contract\": \"SLERF_USDT\",         // Futures contract\n        //        \"text\": \"web\",                    // Text of close order\n        //        \"long_price\": \"0.766306\",         // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price.\n        //        \"pnl\": \"-23.41702352\",            // PNL\n        //        \"pnl_pnl\": \"-22.7187\",            // Position P/L\n        //        \"pnl_fee\": \"-0.06527125\",         // Transaction Fees\n        //        \"pnl_fund\": \"-0.63305227\",        // Funding Fees\n        //        \"accum_size\": \"100\",\n        //        \"time\": 1711279263,               // Position close time\n        //        \"short_price\": \"0.539119\",        // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price\n        //        \"side\": \"long\",                   // Position side, long or short\n        //        \"max_size\": \"100\",                // Max Trade Size\n        //        \"first_open_time\": 1711037985     // First Open Time\n        //    }\n        //\n        const contract = this.safeString (position, 'contract');\n        market = this.safeMarket (contract, market, '_', 'contract');\n        const size = this.safeString2 (position, 'size', 'accum_size');\n        let side = this.safeString (position, 'side');\n        if (side === undefined) {\n            if (Precise.stringGt (size, '0')) {\n                side = 'long';\n            } else if (Precise.stringLt (size, '0')) {\n                side = 'short';\n            }\n        }\n        const maintenanceRate = this.safeString (position, 'maintenance_rate');\n        const notional = this.safeString (position, 'value');\n        const leverage = this.safeString (position, 'leverage');\n        let marginMode = undefined;\n        if (leverage !== undefined) {\n            if (leverage === '0') {\n                marginMode = 'cross';\n            } else {\n                marginMode = 'isolated';\n            }\n        }\n        // Initial Position Margin = ( Position Value / Leverage ) + Close Position Fee\n        // *The default leverage under the full position is the highest leverage in the market.\n        // *Trading fee is charged as Taker Fee Rate (0.075%).\n        let feePaid = this.safeString (position, 'pnl_fee');\n        let initialMarginString = undefined;\n        if (feePaid === undefined) {\n            const takerFee = '0.00075';\n            feePaid = Precise.stringMul (takerFee, notional);\n            initialMarginString = Precise.stringAdd (Precise.stringDiv (notional, leverage), feePaid);\n        }\n        let timestamp = this.safeTimestamp2 (position, 'open_time', 'first_open_time');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeTimestamp2 (position, 'update_time', 'time'),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (Precise.stringDiv (initialMarginString, notional)),\n            'maintenanceMargin': this.parseNumber (Precise.stringMul (maintenanceRate, notional)),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceRate),\n            'entryPrice': this.safeNumber (position, 'entry_price'),\n            'notional': this.parseNumber (notional),\n            'leverage': this.safeNumber (position, 'leverage'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealised_pnl'),\n            'realizedPnl': this.safeNumber2 (position, 'realised_pnl', 'pnl'),\n            'contracts': this.parseNumber (Precise.stringAbs (size)),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liq_price'),\n            'markPrice': this.safeNumber (position, 'mark_price'),\n            'lastPrice': undefined,\n            'collateral': this.safeNumber (position, 'margin'),\n            'marginMode': marginMode,\n            'side': side,\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 7242,
        "line_end": 7278,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'settle_price')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": 1685952000,\n         \"profit\": \"18.266806892718\",\n         \"settle_price\": \"26826.68068927182\",\n         \"fee\": \"0.040240021034\",\n         \"contract\": \"BTC_USDT-20230605-25000-C\",\n         \"strike_price\": \"25000\"\n     }",
          "{\n         \"size\": -1,\n         \"settle_profit\": \"0\",\n         \"contract\": \"BTC_USDT-20220624-26000-C\",\n         \"strike_price\": \"26000\",\n         \"time\": 1656057600,\n         \"settle_price\": \"20917.461281337048\",\n         \"underlying\": \"BTC_USDT\",\n         \"realised_pnl\": \"-0.00116042\",\n         \"fee\": \"0\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"time\": 1685952000,\n        //         \"profit\": \"18.266806892718\",\n        //         \"settle_price\": \"26826.68068927182\",\n        //         \"fee\": \"0.040240021034\",\n        //         \"contract\": \"BTC_USDT-20230605-25000-C\",\n        //         \"strike_price\": \"25000\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"size\": -1,\n        //         \"settle_profit\": \"0\",\n        //         \"contract\": \"BTC_USDT-20220624-26000-C\",\n        //         \"strike_price\": \"26000\",\n        //         \"time\": 1656057600,\n        //         \"settle_price\": \"20917.461281337048\",\n        //         \"underlying\": \"BTC_USDT\",\n        //         \"realised_pnl\": \"-0.00116042\",\n        //         \"fee\": \"0\"\n        //     }\n        //\n        const timestamp = this.safeTimestamp (settlement, 'time');\n        const marketId = this.safeString (settlement, 'contract');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'settle_price'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 7280,
        "line_end": 7316,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"time\": 1685952000,\n             \"profit\": \"18.266806892718\",\n             \"settle_price\": \"26826.68068927182\",\n             \"fee\": \"0.040240021034\",\n             \"contract\": \"BTC_USDT-20230605-25000-C\",\n             \"strike_price\": \"25000\"\n         }\n     ]",
          "[\n         {\n             \"size\": -1,\n             \"settle_profit\": \"0\",\n             \"contract\": \"BTC_USDT-20220624-26000-C\",\n             \"strike_price\": \"26000\",\n             \"time\": 1656057600,\n             \"settle_price\": \"20917.461281337048\",\n             \"underlying\": \"BTC_USDT\",\n             \"realised_pnl\": \"-0.00116042\",\n             \"fee\": \"0\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"time\": 1685952000,\n        //             \"profit\": \"18.266806892718\",\n        //             \"settle_price\": \"26826.68068927182\",\n        //             \"fee\": \"0.040240021034\",\n        //             \"contract\": \"BTC_USDT-20230605-25000-C\",\n        //             \"strike_price\": \"25000\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"size\": -1,\n        //             \"settle_profit\": \"0\",\n        //             \"contract\": \"BTC_USDT-20220624-26000-C\",\n        //             \"strike_price\": \"26000\",\n        //             \"time\": 1656057600,\n        //             \"settle_price\": \"20917.461281337048\",\n        //             \"underlying\": \"BTC_USDT\",\n        //             \"realised_pnl\": \"-0.00116042\",\n        //             \"fee\": \"0\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2869,
        "line_end": 2982,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'index_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency_pair\": \"KFC_USDT\",\n         \"last\": \"7.255\",\n         \"lowest_ask\": \"7.298\",\n         \"highest_bid\": \"7.218\",\n         \"change_percentage\": \"-1.18\",\n         \"base_volume\": \"1219.053687865\",\n         \"quote_volume\": \"8807.40299875455\",\n         \"high_24h\": \"7.262\",\n         \"low_24h\": \"7.095\"\n     }",
          "{\n         \"contract\": \"BTC_USDT\",\n         \"last\": \"6432\",\n         \"low_24h\": \"6278\",\n         \"high_24h\": \"6790\",\n         \"change_percentage\": \"4.43\",\n         \"total_size\": \"32323904\",\n         \"volume_24h\": \"184040233284\",\n         \"volume_24h_btc\": \"28613220\",\n         \"volume_24h_usd\": \"184040233284\",\n         \"volume_24h_base\": \"28613220\",\n         \"volume_24h_quote\": \"184040233284\",\n         \"volume_24h_settle\": \"28613220\",\n         \"mark_price\": \"6534\",\n         \"funding_rate\": \"0.0001\",\n         \"funding_rate_indicative\": \"0.0001\",\n         \"index_price\": \"6531\"\n     }",
          "{\n        \"t\": 1671363004228,\n        \"u\": 9793320464,\n        \"s\": \"BTC_USDT\",\n        \"b\": \"16716.8\", // best bid price\n        \"B\": \"0.0134\", // best bid size\n        \"a\": \"16716.9\", // best ask price\n        \"A\": \"0.0353\" // best ask size\n     }",
          "{\n         \"vega\": \"0.00002\",\n         \"leverage\": \"12.277188268663\",\n         \"ask_iv\": \"0\",\n         \"delta\": \"-0.99999\",\n         \"last_price\": \"0\",\n         \"theta\": \"-0.00661\",\n         \"bid1_price\": \"1096\",\n         \"mark_iv\": \"0.7799\",\n         \"name\": \"BTC_USDT-20230608-28500-P\",\n         \"bid_iv\": \"0\",\n         \"ask1_price\": \"2935\",\n         \"mark_price\": \"2147.3\",\n         \"position_size\": 0,\n         \"bid1_size\": 12,\n         \"ask1_size\": -14,\n         \"gamma\": \"0\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // SPOT\n        //\n        //     {\n        //         \"currency_pair\": \"KFC_USDT\",\n        //         \"last\": \"7.255\",\n        //         \"lowest_ask\": \"7.298\",\n        //         \"highest_bid\": \"7.218\",\n        //         \"change_percentage\": \"-1.18\",\n        //         \"base_volume\": \"1219.053687865\",\n        //         \"quote_volume\": \"8807.40299875455\",\n        //         \"high_24h\": \"7.262\",\n        //         \"low_24h\": \"7.095\"\n        //     }\n        //\n        // LINEAR/DELIVERY\n        //\n        //     {\n        //         \"contract\": \"BTC_USDT\",\n        //         \"last\": \"6432\",\n        //         \"low_24h\": \"6278\",\n        //         \"high_24h\": \"6790\",\n        //         \"change_percentage\": \"4.43\",\n        //         \"total_size\": \"32323904\",\n        //         \"volume_24h\": \"184040233284\",\n        //         \"volume_24h_btc\": \"28613220\",\n        //         \"volume_24h_usd\": \"184040233284\",\n        //         \"volume_24h_base\": \"28613220\",\n        //         \"volume_24h_quote\": \"184040233284\",\n        //         \"volume_24h_settle\": \"28613220\",\n        //         \"mark_price\": \"6534\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"funding_rate_indicative\": \"0.0001\",\n        //         \"index_price\": \"6531\"\n        //     }\n        //\n        // bookTicker\n        //    {\n        //        \"t\": 1671363004228,\n        //        \"u\": 9793320464,\n        //        \"s\": \"BTC_USDT\",\n        //        \"b\": \"16716.8\", // best bid price\n        //        \"B\": \"0.0134\", // best bid size\n        //        \"a\": \"16716.9\", // best ask price\n        //        \"A\": \"0.0353\" // best ask size\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"vega\": \"0.00002\",\n        //         \"leverage\": \"12.277188268663\",\n        //         \"ask_iv\": \"0\",\n        //         \"delta\": \"-0.99999\",\n        //         \"last_price\": \"0\",\n        //         \"theta\": \"-0.00661\",\n        //         \"bid1_price\": \"1096\",\n        //         \"mark_iv\": \"0.7799\",\n        //         \"name\": \"BTC_USDT-20230608-28500-P\",\n        //         \"bid_iv\": \"0\",\n        //         \"ask1_price\": \"2935\",\n        //         \"mark_price\": \"2147.3\",\n        //         \"position_size\": 0,\n        //         \"bid1_size\": 12,\n        //         \"ask1_size\": -14,\n        //         \"gamma\": \"0\"\n        //     }\n        //\n        const marketId = this.safeStringN (ticker, [ 'currency_pair', 'contract', 'name' ]);\n        const marketType = ('mark_price' in ticker) ? 'contract' : 'spot';\n        const symbol = this.safeSymbol (marketId, market, '_', marketType);\n        const last = this.safeString2 (ticker, 'last', 'last_price');\n        const ask = this.safeStringN (ticker, [ 'lowest_ask', 'a', 'ask1_price' ]);\n        const bid = this.safeStringN (ticker, [ 'highest_bid', 'b', 'bid1_price' ]);\n        const high = this.safeString (ticker, 'high_24h');\n        const low = this.safeString (ticker, 'low_24h');\n        const bidVolume = this.safeString2 (ticker, 'B', 'bid1_size');\n        const askVolume = this.safeString2 (ticker, 'A', 'ask1_size');\n        const timestamp = this.safeInteger (ticker, 't');\n        let baseVolume = this.safeString2 (ticker, 'base_volume', 'volume_24h_base');\n        if (baseVolume === 'nan') {\n            baseVolume = '0';\n        }\n        let quoteVolume = this.safeString2 (ticker, 'quote_volume', 'volume_24h_quote');\n        if (quoteVolume === 'nan') {\n            quoteVolume = '0';\n        }\n        const percentage = this.safeString (ticker, 'change_percentage');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'indexPrice': this.safeString (ticker, 'index_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 3823,
        "line_end": 3988,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fees",
            "value": "fees",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeAmount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1334253759\",\n         \"create_time\": \"1626342738\",\n         \"create_time_ms\": \"1626342738331.497000\",\n         \"currency_pair\": \"BTC_USDT\",\n         \"side\": \"sell\",\n         \"amount\": \"0.0022\",\n         \"price\": \"32452.16\"\n     }",
          "{\n        \"id\": \"442288327\",\n        \"contract\": \"BTC_USDT\",\n        \"create_time\": \"1739814676.707\",\n        \"create_time_ms\": \"1739814676.707\",\n        \"size\": \"-105\",\n        \"price\": \"95594.8\"\n    }",
          "{\n         \"id\": 221994511,\n         \"time\": 1580311438.618647,\n         \"price\": \"9309\",\n         \"amount\": \"0.0019\",\n         \"type\": \"sell\"\n     }",
          "{\n         \"id\": \"2876130500\",\n         \"create_time\": \"1645464610\",\n         \"create_time_ms\": \"1645464610777.399200\",\n         \"currency_pair\": \"DOGE_USDT\",\n         \"side\": \"sell\",\n         \"role\": \"taker\",\n         \"amount\": \"10.97\",\n         \"price\": \"0.137384\",\n         \"order_id\": \"125924049993\",\n         \"fee\": \"0.00301420496\",\n         \"fee_currency\": \"USDT\",\n         \"point_fee\": \"1.1\",\n         \"gt_fee\":\"2.2\"\n     }",
          "{\n         \"size\": -5,\n         \"order_id\": \"130264979823\",\n         \"id\": 26884791,\n         \"role\": \"taker\",\n         \"create_time\": 1645465199.5472,\n         \"contract\": \"DOGE_USDT\",\n         \"price\": \"0.136888\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public\n        //\n        //  spot:\n        //     {\n        //         \"id\": \"1334253759\",\n        //         \"create_time\": \"1626342738\",\n        //         \"create_time_ms\": \"1626342738331.497000\",\n        //         \"currency_pair\": \"BTC_USDT\",\n        //         \"side\": \"sell\",\n        //         \"amount\": \"0.0022\",\n        //         \"price\": \"32452.16\"\n        //     }\n        //\n        //  swap:\n        //\n        //    {\n        //        \"id\": \"442288327\",\n        //        \"contract\": \"BTC_USDT\",\n        //        \"create_time\": \"1739814676.707\",\n        //        \"create_time_ms\": \"1739814676.707\",\n        //        \"size\": \"-105\",\n        //        \"price\": \"95594.8\"\n        //    }\n        //\n        //\n        // public ws\n        //\n        //     {\n        //         \"id\": 221994511,\n        //         \"time\": 1580311438.618647,\n        //         \"price\": \"9309\",\n        //         \"amount\": \"0.0019\",\n        //         \"type\": \"sell\"\n        //     }\n        //\n        // spot rest\n        //\n        //     {\n        //         \"id\": \"2876130500\",\n        //         \"create_time\": \"1645464610\",\n        //         \"create_time_ms\": \"1645464610777.399200\",\n        //         \"currency_pair\": \"DOGE_USDT\",\n        //         \"side\": \"sell\",\n        //         \"role\": \"taker\",\n        //         \"amount\": \"10.97\",\n        //         \"price\": \"0.137384\",\n        //         \"order_id\": \"125924049993\",\n        //         \"fee\": \"0.00301420496\",\n        //         \"fee_currency\": \"USDT\",\n        //         \"point_fee\": \"1.1\",\n        //         \"gt_fee\":\"2.2\"\n        //     }\n        //\n        // perpetual swap rest\n        //\n        //     {\n        //         \"size\": -5,\n        //         \"order_id\": \"130264979823\",\n        //         \"id\": 26884791,\n        //         \"role\": \"taker\",\n        //         \"create_time\": 1645465199.5472,\n        //         \"contract\": \"DOGE_USDT\",\n        //         \"price\": \"0.136888\"\n        //     }\n        //\n        // future rest\n        //\n        //     {\n        //         \"id\": 121234231,\n        //         \"create_time\": 1514764800.123,\n        //         \"contract\": \"BTC_USDT\",\n        //         \"order_id\": \"21893289839\",\n        //         \"size\": 100,\n        //         \"price\": \"100.123\",\n        //         \"role\": \"taker\"\n        //     }\n        //\n        // fetchTrades: option\n        //\n        //     {\n        //         \"size\": -5,\n        //         \"id\": 25,\n        //         \"create_time\": 1682378573,\n        //         \"contract\": \"ETH_USDT-20230526-2000-P\",\n        //         \"price\": \"209.1\"\n        //     }\n        //\n        // fetchMyTrades: option\n        //\n        //     {\n        //         \"underlying_price\": \"26817.84\",\n        //         \"size\": -1,\n        //         \"contract\": \"BTC_USDT-20230602-26500-C\",\n        //         \"id\": 16,\n        //         \"role\": \"taker\",\n        //         \"create_time\": 1685594770,\n        //         \"order_id\": 2611026125,\n        //         \"price\": \"333\"\n        //     }\n        //\n        const id = this.safeString2 (trade, 'id', 'trade_id');\n        let timestamp: Int = undefined;\n        let msString = this.safeString (trade, 'create_time_ms');\n        if (msString !== undefined) {\n            msString = Precise.stringMul (msString, '1000');\n            msString = msString.slice (0, 13);\n            timestamp = this.parseToInt (msString);\n        } else {\n            timestamp = this.safeTimestamp2 (trade, 'time', 'create_time');\n        }\n        const marketId = this.safeString2 (trade, 'currency_pair', 'contract');\n        const marketType = ('contract' in trade) ? 'contract' : 'spot';\n        market = this.safeMarket (marketId, market, '_', marketType);\n        let amountString = this.safeString2 (trade, 'amount', 'size');\n        const priceString = this.safeString (trade, 'price');\n        const contractSide = Precise.stringLt (amountString, '0') ? 'sell' : 'buy';\n        amountString = Precise.stringAbs (amountString);\n        const side = this.safeString2 (trade, 'side', 'type', contractSide);\n        const orderId = this.safeString (trade, 'order_id');\n        const feeAmount = this.safeString (trade, 'fee');\n        const gtFee = this.omitZero (this.safeString (trade, 'gt_fee'));\n        const pointFee = this.omitZero (this.safeString (trade, 'point_fee'));\n        const fees = [];\n        if (feeAmount !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fee_currency');\n            let feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            if (feeCurrencyCode === undefined) {\n                feeCurrencyCode = this.safeString (market, 'settle');\n            }\n            fees.push ({\n                'cost': feeAmount,\n                'currency': feeCurrencyCode,\n            });\n        }\n        if (gtFee !== undefined) {\n            fees.push ({\n                'cost': gtFee,\n                'currency': 'GT',\n            });\n        }\n        if (pointFee !== undefined) {\n            fees.push ({\n                'cost': pointFee,\n                'currency': 'GATEPOINT',\n            });\n        }\n        const takerOrMaker = this.safeString (trade, 'role');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n            'fees': fees,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (info, market: Market = undefined)",
        "line_start": 2437,
        "line_end": 2466,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (info, makerKey)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (info, takerKey)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"user_id\": 1486602,\n        \"taker_fee\": \"0.002\",\n        \"maker_fee\": \"0.002\",\n        \"gt_discount\": true,\n        \"gt_taker_fee\": \"0.0015\",\n        \"gt_maker_fee\": \"0.0015\",\n        \"loan_fee\": \"0.18\",\n        \"point_type\": \"0\",\n        \"futures_taker_fee\": \"0.0005\",\n        \"futures_maker_fee\": \"0\"\n    }"
        ],
        "source": "parseTradingFee (info, market: Market = undefined) {\n        //\n        //    {\n        //        \"user_id\": 1486602,\n        //        \"taker_fee\": \"0.002\",\n        //        \"maker_fee\": \"0.002\",\n        //        \"gt_discount\": true,\n        //        \"gt_taker_fee\": \"0.0015\",\n        //        \"gt_maker_fee\": \"0.0015\",\n        //        \"loan_fee\": \"0.18\",\n        //        \"point_type\": \"0\",\n        //        \"futures_taker_fee\": \"0.0005\",\n        //        \"futures_maker_fee\": \"0\"\n        //    }\n        //\n        const gtDiscount = this.safeValue (info, 'gt_discount');\n        const taker = gtDiscount ? 'gt_taker_fee' : 'taker_fee';\n        const maker = gtDiscount ? 'gt_maker_fee' : 'maker_fee';\n        const contract = this.safeValue (market, 'contract');\n        const takerKey = contract ? 'futures_taker_fee' : taker;\n        const makerKey = contract ? 'futures_maker_fee' : maker;\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'maker': this.safeNumber (info, makerKey),\n            'taker': this.safeNumber (info, takerKey),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTradingFees",
        "signature": "parseTradingFees (response)",
        "line_start": 2427,
        "line_end": 2435,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingFees (response) {\n        const result: Dict = {};\n        for (let i = 0; i < this.symbols.length; i++) {\n            const symbol = this.symbols[i];\n            const market = this.market (symbol);\n            result[symbol] = this.parseTradingFee (response, market);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4138,
        "line_end": 4249,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"d33361395\",\n         \"currency\": \"USDT_TRX\",\n         \"address\": \"TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z\",\n         \"amount\": \"100\",\n         \"txid\": \"ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0\",\n         \"timestamp\": \"1626345819\",\n         \"status\": \"DONE\",\n         \"memo\": \"\"\n     }",
          "{\n         \"id\":\"w64413318\",\n         \"currency\":\"usdt\",\n         \"amount\":\"10150\",\n         \"address\":\"0x0ab891497116f7f5532a4c2f4f7b1784488628e1\",\n         \"memo\":null,\n         \"status\":\"REQUEST\",\n         \"chain\":\"eth\",\n         \"withdraw_order_id\":\"\",\n         \"fee_amount\":\"4.15000000\"\n     }",
          "{\n         \"id\": \"210496\",\n         \"timestamp\": \"1542000000\",\n         \"withdraw_order_id\": \"order_123456\",\n         \"currency\": \"USDT\",\n         \"address\": \"1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs\",\n         \"txid\": \"128988928203223323290\",\n         \"block_number\": \"41575382\",\n         \"amount\": \"222.61\",\n         \"fee\": \"0.01\",\n         \"memo\": \"\",\n         \"status\": \"DONE\",\n         \"chain\": \"TRX\"\n     }",
          "{\n         \"id\": \"w13389675\",\n         \"currency\": \"USDT\",\n         \"amount\": \"50\",\n         \"address\": \"TUu2rLFrmzUodiWfYki7QCNtv1akL682p1\",\n         \"memo\": null\n     }",
          "{\n         \"currency\":\"usdt\",\n         \"address\":\"0x01c0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806\",\n         \"amount\":\"1880\",\n         \"chain\":\"eth\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": \"d33361395\",\n        //         \"currency\": \"USDT_TRX\",\n        //         \"address\": \"TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z\",\n        //         \"amount\": \"100\",\n        //         \"txid\": \"ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0\",\n        //         \"timestamp\": \"1626345819\",\n        //         \"status\": \"DONE\",\n        //         \"memo\": \"\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\":\"w64413318\",\n        //         \"currency\":\"usdt\",\n        //         \"amount\":\"10150\",\n        //         \"address\":\"0x0ab891497116f7f5532a4c2f4f7b1784488628e1\",\n        //         \"memo\":null,\n        //         \"status\":\"REQUEST\",\n        //         \"chain\":\"eth\",\n        //         \"withdraw_order_id\":\"\",\n        //         \"fee_amount\":\"4.15000000\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"210496\",\n        //         \"timestamp\": \"1542000000\",\n        //         \"withdraw_order_id\": \"order_123456\",\n        //         \"currency\": \"USDT\",\n        //         \"address\": \"1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs\",\n        //         \"txid\": \"128988928203223323290\",\n        //         \"block_number\": \"41575382\",\n        //         \"amount\": \"222.61\",\n        //         \"fee\": \"0.01\",\n        //         \"memo\": \"\",\n        //         \"status\": \"DONE\",\n        //         \"chain\": \"TRX\"\n        //     }\n        //\n        //     {\n        //         \"id\": \"w13389675\",\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"50\",\n        //         \"address\": \"TUu2rLFrmzUodiWfYki7QCNtv1akL682p1\",\n        //         \"memo\": null\n        //     }\n        //\n        //     {\n        //         \"currency\":\"usdt\",\n        //         \"address\":\"0x01c0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806\",\n        //         \"amount\":\"1880\",\n        //         \"chain\":\"eth\"\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        let type = undefined;\n        let amountString = this.safeString (transaction, 'amount');\n        if (id !== undefined) {\n            if (id[0] === 'b') {\n                // GateCode handling\n                type = Precise.stringGt (amountString, '0') ? 'deposit' : 'withdrawal';\n                amountString = Precise.stringAbs (amountString);\n            } else {\n                type = this.parseTransactionType (id[0]);\n            }\n        }\n        const feeCostString = this.safeString2 (transaction, 'fee', 'fee_amount');\n        if (type === 'withdrawal') {\n            amountString = Precise.stringSub (amountString, feeCostString);\n        }\n        const networkId = this.safeStringUpper (transaction, 'chain');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const txid = this.safeString (transaction, 'txid');\n        const rawStatus = this.safeString (transaction, 'status');\n        const status = this.parseTransactionStatus (rawStatus);\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'memo');\n        const timestamp = this.safeTimestamp (transaction, 'timestamp');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'currency': code,\n            'amount': this.parseNumber (amountString),\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'status': status,\n            'type': type,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 4111,
        "line_end": 4128,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'PEND': 'pending',\n            'REQUEST': 'pending',\n            'DMOVE': 'pending',\n            'MANUAL': 'pending',\n            'VERIFY': 'pending',\n            'PROCES': 'pending',\n            'EXTPEND': 'pending',\n            'SPLITPEND': 'pending',\n            'CANCEL': 'canceled',\n            'FAIL': 'failed',\n            'INVALID': 'failed',\n            'DONE': 'ok',\n            'BCODE': 'ok', // GateCode withdrawal\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 4130,
        "line_end": 4136,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'd': 'deposit',\n            'w': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 5901,
        "line_end": 5922,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'tx_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\": \"BTC\",\n        \"from\": \"spot\",\n        \"to\": \"margin\",\n        \"amount\": \"1\",\n        \"currency_pair\": \"BTC_USDT\"\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    {\n        //        \"currency\": \"BTC\",\n        //        \"from\": \"spot\",\n        //        \"to\": \"margin\",\n        //        \"amount\": \"1\",\n        //        \"currency_pair\": \"BTC_USDT\"\n        //    }\n        //\n        return {\n            'id': this.safeString (transfer, 'tx_id'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n            'info': transfer,\n        };\n    }"
      }
    ],
    "gateio": [
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3026,
        "line_end": 3035,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString2 (entry, 'freeze', 'locked');\n        account['free'] = this.safeString (entry, 'available');\n        account['total'] = this.safeString (entry, 'total');\n        if ('borrowed' in entry) {\n            account['debt'] = this.safeString (entry, 'borrowed');\n        }\n        return account;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 6837,
        "line_end": 6853,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'currency'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'actual_rate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const marketId = this.safeString (info, 'currency_pair');\n        market = this.safeMarket (marketId, market);\n        const marginMode = (marketId !== undefined) ? 'isolated' : 'cross';\n        const timestamp = this.safeInteger (info, 'create_time');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'currency')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'actual_rate'),\n            'amountBorrowed': undefined,\n            'marginMode': marginMode,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseContractMarket",
        "signature": "parseContractMarket (market, settleId)",
        "line_start": 1499,
        "line_end": 1669,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "marketType === 'swap'",
            "comment": null
          },
          {
            "key": "future",
            "value": "marketType === 'future'",
            "comment": null
          },
          {
            "key": "option",
            "value": "marketType === 'option'",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "!isLinear",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber ('0.0005')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber ('1')",
            "comment": "all contracts have this step size\n                'price': this.safeNumber (market, 'order_price_round'),\n            }"
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.safeNumber (market, 'leverage_min'),\n                    'max': this.safeNumber (market, 'leverage_max'),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'order_size_min'),\n                    'max': this.safeNumber (market, 'order_size_max'),\n                },\n                'price': {\n                    'min': this.parseNumber (minPrice),\n                    'max': this.parseNumber (maxPrice),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeIntegerProduct (market, 'create_time', 1000)",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.safeNumber (market, 'leverage_min'),\n                    'max': this.safeNumber (market, 'leverage_max'),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'order_size_min'),\n                    'max': this.safeNumber (market, 'order_size_max'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.parseNumber (minPrice),\n                    'max': this.parseNumber (maxPrice),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'order_size_min')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'order_size_max')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.parseNumber (minPrice)",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.parseNumber (maxPrice)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"name\": \"BTC_USDT\",\n        \"type\": \"direct\",\n        \"quanto_multiplier\": \"0.0001\",\n        \"ref_discount_rate\": \"0\",\n        \"order_price_deviate\": \"0.5\",\n        \"maintenance_rate\": \"0.005\",\n        \"mark_type\": \"index\",\n        \"last_price\": \"38026\",\n        \"mark_price\": \"37985.6\",\n        \"index_price\": \"37954.92\",\n        \"funding_rate_indicative\": \"0.000219\",\n        \"mark_price_round\": \"0.01\",\n        \"funding_offset\": 0,\n        \"in_delisting\": false,\n        \"risk_limit_base\": \"1000000\",\n        \"interest_rate\": \"0.0003\",\n        \"order_price_round\": \"0.1\",\n        \"order_size_min\": 1,\n        \"ref_rebate_rate\": \"0.2\",\n        \"funding_interval\": 28800,\n        \"risk_limit_step\": \"1000000\",\n        \"leverage_min\": \"1\",\n        \"leverage_max\": \"100\",\n        \"risk_limit_max\": \"8000000\",\n        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        \"funding_rate\": \"0.002053\",\n        \"order_size_max\": 1000000,\n        \"funding_next_apply\": 1610035200,\n        \"short_users\": 977,\n        \"config_change_time\": 1609899548,\n        \"create_time\": 1609800048,\n        \"trade_size\": 28530850594,\n        \"position_size\": 5223816,\n        \"long_users\": 455,\n        \"funding_impact_value\": \"60000\",\n        \"orders_limit\": 50,\n        \"trade_id\": 10851092,\n        \"orderbook_id\": 2129638396\n    }",
          "{\n        \"name\": \"BTC_USDT_20200814\",\n        \"underlying\": \"BTC_USDT\",\n        \"cycle\": \"WEEKLY\",\n        \"type\": \"direct\",\n        \"quanto_multiplier\": \"0.0001\",\n        \"mark_type\": \"index\",\n        \"last_price\": \"9017\",\n        \"mark_price\": \"9019\",\n        \"index_price\": \"9005.3\",\n        \"basis_rate\": \"0.185095\",\n        \"basis_value\": \"13.7\",\n        \"basis_impact_value\": \"100000\",\n        \"settle_price\": \"0\",\n        \"settle_price_interval\": 60,\n        \"settle_price_duration\": 1800,\n        \"settle_fee_rate\": \"0.0015\",\n        \"expire_time\": 1593763200,\n        \"order_price_round\": \"0.1\",\n        \"mark_price_round\": \"0.1\",\n        \"leverage_min\": \"1\",\n        \"leverage_max\": \"100\",\n        \"maintenance_rate\": \"1000000\",\n        \"risk_limit_base\": \"140.726652109199\",\n        \"risk_limit_step\": \"1000000\",\n        \"risk_limit_max\": \"8000000\",\n        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        \"ref_discount_rate\": \"0\",\n        \"ref_rebate_rate\": \"0.2\",\n        \"order_price_deviate\": \"0.5\",\n        \"order_size_min\": 1,\n        \"order_size_max\": 1000000,\n        \"orders_limit\": 50,\n        \"orderbook_id\": 63,\n        \"trade_id\": 26,\n        \"trade_size\": 435,\n        \"position_size\": 130,\n        \"config_change_time\": 1593158867,\n        \"in_delisting\": false\n    }"
        ],
        "source": "parseContractMarket (market, settleId) {\n        //\n        //  Perpetual swap\n        //\n        //    {\n        //        \"name\": \"BTC_USDT\",\n        //        \"type\": \"direct\",\n        //        \"quanto_multiplier\": \"0.0001\",\n        //        \"ref_discount_rate\": \"0\",\n        //        \"order_price_deviate\": \"0.5\",\n        //        \"maintenance_rate\": \"0.005\",\n        //        \"mark_type\": \"index\",\n        //        \"last_price\": \"38026\",\n        //        \"mark_price\": \"37985.6\",\n        //        \"index_price\": \"37954.92\",\n        //        \"funding_rate_indicative\": \"0.000219\",\n        //        \"mark_price_round\": \"0.01\",\n        //        \"funding_offset\": 0,\n        //        \"in_delisting\": false,\n        //        \"risk_limit_base\": \"1000000\",\n        //        \"interest_rate\": \"0.0003\",\n        //        \"order_price_round\": \"0.1\",\n        //        \"order_size_min\": 1,\n        //        \"ref_rebate_rate\": \"0.2\",\n        //        \"funding_interval\": 28800,\n        //        \"risk_limit_step\": \"1000000\",\n        //        \"leverage_min\": \"1\",\n        //        \"leverage_max\": \"100\",\n        //        \"risk_limit_max\": \"8000000\",\n        //        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        //        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        //        \"funding_rate\": \"0.002053\",\n        //        \"order_size_max\": 1000000,\n        //        \"funding_next_apply\": 1610035200,\n        //        \"short_users\": 977,\n        //        \"config_change_time\": 1609899548,\n        //        \"create_time\": 1609800048,\n        //        \"trade_size\": 28530850594,\n        //        \"position_size\": 5223816,\n        //        \"long_users\": 455,\n        //        \"funding_impact_value\": \"60000\",\n        //        \"orders_limit\": 50,\n        //        \"trade_id\": 10851092,\n        //        \"orderbook_id\": 2129638396\n        //    }\n        //\n        //  Delivery Futures\n        //\n        //    {\n        //        \"name\": \"BTC_USDT_20200814\",\n        //        \"underlying\": \"BTC_USDT\",\n        //        \"cycle\": \"WEEKLY\",\n        //        \"type\": \"direct\",\n        //        \"quanto_multiplier\": \"0.0001\",\n        //        \"mark_type\": \"index\",\n        //        \"last_price\": \"9017\",\n        //        \"mark_price\": \"9019\",\n        //        \"index_price\": \"9005.3\",\n        //        \"basis_rate\": \"0.185095\",\n        //        \"basis_value\": \"13.7\",\n        //        \"basis_impact_value\": \"100000\",\n        //        \"settle_price\": \"0\",\n        //        \"settle_price_interval\": 60,\n        //        \"settle_price_duration\": 1800,\n        //        \"settle_fee_rate\": \"0.0015\",\n        //        \"expire_time\": 1593763200,\n        //        \"order_price_round\": \"0.1\",\n        //        \"mark_price_round\": \"0.1\",\n        //        \"leverage_min\": \"1\",\n        //        \"leverage_max\": \"100\",\n        //        \"maintenance_rate\": \"1000000\",\n        //        \"risk_limit_base\": \"140.726652109199\",\n        //        \"risk_limit_step\": \"1000000\",\n        //        \"risk_limit_max\": \"8000000\",\n        //        \"maker_fee_rate\": \"-0.00025\", // not actual value for regular users\n        //        \"taker_fee_rate\": \"0.00075\", // not actual value for regular users\n        //        \"ref_discount_rate\": \"0\",\n        //        \"ref_rebate_rate\": \"0.2\",\n        //        \"order_price_deviate\": \"0.5\",\n        //        \"order_size_min\": 1,\n        //        \"order_size_max\": 1000000,\n        //        \"orders_limit\": 50,\n        //        \"orderbook_id\": 63,\n        //        \"trade_id\": 26,\n        //        \"trade_size\": 435,\n        //        \"position_size\": 130,\n        //        \"config_change_time\": 1593158867,\n        //        \"in_delisting\": false\n        //    }\n        //\n        const id = this.safeString (market, 'name');\n        const parts = id.split ('_');\n        const baseId = this.safeString (parts, 0);\n        const quoteId = this.safeString (parts, 1);\n        const date = this.safeString (parts, 2);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settle = this.safeCurrencyCode (settleId);\n        const expiry = this.safeTimestamp (market, 'expire_time');\n        let symbol = '';\n        let marketType = 'swap';\n        if (date !== undefined) {\n            symbol = base + '/' + quote + ':' + settle + '-' + this.yymmdd (expiry, '');\n            marketType = 'future';\n        } else {\n            symbol = base + '/' + quote + ':' + settle;\n        }\n        const priceDeviate = this.safeString (market, 'order_price_deviate');\n        const markPrice = this.safeString (market, 'mark_price');\n        const minMultiplier = Precise.stringSub ('1', priceDeviate);\n        const maxMultiplier = Precise.stringAdd ('1', priceDeviate);\n        const minPrice = Precise.stringMul (minMultiplier, markPrice);\n        const maxPrice = Precise.stringMul (maxMultiplier, markPrice);\n        const isLinear = quote === settle;\n        let contractSize = this.safeString (market, 'quanto_multiplier');\n        // exception only for one market: https://api.gateio.ws/api/v4/futures/btc/contracts\n        if (contractSize === '0') {\n            contractSize = '1'; // 1 USD in WEB: https://i.imgur.com/MBBUI04.png\n        }\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': false,\n            'margin': false,\n            'swap': marketType === 'swap',\n            'future': marketType === 'future',\n            'option': marketType === 'option',\n            'active': true,\n            'contract': true,\n            'linear': isLinear,\n            'inverse': !isLinear,\n            'taker': this.parseNumber ('0.0005'), // 0.05% vip0\n            'maker': this.parseNumber ('0.0002'), // 0.02% vip0\n            'contractSize': this.parseNumber (contractSize),\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber ('1'), // all contracts have this step size\n                'price': this.safeNumber (market, 'order_price_round'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.safeNumber (market, 'leverage_min'),\n                    'max': this.safeNumber (market, 'leverage_max'),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'order_size_min'),\n                    'max': this.safeNumber (market, 'order_size_max'),\n                },\n                'price': {\n                    'min': this.parseNumber (minPrice),\n                    'max': this.parseNumber (maxPrice),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': this.safeIntegerProduct (market, 'create_time', 1000),\n            'info': market,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency = undefined)",
        "line_start": 2345,
        "line_end": 2364,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'payment_id')",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (depositAddress, 'chain'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         chain: \"BTC\",\n         address: \"1Nxu.......Ys\",\n         payment_id: \"\",\n         payment_name: \"\",\n         obtain_failed: \"0\",\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency = undefined) {\n        //\n        //     {\n        //         chain: \"BTC\",\n        //         address: \"1Nxu.......Ys\",\n        //         payment_id: \"\",\n        //         payment_name: \"\",\n        //         obtain_failed: \"0\",\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeString (currency, 'code'),\n            'address': address,\n            'tag': this.safeString (depositAddress, 'payment_id'),\n            'network': this.networkIdToCode (this.safeString (depositAddress, 'chain')),\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2562,
        "line_end": 2611,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': this.safeNumber (fee, 'withdraw_fix'),\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': this.safeNumber (fee, 'deposit'),\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (fee, 'deposit')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                        'fee': this.parseNumber (withdrawFixOnChains[chainKey]),\n                        'percentage': false,\n                    }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'fee': undefined,\n                        'percentage': undefined,\n                    }",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\": \"MTN\",\n        \"name\": \"Medicalchain\",\n        \"name_cn\": \"Medicalchain\",\n        \"deposit\": \"0\",\n        \"withdraw_percent\": \"0%\",\n        \"withdraw_fix\": \"900\",\n        \"withdraw_day_limit\": \"500000\",\n        \"withdraw_day_limit_remain\": \"500000\",\n        \"withdraw_amount_mini\": \"900.1\",\n        \"withdraw_eachtime_limit\": \"90000000000\",\n        \"withdraw_fix_on_chains\": {\n            \"ETH\": \"900\"\n        }\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"currency\": \"MTN\",\n        //        \"name\": \"Medicalchain\",\n        //        \"name_cn\": \"Medicalchain\",\n        //        \"deposit\": \"0\",\n        //        \"withdraw_percent\": \"0%\",\n        //        \"withdraw_fix\": \"900\",\n        //        \"withdraw_day_limit\": \"500000\",\n        //        \"withdraw_day_limit_remain\": \"500000\",\n        //        \"withdraw_amount_mini\": \"900.1\",\n        //        \"withdraw_eachtime_limit\": \"90000000000\",\n        //        \"withdraw_fix_on_chains\": {\n        //            \"ETH\": \"900\"\n        //        }\n        //    }\n        //\n        const withdrawFixOnChains = this.safeValue (fee, 'withdraw_fix_on_chains');\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': this.safeNumber (fee, 'withdraw_fix'),\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': this.safeNumber (fee, 'deposit'),\n                'percentage': false,\n            },\n            'networks': {},\n        };\n        if (withdrawFixOnChains !== undefined) {\n            const chainKeys = Object.keys (withdrawFixOnChains);\n            for (let i = 0; i < chainKeys.length; i++) {\n                const chainKey = chainKeys[i];\n                const networkCode = this.networkIdToCode (chainKey, this.safeString (fee, 'currency'));\n                result['networks'][networkCode] = {\n                    'withdraw': {\n                        'fee': this.parseNumber (withdrawFixOnChains[chainKey]),\n                        'percentage': false,\n                    },\n                    'deposit': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                };\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseEmulatedLeverageTiers",
        "signature": "parseEmulatedLeverageTiers (info, market = undefined): LeverageTier[]",
        "line_start": 6489,
        "line_end": 6517,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseEmulatedLeverageTiers (info, market = undefined): LeverageTier[] {\n        const marketId = this.safeString (info, 'name');\n        const maintenanceMarginUnit = this.safeString (info, 'maintenance_rate'); // '0.005',\n        const leverageMax = this.safeString (info, 'leverage_max'); // '100',\n        const riskLimitStep = this.safeString (info, 'risk_limit_step'); // '1000000',\n        const riskLimitMax = this.safeString (info, 'risk_limit_max'); // '16000000',\n        const initialMarginUnit = Precise.stringDiv ('1', leverageMax);\n        let maintenanceMarginRate = maintenanceMarginUnit;\n        let initialMarginRatio = initialMarginUnit;\n        let floor = '0';\n        const tiers = [];\n        while (Precise.stringLt (floor, riskLimitMax)) {\n            const cap = Precise.stringAdd (floor, riskLimitStep);\n            tiers.push ({\n                'tier': this.parseNumber (Precise.stringDiv (cap, riskLimitStep)),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n                'currency': this.safeString (market, 'settle'),\n                'minNotional': this.parseNumber (floor),\n                'maxNotional': this.parseNumber (cap),\n                'maintenanceMarginRate': this.parseNumber (maintenanceMarginRate),\n                'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMarginRatio)),\n                'info': info,\n            });\n            maintenanceMarginRate = Precise.stringAdd (maintenanceMarginRate, maintenanceMarginUnit);\n            initialMarginRatio = Precise.stringAdd (initialMarginRatio, initialMarginUnit);\n            floor = cap;\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseFundingHistories",
        "signature": "parseFundingHistories (response, symbol, since, limit): FundingHistory[]",
        "line_start": 2666,
        "line_end": 2675,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingHistories (response, symbol, since, limit): FundingHistory[] {\n        const result = [];\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const funding = this.parseFundingHistory (entry);\n            result.push (funding);\n        }\n        const sorted = this.sortBy (result, 'timestamp');\n        return this.filterBySymbolSinceLimit (sorted, symbol, since, limit);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseFundingHistory",
        "signature": "parseFundingHistory (info, market: Market = undefined)",
        "line_start": 2677,
        "line_end": 2699,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (market, 'settle')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'change')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"time\": 1646899200,\n        \"change\": \"-0.027722\",\n        \"balance\": \"11.653120591841\",\n        \"text\": \"XRP_USDT\",\n        \"type\": \"fund\"\n    }"
        ],
        "source": "parseFundingHistory (info, market: Market = undefined) {\n        //\n        //    {\n        //        \"time\": 1646899200,\n        //        \"change\": \"-0.027722\",\n        //        \"balance\": \"11.653120591841\",\n        //        \"text\": \"XRP_USDT\",\n        //        \"type\": \"fund\"\n        //    }\n        //\n        const timestamp = this.safeTimestamp (info, 'time');\n        const marketId = this.safeString (info, 'text');\n        market = this.safeMarket (marketId, market, '_', 'swap');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'code': this.safeString (market, 'settle'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.safeNumber (info, 'change'),\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 2253,
        "line_end": 2262,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 2179,
        "line_end": 2251,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "fundingRateIndicative",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (fundingInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"name\": \"BTC_USDT\",\n        \"type\": \"direct\",\n        \"quanto_multiplier\": \"0.0001\",\n        \"ref_discount_rate\": \"0\",\n        \"order_price_deviate\": \"0.5\",\n        \"maintenance_rate\": \"0.005\",\n        \"mark_type\": \"index\",\n        \"last_price\": \"38026\",\n        \"mark_price\": \"37985.6\",\n        \"index_price\": \"37954.92\",\n        \"funding_rate_indicative\": \"0.000219\",\n        \"mark_price_round\": \"0.01\",\n        \"funding_offset\": 0,\n        \"in_delisting\": false,\n        \"risk_limit_base\": \"1000000\",\n        \"interest_rate\": \"0.0003\",\n        \"order_price_round\": \"0.1\",\n        \"order_size_min\": 1,\n        \"ref_rebate_rate\": \"0.2\",\n        \"funding_interval\": 28800,\n        \"risk_limit_step\": \"1000000\",\n        \"leverage_min\": \"1\",\n        \"leverage_max\": \"100\",\n        \"risk_limit_max\": \"8000000\",\n        \"maker_fee_rate\": \"-0.00025\",\n        \"taker_fee_rate\": \"0.00075\",\n        \"funding_rate\": \"0.002053\",\n        \"order_size_max\": 1000000,\n        \"funding_next_apply\": 1610035200,\n        \"short_users\": 977,\n        \"config_change_time\": 1609899548,\n        \"trade_size\": 28530850594,\n        \"position_size\": 5223816,\n        \"long_users\": 455,\n        \"funding_impact_value\": \"60000\",\n        \"orders_limit\": 50,\n        \"trade_id\": 10851092,\n        \"orderbook_id\": 2129638396\n    }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"name\": \"BTC_USDT\",\n        //        \"type\": \"direct\",\n        //        \"quanto_multiplier\": \"0.0001\",\n        //        \"ref_discount_rate\": \"0\",\n        //        \"order_price_deviate\": \"0.5\",\n        //        \"maintenance_rate\": \"0.005\",\n        //        \"mark_type\": \"index\",\n        //        \"last_price\": \"38026\",\n        //        \"mark_price\": \"37985.6\",\n        //        \"index_price\": \"37954.92\",\n        //        \"funding_rate_indicative\": \"0.000219\",\n        //        \"mark_price_round\": \"0.01\",\n        //        \"funding_offset\": 0,\n        //        \"in_delisting\": false,\n        //        \"risk_limit_base\": \"1000000\",\n        //        \"interest_rate\": \"0.0003\",\n        //        \"order_price_round\": \"0.1\",\n        //        \"order_size_min\": 1,\n        //        \"ref_rebate_rate\": \"0.2\",\n        //        \"funding_interval\": 28800,\n        //        \"risk_limit_step\": \"1000000\",\n        //        \"leverage_min\": \"1\",\n        //        \"leverage_max\": \"100\",\n        //        \"risk_limit_max\": \"8000000\",\n        //        \"maker_fee_rate\": \"-0.00025\",\n        //        \"taker_fee_rate\": \"0.00075\",\n        //        \"funding_rate\": \"0.002053\",\n        //        \"order_size_max\": 1000000,\n        //        \"funding_next_apply\": 1610035200,\n        //        \"short_users\": 977,\n        //        \"config_change_time\": 1609899548,\n        //        \"trade_size\": 28530850594,\n        //        \"position_size\": 5223816,\n        //        \"long_users\": 455,\n        //        \"funding_impact_value\": \"60000\",\n        //        \"orders_limit\": 50,\n        //        \"trade_id\": 10851092,\n        //        \"orderbook_id\": 2129638396\n        //    }\n        //\n        const marketId = this.safeString (contract, 'name');\n        const symbol = this.safeSymbol (marketId, market, '_', 'swap');\n        const markPrice = this.safeNumber (contract, 'mark_price');\n        const indexPrice = this.safeNumber (contract, 'index_price');\n        const interestRate = this.safeNumber (contract, 'interest_rate');\n        const fundingRate = this.safeNumber (contract, 'funding_rate');\n        const fundingTime = this.safeTimestamp (contract, 'funding_next_apply');\n        const fundingRateIndicative = this.safeNumber (contract, 'funding_rate_indicative');\n        const fundingInterval = Precise.stringMul ('1000', this.safeString (contract, 'funding_interval'));\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': fundingRateIndicative,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (fundingInterval),\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 7875,
        "line_end": 7919,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "this.safeNumber (greeks, 'bid1_size')",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "this.safeNumber (greeks, 'ask1_size')",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bid_iv')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'ask_iv')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'mark_iv')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (greeks, 'bid1_price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (greeks, 'ask1_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (greeks, 'last_price')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.parseNumber (market['info']['underlying_price'])",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"vega\": \"1.78992\",\n         \"leverage\": \"6.2096777055417\",\n         \"ask_iv\": \"0.6245\",\n         \"delta\": \"-0.69397\",\n         \"last_price\": \"0\",\n         \"theta\": \"-2.5723\",\n         \"bid1_price\": \"222.9\",\n         \"mark_iv\": \"0.5909\",\n         \"name\": \"ETH_USDT-20231201-2300-P\",\n         \"bid_iv\": \"0.5065\",\n         \"ask1_price\": \"243.6\",\n         \"mark_price\": \"236.57\",\n         \"position_size\": 0,\n         \"bid1_size\": 368,\n         \"ask1_size\": -335,\n         \"gamma\": \"0.00116\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"vega\": \"1.78992\",\n        //         \"leverage\": \"6.2096777055417\",\n        //         \"ask_iv\": \"0.6245\",\n        //         \"delta\": \"-0.69397\",\n        //         \"last_price\": \"0\",\n        //         \"theta\": \"-2.5723\",\n        //         \"bid1_price\": \"222.9\",\n        //         \"mark_iv\": \"0.5909\",\n        //         \"name\": \"ETH_USDT-20231201-2300-P\",\n        //         \"bid_iv\": \"0.5065\",\n        //         \"ask1_price\": \"243.6\",\n        //         \"mark_price\": \"236.57\",\n        //         \"position_size\": 0,\n        //         \"bid1_size\": 368,\n        //         \"ask1_size\": -335,\n        //         \"gamma\": \"0.00116\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'name');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': this.safeNumber (greeks, 'bid1_size'),\n            'askSize': this.safeNumber (greeks, 'ask1_size'),\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bid_iv'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'ask_iv'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'mark_iv'),\n            'bidPrice': this.safeNumber (greeks, 'bid1_price'),\n            'askPrice': this.safeNumber (greeks, 'ask1_price'),\n            'markPrice': this.safeNumber (greeks, 'mark_price'),\n            'lastPrice': this.safeNumber (greeks, 'last_price'),\n            'underlyingPrice': this.parseNumber (market['info']['underlying_price']),\n            'info': greeks,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 7432,
        "line_end": 7515,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "before",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'balance')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"123456\",\n         \"time\": 1547633726123,\n         \"currency\": \"BTC\",\n         \"change\": \"1.03\",\n         \"balance\": \"4.59316525194\",\n         \"type\": \"margin_in\"\n     }",
          "{\n         \"id\": \"123456\",\n         \"time\": \"1547633726\",\n         \"time_ms\": 1547633726123,\n         \"currency\": \"BTC\",\n         \"currency_pair\": \"BTC_USDT\",\n         \"change\": \"1.03\",\n         \"balance\": \"4.59316525194\"\n     }",
          "{\n         \"time\": 1682294400.123456,\n         \"change\": \"0.000010152188\",\n         \"balance\": \"4.59316525194\",\n         \"text\": \"ETH_USD:6086261\",\n         \"type\": \"fee\"\n     }",
          "{\n         \"time\": 1685594770,\n         \"change\": \"3.33\",\n         \"balance\": \"29.87911771\",\n         \"text\": \"BTC_USDT-20230602-26500-C:2611026125\",\n         \"type\": \"prem\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // spot\n        //\n        //     {\n        //         \"id\": \"123456\",\n        //         \"time\": 1547633726123,\n        //         \"currency\": \"BTC\",\n        //         \"change\": \"1.03\",\n        //         \"balance\": \"4.59316525194\",\n        //         \"type\": \"margin_in\"\n        //     }\n        //\n        // margin\n        //\n        //     {\n        //         \"id\": \"123456\",\n        //         \"time\": \"1547633726\",\n        //         \"time_ms\": 1547633726123,\n        //         \"currency\": \"BTC\",\n        //         \"currency_pair\": \"BTC_USDT\",\n        //         \"change\": \"1.03\",\n        //         \"balance\": \"4.59316525194\"\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"time\": 1682294400.123456,\n        //         \"change\": \"0.000010152188\",\n        //         \"balance\": \"4.59316525194\",\n        //         \"text\": \"ETH_USD:6086261\",\n        //         \"type\": \"fee\"\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"time\": 1685594770,\n        //         \"change\": \"3.33\",\n        //         \"balance\": \"29.87911771\",\n        //         \"text\": \"BTC_USDT-20230602-26500-C:2611026125\",\n        //         \"type\": \"prem\"\n        //     }\n        //\n        let direction = undefined;\n        let amount = this.safeString (item, 'change');\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringAbs (amount);\n        } else {\n            direction = 'in';\n        }\n        const currencyId = this.safeString (item, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const type = this.safeString (item, 'type');\n        const rawTimestamp = this.safeString (item, 'time');\n        let timestamp = undefined;\n        if (rawTimestamp.length > 10) {\n            timestamp = parseInt (rawTimestamp);\n        } else {\n            timestamp = parseInt (rawTimestamp) * 1000;\n        }\n        const balanceString = this.safeString (item, 'balance');\n        const changeString = this.safeString (item, 'change');\n        const before = this.parseNumber (Precise.stringSub (balanceString, changeString));\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'direction': direction,\n            'account': undefined,\n            'referenceAccount': undefined,\n            'referenceId': undefined,\n            'type': this.parseLedgerEntryType (type),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': before,\n            'after': this.safeNumber (item, 'balance'),\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 7517,
        "line_end": 7559,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'sub_account_transfer': 'transfer',\n            'margin_in': 'transfer',\n            'margin_out': 'transfer',\n            'margin_funding_in': 'transfer',\n            'margin_funding_out': 'transfer',\n            'cross_margin_in': 'transfer',\n            'cross_margin_out': 'transfer',\n            'copy_trading_in': 'transfer',\n            'copy_trading_out': 'transfer',\n            'quant_in': 'transfer',\n            'quant_out': 'transfer',\n            'futures_in': 'transfer',\n            'futures_out': 'transfer',\n            'delivery_in': 'transfer',\n            'delivery_out': 'transfer',\n            'new_order': 'trade',\n            'order_fill': 'trade',\n            'referral_fee': 'rebate',\n            'order_fee': 'fee',\n            'interest': 'interest',\n            'lend': 'loan',\n            'redeem': 'loan',\n            'profit': 'interest',\n            'flash_swap_buy': 'trade',\n            'flash_swap_sell': 'trade',\n            'unknown': 'unknown',\n            'set': 'settlement',\n            'prem': 'trade',\n            'point_refr': 'rebate',\n            'point_fee': 'fee',\n            'point_dnw': 'deposit/withdraw',\n            'fund': 'fee',\n            'refr': 'rebate',\n            'fee': 'fee',\n            'pnl': 'trade',\n            'dnw': 'deposit/withdraw',\n        };\n        return this.safeString (ledgerType, type, type);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 8103,
        "line_end": 8113,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '_', 'spot')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString2 (leverage, 'currency_pair', 'id');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market, '_', 'spot'),\n            'marginMode': undefined,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 7742,
        "line_end": 7824,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contractsString)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSizeString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (priceString)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.parseNumber (baseValueString)",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.parseNumber (Precise.stringAbs (quoteValueString))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract\": \"BTC_USDT\",\n         \"left\": 0,\n         \"size\": -165,\n         \"fill_price\": \"28070\",\n         \"order_price\": \"28225\",\n         \"time\": 1696736132\n     }",
          "{\n         \"time\": 1548654951,\n         \"contract\": \"BTC_USDT\",\n         \"size\": 600,\n         \"leverage\": \"25\",\n         \"margin\": \"0.006705256878\",\n         \"entry_price\": \"3536.123\",\n         \"liq_price\": \"3421.54\",\n         \"mark_price\": \"3420.27\",\n         \"order_id\": 317393847,\n         \"order_price\": \"3405\",\n         \"fill_price\": \"3424\",\n         \"left\": 0\n     }",
          "{\n         \"time\": 1631764800,\n         \"pnl\": \"-42914.291\",\n         \"settle_size\": \"-10001\",\n         \"side\": \"short\",\n         \"contract\": \"BTC_USDT-20210916-5000-C\",\n         \"text\": \"settled\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        // fetchLiquidations\n        //\n        //     {\n        //         \"contract\": \"BTC_USDT\",\n        //         \"left\": 0,\n        //         \"size\": -165,\n        //         \"fill_price\": \"28070\",\n        //         \"order_price\": \"28225\",\n        //         \"time\": 1696736132\n        //     }\n        //\n        // swap and future: fetchMyLiquidations\n        //\n        //     {\n        //         \"time\": 1548654951,\n        //         \"contract\": \"BTC_USDT\",\n        //         \"size\": 600,\n        //         \"leverage\": \"25\",\n        //         \"margin\": \"0.006705256878\",\n        //         \"entry_price\": \"3536.123\",\n        //         \"liq_price\": \"3421.54\",\n        //         \"mark_price\": \"3420.27\",\n        //         \"order_id\": 317393847,\n        //         \"order_price\": \"3405\",\n        //         \"fill_price\": \"3424\",\n        //         \"left\": 0\n        //     }\n        //\n        // option: fetchMyLiquidations\n        //\n        //     {\n        //         \"time\": 1631764800,\n        //         \"pnl\": \"-42914.291\",\n        //         \"settle_size\": \"-10001\",\n        //         \"side\": \"short\",\n        //         \"contract\": \"BTC_USDT-20210916-5000-C\",\n        //         \"text\": \"settled\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'contract');\n        const timestamp = this.safeTimestamp (liquidation, 'time');\n        const size = this.safeString2 (liquidation, 'size', 'settle_size');\n        const left = this.safeString (liquidation, 'left', '0');\n        const contractsString = Precise.stringAbs (Precise.stringSub (size, left));\n        const contractSizeString = this.safeString (market, 'contractSize');\n        const priceString = this.safeString2 (liquidation, 'liq_price', 'fill_price');\n        const baseValueString = Precise.stringMul (contractsString, contractSizeString);\n        let quoteValueString = this.safeString (liquidation, 'pnl');\n        if (quoteValueString === undefined) {\n            quoteValueString = Precise.stringMul (baseValueString, priceString);\n        }\n        // --- derive side ---\n        // 1) options payload has explicit 'side': 'long' | 'short'\n        const optPos = this.safeStringLower (liquidation, 'side');\n        let side: Str = undefined;\n        if (optPos === 'long') {\n            side = 'buy';\n        } else if (optPos === 'short') {\n            side = 'sell';\n        } else {\n            if (size !== undefined) { // 2) futures/perpetual (and fallback for options): infer from size\n                if (Precise.stringGt (size, '0')) {\n                    side = 'buy';\n                } else if (Precise.stringLt (size, '0')) {\n                    side = 'sell';\n                }\n            }\n        }\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.parseNumber (contractsString),\n            'contractSize': this.parseNumber (contractSizeString),\n            'price': this.parseNumber (priceString),\n            'side': side,\n            'baseValue': this.parseNumber (baseValueString),\n            'quoteValue': this.parseNumber (Precise.stringAbs (quoteValueString)),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 6728,
        "line_end": 6781,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeInteger (info, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, undefined, '_', 'margin')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"17\",\n         \"create_time\": 1620381696159,\n         \"update_time\": 1620381696159,\n         \"currency\": \"EOS\",\n         \"amount\": \"110.553635\",\n         \"text\": \"web\",\n         \"status\": 2,\n         \"repaid\": \"110.506649705159\",\n         \"repaid_interest\": \"0.046985294841\",\n         \"unpaid_interest\": \"0.0000074393366667\"\n     }",
          "{\n         \"id\": \"34267567\",\n         \"create_time\": \"1656394778\",\n         \"expire_time\": \"1657258778\",\n         \"status\": \"loaned\",\n         \"side\": \"borrow\",\n         \"currency\": \"USDT\",\n         \"rate\": \"0.0002\",\n         \"amount\": \"100\",\n         \"days\": 10,\n         \"auto_renew\": false,\n         \"currency_pair\": \"LTC_USDT\",\n         \"left\": \"0\",\n         \"repaid\": \"0\",\n         \"paid_interest\": \"0\",\n         \"unpaid_interest\": \"0.003333333333\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        // Cross\n        //\n        //     {\n        //         \"id\": \"17\",\n        //         \"create_time\": 1620381696159,\n        //         \"update_time\": 1620381696159,\n        //         \"currency\": \"EOS\",\n        //         \"amount\": \"110.553635\",\n        //         \"text\": \"web\",\n        //         \"status\": 2,\n        //         \"repaid\": \"110.506649705159\",\n        //         \"repaid_interest\": \"0.046985294841\",\n        //         \"unpaid_interest\": \"0.0000074393366667\"\n        //     }\n        //\n        // Isolated\n        //\n        //     {\n        //         \"id\": \"34267567\",\n        //         \"create_time\": \"1656394778\",\n        //         \"expire_time\": \"1657258778\",\n        //         \"status\": \"loaned\",\n        //         \"side\": \"borrow\",\n        //         \"currency\": \"USDT\",\n        //         \"rate\": \"0.0002\",\n        //         \"amount\": \"100\",\n        //         \"days\": 10,\n        //         \"auto_renew\": false,\n        //         \"currency_pair\": \"LTC_USDT\",\n        //         \"left\": \"0\",\n        //         \"repaid\": \"0\",\n        //         \"paid_interest\": \"0\",\n        //         \"unpaid_interest\": \"0.003333333333\"\n        //     }\n        //\n        const marginMode = this.safeString2 (this.options, 'defaultMarginMode', 'marginMode', 'cross');\n        let timestamp = this.safeInteger (info, 'create_time');\n        if (marginMode === 'isolated') {\n            timestamp = this.safeTimestamp (info, 'create_time');\n        }\n        const currencyId = this.safeString (info, 'currency');\n        const marketId = this.safeString (info, 'currency_pair');\n        return {\n            'id': this.safeInteger (info, 'id'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amount'),\n            'symbol': this.safeSymbol (marketId, undefined, '_', 'margin'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 6969,
        "line_end": 7012,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "total",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeValue (market, 'quote')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"value\": \"11.9257\",\n         \"leverage\": \"5\",\n         \"mode\": \"single\",\n         \"realised_point\": \"0\",\n         \"contract\": \"ETH_USDT\",\n         \"entry_price\": \"1203.45\",\n         \"mark_price\": \"1192.57\",\n         \"history_point\": \"0\",\n         \"realised_pnl\": \"-0.00577656\",\n         \"close_order\": null,\n         \"size\": \"1\",\n         \"cross_leverage_limit\": \"0\",\n         \"pending_orders\": \"0\",\n         \"adl_ranking\": \"5\",\n         \"maintenance_rate\": \"0.005\",\n         \"unrealised_pnl\": \"-0.1088\",\n         \"user\": \"1486602\",\n         \"leverage_max\": \"100\",\n         \"history_pnl\": \"0\",\n         \"risk_limit\": \"1000000\",\n         \"margin\": \"5.415925875\",\n         \"last_close_pnl\": \"0\",\n         \"liq_price\": \"665.69\"\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //     {\n        //         \"value\": \"11.9257\",\n        //         \"leverage\": \"5\",\n        //         \"mode\": \"single\",\n        //         \"realised_point\": \"0\",\n        //         \"contract\": \"ETH_USDT\",\n        //         \"entry_price\": \"1203.45\",\n        //         \"mark_price\": \"1192.57\",\n        //         \"history_point\": \"0\",\n        //         \"realised_pnl\": \"-0.00577656\",\n        //         \"close_order\": null,\n        //         \"size\": \"1\",\n        //         \"cross_leverage_limit\": \"0\",\n        //         \"pending_orders\": \"0\",\n        //         \"adl_ranking\": \"5\",\n        //         \"maintenance_rate\": \"0.005\",\n        //         \"unrealised_pnl\": \"-0.1088\",\n        //         \"user\": \"1486602\",\n        //         \"leverage_max\": \"100\",\n        //         \"history_pnl\": \"0\",\n        //         \"risk_limit\": \"1000000\",\n        //         \"margin\": \"5.415925875\",\n        //         \"last_close_pnl\": \"0\",\n        //         \"liq_price\": \"665.69\"\n        //     }\n        //\n        const contract = this.safeString (data, 'contract');\n        market = this.safeMarket (contract, market, '_', 'contract');\n        const total = this.safeNumber (data, 'margin');\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': total,\n            'code': this.safeValue (market, 'quote'),\n            'status': 'ok',\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 6519,
        "line_end": 6552,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['base']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "maxNotional",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (item, 'maintenance_rate')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (item, 'leverage_max')",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"maintenance_rate\": \"0.004\",\n             \"tier\": 1,\n             \"initial_rate\": \"0.008\",\n             \"leverage_max\": \"125\",\n             \"risk_limit\": \"1000000\"\n         }\n     ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //     [\n        //         {\n        //             \"maintenance_rate\": \"0.004\",\n        //             \"tier\": 1,\n        //             \"initial_rate\": \"0.008\",\n        //             \"leverage_max\": \"125\",\n        //             \"risk_limit\": \"1000000\"\n        //         }\n        //     ]\n        //\n        if (!Array.isArray (info)) {\n            return this.parseEmulatedLeverageTiers (info, market);\n        }\n        let minNotional = 0;\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const item = info[i];\n            const maxNotional = this.safeNumber (item, 'risk_limit');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': market['symbol'],\n                'currency': market['base'],\n                'minNotional': minNotional,\n                'maxNotional': maxNotional,\n                'maintenanceMarginRate': this.safeNumber (item, 'maintenance_rate'),\n                'maxLeverage': this.safeNumber (item, 'leverage_max'),\n                'info': item,\n            });\n            minNotional = maxNotional;\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 3480,
        "line_end": 3525,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        \"1660957920\", // timestamp\n        \"6227.070147198573\", // quote volume\n        \"0.0000133485\", // close\n        \"0.0000133615\", // high\n        \"0.0000133347\", // low\n        \"0.0000133468\", // open\n        \"466641934.99\" // base volume\n    ]",
          "{\n          \"t\":1632873600,         // Unix timestamp in seconds\n          \"o\": \"41025\",           // Open price\n          \"h\": \"41882.17\",        // Highest price\n          \"c\": \"41776.92\",        // Close price\n          \"l\": \"40783.94\"         // Lowest price\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // Spot market candles\n        //\n        //    [\n        //        \"1660957920\", // timestamp\n        //        \"6227.070147198573\", // quote volume\n        //        \"0.0000133485\", // close\n        //        \"0.0000133615\", // high\n        //        \"0.0000133347\", // low\n        //        \"0.0000133468\", // open\n        //        \"466641934.99\" // base volume\n        //    ]\n        //\n        //\n        // Swap, Future, Option, Mark and Index price candles\n        //\n        //     {\n        //          \"t\":1632873600,         // Unix timestamp in seconds\n        //          \"o\": \"41025\",           // Open price\n        //          \"h\": \"41882.17\",        // Highest price\n        //          \"c\": \"41776.92\",        // Close price\n        //          \"l\": \"40783.94\"         // Lowest price\n        //     }\n        //\n        if (Array.isArray (ohlcv)) {\n            return [\n                this.safeTimestamp (ohlcv, 0),   // unix timestamp in seconds\n                this.safeNumber (ohlcv, 5),      // open price\n                this.safeNumber (ohlcv, 3),      // highest price\n                this.safeNumber (ohlcv, 4),      // lowest price\n                this.safeNumber (ohlcv, 2),      // close price\n                this.safeNumber (ohlcv, 6),      // trading volume\n            ];\n        } else {\n            // Swap, Future, Option, Mark and Index price candles\n            return [\n                this.safeTimestamp (ohlcv, 't'), // unix timestamp in seconds\n                this.safeNumber (ohlcv, 'o'),    // open price\n                this.safeNumber (ohlcv, 'h'),    // highest price\n                this.safeNumber (ohlcv, 'l'),    // lowest price\n                this.safeNumber (ohlcv, 'c'),    // close price\n                this.safeNumber (ohlcv, 'v'),    // trading volume, undefined for mark or index price\n            ];\n        }\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 7104,
        "line_end": 7132,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber (interest, 'open_interest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "this.safeNumber (interest, 'open_interest_usd')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"long_liq_size\": \"0\",\n        \"short_liq_size\": \"0\",\n        \"short_liq_usd\": \"0\",\n        \"lsr_account\": \"3.2808988764045\",\n        \"mark_price\": \"0.34619\",\n        \"top_lsr_size\": \"0\",\n        \"time\": \"1674057000\",\n        \"short_liq_amount\": \"0\",\n        \"long_liq_amount\": \"0\",\n        \"open_interest_usd\": \"9872386.7775\",\n        \"top_lsr_account\": \"0\",\n        \"open_interest\": \"2851725\",\n        \"long_liq_usd\": \"0\",\n        \"lsr_taker\": \"9.3765153315902\"\n    }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //    {\n        //        \"long_liq_size\": \"0\",\n        //        \"short_liq_size\": \"0\",\n        //        \"short_liq_usd\": \"0\",\n        //        \"lsr_account\": \"3.2808988764045\",\n        //        \"mark_price\": \"0.34619\",\n        //        \"top_lsr_size\": \"0\",\n        //        \"time\": \"1674057000\",\n        //        \"short_liq_amount\": \"0\",\n        //        \"long_liq_amount\": \"0\",\n        //        \"open_interest_usd\": \"9872386.7775\",\n        //        \"top_lsr_account\": \"0\",\n        //        \"open_interest\": \"2851725\",\n        //        \"long_liq_usd\": \"0\",\n        //        \"lsr_taker\": \"9.3765153315902\"\n        //    }\n        //\n        const timestamp = this.safeTimestamp (interest, 'time');\n        return {\n            'symbol': this.safeString (market, 'symbol'),\n            'openInterestAmount': this.safeNumber (interest, 'open_interest'),\n            'openInterestValue': this.safeNumber (interest, 'open_interest_usd'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 8237,
        "line_end": 8300,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bid1_price')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'ask1_price')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (chain, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'last_price')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (chain, 'underlying_price')",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"is_active\": true,\n         \"mark_price_round\": \"0.1\",\n         \"settle_fee_rate\": \"0.00015\",\n         \"bid1_size\": 434,\n         \"taker_fee_rate\": \"0.0003\",\n         \"price_limit_fee_rate\": \"0.1\",\n         \"order_price_round\": \"1\",\n         \"tag\": \"day\",\n         \"ref_rebate_rate\": \"0\",\n         \"name\": \"BTC_USDT-20240324-63500-P\",\n         \"strike_price\": \"63500\",\n         \"ask1_price\": \"387\",\n         \"ref_discount_rate\": \"0\",\n         \"order_price_deviate\": \"0.15\",\n         \"ask1_size\": -454,\n         \"mark_price_down\": \"124.3\",\n         \"orderbook_id\": 29600,\n         \"is_call\": false,\n         \"last_price\": \"0\",\n         \"mark_price\": \"366.6\",\n         \"underlying\": \"BTC_USDT\",\n         \"create_time\": 1711118829,\n         \"settle_limit_fee_rate\": \"0.1\",\n         \"orders_limit\": 10,\n         \"mark_price_up\": \"630\",\n         \"position_size\": 0,\n         \"order_size_max\": 10000,\n         \"position_limit\": 10000,\n         \"multiplier\": \"0.01\",\n         \"order_size_min\": 1,\n         \"trade_size\": 0,\n         \"underlying_price\": \"64084.65\",\n         \"maker_fee_rate\": \"0.0003\",\n         \"expiration_time\": 1711267200,\n         \"trade_id\": 0,\n         \"bid1_price\": \"307\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"is_active\": true,\n        //         \"mark_price_round\": \"0.1\",\n        //         \"settle_fee_rate\": \"0.00015\",\n        //         \"bid1_size\": 434,\n        //         \"taker_fee_rate\": \"0.0003\",\n        //         \"price_limit_fee_rate\": \"0.1\",\n        //         \"order_price_round\": \"1\",\n        //         \"tag\": \"day\",\n        //         \"ref_rebate_rate\": \"0\",\n        //         \"name\": \"BTC_USDT-20240324-63500-P\",\n        //         \"strike_price\": \"63500\",\n        //         \"ask1_price\": \"387\",\n        //         \"ref_discount_rate\": \"0\",\n        //         \"order_price_deviate\": \"0.15\",\n        //         \"ask1_size\": -454,\n        //         \"mark_price_down\": \"124.3\",\n        //         \"orderbook_id\": 29600,\n        //         \"is_call\": false,\n        //         \"last_price\": \"0\",\n        //         \"mark_price\": \"366.6\",\n        //         \"underlying\": \"BTC_USDT\",\n        //         \"create_time\": 1711118829,\n        //         \"settle_limit_fee_rate\": \"0.1\",\n        //         \"orders_limit\": 10,\n        //         \"mark_price_up\": \"630\",\n        //         \"position_size\": 0,\n        //         \"order_size_max\": 10000,\n        //         \"position_limit\": 10000,\n        //         \"multiplier\": \"0.01\",\n        //         \"order_size_min\": 1,\n        //         \"trade_size\": 0,\n        //         \"underlying_price\": \"64084.65\",\n        //         \"maker_fee_rate\": \"0.0003\",\n        //         \"expiration_time\": 1711267200,\n        //         \"trade_id\": 0,\n        //         \"bid1_price\": \"307\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'name');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeTimestamp (chain, 'create_time');\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bid1_price'),\n            'askPrice': this.safeNumber (chain, 'ask1_price'),\n            'midPrice': undefined,\n            'markPrice': this.safeNumber (chain, 'mark_price'),\n            'lastPrice': this.safeNumber (chain, 'last_price'),\n            'underlyingPrice': this.safeNumber (chain, 'underlying_price'),\n            'change': undefined,\n            'percentage': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 4839,
        "line_end": 5147,
        "comment": null,
        "mappings": [
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'text')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeValue (order, 'is_reduce_only')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "Precise.stringAbs (amount)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "Precise.stringAbs (cost)",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "fee",
            "value": "multipleFeeCurrencies ? undefined : this.safeValue (fees, 0)",
            "comment": null
          },
          {
            "key": "fees",
            "value": "multipleFeeCurrencies ? fees : []",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\": \"62364648575\",\n        \"text\": \"apiv4\",\n        \"create_time\": \"1626354834\",\n        \"update_time\": \"1626354834\",\n        \"create_time_ms\": \"1626354833544\",\n        \"update_time_ms\": \"1626354833544\",\n        \"status\": \"open\",\n        \"currency_pair\": \"BTC_USDT\",\n        \"type\": \"limit\",\n        \"account\": \"spot\",\n        \"side\": \"buy\",\n        \"amount\": \"0.0001\",\n        \"price\": \"30000\",\n        \"time_in_force\": \"gtc\",\n        \"iceberg\": \"0\",\n        \"left\": \"0.0001\",\n        \"fill_price\": \"0\",\n        \"filled_total\": \"0\",\n        \"fee\": \"0\",\n        \"fee_currency\": \"BTC\",\n        \"point_fee\": \"0\",\n        \"gt_fee\": \"0\",\n        \"gt_discount\": true,\n        \"rebated_fee\": \"0\",\n        \"rebated_fee_currency\": \"USDT\"\n     }",
          "{\n        \"id\": 12604556\n    }",
          "{\n        \"market\": \"ADA_USDT\",\n        \"user\": 6392049,\n        \"trigger\": {\n            \"price\": \"1.08\", // stopPrice\n            \"rule\": \"\\u003e=\",\n            \"expiration\": 86400\n        },\n        \"put\": {\n            \"type\": \"limit\",\n            \"side\": \"buy\",\n            \"price\": \"1.08\", // order price\n            \"amount\": \"1.00000000000000000000\",\n            \"account\": \"normal\",\n            \"time_in_force\": \"gtc\"\n        },\n        \"id\": 71639298,\n        \"ctime\": 1643945985,\n        \"status\": \"open\"\n    }",
          "{\n        \"id\": 123028481731,\n        \"contract\": \"ADA_USDT\",\n        \"mkfr\": \"-0.00005\",\n        \"tkfr\": \"0.00048\",\n        \"tif\": \"ioc\",\n        \"is_reduce_only\": false,\n        \"create_time\": 1643950262.68,\n        \"finish_time\": 1643950262.68,\n        \"price\": \"0\",\n        \"size\": 1,\n        \"refr\": \"0\",\n        \"left\":0,\n        \"text\": \"api\",\n        \"fill_price\": \"1.05273\",\n        \"user\":6329238,\n        \"finish_as\": \"filled\",\n        \"status\": \"finished\",\n        \"is_liq\": false,\n        \"refu\":0,\n        \"is_close\": false,\n        \"iceberg\": 0\n    }",
          "{\n        \"user\": 6320300,\n        \"trigger\": {\n            \"strategy_type\": 0,\n            \"price_type\": 0,\n            \"price\": \"1.03\", // stopPrice\n            \"rule\": 2,\n            \"expiration\": 0\n        },\n        \"initial\": {\n            \"contract\": \"ADA_USDT\",\n            \"size\": -1,\n            \"price\": \"1.02\",\n            \"tif\": \"gtc\",\n            \"text\": \"\",\n            \"iceberg\": 0,\n            \"is_close\": false,\n            \"is_reduce_only\": false,\n            \"auto_size\": \"\"\n        },\n        \"id\": 126393906,\n        \"trade_id\": 0,\n        \"status\": \"open\",\n        \"reason\": \"\",\n        \"create_time\": 1643953482,\n        \"finish_time\": 1643953482,\n        \"is_stop_order\": false,\n        \"stop_trigger\": {\n            \"rule\": 0,\n            \"trigger_price\": \"\",\n            \"order_price\": \"\"\n        },\n        \"me_order_id\": 0,\n        \"order_type\": \"\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // SPOT\n        // createOrder/cancelOrder/fetchOrder/editOrder\n        //\n        //    {\n        //        \"id\": \"62364648575\",\n        //        \"text\": \"apiv4\",\n        //        \"create_time\": \"1626354834\",\n        //        \"update_time\": \"1626354834\",\n        //        \"create_time_ms\": \"1626354833544\",\n        //        \"update_time_ms\": \"1626354833544\",\n        //        \"status\": \"open\",\n        //        \"currency_pair\": \"BTC_USDT\",\n        //        \"type\": \"limit\",\n        //        \"account\": \"spot\",\n        //        \"side\": \"buy\",\n        //        \"amount\": \"0.0001\",\n        //        \"price\": \"30000\",\n        //        \"time_in_force\": \"gtc\",\n        //        \"iceberg\": \"0\",\n        //        \"left\": \"0.0001\",\n        //        \"fill_price\": \"0\",\n        //        \"filled_total\": \"0\",\n        //        \"fee\": \"0\",\n        //        \"fee_currency\": \"BTC\",\n        //        \"point_fee\": \"0\",\n        //        \"gt_fee\": \"0\",\n        //        \"gt_discount\": true,\n        //        \"rebated_fee\": \"0\",\n        //        \"rebated_fee_currency\": \"USDT\"\n        //     }\n        //\n        // SPOT TRIGGER ORDERS\n        // createOrder\n        //\n        //    {\n        //        \"id\": 12604556\n        //    }\n        //\n        // fetchOrder/cancelOrder\n        //\n        //    {\n        //        \"market\": \"ADA_USDT\",\n        //        \"user\": 6392049,\n        //        \"trigger\": {\n        //            \"price\": \"1.08\", // stopPrice\n        //            \"rule\": \"\\u003e=\",\n        //            \"expiration\": 86400\n        //        },\n        //        \"put\": {\n        //            \"type\": \"limit\",\n        //            \"side\": \"buy\",\n        //            \"price\": \"1.08\", // order price\n        //            \"amount\": \"1.00000000000000000000\",\n        //            \"account\": \"normal\",\n        //            \"time_in_force\": \"gtc\"\n        //        },\n        //        \"id\": 71639298,\n        //        \"ctime\": 1643945985,\n        //        \"status\": \"open\"\n        //    }\n        //\n        // FUTURE, SWAP AND OPTION\n        // createOrder/cancelOrder/fetchOrder\n        //\n        //    {\n        //        \"id\": 123028481731,\n        //        \"contract\": \"ADA_USDT\",\n        //        \"mkfr\": \"-0.00005\",\n        //        \"tkfr\": \"0.00048\",\n        //        \"tif\": \"ioc\",\n        //        \"is_reduce_only\": false,\n        //        \"create_time\": 1643950262.68,\n        //        \"finish_time\": 1643950262.68,\n        //        \"price\": \"0\",\n        //        \"size\": 1,\n        //        \"refr\": \"0\",\n        //        \"left\":0,\n        //        \"text\": \"api\",\n        //        \"fill_price\": \"1.05273\",\n        //        \"user\":6329238,\n        //        \"finish_as\": \"filled\",\n        //        \"status\": \"finished\",\n        //        \"is_liq\": false,\n        //        \"refu\":0,\n        //        \"is_close\": false,\n        //        \"iceberg\": 0\n        //    }\n        //\n        // TRIGGER ORDERS (FUTURE AND SWAP)\n        // createOrder\n        //\n        //    {\n        //        \"id\": 12604556\n        //    }\n        //\n        // fetchOrder/cancelOrder\n        //\n        //    {\n        //        \"user\": 6320300,\n        //        \"trigger\": {\n        //            \"strategy_type\": 0,\n        //            \"price_type\": 0,\n        //            \"price\": \"1.03\", // stopPrice\n        //            \"rule\": 2,\n        //            \"expiration\": 0\n        //        },\n        //        \"initial\": {\n        //            \"contract\": \"ADA_USDT\",\n        //            \"size\": -1,\n        //            \"price\": \"1.02\",\n        //            \"tif\": \"gtc\",\n        //            \"text\": \"\",\n        //            \"iceberg\": 0,\n        //            \"is_close\": false,\n        //            \"is_reduce_only\": false,\n        //            \"auto_size\": \"\"\n        //        },\n        //        \"id\": 126393906,\n        //        \"trade_id\": 0,\n        //        \"status\": \"open\",\n        //        \"reason\": \"\",\n        //        \"create_time\": 1643953482,\n        //        \"finish_time\": 1643953482,\n        //        \"is_stop_order\": false,\n        //        \"stop_trigger\": {\n        //            \"rule\": 0,\n        //            \"trigger_price\": \"\",\n        //            \"order_price\": \"\"\n        //        },\n        //        \"me_order_id\": 0,\n        //        \"order_type\": \"\"\n        //    }\n        //\n        //    {\n        //        \"text\": \"t-d18baf9ac44d82e2\",\n        //        \"succeeded\": false,\n        //        \"label\": \"BALANCE_NOT_ENOUGH\",\n        //        \"message\": \"Not enough balance\"\n        //    }\n        //\n        //  {\"user_id\":10406147,\"id\":\"id\",\"succeeded\":false,\"message\":\"INVALID_PROTOCOL\",\"label\":\"INVALID_PROTOCOL\"}\n        //\n        // cancel trigger order returns timestamps in ms\n        //   id: '2007047737421336576',\n        //   id_string: '2007047737421336576',\n        //   trigger_time: '0',\n        //   trade_id: '0',\n        //   trade_id_string: '',\n        //   status: 'finished',\n        //   finish_as: 'cancelled',\n        //   reason: '',\n        //   create_time: '1767352444402496'\n        //   finish_time: '1767352509535790',\n        //   is_stop_order: false,\n        //   stop_trigger: { rule: '0', trigger_price: '', order_price: '' },\n        //   me_order_id: '0',\n        //   me_order_id_string: '',\n        //   order_type: '',\n        //   in_dual_mode: false,\n        //   parent_id: '0',\n        const succeeded = this.safeBool (order, 'succeeded', true);\n        if (!succeeded) {\n            // cancelOrders response\n            return this.safeOrder ({\n                'clientOrderId': this.safeString (order, 'text'),\n                'info': order,\n                'status': 'rejected',\n                'id': this.safeString (order, 'id'),\n            });\n        }\n        const put = this.safeValue2 (order, 'put', 'initial', {});\n        const trigger = this.safeValue (order, 'trigger', {});\n        let contract = this.safeString (put, 'contract');\n        let type = this.safeString (put, 'type');\n        let timeInForce = this.safeStringUpper2 (put, 'time_in_force', 'tif');\n        let amount = this.safeString2 (put, 'amount', 'size');\n        let side = this.safeString (put, 'side');\n        let price = this.safeString (put, 'price');\n        contract = this.safeString (order, 'contract', contract);\n        type = this.safeString (order, 'type', type);\n        timeInForce = this.safeStringUpper2 (order, 'time_in_force', 'tif', timeInForce);\n        if (timeInForce === 'POC') {\n            timeInForce = 'PO';\n        }\n        const postOnly = (timeInForce === 'PO');\n        amount = this.safeString2 (order, 'amount', 'size', amount);\n        side = this.safeString (order, 'side', side);\n        price = this.safeString (order, 'price', price);\n        let remainingString = this.safeString (order, 'left');\n        let cost = this.safeString (order, 'filled_total');\n        const triggerPrice = this.safeNumber (trigger, 'price');\n        let average = this.safeNumber2 (order, 'avg_deal_price', 'fill_price');\n        if (triggerPrice) {\n            remainingString = amount;\n            cost = '0';\n        }\n        if (contract) {\n            const isMarketOrder = Precise.stringEquals (price, '0') && (timeInForce === 'IOC');\n            type = isMarketOrder ? 'market' : 'limit';\n            side = Precise.stringGt (amount, '0') ? 'buy' : 'sell';\n        }\n        const rawStatus = this.safeStringN (order, [ 'finish_as', 'status', 'open' ]);\n        let timestampStr = this.safeString (order, 'create_time_ms');\n        if (timestampStr === undefined) {\n            timestampStr = this.safeString2 (order, 'create_time', 'ctime');\n            if (timestampStr !== undefined) {\n                if (timestampStr.length === 10 || timestampStr.indexOf ('.') >= 0) {\n                    // ts in seconds, multiply to ms\n                    timestampStr = Precise.stringMul (timestampStr, '1000');\n                } else if (timestampStr.length === 16) {\n                    // ts in microseconds, divide to ms\n                    timestampStr = Precise.stringDiv (timestampStr, '1000');\n                }\n            }\n        }\n        let lastTradeTimestampStr = this.safeString (order, 'update_time_ms');\n        if (lastTradeTimestampStr === undefined) {\n            lastTradeTimestampStr = this.safeString2 (order, 'update_time', 'finish_time');\n            if (lastTradeTimestampStr !== undefined) {\n                if (lastTradeTimestampStr.length === 10 || lastTradeTimestampStr.indexOf ('.') >= 0) {\n                    // ts in seconds, multiply to ms\n                    lastTradeTimestampStr = Precise.stringMul (lastTradeTimestampStr, '1000');\n                } else if (lastTradeTimestampStr.length === 16) {\n                    // ts in microseconds, divide to ms\n                    lastTradeTimestampStr = Precise.stringDiv (lastTradeTimestampStr, '1000');\n                }\n            }\n        }\n        let marketType = 'contract';\n        if (('currency_pair' in order) || ('market' in order)) {\n            marketType = 'spot';\n        }\n        const exchangeSymbol = this.safeString2 (order, 'currency_pair', 'market', contract);\n        const symbol = this.safeSymbol (exchangeSymbol, market, '_', marketType);\n        // Everything below this(above return) is related to fees\n        const fees = [];\n        const gtFee = this.safeString (order, 'gt_fee');\n        if (gtFee !== undefined) {\n            fees.push ({\n                'currency': 'GT',\n                'cost': gtFee,\n            });\n        }\n        const fee = this.safeString (order, 'fee');\n        if (fee !== undefined) {\n            fees.push ({\n                'currency': this.safeCurrencyCode (this.safeString (order, 'fee_currency')),\n                'cost': fee,\n            });\n        }\n        const rebate = this.safeString (order, 'rebated_fee');\n        if (rebate !== undefined) {\n            fees.push ({\n                'currency': this.safeCurrencyCode (this.safeString (order, 'rebated_fee_currency')),\n                'cost': Precise.stringNeg (rebate),\n            });\n        }\n        const numFeeCurrencies = fees.length;\n        const multipleFeeCurrencies = numFeeCurrencies > 1;\n        const status = this.parseOrderStatus (rawStatus);\n        let remaining = Precise.stringAbs (remainingString);\n        // handle spot market buy\n        const account = this.safeString (order, 'account'); // using this instead of market type because of the conflicting ids\n        if (account === 'spot') {\n            const averageString = this.safeString (order, 'avg_deal_price');\n            average = this.parseNumber (averageString);\n            if ((type === 'market') && (side === 'buy')) {\n                remaining = Precise.stringDiv (remainingString, averageString);\n                price = undefined; // arrives as 0\n                cost = amount;\n                amount = Precise.stringDiv (amount, averageString);\n            }\n        }\n        let timestamp = undefined;\n        let lastTradeTimestamp = undefined;\n        if (timestampStr !== undefined) {\n            timestamp = this.parseToInt (timestampStr);\n        }\n        if (lastTradeTimestampStr !== undefined) {\n            lastTradeTimestamp = this.parseToInt (lastTradeTimestampStr);\n        }\n        return this.safeOrder ({\n            'id': this.safeString (order, 'id'),\n            'clientOrderId': this.safeString (order, 'text'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeValue (order, 'is_reduce_only'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'average': average,\n            'amount': Precise.stringAbs (amount),\n            'cost': Precise.stringAbs (cost),\n            'filled': undefined,\n            'remaining': remaining,\n            'fee': multipleFeeCurrencies ? undefined : this.safeValue (fees, 0),\n            'fees': multipleFeeCurrencies ? fees : [],\n            'trades': undefined,\n            'info': order,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 4822,
        "line_end": 4837,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'open': 'open',\n            '_new': 'open',\n            'filled': 'closed',\n            'cancelled': 'canceled',\n            'liquidated': 'closed',\n            'ioc': 'canceled',\n            'failed': 'canceled',\n            'expired': 'canceled',\n            'finished': 'closed',\n            'finish': 'closed',\n            'succeeded': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 5999,
        "line_end": 6139,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeTimestamp2 (position, 'update_time', 'time')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (Precise.stringDiv (initialMarginString, notional))",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (Precise.stringMul (maintenanceRate, notional))",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceRate)",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entry_price')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealised_pnl')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber2 (position, 'realised_pnl', 'pnl')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (Precise.stringAbs (size))",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liq_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'margin')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"value\": \"4.60516\",\n         \"leverage\": \"0\",\n         \"mode\": \"single\",\n         \"realised_point\": \"0\",\n         \"contract\": \"BTC_USDT\",\n         \"entry_price\": \"46030.3\",\n         \"mark_price\": \"46051.6\",\n         \"history_point\": \"0\",\n         \"realised_pnl\": \"-0.002301515\",\n         \"close_order\": null,\n         \"size\": 1,\n         \"cross_leverage_limit\": \"0\",\n         \"pending_orders\": 0,\n         \"adl_ranking\": 5,\n         \"maintenance_rate\": \"0.004\",\n         \"unrealised_pnl\": \"0.00213\",\n         \"user\": 5691076,\n         \"leverage_max\": \"125\",\n         \"history_pnl\": \"0\",\n         \"risk_limit\": \"1000000\",\n         \"margin\": \"8.997698485\",\n         \"last_close_pnl\": \"0\",\n         \"liq_price\": \"0\",\n         \"update_time\": 1705034246,\n         \"update_id\": 1,\n         \"initial_margin\": \"0\",\n         \"maintenance_margin\": \"0\",\n         \"open_time\": 1705034246,\n         \"trade_max_size\": \"0\"\n     }",
          "{\n         \"close_order\": null,\n         \"size\": 1,\n         \"vega\": \"5.29756\",\n         \"theta\": \"-98.98917\",\n         \"gamma\": \"0.00056\",\n         \"delta\": \"0.68691\",\n         \"contract\": \"BTC_USDT-20230602-26500-C\",\n         \"entry_price\": \"529\",\n         \"unrealised_pnl\": \"-1.0131\",\n         \"user\": 5691076,\n         \"mark_price\": \"427.69\",\n         \"underlying_price\": \"26810.2\",\n         \"underlying\": \"BTC_USDT\",\n         \"realised_pnl\": \"-0.08042877\",\n         \"mark_iv\": \"0.4224\",\n         \"pending_orders\": 0\n     }",
          "{\n        \"contract\": \"SLERF_USDT\",         // Futures contract\n        \"text\": \"web\",                    // Text of close order\n        \"long_price\": \"0.766306\",         // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price.\n        \"pnl\": \"-23.41702352\",            // PNL\n        \"pnl_pnl\": \"-22.7187\",            // Position P/L\n        \"pnl_fee\": \"-0.06527125\",         // Transaction Fees\n        \"pnl_fund\": \"-0.63305227\",        // Funding Fees\n        \"accum_size\": \"100\",\n        \"time\": 1711279263,               // Position close time\n        \"short_price\": \"0.539119\",        // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price\n        \"side\": \"long\",                   // Position side, long or short\n        \"max_size\": \"100\",                // Max Trade Size\n        \"first_open_time\": 1711037985     // First Open Time\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // swap and future\n        //\n        //     {\n        //         \"value\": \"4.60516\",\n        //         \"leverage\": \"0\",\n        //         \"mode\": \"single\",\n        //         \"realised_point\": \"0\",\n        //         \"contract\": \"BTC_USDT\",\n        //         \"entry_price\": \"46030.3\",\n        //         \"mark_price\": \"46051.6\",\n        //         \"history_point\": \"0\",\n        //         \"realised_pnl\": \"-0.002301515\",\n        //         \"close_order\": null,\n        //         \"size\": 1,\n        //         \"cross_leverage_limit\": \"0\",\n        //         \"pending_orders\": 0,\n        //         \"adl_ranking\": 5,\n        //         \"maintenance_rate\": \"0.004\",\n        //         \"unrealised_pnl\": \"0.00213\",\n        //         \"user\": 5691076,\n        //         \"leverage_max\": \"125\",\n        //         \"history_pnl\": \"0\",\n        //         \"risk_limit\": \"1000000\",\n        //         \"margin\": \"8.997698485\",\n        //         \"last_close_pnl\": \"0\",\n        //         \"liq_price\": \"0\",\n        //         \"update_time\": 1705034246,\n        //         \"update_id\": 1,\n        //         \"initial_margin\": \"0\",\n        //         \"maintenance_margin\": \"0\",\n        //         \"open_time\": 1705034246,\n        //         \"trade_max_size\": \"0\"\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"close_order\": null,\n        //         \"size\": 1,\n        //         \"vega\": \"5.29756\",\n        //         \"theta\": \"-98.98917\",\n        //         \"gamma\": \"0.00056\",\n        //         \"delta\": \"0.68691\",\n        //         \"contract\": \"BTC_USDT-20230602-26500-C\",\n        //         \"entry_price\": \"529\",\n        //         \"unrealised_pnl\": \"-1.0131\",\n        //         \"user\": 5691076,\n        //         \"mark_price\": \"427.69\",\n        //         \"underlying_price\": \"26810.2\",\n        //         \"underlying\": \"BTC_USDT\",\n        //         \"realised_pnl\": \"-0.08042877\",\n        //         \"mark_iv\": \"0.4224\",\n        //         \"pending_orders\": 0\n        //     }\n        //\n        // fetchPositionsHistory (swap and future)\n        //\n        //    {\n        //        \"contract\": \"SLERF_USDT\",         // Futures contract\n        //        \"text\": \"web\",                    // Text of close order\n        //        \"long_price\": \"0.766306\",         // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price.\n        //        \"pnl\": \"-23.41702352\",            // PNL\n        //        \"pnl_pnl\": \"-22.7187\",            // Position P/L\n        //        \"pnl_fee\": \"-0.06527125\",         // Transaction Fees\n        //        \"pnl_fund\": \"-0.63305227\",        // Funding Fees\n        //        \"accum_size\": \"100\",\n        //        \"time\": 1711279263,               // Position close time\n        //        \"short_price\": \"0.539119\",        // When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price\n        //        \"side\": \"long\",                   // Position side, long or short\n        //        \"max_size\": \"100\",                // Max Trade Size\n        //        \"first_open_time\": 1711037985     // First Open Time\n        //    }\n        //\n        const contract = this.safeString (position, 'contract');\n        market = this.safeMarket (contract, market, '_', 'contract');\n        const size = this.safeString2 (position, 'size', 'accum_size');\n        let side = this.safeString (position, 'side');\n        if (side === undefined) {\n            if (Precise.stringGt (size, '0')) {\n                side = 'long';\n            } else if (Precise.stringLt (size, '0')) {\n                side = 'short';\n            }\n        }\n        const maintenanceRate = this.safeString (position, 'maintenance_rate');\n        const notional = this.safeString (position, 'value');\n        const leverage = this.safeString (position, 'leverage');\n        let marginMode = undefined;\n        if (leverage !== undefined) {\n            if (leverage === '0') {\n                marginMode = 'cross';\n            } else {\n                marginMode = 'isolated';\n            }\n        }\n        // Initial Position Margin = ( Position Value / Leverage ) + Close Position Fee\n        // *The default leverage under the full position is the highest leverage in the market.\n        // *Trading fee is charged as Taker Fee Rate (0.075%).\n        let feePaid = this.safeString (position, 'pnl_fee');\n        let initialMarginString = undefined;\n        if (feePaid === undefined) {\n            const takerFee = '0.00075';\n            feePaid = Precise.stringMul (takerFee, notional);\n            initialMarginString = Precise.stringAdd (Precise.stringDiv (notional, leverage), feePaid);\n        }\n        let timestamp = this.safeTimestamp2 (position, 'open_time', 'first_open_time');\n        if (timestamp === 0) {\n            timestamp = undefined;\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeTimestamp2 (position, 'update_time', 'time'),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (Precise.stringDiv (initialMarginString, notional)),\n            'maintenanceMargin': this.parseNumber (Precise.stringMul (maintenanceRate, notional)),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceRate),\n            'entryPrice': this.safeNumber (position, 'entry_price'),\n            'notional': this.parseNumber (notional),\n            'leverage': this.safeNumber (position, 'leverage'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealised_pnl'),\n            'realizedPnl': this.safeNumber2 (position, 'realised_pnl', 'pnl'),\n            'contracts': this.parseNumber (Precise.stringAbs (size)),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liq_price'),\n            'markPrice': this.safeNumber (position, 'mark_price'),\n            'lastPrice': undefined,\n            'collateral': this.safeNumber (position, 'margin'),\n            'marginMode': marginMode,\n            'side': side,\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 7242,
        "line_end": 7278,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'settle_price')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": 1685952000,\n         \"profit\": \"18.266806892718\",\n         \"settle_price\": \"26826.68068927182\",\n         \"fee\": \"0.040240021034\",\n         \"contract\": \"BTC_USDT-20230605-25000-C\",\n         \"strike_price\": \"25000\"\n     }",
          "{\n         \"size\": -1,\n         \"settle_profit\": \"0\",\n         \"contract\": \"BTC_USDT-20220624-26000-C\",\n         \"strike_price\": \"26000\",\n         \"time\": 1656057600,\n         \"settle_price\": \"20917.461281337048\",\n         \"underlying\": \"BTC_USDT\",\n         \"realised_pnl\": \"-0.00116042\",\n         \"fee\": \"0\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     {\n        //         \"time\": 1685952000,\n        //         \"profit\": \"18.266806892718\",\n        //         \"settle_price\": \"26826.68068927182\",\n        //         \"fee\": \"0.040240021034\",\n        //         \"contract\": \"BTC_USDT-20230605-25000-C\",\n        //         \"strike_price\": \"25000\"\n        //     }\n        //\n        // fetchMySettlementHistory\n        //\n        //     {\n        //         \"size\": -1,\n        //         \"settle_profit\": \"0\",\n        //         \"contract\": \"BTC_USDT-20220624-26000-C\",\n        //         \"strike_price\": \"26000\",\n        //         \"time\": 1656057600,\n        //         \"settle_price\": \"20917.461281337048\",\n        //         \"underlying\": \"BTC_USDT\",\n        //         \"realised_pnl\": \"-0.00116042\",\n        //         \"fee\": \"0\"\n        //     }\n        //\n        const timestamp = this.safeTimestamp (settlement, 'time');\n        const marketId = this.safeString (settlement, 'contract');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'settle_price'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 7280,
        "line_end": 7316,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"time\": 1685952000,\n             \"profit\": \"18.266806892718\",\n             \"settle_price\": \"26826.68068927182\",\n             \"fee\": \"0.040240021034\",\n             \"contract\": \"BTC_USDT-20230605-25000-C\",\n             \"strike_price\": \"25000\"\n         }\n     ]",
          "[\n         {\n             \"size\": -1,\n             \"settle_profit\": \"0\",\n             \"contract\": \"BTC_USDT-20220624-26000-C\",\n             \"strike_price\": \"26000\",\n             \"time\": 1656057600,\n             \"settle_price\": \"20917.461281337048\",\n             \"underlying\": \"BTC_USDT\",\n             \"realised_pnl\": \"-0.00116042\",\n             \"fee\": \"0\"\n         }\n     ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // fetchSettlementHistory\n        //\n        //     [\n        //         {\n        //             \"time\": 1685952000,\n        //             \"profit\": \"18.266806892718\",\n        //             \"settle_price\": \"26826.68068927182\",\n        //             \"fee\": \"0.040240021034\",\n        //             \"contract\": \"BTC_USDT-20230605-25000-C\",\n        //             \"strike_price\": \"25000\"\n        //         }\n        //     ]\n        //\n        // fetchMySettlementHistory\n        //\n        //     [\n        //         {\n        //             \"size\": -1,\n        //             \"settle_profit\": \"0\",\n        //             \"contract\": \"BTC_USDT-20220624-26000-C\",\n        //             \"strike_price\": \"26000\",\n        //             \"time\": 1656057600,\n        //             \"settle_price\": \"20917.461281337048\",\n        //             \"underlying\": \"BTC_USDT\",\n        //             \"realised_pnl\": \"-0.00116042\",\n        //             \"fee\": \"0\"\n        //         }\n        //     ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            result.push (this.parseSettlement (settlements[i], market));\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2869,
        "line_end": 2982,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'index_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency_pair\": \"KFC_USDT\",\n         \"last\": \"7.255\",\n         \"lowest_ask\": \"7.298\",\n         \"highest_bid\": \"7.218\",\n         \"change_percentage\": \"-1.18\",\n         \"base_volume\": \"1219.053687865\",\n         \"quote_volume\": \"8807.40299875455\",\n         \"high_24h\": \"7.262\",\n         \"low_24h\": \"7.095\"\n     }",
          "{\n         \"contract\": \"BTC_USDT\",\n         \"last\": \"6432\",\n         \"low_24h\": \"6278\",\n         \"high_24h\": \"6790\",\n         \"change_percentage\": \"4.43\",\n         \"total_size\": \"32323904\",\n         \"volume_24h\": \"184040233284\",\n         \"volume_24h_btc\": \"28613220\",\n         \"volume_24h_usd\": \"184040233284\",\n         \"volume_24h_base\": \"28613220\",\n         \"volume_24h_quote\": \"184040233284\",\n         \"volume_24h_settle\": \"28613220\",\n         \"mark_price\": \"6534\",\n         \"funding_rate\": \"0.0001\",\n         \"funding_rate_indicative\": \"0.0001\",\n         \"index_price\": \"6531\"\n     }",
          "{\n        \"t\": 1671363004228,\n        \"u\": 9793320464,\n        \"s\": \"BTC_USDT\",\n        \"b\": \"16716.8\", // best bid price\n        \"B\": \"0.0134\", // best bid size\n        \"a\": \"16716.9\", // best ask price\n        \"A\": \"0.0353\" // best ask size\n     }",
          "{\n         \"vega\": \"0.00002\",\n         \"leverage\": \"12.277188268663\",\n         \"ask_iv\": \"0\",\n         \"delta\": \"-0.99999\",\n         \"last_price\": \"0\",\n         \"theta\": \"-0.00661\",\n         \"bid1_price\": \"1096\",\n         \"mark_iv\": \"0.7799\",\n         \"name\": \"BTC_USDT-20230608-28500-P\",\n         \"bid_iv\": \"0\",\n         \"ask1_price\": \"2935\",\n         \"mark_price\": \"2147.3\",\n         \"position_size\": 0,\n         \"bid1_size\": 12,\n         \"ask1_size\": -14,\n         \"gamma\": \"0\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // SPOT\n        //\n        //     {\n        //         \"currency_pair\": \"KFC_USDT\",\n        //         \"last\": \"7.255\",\n        //         \"lowest_ask\": \"7.298\",\n        //         \"highest_bid\": \"7.218\",\n        //         \"change_percentage\": \"-1.18\",\n        //         \"base_volume\": \"1219.053687865\",\n        //         \"quote_volume\": \"8807.40299875455\",\n        //         \"high_24h\": \"7.262\",\n        //         \"low_24h\": \"7.095\"\n        //     }\n        //\n        // LINEAR/DELIVERY\n        //\n        //     {\n        //         \"contract\": \"BTC_USDT\",\n        //         \"last\": \"6432\",\n        //         \"low_24h\": \"6278\",\n        //         \"high_24h\": \"6790\",\n        //         \"change_percentage\": \"4.43\",\n        //         \"total_size\": \"32323904\",\n        //         \"volume_24h\": \"184040233284\",\n        //         \"volume_24h_btc\": \"28613220\",\n        //         \"volume_24h_usd\": \"184040233284\",\n        //         \"volume_24h_base\": \"28613220\",\n        //         \"volume_24h_quote\": \"184040233284\",\n        //         \"volume_24h_settle\": \"28613220\",\n        //         \"mark_price\": \"6534\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"funding_rate_indicative\": \"0.0001\",\n        //         \"index_price\": \"6531\"\n        //     }\n        //\n        // bookTicker\n        //    {\n        //        \"t\": 1671363004228,\n        //        \"u\": 9793320464,\n        //        \"s\": \"BTC_USDT\",\n        //        \"b\": \"16716.8\", // best bid price\n        //        \"B\": \"0.0134\", // best bid size\n        //        \"a\": \"16716.9\", // best ask price\n        //        \"A\": \"0.0353\" // best ask size\n        //     }\n        //\n        // option\n        //\n        //     {\n        //         \"vega\": \"0.00002\",\n        //         \"leverage\": \"12.277188268663\",\n        //         \"ask_iv\": \"0\",\n        //         \"delta\": \"-0.99999\",\n        //         \"last_price\": \"0\",\n        //         \"theta\": \"-0.00661\",\n        //         \"bid1_price\": \"1096\",\n        //         \"mark_iv\": \"0.7799\",\n        //         \"name\": \"BTC_USDT-20230608-28500-P\",\n        //         \"bid_iv\": \"0\",\n        //         \"ask1_price\": \"2935\",\n        //         \"mark_price\": \"2147.3\",\n        //         \"position_size\": 0,\n        //         \"bid1_size\": 12,\n        //         \"ask1_size\": -14,\n        //         \"gamma\": \"0\"\n        //     }\n        //\n        const marketId = this.safeStringN (ticker, [ 'currency_pair', 'contract', 'name' ]);\n        const marketType = ('mark_price' in ticker) ? 'contract' : 'spot';\n        const symbol = this.safeSymbol (marketId, market, '_', marketType);\n        const last = this.safeString2 (ticker, 'last', 'last_price');\n        const ask = this.safeStringN (ticker, [ 'lowest_ask', 'a', 'ask1_price' ]);\n        const bid = this.safeStringN (ticker, [ 'highest_bid', 'b', 'bid1_price' ]);\n        const high = this.safeString (ticker, 'high_24h');\n        const low = this.safeString (ticker, 'low_24h');\n        const bidVolume = this.safeString2 (ticker, 'B', 'bid1_size');\n        const askVolume = this.safeString2 (ticker, 'A', 'ask1_size');\n        const timestamp = this.safeInteger (ticker, 't');\n        let baseVolume = this.safeString2 (ticker, 'base_volume', 'volume_24h_base');\n        if (baseVolume === 'nan') {\n            baseVolume = '0';\n        }\n        let quoteVolume = this.safeString2 (ticker, 'quote_volume', 'volume_24h_quote');\n        if (quoteVolume === 'nan') {\n            quoteVolume = '0';\n        }\n        const percentage = this.safeString (ticker, 'change_percentage');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'indexPrice': this.safeString (ticker, 'index_price'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 3823,
        "line_end": 3988,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fees",
            "value": "fees",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeAmount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1334253759\",\n         \"create_time\": \"1626342738\",\n         \"create_time_ms\": \"1626342738331.497000\",\n         \"currency_pair\": \"BTC_USDT\",\n         \"side\": \"sell\",\n         \"amount\": \"0.0022\",\n         \"price\": \"32452.16\"\n     }",
          "{\n        \"id\": \"442288327\",\n        \"contract\": \"BTC_USDT\",\n        \"create_time\": \"1739814676.707\",\n        \"create_time_ms\": \"1739814676.707\",\n        \"size\": \"-105\",\n        \"price\": \"95594.8\"\n    }",
          "{\n         \"id\": 221994511,\n         \"time\": 1580311438.618647,\n         \"price\": \"9309\",\n         \"amount\": \"0.0019\",\n         \"type\": \"sell\"\n     }",
          "{\n         \"id\": \"2876130500\",\n         \"create_time\": \"1645464610\",\n         \"create_time_ms\": \"1645464610777.399200\",\n         \"currency_pair\": \"DOGE_USDT\",\n         \"side\": \"sell\",\n         \"role\": \"taker\",\n         \"amount\": \"10.97\",\n         \"price\": \"0.137384\",\n         \"order_id\": \"125924049993\",\n         \"fee\": \"0.00301420496\",\n         \"fee_currency\": \"USDT\",\n         \"point_fee\": \"1.1\",\n         \"gt_fee\":\"2.2\"\n     }",
          "{\n         \"size\": -5,\n         \"order_id\": \"130264979823\",\n         \"id\": 26884791,\n         \"role\": \"taker\",\n         \"create_time\": 1645465199.5472,\n         \"contract\": \"DOGE_USDT\",\n         \"price\": \"0.136888\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public\n        //\n        //  spot:\n        //     {\n        //         \"id\": \"1334253759\",\n        //         \"create_time\": \"1626342738\",\n        //         \"create_time_ms\": \"1626342738331.497000\",\n        //         \"currency_pair\": \"BTC_USDT\",\n        //         \"side\": \"sell\",\n        //         \"amount\": \"0.0022\",\n        //         \"price\": \"32452.16\"\n        //     }\n        //\n        //  swap:\n        //\n        //    {\n        //        \"id\": \"442288327\",\n        //        \"contract\": \"BTC_USDT\",\n        //        \"create_time\": \"1739814676.707\",\n        //        \"create_time_ms\": \"1739814676.707\",\n        //        \"size\": \"-105\",\n        //        \"price\": \"95594.8\"\n        //    }\n        //\n        //\n        // public ws\n        //\n        //     {\n        //         \"id\": 221994511,\n        //         \"time\": 1580311438.618647,\n        //         \"price\": \"9309\",\n        //         \"amount\": \"0.0019\",\n        //         \"type\": \"sell\"\n        //     }\n        //\n        // spot rest\n        //\n        //     {\n        //         \"id\": \"2876130500\",\n        //         \"create_time\": \"1645464610\",\n        //         \"create_time_ms\": \"1645464610777.399200\",\n        //         \"currency_pair\": \"DOGE_USDT\",\n        //         \"side\": \"sell\",\n        //         \"role\": \"taker\",\n        //         \"amount\": \"10.97\",\n        //         \"price\": \"0.137384\",\n        //         \"order_id\": \"125924049993\",\n        //         \"fee\": \"0.00301420496\",\n        //         \"fee_currency\": \"USDT\",\n        //         \"point_fee\": \"1.1\",\n        //         \"gt_fee\":\"2.2\"\n        //     }\n        //\n        // perpetual swap rest\n        //\n        //     {\n        //         \"size\": -5,\n        //         \"order_id\": \"130264979823\",\n        //         \"id\": 26884791,\n        //         \"role\": \"taker\",\n        //         \"create_time\": 1645465199.5472,\n        //         \"contract\": \"DOGE_USDT\",\n        //         \"price\": \"0.136888\"\n        //     }\n        //\n        // future rest\n        //\n        //     {\n        //         \"id\": 121234231,\n        //         \"create_time\": 1514764800.123,\n        //         \"contract\": \"BTC_USDT\",\n        //         \"order_id\": \"21893289839\",\n        //         \"size\": 100,\n        //         \"price\": \"100.123\",\n        //         \"role\": \"taker\"\n        //     }\n        //\n        // fetchTrades: option\n        //\n        //     {\n        //         \"size\": -5,\n        //         \"id\": 25,\n        //         \"create_time\": 1682378573,\n        //         \"contract\": \"ETH_USDT-20230526-2000-P\",\n        //         \"price\": \"209.1\"\n        //     }\n        //\n        // fetchMyTrades: option\n        //\n        //     {\n        //         \"underlying_price\": \"26817.84\",\n        //         \"size\": -1,\n        //         \"contract\": \"BTC_USDT-20230602-26500-C\",\n        //         \"id\": 16,\n        //         \"role\": \"taker\",\n        //         \"create_time\": 1685594770,\n        //         \"order_id\": 2611026125,\n        //         \"price\": \"333\"\n        //     }\n        //\n        const id = this.safeString2 (trade, 'id', 'trade_id');\n        let timestamp: Int = undefined;\n        let msString = this.safeString (trade, 'create_time_ms');\n        if (msString !== undefined) {\n            msString = Precise.stringMul (msString, '1000');\n            msString = msString.slice (0, 13);\n            timestamp = this.parseToInt (msString);\n        } else {\n            timestamp = this.safeTimestamp2 (trade, 'time', 'create_time');\n        }\n        const marketId = this.safeString2 (trade, 'currency_pair', 'contract');\n        const marketType = ('contract' in trade) ? 'contract' : 'spot';\n        market = this.safeMarket (marketId, market, '_', marketType);\n        let amountString = this.safeString2 (trade, 'amount', 'size');\n        const priceString = this.safeString (trade, 'price');\n        const contractSide = Precise.stringLt (amountString, '0') ? 'sell' : 'buy';\n        amountString = Precise.stringAbs (amountString);\n        const side = this.safeString2 (trade, 'side', 'type', contractSide);\n        const orderId = this.safeString (trade, 'order_id');\n        const feeAmount = this.safeString (trade, 'fee');\n        const gtFee = this.omitZero (this.safeString (trade, 'gt_fee'));\n        const pointFee = this.omitZero (this.safeString (trade, 'point_fee'));\n        const fees = [];\n        if (feeAmount !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'fee_currency');\n            let feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            if (feeCurrencyCode === undefined) {\n                feeCurrencyCode = this.safeString (market, 'settle');\n            }\n            fees.push ({\n                'cost': feeAmount,\n                'currency': feeCurrencyCode,\n            });\n        }\n        if (gtFee !== undefined) {\n            fees.push ({\n                'cost': gtFee,\n                'currency': 'GT',\n            });\n        }\n        if (pointFee !== undefined) {\n            fees.push ({\n                'cost': pointFee,\n                'currency': 'GATEPOINT',\n            });\n        }\n        const takerOrMaker = this.safeString (trade, 'role');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n            'fees': fees,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (info, market: Market = undefined)",
        "line_start": 2437,
        "line_end": 2466,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (info, makerKey)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (info, takerKey)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"user_id\": 1486602,\n        \"taker_fee\": \"0.002\",\n        \"maker_fee\": \"0.002\",\n        \"gt_discount\": true,\n        \"gt_taker_fee\": \"0.0015\",\n        \"gt_maker_fee\": \"0.0015\",\n        \"loan_fee\": \"0.18\",\n        \"point_type\": \"0\",\n        \"futures_taker_fee\": \"0.0005\",\n        \"futures_maker_fee\": \"0\"\n    }"
        ],
        "source": "parseTradingFee (info, market: Market = undefined) {\n        //\n        //    {\n        //        \"user_id\": 1486602,\n        //        \"taker_fee\": \"0.002\",\n        //        \"maker_fee\": \"0.002\",\n        //        \"gt_discount\": true,\n        //        \"gt_taker_fee\": \"0.0015\",\n        //        \"gt_maker_fee\": \"0.0015\",\n        //        \"loan_fee\": \"0.18\",\n        //        \"point_type\": \"0\",\n        //        \"futures_taker_fee\": \"0.0005\",\n        //        \"futures_maker_fee\": \"0\"\n        //    }\n        //\n        const gtDiscount = this.safeValue (info, 'gt_discount');\n        const taker = gtDiscount ? 'gt_taker_fee' : 'taker_fee';\n        const maker = gtDiscount ? 'gt_maker_fee' : 'maker_fee';\n        const contract = this.safeValue (market, 'contract');\n        const takerKey = contract ? 'futures_taker_fee' : taker;\n        const makerKey = contract ? 'futures_maker_fee' : maker;\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'maker': this.safeNumber (info, makerKey),\n            'taker': this.safeNumber (info, takerKey),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTradingFees",
        "signature": "parseTradingFees (response)",
        "line_start": 2427,
        "line_end": 2435,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingFees (response) {\n        const result: Dict = {};\n        for (let i = 0; i < this.symbols.length; i++) {\n            const symbol = this.symbols[i];\n            const market = this.market (symbol);\n            result[symbol] = this.parseTradingFee (response, market);\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4138,
        "line_end": 4249,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"d33361395\",\n         \"currency\": \"USDT_TRX\",\n         \"address\": \"TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z\",\n         \"amount\": \"100\",\n         \"txid\": \"ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0\",\n         \"timestamp\": \"1626345819\",\n         \"status\": \"DONE\",\n         \"memo\": \"\"\n     }",
          "{\n         \"id\":\"w64413318\",\n         \"currency\":\"usdt\",\n         \"amount\":\"10150\",\n         \"address\":\"0x0ab891497116f7f5532a4c2f4f7b1784488628e1\",\n         \"memo\":null,\n         \"status\":\"REQUEST\",\n         \"chain\":\"eth\",\n         \"withdraw_order_id\":\"\",\n         \"fee_amount\":\"4.15000000\"\n     }",
          "{\n         \"id\": \"210496\",\n         \"timestamp\": \"1542000000\",\n         \"withdraw_order_id\": \"order_123456\",\n         \"currency\": \"USDT\",\n         \"address\": \"1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs\",\n         \"txid\": \"128988928203223323290\",\n         \"block_number\": \"41575382\",\n         \"amount\": \"222.61\",\n         \"fee\": \"0.01\",\n         \"memo\": \"\",\n         \"status\": \"DONE\",\n         \"chain\": \"TRX\"\n     }",
          "{\n         \"id\": \"w13389675\",\n         \"currency\": \"USDT\",\n         \"amount\": \"50\",\n         \"address\": \"TUu2rLFrmzUodiWfYki7QCNtv1akL682p1\",\n         \"memo\": null\n     }",
          "{\n         \"currency\":\"usdt\",\n         \"address\":\"0x01c0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806\",\n         \"amount\":\"1880\",\n         \"chain\":\"eth\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": \"d33361395\",\n        //         \"currency\": \"USDT_TRX\",\n        //         \"address\": \"TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z\",\n        //         \"amount\": \"100\",\n        //         \"txid\": \"ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0\",\n        //         \"timestamp\": \"1626345819\",\n        //         \"status\": \"DONE\",\n        //         \"memo\": \"\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\":\"w64413318\",\n        //         \"currency\":\"usdt\",\n        //         \"amount\":\"10150\",\n        //         \"address\":\"0x0ab891497116f7f5532a4c2f4f7b1784488628e1\",\n        //         \"memo\":null,\n        //         \"status\":\"REQUEST\",\n        //         \"chain\":\"eth\",\n        //         \"withdraw_order_id\":\"\",\n        //         \"fee_amount\":\"4.15000000\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"210496\",\n        //         \"timestamp\": \"1542000000\",\n        //         \"withdraw_order_id\": \"order_123456\",\n        //         \"currency\": \"USDT\",\n        //         \"address\": \"1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs\",\n        //         \"txid\": \"128988928203223323290\",\n        //         \"block_number\": \"41575382\",\n        //         \"amount\": \"222.61\",\n        //         \"fee\": \"0.01\",\n        //         \"memo\": \"\",\n        //         \"status\": \"DONE\",\n        //         \"chain\": \"TRX\"\n        //     }\n        //\n        //     {\n        //         \"id\": \"w13389675\",\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"50\",\n        //         \"address\": \"TUu2rLFrmzUodiWfYki7QCNtv1akL682p1\",\n        //         \"memo\": null\n        //     }\n        //\n        //     {\n        //         \"currency\":\"usdt\",\n        //         \"address\":\"0x01c0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806\",\n        //         \"amount\":\"1880\",\n        //         \"chain\":\"eth\"\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        let type = undefined;\n        let amountString = this.safeString (transaction, 'amount');\n        if (id !== undefined) {\n            if (id[0] === 'b') {\n                // GateCode handling\n                type = Precise.stringGt (amountString, '0') ? 'deposit' : 'withdrawal';\n                amountString = Precise.stringAbs (amountString);\n            } else {\n                type = this.parseTransactionType (id[0]);\n            }\n        }\n        const feeCostString = this.safeString2 (transaction, 'fee', 'fee_amount');\n        if (type === 'withdrawal') {\n            amountString = Precise.stringSub (amountString, feeCostString);\n        }\n        const networkId = this.safeStringUpper (transaction, 'chain');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const txid = this.safeString (transaction, 'txid');\n        const rawStatus = this.safeString (transaction, 'status');\n        const status = this.parseTransactionStatus (rawStatus);\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'memo');\n        const timestamp = this.safeTimestamp (transaction, 'timestamp');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'currency': code,\n            'amount': this.parseNumber (amountString),\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'status': status,\n            'type': type,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n            },\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 4111,
        "line_end": 4128,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'PEND': 'pending',\n            'REQUEST': 'pending',\n            'DMOVE': 'pending',\n            'MANUAL': 'pending',\n            'VERIFY': 'pending',\n            'PROCES': 'pending',\n            'EXTPEND': 'pending',\n            'SPLITPEND': 'pending',\n            'CANCEL': 'canceled',\n            'FAIL': 'failed',\n            'INVALID': 'failed',\n            'DONE': 'ok',\n            'BCODE': 'ok', // GateCode withdrawal\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 4130,
        "line_end": 4136,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'd': 'deposit',\n            'w': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "gate"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 5901,
        "line_end": 5922,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'tx_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\": \"BTC\",\n        \"from\": \"spot\",\n        \"to\": \"margin\",\n        \"amount\": \"1\",\n        \"currency_pair\": \"BTC_USDT\"\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    {\n        //        \"currency\": \"BTC\",\n        //        \"from\": \"spot\",\n        //        \"to\": \"margin\",\n        //        \"amount\": \"1\",\n        //        \"currency_pair\": \"BTC_USDT\"\n        //    }\n        //\n        return {\n            'id': this.safeString (transfer, 'tx_id'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n            'info': transfer,\n        };\n    }",
        "inherited": true,
        "inherited_from": "gate"
      }
    ],
    "gemini": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1187,
        "line_end": 1199,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'available');\n            account['total'] = this.safeString (balance, 'amount');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined)",
        "line_start": 1848,
        "line_end": 1865,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"address\": \"0xed6494Fe7c1E56d1bd6136e89268C51E32d9708B\",\n          \"timestamp\": \"1636813923098\",\n          \"addressVersion\": \"eV1\"                                         }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined) {\n        //\n        //      {\n        //          \"address\": \"0xed6494Fe7c1E56d1bd6136e89268C51E32d9708B\",\n        //          \"timestamp\": \"1636813923098\",\n        //          \"addressVersion\": \"eV1\"                                         }\n        //      }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const code = this.safeCurrencyCode (undefined, currency);\n        return {\n            'currency': code,\n            'network': undefined,\n            'address': address,\n            'tag': undefined,\n            'info': depositAddress,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (response): Market",
        "line_start": 695,
        "line_end": 850,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "!swap",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "status",
            "comment": null
          },
          {
            "key": "contract",
            "value": "swap",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'price': tickSize,\n                'amount': amountPrecision,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minSize,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [
          "[\n         'BTCUSD',   // symbol\n         2,          // tick precision (priceTickDecimalPlaces)\n         8,          // amount precision (quantityTickDecimalPlaces)\n         '0.00001',  // quantityMinimum\n         10,         // quantityRoundDecimalPlaces\n         true        // minimumsAreInclusive\n     ],",
          "{\n         \"symbol\": \"BTCUSD\", // perpetuals have 'PERP' suffix, i.e. DOGEUSDPERP\n         \"base_currency\": \"BTC\",\n         \"quote_currency\": \"USD\",\n         \"tick_size\": 1E-8,\n         \"quote_increment\": 0.01,\n         \"min_order_size\": \"0.00001\",\n         \"status\": \"open\",\n         \"wrap_enabled\": false\n         \"product_type\": \"swap\", // only in perps\n         \"contract_type\": \"linear\", // only in perps\n         \"contract_price_currency\": \"GUSD\"\n     }"
        ],
        "source": "parseMarket (response): Market {\n        //\n        // response might be:\n        //\n        //     btcusd\n        //\n        // or\n        //\n        //     [\n        //         'BTCUSD',   // symbol\n        //         2,          // tick precision (priceTickDecimalPlaces)\n        //         8,          // amount precision (quantityTickDecimalPlaces)\n        //         '0.00001',  // quantityMinimum\n        //         10,         // quantityRoundDecimalPlaces\n        //         true        // minimumsAreInclusive\n        //     ],\n        //\n        // or\n        //\n        //     {\n        //         \"symbol\": \"BTCUSD\", // perpetuals have 'PERP' suffix, i.e. DOGEUSDPERP\n        //         \"base_currency\": \"BTC\",\n        //         \"quote_currency\": \"USD\",\n        //         \"tick_size\": 1E-8,\n        //         \"quote_increment\": 0.01,\n        //         \"min_order_size\": \"0.00001\",\n        //         \"status\": \"open\",\n        //         \"wrap_enabled\": false\n        //         \"product_type\": \"swap\", // only in perps\n        //         \"contract_type\": \"linear\", // only in perps\n        //         \"contract_price_currency\": \"GUSD\"\n        //     }\n        //\n        let marketId = undefined;\n        let baseId = undefined;\n        let quoteId = undefined;\n        let settleId = undefined;\n        let tickSize = undefined;\n        let amountPrecision = undefined;\n        let minSize = undefined;\n        let status = undefined;\n        let swap = false;\n        let contractSize = undefined;\n        let linear = undefined;\n        let inverse = undefined;\n        const isString = (typeof response === 'string');\n        const isArray = (Array.isArray (response));\n        if (!isString && !isArray) {\n            marketId = this.safeStringLower (response, 'symbol');\n            amountPrecision = this.safeNumber (response, 'tick_size'); // right, exchange has an imperfect naming and this turns out to be an amount-precision\n            tickSize = this.safeNumber (response, 'quote_increment'); // this is tick-size actually\n            minSize = this.safeNumber (response, 'min_order_size');\n            status = this.parseMarketActive (this.safeString (response, 'status'));\n            baseId = this.safeString (response, 'base_currency');\n            quoteId = this.safeString (response, 'quote_currency');\n            settleId = this.safeString (response, 'contract_price_currency');\n        } else {\n            // if no detailed API was called, then parse either string or array\n            if (isString) {\n                marketId = response;\n            } else {\n                marketId = this.safeStringLower (response, 0);\n                tickSize = this.parseNumber (this.parsePrecision (this.safeString (response, 1))); // priceTickDecimalPlaces\n                amountPrecision = this.parseNumber (this.parsePrecision (this.safeString (response, 2))); // quantityTickDecimalPlaces\n                minSize = this.safeNumber (response, 3); // quantityMinimum\n            }\n            const marketIdUpper = marketId.toUpperCase ();\n            const isPerp = (marketIdUpper.indexOf ('PERP') >= 0);\n            const marketIdWithoutPerp = marketIdUpper.replace ('PERP', '');\n            const conflictingMarkets = this.safeDict (this.options, 'conflictingMarkets', {});\n            const lowerCaseId = marketIdWithoutPerp.toLowerCase ();\n            if (lowerCaseId in conflictingMarkets) {\n                const conflictingMarket = conflictingMarkets[lowerCaseId];\n                baseId = conflictingMarket['base'];\n                quoteId = conflictingMarket['quote'];\n                if (isPerp) {\n                    settleId = conflictingMarket['quote'];\n                }\n            } else {\n                const quoteCurrencies = this.handleOption ('fetchMarketsFromAPI', 'quoteCurrencies', []);\n                for (let i = 0; i < quoteCurrencies.length; i++) {\n                    const quoteCurrency = quoteCurrencies[i];\n                    if (marketIdWithoutPerp.endsWith (quoteCurrency)) {\n                        const quoteLength = this.parseToInt (-1 * quoteCurrency.length);\n                        baseId = marketIdWithoutPerp.slice (0, quoteLength);\n                        quoteId = quoteCurrency;\n                        if (isPerp) {\n                            settleId = quoteCurrency; // always same\n                        }\n                        break;\n                    }\n                }\n            }\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settle = this.safeCurrencyCode (settleId);\n        let symbol = base + '/' + quote;\n        if (settleId !== undefined) {\n            symbol = symbol + ':' + settle;\n            swap = true;\n            contractSize = tickSize; // always same\n            linear = true; // always linear\n            inverse = false;\n        }\n        const type = swap ? 'swap' : 'spot';\n        return {\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': !swap,\n            'margin': false,\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': status,\n            'contract': swap,\n            'linear': linear,\n            'inverse': inverse,\n            'contractSize': contractSize,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'price': tickSize,\n                'amount': amountPrecision,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minSize,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': response,\n        };\n    }"
      },
      {
        "name": "parseMarketActive",
        "signature": "parseMarketActive (status)",
        "line_start": 595,
        "line_end": 607,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarketActive (status) {\n        const statuses: Dict = {\n            'open': true,\n            'closed': false,\n            'cancel_only': true,\n            'post_only': true,\n            'limit_only': true,\n        };\n        if (status === undefined) {\n            return true; // as defaulted below\n        }\n        return this.safeBool (statuses, status, true);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1275,
        "line_end": 1438,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"order_id\":\"106027397702\",\n          \"id\":\"106027397702\",\n          \"symbol\":\"etheur\",\n          \"exchange\":\"gemini\",\n          \"avg_execution_price\":\"2877.48\",\n          \"side\":\"sell\",\n          \"type\":\"exchange limit\",\n          \"timestamp\":\"1650398122\",\n          \"timestampms\":1650398122308,\n          \"is_live\":false,\n          \"is_cancelled\":false,\n          \"is_hidden\":false,\n          \"was_forced\":false,\n          \"executed_amount\":\"0.014434\",\n          \"client_order_id\":\"1650398121695\",\n          \"options\":[],\n          \"price\":\"2800.00\",\n          \"original_amount\":\"0.014434\",\n          \"remaining_amount\":\"0\"\n      }",
          "{\n          \"order_id\":\"106028543717\",\n          \"id\":\"106028543717\",\n          \"symbol\":\"etheur\",\n          \"exchange\":\"gemini\",\n          \"avg_execution_price\":\"0.00\",\n          \"side\":\"buy\",\n          \"type\":\"exchange limit\",\n          \"timestamp\":\"1650398446\",\n          \"timestampms\":1650398446375,\n          \"is_live\":true,\n          \"is_cancelled\":false,\n          \"is_hidden\":false,\n          \"was_forced\":false,\n          \"executed_amount\":\"0\",\n          \"client_order_id\":\"1650398445709\",\n          \"options\":[],\n          \"price\":\"2000.00\",\n          \"original_amount\":\"0.01\",\n          \"remaining_amount\":\"0.01\"\n      }",
          "{\n          \"order_id\":\"106028543717\",\n          \"id\":\"106028543717\",\n          \"symbol\":\"etheur\",\n          \"exchange\":\"gemini\",\n          \"avg_execution_price\":\"0.00\",\n          \"side\":\"buy\",\n          \"type\":\"exchange limit\",\n          \"timestamp\":\"1650398446\",\n          \"timestampms\":1650398446375,\n          \"is_live\":false,\n          \"is_cancelled\":true,\n          \"is_hidden\":false,\n          \"was_forced\":false,\n          \"executed_amount\":\"0\",\n          \"client_order_id\":\"1650398445709\",\n          \"reason\":\"Requested\",\n          \"options\":[],\n          \"price\":\"2000.00\",\n          \"original_amount\":\"0.01\",\n          \"remaining_amount\":\"0.01\"\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder (private)\n        //\n        //      {\n        //          \"order_id\":\"106027397702\",\n        //          \"id\":\"106027397702\",\n        //          \"symbol\":\"etheur\",\n        //          \"exchange\":\"gemini\",\n        //          \"avg_execution_price\":\"2877.48\",\n        //          \"side\":\"sell\",\n        //          \"type\":\"exchange limit\",\n        //          \"timestamp\":\"1650398122\",\n        //          \"timestampms\":1650398122308,\n        //          \"is_live\":false,\n        //          \"is_cancelled\":false,\n        //          \"is_hidden\":false,\n        //          \"was_forced\":false,\n        //          \"executed_amount\":\"0.014434\",\n        //          \"client_order_id\":\"1650398121695\",\n        //          \"options\":[],\n        //          \"price\":\"2800.00\",\n        //          \"original_amount\":\"0.014434\",\n        //          \"remaining_amount\":\"0\"\n        //      }\n        //\n        // fetchOrder (private)\n        //\n        //      {\n        //          \"order_id\":\"106028543717\",\n        //          \"id\":\"106028543717\",\n        //          \"symbol\":\"etheur\",\n        //          \"exchange\":\"gemini\",\n        //          \"avg_execution_price\":\"0.00\",\n        //          \"side\":\"buy\",\n        //          \"type\":\"exchange limit\",\n        //          \"timestamp\":\"1650398446\",\n        //          \"timestampms\":1650398446375,\n        //          \"is_live\":true,\n        //          \"is_cancelled\":false,\n        //          \"is_hidden\":false,\n        //          \"was_forced\":false,\n        //          \"executed_amount\":\"0\",\n        //          \"client_order_id\":\"1650398445709\",\n        //          \"options\":[],\n        //          \"price\":\"2000.00\",\n        //          \"original_amount\":\"0.01\",\n        //          \"remaining_amount\":\"0.01\"\n        //      }\n        //\n        // fetchOpenOrders (private)\n        //\n        //      {\n        //          \"order_id\":\"106028543717\",\n        //          \"id\":\"106028543717\",\n        //          \"symbol\":\"etheur\",\n        //          \"exchange\":\"gemini\",\n        //          \"avg_execution_price\":\"0.00\",\n        //          \"side\":\"buy\",\n        //          \"type\":\"exchange limit\",\n        //          \"timestamp\":\"1650398446\",\n        //          \"timestampms\":1650398446375,\n        //          \"is_live\":true,\n        //          \"is_cancelled\":false,\n        //          \"is_hidden\":false,\n        //          \"was_forced\":false,\n        //          \"executed_amount\":\"0\",\n        //          \"client_order_id\":\"1650398445709\",\n        //          \"options\":[],\n        //          \"price\":\"2000.00\",\n        //          \"original_amount\":\"0.01\",\n        //          \"remaining_amount\":\"0.01\"\n        //      }\n        //\n        // cancelOrder (private)\n        //\n        //      {\n        //          \"order_id\":\"106028543717\",\n        //          \"id\":\"106028543717\",\n        //          \"symbol\":\"etheur\",\n        //          \"exchange\":\"gemini\",\n        //          \"avg_execution_price\":\"0.00\",\n        //          \"side\":\"buy\",\n        //          \"type\":\"exchange limit\",\n        //          \"timestamp\":\"1650398446\",\n        //          \"timestampms\":1650398446375,\n        //          \"is_live\":false,\n        //          \"is_cancelled\":true,\n        //          \"is_hidden\":false,\n        //          \"was_forced\":false,\n        //          \"executed_amount\":\"0\",\n        //          \"client_order_id\":\"1650398445709\",\n        //          \"reason\":\"Requested\",\n        //          \"options\":[],\n        //          \"price\":\"2000.00\",\n        //          \"original_amount\":\"0.01\",\n        //          \"remaining_amount\":\"0.01\"\n        //      }\n        //\n        const timestamp = this.safeInteger (order, 'timestampms');\n        const amount = this.safeString (order, 'original_amount');\n        const remaining = this.safeString (order, 'remaining_amount');\n        const filled = this.safeString (order, 'executed_amount');\n        let status = 'closed';\n        if (order['is_live']) {\n            status = 'open';\n        }\n        if (order['is_cancelled']) {\n            status = 'canceled';\n        }\n        const price = this.safeString (order, 'price');\n        const average = this.safeString (order, 'avg_execution_price');\n        let type = this.safeString (order, 'type');\n        if (type === 'exchange limit') {\n            type = 'limit';\n        } else if (type === 'market buy' || type === 'market sell') {\n            type = 'market';\n        } else {\n            type = order['type'];\n        }\n        const fee = undefined;\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const id = this.safeString (order, 'order_id');\n        const side = this.safeStringLower (order, 'side');\n        const clientOrderId = this.safeString (order, 'client_order_id');\n        const optionsArray = this.safeValue (order, 'options', []);\n        const option = this.safeString (optionsArray, 0);\n        let timeInForce = 'GTC';\n        let postOnly = false;\n        if (option !== undefined) {\n            if (option === 'immediate-or-cancel') {\n                timeInForce = 'IOC';\n            } else if (option === 'fill-or-kill') {\n                timeInForce = 'FOK';\n            } else if (option === 'maker-or-cancel') {\n                timeInForce = 'PO';\n                postOnly = true;\n            }\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce, // default set to GTC\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'average': average,\n            'cost': undefined,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 958,
        "line_end": 1050,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"pair\": \"BATUSD\",\n         \"price\": \"0.20687\",\n         \"percentChange24h\": \"0.0146\"\n     }",
          "{\n         \"bid\":\"9117.95\",\n         \"ask\":\"9117.96\",\n         \"volume\":{\n             \"BTC\":\"1615.46861748\",\n             \"USD\":\"14727307.57545006088\",\n             \"timestamp\":1594982700000\n         },\n         \"last\":\"9115.23\"\n     }",
          "{\n         \"symbol\":\"BTCUSD\",\n         \"open\":\"9080.58\",\n         \"high\":\"9184.53\",\n         \"low\":\"9063.56\",\n         \"close\":\"9116.08\",\n         // Hourly prices descending for past 24 hours\n         \"changes\":[\"9117.33\",\"9105.69\",\"9106.23\",\"9120.35\",\"9098.57\",\"9114.53\",\"9113.55\",\"9128.01\",\"9113.63\",\"9133.49\",\"9133.49\",\"9137.75\",\"9126.73\",\"9103.91\",\"9119.33\",\"9123.04\",\"9124.44\",\"9117.57\",\"9114.22\",\"9102.33\",\"9076.67\",\"9074.72\",\"9074.97\",\"9092.05\"],\n         \"bid\":\"9115.86\",\n         \"ask\":\"9115.87\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTickers\n        //\n        //     {\n        //         \"pair\": \"BATUSD\",\n        //         \"price\": \"0.20687\",\n        //         \"percentChange24h\": \"0.0146\"\n        //     }\n        //\n        // fetchTickerV1\n        //\n        //     {\n        //         \"bid\":\"9117.95\",\n        //         \"ask\":\"9117.96\",\n        //         \"volume\":{\n        //             \"BTC\":\"1615.46861748\",\n        //             \"USD\":\"14727307.57545006088\",\n        //             \"timestamp\":1594982700000\n        //         },\n        //         \"last\":\"9115.23\"\n        //     }\n        //\n        // fetchTickerV2\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD\",\n        //         \"open\":\"9080.58\",\n        //         \"high\":\"9184.53\",\n        //         \"low\":\"9063.56\",\n        //         \"close\":\"9116.08\",\n        //         // Hourly prices descending for past 24 hours\n        //         \"changes\":[\"9117.33\",\"9105.69\",\"9106.23\",\"9120.35\",\"9098.57\",\"9114.53\",\"9113.55\",\"9128.01\",\"9113.63\",\"9133.49\",\"9133.49\",\"9137.75\",\"9126.73\",\"9103.91\",\"9119.33\",\"9123.04\",\"9124.44\",\"9117.57\",\"9114.22\",\"9102.33\",\"9076.67\",\"9074.72\",\"9074.97\",\"9092.05\"],\n        //         \"bid\":\"9115.86\",\n        //         \"ask\":\"9115.87\"\n        //     }\n        //\n        const volume = this.safeValue (ticker, 'volume', {});\n        const timestamp = this.safeInteger (volume, 'timestamp');\n        let symbol = undefined;\n        const marketId = this.safeStringLower (ticker, 'pair');\n        market = this.safeMarket (marketId, market);\n        let baseId = undefined;\n        let quoteId = undefined;\n        let base = undefined;\n        let quote = undefined;\n        if ((marketId !== undefined) && (market === undefined)) {\n            const idLength = marketId.length - 0;\n            if (idLength === 7) {\n                baseId = marketId.slice (0, 4);\n                quoteId = marketId.slice (4, 7);\n            } else {\n                baseId = marketId.slice (0, 3);\n                quoteId = marketId.slice (3, 6);\n            }\n            base = this.safeCurrencyCode (baseId);\n            quote = this.safeCurrencyCode (quoteId);\n            symbol = base + '/' + quote;\n        }\n        if ((symbol === undefined) && (market !== undefined)) {\n            symbol = market['symbol'];\n            baseId = this.safeStringUpper (market, 'baseId');\n            quoteId = this.safeStringUpper (market, 'quoteId');\n        }\n        const price = this.safeString (ticker, 'price');\n        const last = this.safeString2 (ticker, 'last', 'close', price);\n        const percentage = this.safeString (ticker, 'percentChange24h');\n        const open = this.safeString (ticker, 'open');\n        const baseVolume = this.safeString (volume, baseId);\n        const quoteVolume = this.safeString (volume, quoteId);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined, // previous day close\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1083,
        "line_end": 1145,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee_amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"timestamp\":1601617445,\n         \"timestampms\":1601617445144,\n         \"tid\":14122489752,\n         \"price\":\"0.46476\",\n         \"amount\":\"28.407209\",\n         \"exchange\":\"gemini\",\n         \"type\":\"buy\"\n     }",
          "{\n          \"price\":\"3900.00\",\n          \"amount\":\"0.00996\",\n          \"timestamp\":1638891173,\n          \"timestampms\":1638891173518,\n          \"type\":\"Sell\",\n          \"aggressor\":false,\n          \"fee_currency\":\"EUR\",\n          \"fee_amount\":\"0.00\",\n          \"tid\":73621746145,\n          \"order_id\":\"73621746059\",\n          \"exchange\":\"gemini\",\n          \"is_auction_fill\":false,\n          \"is_clearing_fill\":false,\n          \"symbol\":\"ETHEUR\",\n          \"client_order_id\":\"1638891171610\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"timestamp\":1601617445,\n        //         \"timestampms\":1601617445144,\n        //         \"tid\":14122489752,\n        //         \"price\":\"0.46476\",\n        //         \"amount\":\"28.407209\",\n        //         \"exchange\":\"gemini\",\n        //         \"type\":\"buy\"\n        //     }\n        //\n        // private fetchTrades\n        //\n        //      {\n        //          \"price\":\"3900.00\",\n        //          \"amount\":\"0.00996\",\n        //          \"timestamp\":1638891173,\n        //          \"timestampms\":1638891173518,\n        //          \"type\":\"Sell\",\n        //          \"aggressor\":false,\n        //          \"fee_currency\":\"EUR\",\n        //          \"fee_amount\":\"0.00\",\n        //          \"tid\":73621746145,\n        //          \"order_id\":\"73621746059\",\n        //          \"exchange\":\"gemini\",\n        //          \"is_auction_fill\":false,\n        //          \"is_clearing_fill\":false,\n        //          \"symbol\":\"ETHEUR\",\n        //          \"client_order_id\":\"1638891171610\"\n        //      }\n        //\n        const timestamp = this.safeInteger (trade, 'timestampms');\n        const id = this.safeString (trade, 'tid');\n        const orderId = this.safeString (trade, 'order_id');\n        const feeCurrencyId = this.safeString (trade, 'fee_currency');\n        const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n        const fee = {\n            'cost': this.safeString (trade, 'fee_amount'),\n            'currency': feeCurrencyCode,\n        };\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const side = this.safeStringLower (trade, 'type');\n        const symbol = this.safeSymbol (undefined, market);\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'cost': undefined,\n            'amount': amountString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1782,
        "line_end": 1838,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'eid', 'withdrawalId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txHash')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (statusRaw)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'message')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\":\"mi98Z9brJ3TgaKsmvXatuRahbFRUFKRUdR\",\n         \"amount\":\"1\",\n         \"withdrawalId\":\"02176a83-a6b1-4202-9b85-1c1c92dd25c4\",\n         \"message\":\"You have requested a transfer of 1 BTC to mi98Z9brJ3TgaKsmvXatuRahbFRUFKRUdR. This withdrawal will be sent to the blockchain within the next 60 seconds.\"\n     }",
          "{\n         \"address\":\"0xA63123350Acc8F5ee1b1fBd1A6717135e82dBd28\",\n         \"amount\":\"2.34567\",\n         \"txHash\":\"0x28267179f92926d85c5516bqc063b2631935573d8915258e95d9572eedcc8cc\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //   for BTC\n        //     {\n        //         \"address\":\"mi98Z9brJ3TgaKsmvXatuRahbFRUFKRUdR\",\n        //         \"amount\":\"1\",\n        //         \"withdrawalId\":\"02176a83-a6b1-4202-9b85-1c1c92dd25c4\",\n        //         \"message\":\"You have requested a transfer of 1 BTC to mi98Z9brJ3TgaKsmvXatuRahbFRUFKRUdR. This withdrawal will be sent to the blockchain within the next 60 seconds.\"\n        //     }\n        //\n        //   for ETH\n        //     {\n        //         \"address\":\"0xA63123350Acc8F5ee1b1fBd1A6717135e82dBd28\",\n        //         \"amount\":\"2.34567\",\n        //         \"txHash\":\"0x28267179f92926d85c5516bqc063b2631935573d8915258e95d9572eedcc8cc\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transaction, 'timestampms');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const address = this.safeString (transaction, 'destination');\n        const type = this.safeStringLower (transaction, 'type');\n        // if status field is available, then it's complete\n        const statusRaw = this.safeString (transaction, 'status');\n        let fee = undefined;\n        const feeAmount = this.safeNumber (transaction, 'feeAmount');\n        if (feeAmount !== undefined) {\n            fee = {\n                'cost': feeAmount,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'eid', 'withdrawalId'),\n            'txid': this.safeString (transaction, 'txHash'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': undefined, // or is it defined?\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type, // direction of the transaction, ('deposit' | 'withdraw')\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (statusRaw),\n            'updated': undefined,\n            'internal': undefined,\n            'comment': this.safeString (transaction, 'message'),\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1840,
        "line_end": 1846,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'Advanced': 'ok',\n            'Complete': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "hashkey": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 2280,
        "line_end": 2296,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (account, 'accountId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseAccount (account) {\n        const accountLabel = this.safeString (account, 'accountLabel');\n        let label = '';\n        if (accountLabel === 'Main Trading Account' || accountLabel === 'Main Future Account') {\n            label = 'main';\n        } else if (accountLabel === 'Sub Main Trading Account' || accountLabel === 'Sub Main Future Account') {\n            label = 'sub';\n        }\n        const accountType = this.parseAccountType (this.safeString (account, 'accountType'));\n        const type = label + ' ' + accountType;\n        return {\n            'id': this.safeString (account, 'accountId'),\n            'type': type,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseAccountType",
        "signature": "parseAccountType (type)",
        "line_start": 2298,
        "line_end": 2306,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseAccountType (type) {\n        const types: Dict = {\n            '1': 'spot account',\n            '3': 'swap account',\n            '5': 'custody account',\n            '6': 'fiat account',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (balance): Balances",
        "line_start": 1810,
        "line_end": 1842,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"balances\": [\n             {\n                 \"asset\":\"USDT\",\n                 \"assetId\":\"USDT\",\n                 \"assetName\":\"USDT\",\n                 \"total\":\"40\",\n                 \"free\":\"40\",\n                 \"locked\":\"0\"\n             },\n             ...\n         ],\n         \"userId\": \"1732885739572845312\"\n     }"
        ],
        "source": "parseBalance (balance): Balances {\n        //\n        //     {\n        //         \"balances\": [\n        //             {\n        //                 \"asset\":\"USDT\",\n        //                 \"assetId\":\"USDT\",\n        //                 \"assetName\":\"USDT\",\n        //                 \"total\":\"40\",\n        //                 \"free\":\"40\",\n        //                 \"locked\":\"0\"\n        //             },\n        //             ...\n        //         ],\n        //         \"userId\": \"1732885739572845312\"\n        //     }\n        //\n        const result: Dict = {\n            'info': balance,\n        };\n        const balances = this.safeList (balance, 'balances', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balanceEntry = balances[i];\n            const currencyId = this.safeString (balanceEntry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balanceEntry, 'total');\n            account['free'] = this.safeString (balanceEntry, 'free');\n            account['used'] = this.safeString (balanceEntry, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1909,
        "line_end": 1935,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"canDeposit\": true,\n         \"address\": \"0x61AAd7F763e2C7fF1CC996918740F67f9dC8BF4e\",\n         \"addressExt\": \"\",\n         \"minQuantity\": \"1\",\n         \"needAddressTag\": false,\n         \"requiredConfirmTimes\": 64,\n         \"canWithdrawConfirmTimes\": 64,\n         \"coinType\": \"ERC20_TOKEN\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"canDeposit\": true,\n        //         \"address\": \"0x61AAd7F763e2C7fF1CC996918740F67f9dC8BF4e\",\n        //         \"addressExt\": \"\",\n        //         \"minQuantity\": \"1\",\n        //         \"needAddressTag\": false,\n        //         \"requiredConfirmTimes\": 64,\n        //         \"canWithdrawConfirmTimes\": 64,\n        //         \"coinType\": \"ERC20_TOKEN\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        let tag = this.safeString (depositAddress, 'addressExt');\n        if (tag === '') {\n            tag = undefined;\n        }\n        return {\n            'info': depositAddress,\n            'currency': currency['code'],\n            'network': undefined,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3823,
        "line_end": 3855,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT-PERPETUAL\",\n         \"rate\": \"0.0001\",\n         \"nextSettleTime\": \"1722297600000\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"ETHUSDT-PERPETUAL\",\n        //         \"rate\": \"0.0001\",\n        //         \"nextSettleTime\": \"1722297600000\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'swap');\n        const fundingRate = this.safeNumber (contract, 'rate');\n        const fundingTimestamp = this.safeInteger (contract, 'nextSettleTime');\n        return {\n            'info': contract,\n            'symbol': market['symbol'],\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': fundingRate,\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': fundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (fundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined): LastPrice",
        "line_start": 1741,
        "line_end": 1752,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (entry, 'p')",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLastPrice (entry, market: Market = undefined): LastPrice {\n        const marketId = this.safeString (entry, 's');\n        market = this.safeMarket (marketId, market);\n        return {\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'price': this.safeNumber (entry, 'p'),\n            'side': undefined,\n            'info': entry,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2403,
        "line_end": 2453,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1740844413612065537\",\n         \"accountId\": \"1732885739589466112\",\n         \"coin\": \"USDT\",\n         \"coinId\": \"USDT\",\n         \"coinName\": \"USDT\",\n         \"flowTypeValue\": 51,\n         \"flowType\": \"USER_ACCOUNT_TRANSFER\",\n         \"flowName\": \"\",\n         \"change\": \"-1\",\n         \"total\": \"8.015680088\",\n         \"created\": \"1722260825765\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"id\": \"1740844413612065537\",\n        //         \"accountId\": \"1732885739589466112\",\n        //         \"coin\": \"USDT\",\n        //         \"coinId\": \"USDT\",\n        //         \"coinName\": \"USDT\",\n        //         \"flowTypeValue\": 51,\n        //         \"flowType\": \"USER_ACCOUNT_TRANSFER\",\n        //         \"flowName\": \"\",\n        //         \"change\": \"-1\",\n        //         \"total\": \"8.015680088\",\n        //         \"created\": \"1722260825765\"\n        //     }\n        //\n        const id = this.safeString (item, 'id');\n        const account = this.safeString (item, 'accountId');\n        const timestamp = this.safeInteger (item, 'created');\n        const type = this.parseLedgerEntryType (this.safeString (item, 'flowTypeValue'));\n        const currencyId = this.safeString (item, 'coin');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amountString = this.safeString (item, 'change');\n        const amount = this.parseNumber (amountString);\n        let direction = 'in';\n        if (amountString.indexOf ('-') >= 0) {\n            direction = 'out';\n        }\n        const afterString = this.safeString (item, 'total');\n        const after = this.parseNumber (afterString);\n        const status = 'ok';\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'account': account,\n            'direction': direction,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'symbol': undefined,\n            'amount': amount,\n            'before': undefined,\n            'after': after,\n            'status': status,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2392,
        "line_end": 2401,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            '1': 'trade', // transfer\n            '2': 'fee', // trade\n            '51': 'transfer',\n            '900': 'deposit',\n            '904': 'withdraw',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 4047,
        "line_end": 4057,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marginMode = this.safeStringLower (leverage, 'marginType');\n        const leverageValue = this.safeNumber (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': marginMode,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 869,
        "line_end": 1137,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "subType",
            "value": "subType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "isSpot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "this.safeBool (market, 'allowMargin')",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isSwap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "contract",
            "value": "isSwap",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSizeString)",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isLinear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isInverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeBool (fees, 'percentage')",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "this.safeBool (fees, 'tierBased')",
            "comment": null
          },
          {
            "key": "feeSide",
            "value": "this.safeString (fees, 'feeSide')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (amountPrecisionString),\n                'price': this.safeNumber (priceFilter, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.parseNumber (amountMinLimitString),\n                    'max': this.parseNumber (amountMaxLimitString),\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'leverage': {\n                    'min': minLeverage,\n                    'max': maxLeverage,\n                },\n                'cost': {\n                    'min': this.parseNumber (minCostString),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountPrecisionString)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (priceFilter, 'tickSize')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.parseNumber (amountMinLimitString),\n                    'max': this.parseNumber (amountMaxLimitString),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                }",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': minLeverage,\n                    'max': maxLeverage,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.parseNumber (minCostString),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "minLeverage",
            "comment": null
          },
          {
            "key": "max",
            "value": "maxLeverage",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"symbolName\": \"BTCUSDT\",\n         \"status\": \"TRADING\",\n         \"baseAsset\": \"BTC\",\n         \"baseAssetName\": \"BTC\",\n         \"baseAssetPrecision\": \"0.00001\",\n         \"quoteAsset\": \"USDT\",\n         \"quoteAssetName\": \"USDT\",\n         \"quotePrecision\": \"0.0000001\",\n         \"retailAllowed\": true,\n         \"piAllowed\": true,\n         \"corporateAllowed\": true,\n         \"omnibusAllowed\": true,\n         \"icebergAllowed\": false,\n         \"isAggregate\": false,\n         \"allowMargin\": false,\n         \"filters\": [\n             {\n                 \"minPrice\": \"0.01\",\n                 \"maxPrice\": \"100000.00000000\",\n                 \"tickSize\": \"0.01\",\n                 \"filterType\": \"PRICE_FILTER\"\n             },\n             {\n                 \"minQty\": \"0.00001\",\n                 \"maxQty\": \"8\",\n                 \"stepSize\": \"0.00001\",\n                 \"marketOrderMinQty\": \"0.00001\",\n                 \"marketOrderMaxQty\": \"4\",\n                 \"filterType\": \"LOT_SIZE\"\n             },\n             {\n                 \"minNotional\": \"1\",\n                 \"filterType\": \"MIN_NOTIONAL\"\n             },\n             {\n                 \"minAmount\": \"1\",\n                 \"maxAmount\": \"400000\",\n                 \"minBuyPrice\": \"0\",\n                 \"marketOrderMinAmount\": \"1\",\n                 \"marketOrderMaxAmount\": \"200000\",\n                 \"filterType\": \"TRADE_AMOUNT\"\n             },\n             {\n                 \"maxSellPrice\": \"0\",\n                 \"buyPriceUpRate\": \"0.1\",\n                 \"sellPriceDownRate\": \"0.1\",\n                 \"filterType\": \"LIMIT_TRADING\"\n             },\n             {\n                 \"buyPriceUpRate\": \"0.1\",\n                 \"sellPriceDownRate\": \"0.1\",\n                 \"filterType\": \"MARKET_TRADING\"\n             },\n             {\n                 \"noAllowMarketStartTime\": \"1710485700000\",\n                 \"noAllowMarketEndTime\": \"1710486000000\",\n                 \"limitOrderStartTime\": \"0\",\n                 \"limitOrderEndTime\": \"0\",\n                 \"limitMinPrice\": \"0\",\n                 \"limitMaxPrice\": \"0\",\n                 \"filterType\": \"OPEN_QUOTE\"\n             }\n         ]\n     }",
          "{\n         \"filters\": [\n             {\n                 \"minPrice\": \"0.1\",\n                 \"maxPrice\": \"100000.00000000\",\n                 \"tickSize\": \"0.1\",\n                 \"filterType\": \"PRICE_FILTER\"\n             },\n             {\n                 \"minQty\": \"0.001\",\n                 \"maxQty\": \"10\",\n                 \"stepSize\": \"0.001\",\n                 \"marketOrderMinQty\": \"0\",\n                 \"marketOrderMaxQty\": \"0\",\n                 \"filterType\": \"LOT_SIZE\"\n             },\n             {\n                 \"minNotional\": \"0\",\n                 \"filterType\": \"MIN_NOTIONAL\"\n             },\n             {\n                 \"maxSellPrice\": \"999999\",\n                 \"buyPriceUpRate\": \"0.05\",\n                 \"sellPriceDownRate\": \"0.05\",\n                 \"maxEntrustNum\": 200,\n                 \"maxConditionNum\": 200,\n                 \"filterType\": \"LIMIT_TRADING\"\n             },\n             {\n                 \"buyPriceUpRate\": \"0.05\",\n                 \"sellPriceDownRate\": \"0.05\",\n                 \"filterType\": \"MARKET_TRADING\"\n             },\n             {\n                 \"noAllowMarketStartTime\": \"0\",\n                 \"noAllowMarketEndTime\": \"0\",\n                 \"limitOrderStartTime\": \"0\",\n                 \"limitOrderEndTime\": \"0\",\n                 \"limitMinPrice\": \"0\",\n                 \"limitMaxPrice\": \"0\",\n                 \"filterType\": \"OPEN_QUOTE\"\n             }\n         ],\n         \"exchangeId\": \"301\",\n         \"symbol\": \"BTCUSDT-PERPETUAL\",\n         \"symbolName\": \"BTCUSDT-PERPETUAL\",\n         \"status\": \"TRADING\",\n         \"baseAsset\": \"BTCUSDT-PERPETUAL\",\n         \"baseAssetPrecision\": \"0.001\",\n         \"quoteAsset\": \"USDT\",\n         \"quoteAssetPrecision\": \"0.1\",\n         \"icebergAllowed\": false,\n         \"inverse\": false,\n         \"index\": \"USDT\",\n         \"marginToken\": \"USDT\",\n         \"marginPrecision\": \"0.0001\",\n         \"contractMultiplier\": \"0.001\",\n         \"underlying\": \"BTC\",\n         \"riskLimits\": [\n             {\n                 \"riskLimitId\": \"200000722\",\n                 \"quantity\": \"1000.00\",\n                 \"initialMargin\": \"0.10\",\n                 \"maintMargin\": \"0.005\",\n                 \"isWhite\": false\n             },\n             {\n                 \"riskLimitId\": \"200000723\",\n                 \"quantity\": \"2000.00\",\n                 \"initialMargin\": \"0.10\",\n                 \"maintMargin\": \"0.01\",\n                 \"isWhite\": false\n             }\n         ]\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        // spot\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"symbolName\": \"BTCUSDT\",\n        //         \"status\": \"TRADING\",\n        //         \"baseAsset\": \"BTC\",\n        //         \"baseAssetName\": \"BTC\",\n        //         \"baseAssetPrecision\": \"0.00001\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"quoteAssetName\": \"USDT\",\n        //         \"quotePrecision\": \"0.0000001\",\n        //         \"retailAllowed\": true,\n        //         \"piAllowed\": true,\n        //         \"corporateAllowed\": true,\n        //         \"omnibusAllowed\": true,\n        //         \"icebergAllowed\": false,\n        //         \"isAggregate\": false,\n        //         \"allowMargin\": false,\n        //         \"filters\": [\n        //             {\n        //                 \"minPrice\": \"0.01\",\n        //                 \"maxPrice\": \"100000.00000000\",\n        //                 \"tickSize\": \"0.01\",\n        //                 \"filterType\": \"PRICE_FILTER\"\n        //             },\n        //             {\n        //                 \"minQty\": \"0.00001\",\n        //                 \"maxQty\": \"8\",\n        //                 \"stepSize\": \"0.00001\",\n        //                 \"marketOrderMinQty\": \"0.00001\",\n        //                 \"marketOrderMaxQty\": \"4\",\n        //                 \"filterType\": \"LOT_SIZE\"\n        //             },\n        //             {\n        //                 \"minNotional\": \"1\",\n        //                 \"filterType\": \"MIN_NOTIONAL\"\n        //             },\n        //             {\n        //                 \"minAmount\": \"1\",\n        //                 \"maxAmount\": \"400000\",\n        //                 \"minBuyPrice\": \"0\",\n        //                 \"marketOrderMinAmount\": \"1\",\n        //                 \"marketOrderMaxAmount\": \"200000\",\n        //                 \"filterType\": \"TRADE_AMOUNT\"\n        //             },\n        //             {\n        //                 \"maxSellPrice\": \"0\",\n        //                 \"buyPriceUpRate\": \"0.1\",\n        //                 \"sellPriceDownRate\": \"0.1\",\n        //                 \"filterType\": \"LIMIT_TRADING\"\n        //             },\n        //             {\n        //                 \"buyPriceUpRate\": \"0.1\",\n        //                 \"sellPriceDownRate\": \"0.1\",\n        //                 \"filterType\": \"MARKET_TRADING\"\n        //             },\n        //             {\n        //                 \"noAllowMarketStartTime\": \"1710485700000\",\n        //                 \"noAllowMarketEndTime\": \"1710486000000\",\n        //                 \"limitOrderStartTime\": \"0\",\n        //                 \"limitOrderEndTime\": \"0\",\n        //                 \"limitMinPrice\": \"0\",\n        //                 \"limitMaxPrice\": \"0\",\n        //                 \"filterType\": \"OPEN_QUOTE\"\n        //             }\n        //         ]\n        //     }\n        //\n        // swap\n        //     {\n        //         \"filters\": [\n        //             {\n        //                 \"minPrice\": \"0.1\",\n        //                 \"maxPrice\": \"100000.00000000\",\n        //                 \"tickSize\": \"0.1\",\n        //                 \"filterType\": \"PRICE_FILTER\"\n        //             },\n        //             {\n        //                 \"minQty\": \"0.001\",\n        //                 \"maxQty\": \"10\",\n        //                 \"stepSize\": \"0.001\",\n        //                 \"marketOrderMinQty\": \"0\",\n        //                 \"marketOrderMaxQty\": \"0\",\n        //                 \"filterType\": \"LOT_SIZE\"\n        //             },\n        //             {\n        //                 \"minNotional\": \"0\",\n        //                 \"filterType\": \"MIN_NOTIONAL\"\n        //             },\n        //             {\n        //                 \"maxSellPrice\": \"999999\",\n        //                 \"buyPriceUpRate\": \"0.05\",\n        //                 \"sellPriceDownRate\": \"0.05\",\n        //                 \"maxEntrustNum\": 200,\n        //                 \"maxConditionNum\": 200,\n        //                 \"filterType\": \"LIMIT_TRADING\"\n        //             },\n        //             {\n        //                 \"buyPriceUpRate\": \"0.05\",\n        //                 \"sellPriceDownRate\": \"0.05\",\n        //                 \"filterType\": \"MARKET_TRADING\"\n        //             },\n        //             {\n        //                 \"noAllowMarketStartTime\": \"0\",\n        //                 \"noAllowMarketEndTime\": \"0\",\n        //                 \"limitOrderStartTime\": \"0\",\n        //                 \"limitOrderEndTime\": \"0\",\n        //                 \"limitMinPrice\": \"0\",\n        //                 \"limitMaxPrice\": \"0\",\n        //                 \"filterType\": \"OPEN_QUOTE\"\n        //             }\n        //         ],\n        //         \"exchangeId\": \"301\",\n        //         \"symbol\": \"BTCUSDT-PERPETUAL\",\n        //         \"symbolName\": \"BTCUSDT-PERPETUAL\",\n        //         \"status\": \"TRADING\",\n        //         \"baseAsset\": \"BTCUSDT-PERPETUAL\",\n        //         \"baseAssetPrecision\": \"0.001\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"quoteAssetPrecision\": \"0.1\",\n        //         \"icebergAllowed\": false,\n        //         \"inverse\": false,\n        //         \"index\": \"USDT\",\n        //         \"marginToken\": \"USDT\",\n        //         \"marginPrecision\": \"0.0001\",\n        //         \"contractMultiplier\": \"0.001\",\n        //         \"underlying\": \"BTC\",\n        //         \"riskLimits\": [\n        //             {\n        //                 \"riskLimitId\": \"200000722\",\n        //                 \"quantity\": \"1000.00\",\n        //                 \"initialMargin\": \"0.10\",\n        //                 \"maintMargin\": \"0.005\",\n        //                 \"isWhite\": false\n        //             },\n        //             {\n        //                 \"riskLimitId\": \"200000723\",\n        //                 \"quantity\": \"2000.00\",\n        //                 \"initialMargin\": \"0.10\",\n        //                 \"maintMargin\": \"0.01\",\n        //                 \"isWhite\": false\n        //             }\n        //         ]\n        //     }\n        //\n        const marketId = this.safeString (market, 'symbol');\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const quote = this.safeCurrencyCode (quoteId);\n        const settleId = this.safeString (market, 'marginToken');\n        const settle = this.safeCurrencyCode (settleId);\n        let baseId = this.safeString (market, 'baseAsset');\n        let marketType = 'spot' as any;\n        let isSpot = true;\n        let isSwap = false;\n        let suffix = '';\n        const parts = marketId.split ('-');\n        const secondPart = this.safeString (parts, 1);\n        if (secondPart === 'PERPETUAL') {\n            marketType = 'swap';\n            isSpot = false;\n            isSwap = true;\n            baseId = this.safeString (market, 'underlying');\n            suffix += ':' + settleId;\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const symbol = base + '/' + quote + suffix;\n        const status = this.safeString (market, 'status');\n        const active = status === 'TRADING';\n        let isLinear: Bool = undefined;\n        let subType = undefined;\n        const isInverse = this.safeBool (market, 'inverse');\n        if (isInverse !== undefined) {\n            if (isInverse) {\n                isLinear = false;\n                subType = 'inverse';\n            } else {\n                isLinear = true;\n                subType = 'linear';\n            }\n        }\n        const filtersList = this.safeList (market, 'filters', []);\n        const filters = this.indexBy (filtersList, 'filterType');\n        const priceFilter = this.safeDict (filters, 'PRICE_FILTER', {});\n        const amountFilter = this.safeDict (filters, 'LOT_SIZE', {});\n        const costFilter = this.safeDict (filters, 'MIN_NOTIONAL', {});\n        const minCostString = this.omitZero (this.safeString (costFilter, 'min_notional'));\n        const contractSizeString = this.safeString (market, 'contractMultiplier');\n        let amountPrecisionString = this.safeString (amountFilter, 'stepSize');\n        let amountMinLimitString = this.safeString (amountFilter, 'minQty');\n        let amountMaxLimitString = this.safeString (amountFilter, 'maxQty');\n        let minLeverage: Int = undefined;\n        let maxLeverage: Int = undefined;\n        if (isSwap) {\n            amountPrecisionString = Precise.stringDiv (amountPrecisionString, contractSizeString);\n            amountMinLimitString = Precise.stringDiv (amountMinLimitString, contractSizeString);\n            amountMaxLimitString = Precise.stringDiv (amountMaxLimitString, contractSizeString);\n            const riskLimits = this.safeList (market, 'riskLimits');\n            if (riskLimits !== undefined) {\n                const first = this.safeDict (riskLimits, 0);\n                const arrayLength = riskLimits.length;\n                const last = this.safeDict (riskLimits, arrayLength - 1);\n                let minInitialMargin = this.safeString (first, 'initialMargin');\n                let maxInitialMargin = this.safeString (last, 'initialMargin');\n                if (Precise.stringGt (minInitialMargin, maxInitialMargin)) {\n                    [ minInitialMargin, maxInitialMargin ] = [ maxInitialMargin, minInitialMargin ];\n                }\n                minLeverage = this.parseToInt (Precise.stringDiv ('1', maxInitialMargin));\n                maxLeverage = this.parseToInt (Precise.stringDiv ('1', minInitialMargin));\n            }\n        }\n        const tradingFees = this.safeDict (this.fees, 'trading');\n        const fees = isSpot ? this.safeDict (tradingFees, 'spot') : this.safeDict (tradingFees, 'swap');\n        return this.safeMarketStructure ({\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'active': active,\n            'type': marketType,\n            'subType': subType,\n            'spot': isSpot,\n            'margin': this.safeBool (market, 'allowMargin'),\n            'swap': isSwap,\n            'future': false,\n            'option': false,\n            'contract': isSwap,\n            'settle': settle,\n            'settleId': settleId,\n            'contractSize': this.parseNumber (contractSizeString),\n            'linear': isLinear,\n            'inverse': isInverse,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'percentage': this.safeBool (fees, 'percentage'),\n            'tierBased': this.safeBool (fees, 'tierBased'),\n            'feeSide': this.safeString (fees, 'feeSide'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (amountPrecisionString),\n                'price': this.safeNumber (priceFilter, 'tickSize'),\n            },\n            'limits': {\n                'amount': {\n                    'min': this.parseNumber (amountMinLimitString),\n                    'max': this.parseNumber (amountMaxLimitString),\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'leverage': {\n                    'min': minLeverage,\n                    'max': maxLeverage,\n                },\n                'cost': {\n                    'min': this.parseNumber (minCostString),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 4108,
        "line_end": 4205,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'quantity')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintMargin')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.parseNumber (Precise.stringDiv ('1', initialMarginRate))",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"filters\": [\n             {\n                 \"minPrice\": \"0.1\",\n                 \"maxPrice\": \"100000.00000000\",\n                 \"tickSize\": \"0.1\",\n                 \"filterType\": \"PRICE_FILTER\"\n             },\n             {\n                 \"minQty\": \"0.001\",\n                 \"maxQty\": \"10\",\n                 \"stepSize\": \"0.001\",\n                 \"marketOrderMinQty\": \"0\",\n                 \"marketOrderMaxQty\": \"0\",\n                 \"filterType\": \"LOT_SIZE\"\n             },\n             {\n                 \"minNotional\": \"0\",\n                 \"filterType\": \"MIN_NOTIONAL\"\n             },\n             {\n                 \"maxSellPrice\": \"999999\",\n                 \"buyPriceUpRate\": \"0.05\",\n                 \"sellPriceDownRate\": \"0.05\",\n                 \"maxEntrustNum\": 200,\n                 \"maxConditionNum\": 200,\n                 \"filterType\": \"LIMIT_TRADING\"\n             },\n             {\n                 \"buyPriceUpRate\": \"0.05\",\n                 \"sellPriceDownRate\": \"0.05\",\n                 \"filterType\": \"MARKET_TRADING\"\n             },\n             {\n                 \"noAllowMarketStartTime\": \"0\",\n                 \"noAllowMarketEndTime\": \"0\",\n                 \"limitOrderStartTime\": \"0\",\n                 \"limitOrderEndTime\": \"0\",\n                 \"limitMinPrice\": \"0\",\n                 \"limitMaxPrice\": \"0\",\n                 \"filterType\": \"OPEN_QUOTE\"\n             }\n         ],\n         \"exchangeId\": \"301\",\n         \"symbol\": \"BTCUSDT-PERPETUAL\",\n         \"symbolName\": \"BTCUSDT-PERPETUAL\",\n         \"status\": \"TRADING\",\n         \"baseAsset\": \"BTCUSDT-PERPETUAL\",\n         \"baseAssetPrecision\": \"0.001\",\n         \"quoteAsset\": \"USDT\",\n         \"quoteAssetPrecision\": \"0.1\",\n         \"icebergAllowed\": false,\n         \"inverse\": false,\n         \"index\": \"USDT\",\n         \"marginToken\": \"USDT\",\n         \"marginPrecision\": \"0.0001\",\n         \"contractMultiplier\": \"0.001\",\n         \"underlying\": \"BTC\",\n         \"riskLimits\": [\n             {\n                 \"riskLimitId\": \"200000722\",\n                 \"quantity\": \"1000.00\",\n                 \"initialMargin\": \"0.10\",\n                 \"maintMargin\": \"0.005\",\n                 \"isWhite\": false\n             },\n             {\n                 \"riskLimitId\": \"200000723\",\n                 \"quantity\": \"2000.00\",\n                 \"initialMargin\": \"0.10\",\n                 \"maintMargin\": \"0.01\",\n                 \"isWhite\": false\n             }\n         ]\n     }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //     {\n        //         \"filters\": [\n        //             {\n        //                 \"minPrice\": \"0.1\",\n        //                 \"maxPrice\": \"100000.00000000\",\n        //                 \"tickSize\": \"0.1\",\n        //                 \"filterType\": \"PRICE_FILTER\"\n        //             },\n        //             {\n        //                 \"minQty\": \"0.001\",\n        //                 \"maxQty\": \"10\",\n        //                 \"stepSize\": \"0.001\",\n        //                 \"marketOrderMinQty\": \"0\",\n        //                 \"marketOrderMaxQty\": \"0\",\n        //                 \"filterType\": \"LOT_SIZE\"\n        //             },\n        //             {\n        //                 \"minNotional\": \"0\",\n        //                 \"filterType\": \"MIN_NOTIONAL\"\n        //             },\n        //             {\n        //                 \"maxSellPrice\": \"999999\",\n        //                 \"buyPriceUpRate\": \"0.05\",\n        //                 \"sellPriceDownRate\": \"0.05\",\n        //                 \"maxEntrustNum\": 200,\n        //                 \"maxConditionNum\": 200,\n        //                 \"filterType\": \"LIMIT_TRADING\"\n        //             },\n        //             {\n        //                 \"buyPriceUpRate\": \"0.05\",\n        //                 \"sellPriceDownRate\": \"0.05\",\n        //                 \"filterType\": \"MARKET_TRADING\"\n        //             },\n        //             {\n        //                 \"noAllowMarketStartTime\": \"0\",\n        //                 \"noAllowMarketEndTime\": \"0\",\n        //                 \"limitOrderStartTime\": \"0\",\n        //                 \"limitOrderEndTime\": \"0\",\n        //                 \"limitMinPrice\": \"0\",\n        //                 \"limitMaxPrice\": \"0\",\n        //                 \"filterType\": \"OPEN_QUOTE\"\n        //             }\n        //         ],\n        //         \"exchangeId\": \"301\",\n        //         \"symbol\": \"BTCUSDT-PERPETUAL\",\n        //         \"symbolName\": \"BTCUSDT-PERPETUAL\",\n        //         \"status\": \"TRADING\",\n        //         \"baseAsset\": \"BTCUSDT-PERPETUAL\",\n        //         \"baseAssetPrecision\": \"0.001\",\n        //         \"quoteAsset\": \"USDT\",\n        //         \"quoteAssetPrecision\": \"0.1\",\n        //         \"icebergAllowed\": false,\n        //         \"inverse\": false,\n        //         \"index\": \"USDT\",\n        //         \"marginToken\": \"USDT\",\n        //         \"marginPrecision\": \"0.0001\",\n        //         \"contractMultiplier\": \"0.001\",\n        //         \"underlying\": \"BTC\",\n        //         \"riskLimits\": [\n        //             {\n        //                 \"riskLimitId\": \"200000722\",\n        //                 \"quantity\": \"1000.00\",\n        //                 \"initialMargin\": \"0.10\",\n        //                 \"maintMargin\": \"0.005\",\n        //                 \"isWhite\": false\n        //             },\n        //             {\n        //                 \"riskLimitId\": \"200000723\",\n        //                 \"quantity\": \"2000.00\",\n        //                 \"initialMargin\": \"0.10\",\n        //                 \"maintMargin\": \"0.01\",\n        //                 \"isWhite\": false\n        //             }\n        //         ]\n        //     }\n        //\n        const riskLimits = this.safeList (info, 'riskLimits', []);\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const tiers = [];\n        for (let i = 0; i < riskLimits.length; i++) {\n            const tier = riskLimits[i];\n            const initialMarginRate = this.safeString (tier, 'initialMargin');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['settle'],\n                'minNotional': undefined,\n                'maxNotional': this.safeNumber (tier, 'quantity'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintMargin'),\n                'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMarginRate)),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1594,
        "line_end": 1616,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1721684280000,\n         \"67832.49\",\n         \"67862.5\",\n         \"67832.49\",\n         \"67861.44\",\n         \"0.01122\",0,\n         \"761.2763533\",68,\n         \"0.00561\",\n         \"380.640643\"\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1721684280000,\n        //         \"67832.49\",\n        //         \"67862.5\",\n        //         \"67832.49\",\n        //         \"67861.44\",\n        //         \"0.01122\",0,\n        //         \"761.2763533\",68,\n        //         \"0.00561\",\n        //         \"380.640643\"\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3547,
        "line_end": 3718,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'updateTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.omitZero (this.safeString (order, 'origQty'))",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'executedQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.omitZero (this.safeString (order, 'stopPrice'))",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.omitZero (this.safeString2 (order, 'cumulativeQuoteQty', 'cummulativeQuoteQty'))",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': this.safeCurrencyCode (feeCurrncyId),\n                'amount': this.omitZero (this.safeString (order, 'feeAmount')),\n            }",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrncyId)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.omitZero (this.safeString (order, 'feeAmount'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"accountId\": \"1732885739589466112\",\n         \"symbol\": \"ETHUSDT\",\n         \"symbolName\": \"ETHUSDT\",\n         \"clientOrderId\": \"1722004623170558\",\n         \"orderId\": \"1738695230608169984\",\n         \"transactTime\": \"1722004623186\",\n         \"price\": \"0\",\n         \"origQty\": \"0\",\n         \"executedQty\": \"0.0061\",\n         \"status\": \"FILLED\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"MARKET\",\n         \"side\": \"BUY\",\n         \"reqAmount\": \"20\",\n         \"concentration\": \"\"\n     }",
          "{\n         \"accountId\": \"1732885739589466112\",\n         \"exchangeId\": \"301\",\n         \"symbol\": \"ETHUSDT\",\n         \"symbolName\": \"ETHUSDT\",\n         \"clientOrderId\": \"1722004623170558\",\n         \"orderId\": \"1738695230608169984\",\n         \"price\": \"0\",\n         \"origQty\": \"0\",\n         \"executedQty\": \"0.0061\",\n         \"cummulativeQuoteQty\": \"19.736489\",\n         \"cumulativeQuoteQty\": \"19.736489\",\n         \"avgPrice\": \"3235.49\",\n         \"status\": \"FILLED\",\n         \"timeInForce\": \"IOC\",\n         \"type\": \"MARKET\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"icebergQty\": \"0.0\",\n         \"time\": \"1722004623186\",\n         \"updateTime\": \"1722004623406\",\n         \"isWorking\": true,\n         \"reqAmount\": \"20\",\n         \"feeCoin\": \"\",\n         \"feeAmount\": \"0\",\n         \"sumFeeAmount\": \"0\"\n     }",
          "{\n         \"accountId\": \"1732885739589466112\",\n         \"symbol\": \"ETHUSDT\",\n         \"clientOrderId\": \"1722006209978370\",\n         \"orderId\": \"1738708541676585728\",\n         \"transactTime\": \"1722006209989\",\n         \"price\": \"5000\",\n         \"origQty\": \"0.005\",\n         \"executedQty\": \"0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT_MAKER\",\n         \"side\": \"SELL\"\n     }",
          "{\n         \"time\": \"1722429951611\",\n         \"updateTime\": \"1722429951648\",\n         \"orderId\": \"1742263144028363776\",\n         \"clientOrderId\": \"1722429950315\",\n         \"symbol\": \"ETHUSDT-PERPETUAL\",\n         \"price\": \"3460.62\",\n         \"leverage\": \"5\",\n         \"origQty\": \"10\",\n         \"executedQty\": \"10\",\n         \"avgPrice\": \"0\",\n         \"marginLocked\": \"6.9212\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY_OPEN\",\n         \"timeInForce\": \"IOC\",\n         \"status\": \"FILLED\",\n         \"priceType\": \"MARKET\",\n         \"contractMultiplier\": \"0.00100000\"\n     }",
          "{\n         \"time\": \"1722429951611\",\n         \"updateTime\": \"1722429951700\",\n         \"orderId\": \"1742263144028363776\",\n         \"clientOrderId\": \"1722429950315\",\n         \"symbol\": \"ETHUSDT-PERPETUAL\",\n         \"price\": \"3460.62\",\n         \"leverage\": \"5\",\n         \"origQty\": \"10\",\n         \"executedQty\": \"10\",\n         \"avgPrice\": \"3327.52\",\n         \"marginLocked\": \"0\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY_OPEN\",\n         \"timeInForce\": \"IOC\",\n         \"status\": \"FILLED\",\n         \"priceType\": \"MARKET\",\n         \"isLiquidationOrder\": false,\n         \"indexPrice\": \"0\",\n         \"liquidationType\": \"\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder spot\n        //     {\n        //         \"accountId\": \"1732885739589466112\",\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"symbolName\": \"ETHUSDT\",\n        //         \"clientOrderId\": \"1722004623170558\",\n        //         \"orderId\": \"1738695230608169984\",\n        //         \"transactTime\": \"1722004623186\",\n        //         \"price\": \"0\",\n        //         \"origQty\": \"0\",\n        //         \"executedQty\": \"0.0061\",\n        //         \"status\": \"FILLED\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"MARKET\",\n        //         \"side\": \"BUY\",\n        //         \"reqAmount\": \"20\",\n        //         \"concentration\": \"\"\n        //     }\n        //\n        // fetchOrder spot\n        //     {\n        //         \"accountId\": \"1732885739589466112\",\n        //         \"exchangeId\": \"301\",\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"symbolName\": \"ETHUSDT\",\n        //         \"clientOrderId\": \"1722004623170558\",\n        //         \"orderId\": \"1738695230608169984\",\n        //         \"price\": \"0\",\n        //         \"origQty\": \"0\",\n        //         \"executedQty\": \"0.0061\",\n        //         \"cummulativeQuoteQty\": \"19.736489\",\n        //         \"cumulativeQuoteQty\": \"19.736489\",\n        //         \"avgPrice\": \"3235.49\",\n        //         \"status\": \"FILLED\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"type\": \"MARKET\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"icebergQty\": \"0.0\",\n        //         \"time\": \"1722004623186\",\n        //         \"updateTime\": \"1722004623406\",\n        //         \"isWorking\": true,\n        //         \"reqAmount\": \"20\",\n        //         \"feeCoin\": \"\",\n        //         \"feeAmount\": \"0\",\n        //         \"sumFeeAmount\": \"0\"\n        //     }\n        //\n        // cancelOrder\n        //     {\n        //         \"accountId\": \"1732885739589466112\",\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"clientOrderId\": \"1722006209978370\",\n        //         \"orderId\": \"1738708541676585728\",\n        //         \"transactTime\": \"1722006209989\",\n        //         \"price\": \"5000\",\n        //         \"origQty\": \"0.005\",\n        //         \"executedQty\": \"0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT_MAKER\",\n        //         \"side\": \"SELL\"\n        //     }\n        //\n        // createOrder swap\n        //     {\n        //         \"time\": \"1722429951611\",\n        //         \"updateTime\": \"1722429951648\",\n        //         \"orderId\": \"1742263144028363776\",\n        //         \"clientOrderId\": \"1722429950315\",\n        //         \"symbol\": \"ETHUSDT-PERPETUAL\",\n        //         \"price\": \"3460.62\",\n        //         \"leverage\": \"5\",\n        //         \"origQty\": \"10\",\n        //         \"executedQty\": \"10\",\n        //         \"avgPrice\": \"0\",\n        //         \"marginLocked\": \"6.9212\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY_OPEN\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"status\": \"FILLED\",\n        //         \"priceType\": \"MARKET\",\n        //         \"contractMultiplier\": \"0.00100000\"\n        //     }\n        //\n        // fetchOrder swap\n        //     {\n        //         \"time\": \"1722429951611\",\n        //         \"updateTime\": \"1722429951700\",\n        //         \"orderId\": \"1742263144028363776\",\n        //         \"clientOrderId\": \"1722429950315\",\n        //         \"symbol\": \"ETHUSDT-PERPETUAL\",\n        //         \"price\": \"3460.62\",\n        //         \"leverage\": \"5\",\n        //         \"origQty\": \"10\",\n        //         \"executedQty\": \"10\",\n        //         \"avgPrice\": \"3327.52\",\n        //         \"marginLocked\": \"0\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY_OPEN\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"status\": \"FILLED\",\n        //         \"priceType\": \"MARKET\",\n        //         \"isLiquidationOrder\": false,\n        //         \"indexPrice\": \"0\",\n        //         \"liquidationType\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger2 (order, 'transactTime', 'time');\n        const status = this.safeString (order, 'status');\n        let type = this.safeString (order, 'type');\n        const priceType = this.safeString (order, 'priceType');\n        if (priceType === 'MARKET') {\n            type = 'market';\n        }\n        let price = this.omitZero (this.safeString (order, 'price'));\n        if (type === 'STOP') {\n            if (price === undefined) {\n                type = 'market';\n            } else {\n                type = 'limit';\n            }\n        }\n        let timeInForce = this.safeString (order, 'timeInForce');\n        let postOnly: Bool = undefined;\n        [ type, timeInForce, postOnly ] = this.parseOrderTypeTimeInForceAndPostOnly (type, timeInForce);\n        const average = this.omitZero (this.safeString (order, 'avgPrice'));\n        if (price === undefined) {\n            price = average;\n        }\n        let side = this.safeStringLower (order, 'side');\n        let reduceOnly: Bool = undefined;\n        [ side, reduceOnly ] = this.parseOrderSideAndReduceOnly (side);\n        let feeCurrncyId = this.safeString (order, 'feeCoin');\n        if (feeCurrncyId === '') {\n            feeCurrncyId = undefined;\n        }\n        return this.safeOrder ({\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (order, 'updateTime'),\n            'status': this.parseOrderStatus (status),\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'side': side,\n            'price': price,\n            'average': average,\n            'amount': this.omitZero (this.safeString (order, 'origQty')),\n            'filled': this.safeString (order, 'executedQty'),\n            'remaining': undefined,\n            'triggerPrice': this.omitZero (this.safeString (order, 'stopPrice')),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n            'cost': this.omitZero (this.safeString2 (order, 'cumulativeQuoteQty', 'cummulativeQuoteQty')),\n            'trades': undefined,\n            'fee': {\n                'currency': this.safeCurrencyCode (feeCurrncyId),\n                'amount': this.omitZero (this.safeString (order, 'feeAmount')),\n            },\n            'reduceOnly': reduceOnly,\n            'postOnly': postOnly,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSideAndReduceOnly",
        "signature": "parseOrderSideAndReduceOnly (unparsed)",
        "line_start": 3720,
        "line_end": 3733,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSideAndReduceOnly (unparsed) {\n        const parts = unparsed.split ('_');\n        const side = parts[0];\n        let reduceOnly: Bool = undefined;\n        const secondPart = this.safeString (parts, 1);\n        if (secondPart !== undefined) {\n            if (secondPart === 'open') {\n                reduceOnly = false;\n            } else if ((secondPart === 'close')) {\n                reduceOnly = true;\n            }\n        }\n        return [ side, reduceOnly ];\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status)",
        "line_start": 3735,
        "line_end": 3748,
        "comment": null,
        "mappings": [
          {
            "key": "NEW",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "PARTIALLY_FILLED",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "PARTIALLY_CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "FILLED",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "ORDER_CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "PENDING_CANCEL",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "REJECTED",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "ORDER_NEW",
            "value": "'open'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status) {\n        const statuses = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'PARTIALLY_CANCELED': 'canceled',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'ORDER_CANCELED': 'canceled',\n            'PENDING_CANCEL': 'canceled',\n            'REJECTED': 'rejected',\n            'ORDER_NEW': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type)",
        "line_start": 3762,
        "line_end": 3770,
        "comment": null,
        "mappings": [
          {
            "key": "MARKET",
            "value": "'market'",
            "comment": null
          },
          {
            "key": "LIMIT",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "LIMIT_MAKER",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "MARKET_OF_BASE",
            "value": "'market'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderType (type) {\n        const types = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'LIMIT_MAKER': 'limit',\n            'MARKET_OF_BASE': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOrderTypeTimeInForceAndPostOnly",
        "signature": "parseOrderTypeTimeInForceAndPostOnly (type, timeInForce)",
        "line_start": 3750,
        "line_end": 3760,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderTypeTimeInForceAndPostOnly (type, timeInForce) {\n        let postOnly: Bool = undefined;\n        if (type === 'LIMIT_MAKER') {\n            postOnly = true;\n        } else if ((timeInForce === 'LIMIT_MAKER') || (timeInForce === 'MAKER')) {\n            postOnly = true;\n            timeInForce = 'PO';\n        }\n        type = this.parseOrderType (type);\n        return [ type, timeInForce, postOnly ];\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3982,
        "line_end": 4016,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'position')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (position, 'side')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'positionValue')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeInteger (position, 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'unrealizedPnL')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realizedPnL')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'avgPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidationPrice')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'cross'",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "true",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (position, 'minMargin')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'margin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (position, 'lastPrice')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "position",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        return this.safePosition ({\n            'symbol': symbol,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'contracts': this.safeNumber (position, 'position'),\n            'contractSize': undefined,\n            'side': this.safeStringLower (position, 'side'),\n            'notional': this.safeNumber (position, 'positionValue'),\n            'leverage': this.safeInteger (position, 'leverage'),\n            'unrealizedPnl': this.safeNumber (position, 'unrealizedPnL'),\n            'realizedPnl': this.safeNumber (position, 'realizedPnL'),\n            'collateral': undefined,\n            'entryPrice': this.safeNumber (position, 'avgPrice'),\n            'markPrice': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n            'marginMode': 'cross',\n            'hedged': true,\n            'maintenanceMargin': this.safeNumber (position, 'minMargin'),\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': this.safeNumber (position, 'margin'),\n            'initialMarginPercentage': undefined,\n            'marginRatio': undefined,\n            'lastUpdateTimestamp': undefined,\n            'lastPrice': this.safeNumber (position, 'lastPrice'),\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n            'percentage': undefined,\n            'info': position,\n        });\n    }"
      },
      {
        "name": "parseSwapBalance",
        "signature": "parseSwapBalance (balance): Balances",
        "line_start": 1844,
        "line_end": 1867,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "balance",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"balance\": \"30.63364672\",\n         \"availableBalance\": \"28.85635534\",\n         \"positionMargin\": \"4.3421\",\n         \"orderMargin\": \"0\",\n         \"asset\": \"USDT\",\n         \"crossUnRealizedPnl\": \"2.5649\"\n     }"
        ],
        "source": "parseSwapBalance (balance): Balances {\n        //\n        //     {\n        //         \"balance\": \"30.63364672\",\n        //         \"availableBalance\": \"28.85635534\",\n        //         \"positionMargin\": \"4.3421\",\n        //         \"orderMargin\": \"0\",\n        //         \"asset\": \"USDT\",\n        //         \"crossUnRealizedPnl\": \"2.5649\"\n        //     }\n        //\n        const currencyId = this.safeString (balance, 'asset');\n        const code = this.safeCurrencyCode (currencyId);\n        const account = this.account ();\n        account['total'] = this.safeString (balance, 'balance');\n        const positionMargin = this.safeString (balance, 'positionMargin');\n        const orderMargin = this.safeString (balance, 'orderMargin');\n        account['used'] = Precise.stringAdd (positionMargin, orderMargin);\n        const result: Dict = {\n            'info': balance,\n        };\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker, market: Market = undefined): Ticker",
        "line_start": 1670,
        "line_end": 1712,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'b')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'a')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'o')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'v')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'qv')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"t\": 1721685896846,\n         \"s\": \"BTCUSDT-PERPETUAL\",\n         \"c\": \"67756.7\",\n         \"h\": \"68479.9\",\n         \"l\": \"66594.3\",\n         \"o\": \"68279.7\",\n         \"b\": \"67756.6\",\n         \"a\": \"67756.7\",\n         \"v\": \"1604722\",\n         \"qv\": \"108827258.7761\"\n     }"
        ],
        "source": "parseTicker (ticker, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"t\": 1721685896846,\n        //         \"s\": \"BTCUSDT-PERPETUAL\",\n        //         \"c\": \"67756.7\",\n        //         \"h\": \"68479.9\",\n        //         \"l\": \"66594.3\",\n        //         \"o\": \"68279.7\",\n        //         \"b\": \"67756.6\",\n        //         \"a\": \"67756.7\",\n        //         \"v\": \"1604722\",\n        //         \"qv\": \"108827258.7761\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 't');\n        const marketId = this.safeString (ticker, 's');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'c');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'h'),\n            'low': this.safeString (ticker, 'l'),\n            'bid': this.safeString (ticker, 'b'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'a'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'o'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'v'),\n            'quoteVolume': this.safeString (ticker, 'qv'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1428,
        "line_end": 1533,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'id', 'tradeId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'p', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeStringN (trade, [ 'q', 'qty', 'quantity' ])",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"t\": 1721682745779,\n         \"p\": \"67835.99\",\n         \"q\": \"0.00017\",\n         \"ibm\": true\n     }",
          "{\n         \"id\": \"1739352552862964736\",\n         \"clientOrderId\": \"1722082982086472\",\n         \"ticketId\": \"1739352552795029504\",\n         \"symbol\": \"ETHUSDT\",\n         \"symbolName\": \"ETHUSDT\",\n         \"orderId\": \"1739352552762301440\",\n         \"matchOrderId\": \"0\",\n         \"price\": \"3289.96\",\n         \"qty\": \"0.001\",\n         \"commission\": \"0.0000012\",\n         \"commissionAsset\": \"ETH\",\n         \"time\": \"1722082982097\",\n         \"isBuyer\": true,\n         \"isMaker\": false,\n         \"fee\": {\n             \"feeCoinId\": \"ETH\",\n             \"feeCoinName\": \"ETH\",\n             \"fee\": \"0.0000012\"\n         },\n         \"feeCoinId\": \"ETH\",\n         \"feeAmount\": \"0.0000012\",\n         \"makerRebate\": \"0\"\n     }",
          "{\n         \"time\": \"1722429951648\",\n         \"tradeId\": \"1742263144691139328\",\n         \"orderId\": \"1742263144028363776\",\n         \"symbol\": \"ETHUSDT-PERPETUAL\",\n         \"price\": \"3327.54\",\n         \"quantity\": \"4\",\n         \"commissionAsset\": \"USDT\",\n         \"commission\": \"0.00798609\",\n         \"makerRebate\": \"0\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY_OPEN\",\n         \"realizedPnl\": \"0\",\n         \"isMarker\": false\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //     {\n        //         \"t\": 1721682745779,\n        //         \"p\": \"67835.99\",\n        //         \"q\": \"0.00017\",\n        //         \"ibm\": true\n        //     }\n        //\n        // fetchMyTrades spot\n        //\n        //     {\n        //         \"id\": \"1739352552862964736\",\n        //         \"clientOrderId\": \"1722082982086472\",\n        //         \"ticketId\": \"1739352552795029504\",\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"symbolName\": \"ETHUSDT\",\n        //         \"orderId\": \"1739352552762301440\",\n        //         \"matchOrderId\": \"0\",\n        //         \"price\": \"3289.96\",\n        //         \"qty\": \"0.001\",\n        //         \"commission\": \"0.0000012\",\n        //         \"commissionAsset\": \"ETH\",\n        //         \"time\": \"1722082982097\",\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false,\n        //         \"fee\": {\n        //             \"feeCoinId\": \"ETH\",\n        //             \"feeCoinName\": \"ETH\",\n        //             \"fee\": \"0.0000012\"\n        //         },\n        //         \"feeCoinId\": \"ETH\",\n        //         \"feeAmount\": \"0.0000012\",\n        //         \"makerRebate\": \"0\"\n        //     }\n        //\n        // fetchMyTrades swap\n        //     {\n        //         \"time\": \"1722429951648\",\n        //         \"tradeId\": \"1742263144691139328\",\n        //         \"orderId\": \"1742263144028363776\",\n        //         \"symbol\": \"ETHUSDT-PERPETUAL\",\n        //         \"price\": \"3327.54\",\n        //         \"quantity\": \"4\",\n        //         \"commissionAsset\": \"USDT\",\n        //         \"commission\": \"0.00798609\",\n        //         \"makerRebate\": \"0\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY_OPEN\",\n        //         \"realizedPnl\": \"0\",\n        //         \"isMarker\": false\n        //     }\n        const timestamp = this.safeInteger2 (trade, 't', 'time');\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        let side = this.safeStringLower (trade, 'side'); // swap trades have side param\n        if (side !== undefined) {\n            side = this.safeString (side.split ('_'), 0);\n        }\n        const isBuyer = this.safeBool (trade, 'isBuyer');\n        if (isBuyer !== undefined) {\n            side = isBuyer ? 'buy' : 'sell';\n        }\n        let takerOrMaker = undefined;\n        const isMaker = this.safeBoolN (trade, [ 'isMaker', 'isMarker' ]);\n        if (isMaker !== undefined) {\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        const isBuyerMaker = this.safeBool (trade, 'ibm');\n        // if public trade\n        if (isBuyerMaker !== undefined) {\n            takerOrMaker = 'taker';\n            side = isBuyerMaker ? 'sell' : 'buy';\n        }\n        let feeCost = this.safeString (trade, 'commission');\n        let feeCurrncyId = this.safeString (trade, 'commissionAsset');\n        const feeInfo = this.safeDict (trade, 'fee');\n        let fee = undefined;\n        if (feeInfo !== undefined) {\n            feeCost = this.safeString (feeInfo, 'fee');\n            feeCurrncyId = this.safeString (feeInfo, 'feeCoinId');\n        }\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': this.parseNumber (feeCost),\n                'currency': this.safeCurrencyCode (feeCurrncyId),\n            };\n        }\n        return this.safeTrade ({\n            'id': this.safeString2 (trade, 'id', 'tradeId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'side': side,\n            'price': this.safeString2 (trade, 'p', 'price'),\n            'amount': this.safeStringN (trade, [ 'q', 'qty', 'quantity' ]),\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'type': undefined,\n            'order': this.safeString (trade, 'orderId'),\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 4284,
        "line_end": 4316,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber2 (fee, 'openMakerFee', 'actualMakerRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber2 (fee, 'openTakerFee', 'actualTakerRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "true",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"UXLINKUSDT\",\n         \"productType\": \"Token-Token\",\n         \"buyMakerFeeCurrency\": \"UXLINK\",\n         \"buyTakerFeeCurrency\": \"UXLINK\",\n         \"sellMakerFeeCurrency\": \"USDT\",\n         \"sellTakerFeeCurrency\": \"USDT\",\n         \"actualMakerRate\": \"0.0012\",\n         \"actualTakerRate\": \"0.0012\"\n     }",
          "{\n         \"openMakerFee\": \"0.00025\",\n         \"openTakerFee\": \"0.0006\",\n         \"closeMakerFee\": \"0.00025\",\n         \"closeTakerFee\": \"0.0006\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        // spot\n        //     {\n        //         \"symbol\": \"UXLINKUSDT\",\n        //         \"productType\": \"Token-Token\",\n        //         \"buyMakerFeeCurrency\": \"UXLINK\",\n        //         \"buyTakerFeeCurrency\": \"UXLINK\",\n        //         \"sellMakerFeeCurrency\": \"USDT\",\n        //         \"sellTakerFeeCurrency\": \"USDT\",\n        //         \"actualMakerRate\": \"0.0012\",\n        //         \"actualTakerRate\": \"0.0012\"\n        //     }\n        //\n        // swap\n        //     {\n        //         \"openMakerFee\": \"0.00025\",\n        //         \"openTakerFee\": \"0.0006\",\n        //         \"closeMakerFee\": \"0.00025\",\n        //         \"closeTakerFee\": \"0.0006\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': fee,\n            'symbol': market['symbol'],\n            'maker': this.safeNumber2 (fee, 'openMakerFee', 'actualMakerRate'),\n            'taker': this.safeNumber2 (fee, 'openTakerFee', 'actualTakerRate'),\n            'percentage': true,\n            'tierBased': true,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction, currency: Currency = undefined): Transaction",
        "line_start": 2089,
        "line_end": 2179,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": \"1721641082163\",\n         \"coin\": \"TRXUSDT\", // todo how to parse it?\n         \"coinName\": \"TRXUSDT\",\n         \"address\": \"TBA6CypYJizwA9XdC7Ubgc5F1bxrQ7SqPt\",\n         \"quantity\": \"86.00000000000000000000\",\n         \"status\": 4,\n         \"statusCode\": \"4\",\n         \"txId\": \"0970c14da4d7412295fa7b21c03a08da319e746a0d59ef14462a74183d118da4\"\n     }",
          "{\n         \"time\": \"1723545505366\",\n         \"id\": \"W611267400947572736\",\n         \"coin\": \"USDT\",\n         \"coinId\": \"USDT\",\n         \"coinName\": \"USDT\",\n         \"address\": \"TQbkBMnWnJNGTAUpFS4kvv4NRLzUAnGAes\",\n         \"quantity\": \"2.00000000\",\n         \"arriveQuantity\": \"2.00000000\",\n         \"txId\": \"f83f94e7d2e81fbec98c66c25d6615872cc2d426145629b6cf22e5e0a0753715\",\n         \"addressUrl\": \"TQbkBMnWnJNGTAUpFS4kvv4NRLzUAnGAes\",\n         \"feeCoinId\": \"USDT\",\n         \"feeCoinName\": \"USDT\",\n         \"fee\": \"1.00000000\",\n         \"remark\": \"\",\n         \"platform\": \"\"\n     }",
          "{\n         \"success\": true,\n         \"id\": \"0\",\n         \"orderId\": \"W611267400947572736\",\n         \"accountId\": \"1732885739589466115\"\n     }"
        ],
        "source": "parseTransaction (transaction, currency: Currency = undefined): Transaction {\n        //\n        //  fetchDeposits\n        //     {\n        //         \"time\": \"1721641082163\",\n        //         \"coin\": \"TRXUSDT\", // todo how to parse it?\n        //         \"coinName\": \"TRXUSDT\",\n        //         \"address\": \"TBA6CypYJizwA9XdC7Ubgc5F1bxrQ7SqPt\",\n        //         \"quantity\": \"86.00000000000000000000\",\n        //         \"status\": 4,\n        //         \"statusCode\": \"4\",\n        //         \"txId\": \"0970c14da4d7412295fa7b21c03a08da319e746a0d59ef14462a74183d118da4\"\n        //     }\n        //\n        // fetchWithdrawals\n        //     {\n        //         \"time\": \"1723545505366\",\n        //         \"id\": \"W611267400947572736\",\n        //         \"coin\": \"USDT\",\n        //         \"coinId\": \"USDT\",\n        //         \"coinName\": \"USDT\",\n        //         \"address\": \"TQbkBMnWnJNGTAUpFS4kvv4NRLzUAnGAes\",\n        //         \"quantity\": \"2.00000000\",\n        //         \"arriveQuantity\": \"2.00000000\",\n        //         \"txId\": \"f83f94e7d2e81fbec98c66c25d6615872cc2d426145629b6cf22e5e0a0753715\",\n        //         \"addressUrl\": \"TQbkBMnWnJNGTAUpFS4kvv4NRLzUAnGAes\",\n        //         \"feeCoinId\": \"USDT\",\n        //         \"feeCoinName\": \"USDT\",\n        //         \"fee\": \"1.00000000\",\n        //         \"remark\": \"\",\n        //         \"platform\": \"\"\n        //     }\n        //\n        // withdraw\n        //     {\n        //         \"success\": true,\n        //         \"id\": \"0\",\n        //         \"orderId\": \"W611267400947572736\",\n        //         \"accountId\": \"1732885739589466115\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'id', 'orderId');\n        const address = this.safeString (transaction, 'address');\n        let status = this.safeString (transaction, 'status'); // for fetchDeposits\n        if (status === undefined) {\n            const success = this.safeBool (transaction, 'success', false); // for withdraw\n            if (success) {\n                status = 'ok';\n            } else {\n                const addressUrl = this.safeString (transaction, 'addressUrl'); // for fetchWithdrawals\n                if (addressUrl !== undefined) {\n                    status = 'ok';\n                }\n            }\n        }\n        const txid = this.safeString (transaction, 'txId');\n        const coin = this.safeString (transaction, 'coin');\n        const code = this.safeCurrencyCode (coin, currency);\n        const timestamp = this.safeInteger (transaction, 'time');\n        const amount = this.safeNumber (transaction, 'quantity');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': amount,\n            'currency': code,\n            'status': this.parseTransactionStatus (status),\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status)",
        "line_start": 2181,
        "line_end": 2197,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status) {\n        const statuses: Dict = {\n            '1': 'pending',\n            '2': 'pending',\n            '3': 'failed',\n            '4': 'ok',\n            '5': 'pending',\n            '6': 'ok',\n            '7': 'failed',\n            '8': 'cancelled',\n            '9': 'failed',\n            '10': 'failed',\n            'successful': 'ok',\n            'success': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency: Currency = undefined)",
        "line_start": 2234,
        "line_end": 2253,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'orderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer, currency: Currency = undefined) {\n        const timestamp = this.safeInteger (transfer, 'timestamp');\n        const currencyId = this.safeString (currency, 'id');\n        let status: Str = undefined;\n        const success = this.safeBool (transfer, 'success', false);\n        if (success) {\n            status = 'ok';\n        }\n        return {\n            'id': this.safeString (transfer, 'orderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': status,\n            'info': transfer,\n        };\n    }"
      }
    ],
    "hibachi": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 433,
        "line_end": 444,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        // Hibachi only supports USDT on Arbitrum at this time\n        const code = this.safeCurrencyCode ('USDT');\n        const account = this.account ();\n        account['total'] = this.safeString (response, 'balance');\n        account['free'] = this.safeString (response, 'maximalWithdraw');\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1681,
        "line_end": 1736,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.currency ('USDT')",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.numberToString (this.accountId)",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "referenceAccount",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        const transactionType = this.safeString (item, 'transactionType');\n        let timestamp = undefined;\n        let type = undefined;\n        let direction = undefined;\n        let amount = undefined;\n        let fee = undefined;\n        let referenceId = undefined;\n        let referenceAccount = undefined;\n        let status = undefined;\n        if (transactionType === undefined) {\n            // response from TradeAccountTradingHistory\n            timestamp = this.safeIntegerProduct (item, 'timestamp', 1000);\n            type = 'trade';\n            let amountStr = this.safeString (item, 'realizedPnl');\n            if (Precise.stringLt (amountStr, '0')) {\n                direction = 'out';\n                amountStr = Precise.stringNeg (amountStr);\n            } else {\n                direction = 'in';\n            }\n            amount = this.parseNumber (amountStr);\n            fee = { 'currency': 'USDT', 'cost': this.safeNumber (item, 'fee') };\n            status = 'ok';\n        } else {\n            // response from CapitalHistory\n            timestamp = this.safeIntegerProduct (item, 'timestampSec', 1000);\n            amount = this.safeNumber (item, 'quantity');\n            direction = (transactionType === 'deposit' || transactionType === 'transfer-in') ? 'in' : 'out';\n            type = this.parseTransactionType (transactionType);\n            status = this.parseTransactionStatus (this.safeString (item, 'status'));\n            if (transactionType === 'transfer-in') {\n                referenceAccount = this.safeString (item, 'srcAccountId');\n            } else if (transactionType === 'transfer-out') {\n                referenceAccount = this.safeString (item, 'receivingAccountId');\n            }\n            referenceId = this.safeString (item, 'transactionHash');\n        }\n        return this.safeLedgerEntry ({\n            'id': this.safeString (item, 'id'),\n            'currency': this.currency ('USDT'),\n            'account': this.numberToString (this.accountId),\n            'referenceAccount': referenceAccount,\n            'referenceId': referenceId,\n            'status': status,\n            'amount': amount,\n            'before': undefined,\n            'after': undefined,\n            'fee': fee,\n            'direction': direction,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'type': type,\n            'info': item,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 279,
        "line_end": 341,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "numericId",
            "value": "numericId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeString (market, 'status') === 'LIVE'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'underlyingDecimals'))),\n                'price': this.parseNumber (this.safeList (market, 'orderbookGranularities')[0]) / 10000.0,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minNotional'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "created",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'underlyingDecimals')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.safeList (market, 'orderbookGranularities')[0]) / 10000.0",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'minNotional'),\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const marketId = this.safeString (market, 'symbol');\n        const numericId = this.safeNumber (market, 'id');\n        const marketType = 'swap';\n        const baseId = this.safeString (market, 'underlyingSymbol');\n        const quoteId = this.safeString (market, 'settlementSymbol');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settleId: Str = this.safeString (market, 'settlementSymbol');\n        const settle: Str = this.safeCurrencyCode (settleId);\n        const symbol = base + '/' + quote + ':' + settle;\n        const created = this.safeIntegerProduct (market, 'marketCreationTimestamp', 1000);\n        return {\n            'id': marketId,\n            'numericId': numericId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': false,\n            'margin': false,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': this.safeString (market, 'status') === 'LIVE',\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'contractSize': this.parseNumber ('1'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'underlyingDecimals'))),\n                'price': this.parseNumber (this.safeList (market, 'orderbookGranularities')[0]) / 10000.0,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minNotional'),\n                    'max': undefined,\n                },\n            },\n            'created': created,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1386,
        "line_end": 1408,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n     {\n       \"close\": \"3704.751036\",\n       \"high\": \"3716.530378\",\n       \"interval\": \"1h\",\n       \"low\": \"3699.627883\",\n       \"open\": \"3716.406894\",\n       \"timestamp\": 1712628000,\n       \"volumeNotional\": \"1637355.846362\"\n     }\n   ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // [\n        //     {\n        //       \"close\": \"3704.751036\",\n        //       \"high\": \"3716.530378\",\n        //       \"interval\": \"1h\",\n        //       \"low\": \"3699.627883\",\n        //       \"open\": \"3716.406894\",\n        //       \"timestamp\": 1712628000,\n        //       \"volumeNotional\": \"1637355.846362\"\n        //     }\n        //   ]\n        //\n        return [\n            this.safeIntegerProduct (ohlcv, 'timestamp', 1000),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volumeNotional'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 676,
        "line_end": 734,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'triggerPrice')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const status = this.safeString (order, 'status');\n        const type = this.safeStringLower (order, 'orderType');\n        const price = this.safeString (order, 'price');\n        const rawSide = this.safeString (order, 'side');\n        let side = undefined;\n        if (rawSide === 'BID') {\n            side = 'buy';\n        } else if (rawSide === 'ASK') {\n            side = 'sell';\n        }\n        const amount = this.safeString (order, 'totalQuantity');\n        const remaining = this.safeString (order, 'availableQuantity');\n        const totalQuantity = this.safeString (order, 'totalQuantity');\n        const availableQuantity = this.safeString (order, 'availableQuantity');\n        let filled = undefined;\n        if (totalQuantity !== undefined && availableQuantity !== undefined) {\n            filled = Precise.stringSub (totalQuantity, availableQuantity);\n        }\n        let timeInForce = 'GTC';\n        const orderFlags = this.safeValue (order, 'orderFlags');\n        let postOnly = false;\n        let reduceOnly = false;\n        if (orderFlags === 'POST_ONLY') {\n            timeInForce = 'PO';\n            postOnly = true;\n        } else if (orderFlags === 'IOC') {\n            timeInForce = 'IOC';\n        } else if (orderFlags === 'REDUCE_ONLY') {\n            reduceOnly = true;\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': undefined,\n            'datetime': undefined,\n            'timestamp': undefined,\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': undefined,\n            'status': this.parseOrderStatus (status),\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'side': side,\n            'price': price,\n            'average': undefined,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': undefined,\n            'reduceOnly': reduceOnly,\n            'postOnly': postOnly,\n            'triggerPrice': this.safeNumber (order, 'triggerPrice'),\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: string): string",
        "line_start": 662,
        "line_end": 674,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: string): string {\n        const statuses: Dict = {\n            'PENDING': 'open',\n            'CHILD_PENDING': 'open',\n            'SCHEDULED_TWAP': 'open',\n            'PLACED': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELLED': 'canceled',\n            'REJECTED': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1570,
        "line_end": 1615,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeString (position, 'average_entry_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeString (position, 'notionalValue')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedPnl",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"direction\": \"Short\",\n     \"entryNotional\": \"10.302213\",\n     \"notionalValue\": \"10.225008\",\n     \"quantity\": \"0.004310550\",\n     \"symbol\": \"ETH/USDT-P\",\n     \"unrealizedFundingPnl\": \"0.000000\",\n     \"unrealizedTradingPnl\": \"0.077204\"\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"direction\": \"Short\",\n        //     \"entryNotional\": \"10.302213\",\n        //     \"notionalValue\": \"10.225008\",\n        //     \"quantity\": \"0.004310550\",\n        //     \"symbol\": \"ETH/USDT-P\",\n        //     \"unrealizedFundingPnl\": \"0.000000\",\n        //     \"unrealizedTradingPnl\": \"0.077204\"\n        // }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'direction');\n        const quantity = this.safeString (position, 'quantity');\n        const unrealizedFunding = this.safeString (position, 'unrealizedFundingPnl', '0');\n        const unrealizedTrading = this.safeString (position, 'unrealizedTradingPnl', '0');\n        const unrealizedPnl = Precise.stringAdd (unrealizedFunding, unrealizedTrading);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'entryPrice': this.safeString (position, 'average_entry_price'),\n            'markPrice': undefined,\n            'notional': this.safeString (position, 'notionalValue'),\n            'collateral': undefined,\n            'unrealizedPnl': unrealizedPnl,\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 478,
        "line_end": 509,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "volume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const prices = this.safeDict (ticker, 'prices');\n        const stats = this.safeDict (ticker, 'stats');\n        const bid = this.safeNumber (prices, 'bidPrice');\n        const ask = this.safeNumber (prices, 'askPrice');\n        const last = this.safeNumber (prices, 'tradePrice');\n        const high = this.safeNumber (stats, 'high24h');\n        const low = this.safeNumber (stats, 'low24h');\n        const volume = this.safeNumber (stats, 'volume24h');\n        return this.safeTicker ({\n            'symbol': this.safeSymbol (undefined, market),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'bid': bid,\n            'ask': ask,\n            'last': last,\n            'high': high,\n            'low': low,\n            'bidVolume': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': volume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 511,
        "line_end": 579,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "'USDT'",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"price\": \"3512.431902\",\n          \"quantity\": \"1.414780098\",\n          \"takerSide\": \"Buy\",\n          \"timestamp\": 1712692147\n      }",
          "{\n          \"askAccountId\": 221,\n          \"askOrderId\": 589168494921909200,\n          \"bidAccountId\": 132,\n          \"bidOrderId\": 589168494829895700,\n          \"fee\": \"0.000477\",\n          \"id\": 199511136,\n          \"orderType\": \"MARKET\",\n          \"price\": \"119257.90000\",\n          \"quantity\": \"0.0000200000\",\n          \"realizedPnl\": \"-0.000352\",\n          \"side\": \"Sell\",\n          \"symbol\": \"BTC/USDT-P\",\n          \"timestamp\": 1752543391\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        // public fetchTrades:\n        //      {\n        //          \"price\": \"3512.431902\",\n        //          \"quantity\": \"1.414780098\",\n        //          \"takerSide\": \"Buy\",\n        //          \"timestamp\": 1712692147\n        //      }\n        //\n        // private fetchMyTrades:\n        //      {\n        //          \"askAccountId\": 221,\n        //          \"askOrderId\": 589168494921909200,\n        //          \"bidAccountId\": 132,\n        //          \"bidOrderId\": 589168494829895700,\n        //          \"fee\": \"0.000477\",\n        //          \"id\": 199511136,\n        //          \"orderType\": \"MARKET\",\n        //          \"price\": \"119257.90000\",\n        //          \"quantity\": \"0.0000200000\",\n        //          \"realizedPnl\": \"-0.000352\",\n        //          \"side\": \"Sell\",\n        //          \"symbol\": \"BTC/USDT-P\",\n        //          \"timestamp\": 1752543391\n        //      }\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const id = this.safeString (trade, 'id');\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString (trade, 'quantity');\n        const timestamp = this.safeIntegerProduct (trade, 'timestamp', 1000);\n        const cost = Precise.stringMul (price, amount);\n        let side = undefined;\n        let fee = undefined;\n        let orderType = undefined;\n        let orderId = undefined;\n        let takerOrMaker = undefined;\n        if (id === undefined) {\n            // public trades\n            side = this.safeStringLower (trade, 'takerSide');\n            takerOrMaker = 'taker';\n        } else {\n            // private trades\n            side = this.safeStringLower (trade, 'side');\n            fee = { 'cost': this.safeString (trade, 'fee'), 'currency': 'USDT' };\n            orderType = this.safeStringLower (trade, 'orderType');\n            if (side === 'buy') {\n                orderId = this.safeString (trade, 'bidOrderId');\n            } else {\n                orderId = this.safeString (trade, 'askOrderId');\n            }\n        }\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'order': orderId,\n            'takerOrMaker': takerOrMaker,\n            'type': orderType,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1872,
        "line_end": 1901,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transactionHash')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "'ARBITRUM'",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "transactionType",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'quantity')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "'USDT'",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        const timestamp = this.safeIntegerProduct (transaction, 'timestampSec', 1000);\n        const address = this.safeString (transaction, 'withdrawalAddress');\n        let transactionType = this.safeString (transaction, 'transactionType');\n        if (transactionType !== 'deposit' && transactionType !== 'withdrawal') {\n            transactionType = this.parseTransactionType (transactionType);\n        }\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'transactionHash'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': 'ARBITRUM', // Currently the exchange only exists on Arbitrum,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': transactionType,\n            'amount': this.safeNumber (transaction, 'quantity'),\n            'currency': 'USDT',\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status)",
        "line_start": 1671,
        "line_end": 1679,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status) {\n        const statuses: Dict = {\n            'pending': 'pending',\n            'claimable': 'pending',\n            'completed': 'ok',\n            'failed': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 1661,
        "line_end": 1669,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'deposit': 'transaction',\n            'withdrawal': 'transaction',\n            'transfer-in': 'transfer',\n            'transfer-out': 'transfer',\n        };\n        return this.safeString (types, type, type);\n    }"
      }
    ],
    "hitbtc": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1095,
        "line_end": 1107,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const currencyId = this.safeString (entry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (entry, 'available');\n            account['used'] = this.safeString (entry, 'reserved');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 3663,
        "line_end": 3712,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"full_name\": \"ConnectWealth\",\n         \"payin_enabled\": false,\n         \"payout_enabled\": false,\n         \"transfer_enabled\": true,\n         \"precision_transfer\": \"0.001\",\n         \"networks\": [\n           {\n             \"network\": \"ETH\",\n             \"protocol\": \"ERC20\",\n             \"default\": true,\n             \"payin_enabled\": false,\n             \"payout_enabled\": false,\n             \"precision_payout\": \"0.001\",\n             \"payout_fee\": \"0.016800000000\",\n             \"payout_is_payment_id\": false,\n             \"payin_payment_id\": false,\n             \"payin_confirmations\": \"2\"\n           }\n         ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //         \"full_name\": \"ConnectWealth\",\n        //         \"payin_enabled\": false,\n        //         \"payout_enabled\": false,\n        //         \"transfer_enabled\": true,\n        //         \"precision_transfer\": \"0.001\",\n        //         \"networks\": [\n        //           {\n        //             \"network\": \"ETH\",\n        //             \"protocol\": \"ERC20\",\n        //             \"default\": true,\n        //             \"payin_enabled\": false,\n        //             \"payout_enabled\": false,\n        //             \"precision_payout\": \"0.001\",\n        //             \"payout_fee\": \"0.016800000000\",\n        //             \"payout_is_payment_id\": false,\n        //             \"payin_payment_id\": false,\n        //             \"payin_confirmations\": \"2\"\n        //           }\n        //         ]\n        //    }\n        //\n        const networks = this.safeValue (fee, 'networks', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networks.length; j++) {\n            const networkEntry = networks[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            let networkCode = this.networkIdToCode (networkId);\n            networkCode = (networkCode !== undefined) ? networkCode.toUpperCase () : undefined;\n            const withdrawFee = this.safeNumber (networkEntry, 'payout_fee');\n            const isDefault = this.safeValue (networkEntry, 'default');\n            const withdrawResult: Dict = {\n                'fee': withdrawFee,\n                'percentage': (withdrawFee !== undefined) ? false : undefined,\n            };\n            if (isDefault === true) {\n                result['withdraw'] = withdrawResult;\n            }\n            result['networks'][networkCode] = {\n                'withdraw': withdrawResult,\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3332,
        "line_end": 3370,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'mark_price')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'index_price')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (contract, 'interest_rate')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "this.parse8601 (fundingDateTime)",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "fundingDateTime",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'indicative_funding_rate')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_type\": \"perpetual\",\n         \"mark_price\": \"42307.43\",\n         \"index_price\": \"42303.27\",\n         \"funding_rate\": \"0.0001\",\n         \"open_interest\": \"30.9826\",\n         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n         \"indicative_funding_rate\": \"0.0001\",\n         \"premium_index\": \"0\",\n         \"avg_premium_index\": \"0.000029587712038098\",\n         \"interest_rate\": \"0.0001\",\n         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"contract_type\": \"perpetual\",\n        //         \"mark_price\": \"42307.43\",\n        //         \"index_price\": \"42303.27\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"open_interest\": \"30.9826\",\n        //         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n        //         \"indicative_funding_rate\": \"0.0001\",\n        //         \"premium_index\": \"0\",\n        //         \"avg_premium_index\": \"0.000029587712038098\",\n        //         \"interest_rate\": \"0.0001\",\n        //         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n        //     }\n        //\n        const fundingDateTime = this.safeString (contract, 'next_funding_time');\n        const datetime = this.safeString (contract, 'timestamp');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (undefined, market),\n            'markPrice': this.safeNumber (contract, 'mark_price'),\n            'indexPrice': this.safeNumber (contract, 'index_price'),\n            'interestRate': this.safeNumber (contract, 'interest_rate'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': this.parse8601 (fundingDateTime),\n            'fundingDatetime': fundingDateTime,\n            'nextFundingRate': this.safeNumber (contract, 'indicative_funding_rate'),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3575,
        "line_end": 3585,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (leverage, 'type')",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (leverage, 'type'),\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 2669,
        "line_end": 2676,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower (marginMode, 'margin_mode')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (marginMode, 'symbol');\n        return {\n            'info': marginMode,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': this.safeStringLower (marginMode, 'margin_mode'),\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 3432,
        "line_end": 3468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (currencyInfo, 'code')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCUSDT_PERP\",\n         \"type\": \"isolated\",\n         \"leverage\": \"8.00\",\n         \"created_at\": \"2022-03-30T23:34:27.161Z\",\n         \"updated_at\": \"2022-03-30T23:34:27.161Z\",\n         \"currencies\": [\n             {\n                 \"code\": \"USDT\",\n                 \"margin_balance\": \"7.000000000000\",\n                 \"reserved_orders\": \"0\",\n                 \"reserved_positions\": \"0\"\n             }\n         ],\n         \"positions\": null\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT_PERP\",\n        //         \"type\": \"isolated\",\n        //         \"leverage\": \"8.00\",\n        //         \"created_at\": \"2022-03-30T23:34:27.161Z\",\n        //         \"updated_at\": \"2022-03-30T23:34:27.161Z\",\n        //         \"currencies\": [\n        //             {\n        //                 \"code\": \"USDT\",\n        //                 \"margin_balance\": \"7.000000000000\",\n        //                 \"reserved_orders\": \"0\",\n        //                 \"reserved_positions\": \"0\"\n        //             }\n        //         ],\n        //         \"positions\": null\n        //     }\n        //\n        const currencies = this.safeValue (data, 'currencies', []);\n        const currencyInfo = this.safeValue (currencies, 0);\n        const datetime = this.safeString (data, 'updated_at');\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': this.safeString (currencyInfo, 'code'),\n            'status': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1892,
        "line_end": 1924,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"timestamp\":\"2015-08-20T19:01:00.000Z\",\n         \"open\":\"0.006\",\n         \"close\":\"0.006\",\n         \"min\":\"0.006\",\n         \"max\":\"0.006\",\n         \"volume\":\"0.003\",\n         \"volume_quote\":\"0.000018\"\n     }",
          "{\n         \"timestamp\": \"2022-04-01T01:28:00.000Z\",\n         \"open\": \"45146.39\",\n         \"close\": \"45219.43\",\n         \"min\": \"45146.39\",\n         \"max\": \"45219.43\"\n     },"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // Spot and Swap\n        //\n        //     {\n        //         \"timestamp\":\"2015-08-20T19:01:00.000Z\",\n        //         \"open\":\"0.006\",\n        //         \"close\":\"0.006\",\n        //         \"min\":\"0.006\",\n        //         \"max\":\"0.006\",\n        //         \"volume\":\"0.003\",\n        //         \"volume_quote\":\"0.000018\"\n        //     }\n        //\n        // Mark, Index and Premium Index\n        //\n        //     {\n        //         \"timestamp\": \"2022-04-01T01:28:00.000Z\",\n        //         \"open\": \"45146.39\",\n        //         \"close\": \"45219.43\",\n        //         \"min\": \"45146.39\",\n        //         \"max\": \"45219.43\"\n        //     },\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'timestamp')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'max'),\n            this.safeNumber (ohlcv, 'min'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 3184,
        "line_end": 3210,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"contract_type\": \"perpetual\",\n         \"mark_price\": \"42307.43\",\n         \"index_price\": \"42303.27\",\n         \"funding_rate\": \"0.0001\",\n         \"open_interest\": \"30.9826\",\n         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n         \"indicative_funding_rate\": \"0.0001\",\n         \"premium_index\": \"0\",\n         \"avg_premium_index\": \"0.000029587712038098\",\n         \"interest_rate\": \"0.0001\",\n         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"contract_type\": \"perpetual\",\n        //         \"mark_price\": \"42307.43\",\n        //         \"index_price\": \"42303.27\",\n        //         \"funding_rate\": \"0.0001\",\n        //         \"open_interest\": \"30.9826\",\n        //         \"next_funding_time\": \"2022-03-22T16:00:00.000Z\",\n        //         \"indicative_funding_rate\": \"0.0001\",\n        //         \"premium_index\": \"0\",\n        //         \"avg_premium_index\": \"0.000029587712038098\",\n        //         \"interest_rate\": \"0.0001\",\n        //         \"timestamp\": \"2022-03-22T08:08:26.687Z\"\n        //     }\n        //\n        const datetime = this.safeString (interest, 'timestamp');\n        const value = this.safeNumber (interest, 'open_interest');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (undefined, market),\n            'openInterestAmount': undefined,\n            'openInterestValue': value,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2485,
        "line_end": 2602,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeValue (order, 'reduce_only')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stop_price')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": 488953123149,\n       \"client_order_id\": \"103ad305301e4c3590045b13de15b36e\",\n       \"symbol\": \"BTCUSDT\",\n       \"side\": \"buy\",\n       \"status\": \"new\",\n       \"type\": \"limit\",\n       \"time_in_force\": \"GTC\",\n       \"quantity\": \"0.00001\",\n       \"quantity_cumulative\": \"0\",\n       \"price\": \"0.01\",\n       \"price_average\": \"0.01\",\n       \"post_only\": false,\n       \"created_at\": \"2021-04-13T13:06:16.567Z\",\n       \"updated_at\": \"2021-04-13T13:06:16.567Z\"\n     }",
          "{\n       \"id\": \"685877626834\",\n       \"client_order_id\": \"Yshl7G-EjaREyXQYaGbsmdtVbW-nzQwu\",\n       \"symbol\": \"BTCUSDT\",\n       \"side\": \"buy\",\n       \"status\": \"filled\",\n       \"type\": \"market\",\n       \"time_in_force\": \"GTC\",\n       \"quantity\": \"0.00010\",\n       \"quantity_cumulative\": \"0.00010\",\n       \"post_only\": false,\n       \"created_at\": \"2021-10-26T08:55:55.1Z\",\n       \"updated_at\": \"2021-10-26T08:55:55.1Z\",\n       \"trades\": [\n         {\n           \"id\": \"1437229630\",\n           \"position_id\": \"0\",\n           \"quantity\": \"0.00010\",\n           \"price\": \"62884.78\",\n           \"fee\": \"0.005659630200\",\n           \"timestamp\": \"2021-10-26T08:55:55.1Z\",\n           \"taker\": true\n         }\n       ]\n     }",
          "{\n         \"id\": 58418961892,\n         \"client_order_id\": \"r42gdPjNMZN-H_xs8RKl2wljg_dfgdg4\",\n         \"symbol\": \"BTCUSDT_PERP\",\n         \"side\": \"buy\",\n         \"status\": \"new\",\n         \"type\": \"limit\",\n         \"time_in_force\": \"GTC\",\n         \"quantity\": \"0.0005\",\n         \"quantity_cumulative\": \"0\",\n         \"price\": \"30000.00\",\n         \"post_only\": false,\n         \"reduce_only\": false,\n         \"created_at\": \"2022-03-16T08:16:53.039Z\",\n         \"updated_at\": \"2022-03-16T08:16:53.039Z\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // limit\n        //     {\n        //       \"id\": 488953123149,\n        //       \"client_order_id\": \"103ad305301e4c3590045b13de15b36e\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"side\": \"buy\",\n        //       \"status\": \"new\",\n        //       \"type\": \"limit\",\n        //       \"time_in_force\": \"GTC\",\n        //       \"quantity\": \"0.00001\",\n        //       \"quantity_cumulative\": \"0\",\n        //       \"price\": \"0.01\",\n        //       \"price_average\": \"0.01\",\n        //       \"post_only\": false,\n        //       \"created_at\": \"2021-04-13T13:06:16.567Z\",\n        //       \"updated_at\": \"2021-04-13T13:06:16.567Z\"\n        //     }\n        //\n        // market\n        //     {\n        //       \"id\": \"685877626834\",\n        //       \"client_order_id\": \"Yshl7G-EjaREyXQYaGbsmdtVbW-nzQwu\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"side\": \"buy\",\n        //       \"status\": \"filled\",\n        //       \"type\": \"market\",\n        //       \"time_in_force\": \"GTC\",\n        //       \"quantity\": \"0.00010\",\n        //       \"quantity_cumulative\": \"0.00010\",\n        //       \"post_only\": false,\n        //       \"created_at\": \"2021-10-26T08:55:55.1Z\",\n        //       \"updated_at\": \"2021-10-26T08:55:55.1Z\",\n        //       \"trades\": [\n        //         {\n        //           \"id\": \"1437229630\",\n        //           \"position_id\": \"0\",\n        //           \"quantity\": \"0.00010\",\n        //           \"price\": \"62884.78\",\n        //           \"fee\": \"0.005659630200\",\n        //           \"timestamp\": \"2021-10-26T08:55:55.1Z\",\n        //           \"taker\": true\n        //         }\n        //       ]\n        //     }\n        //\n        // swap and margin\n        //\n        //     {\n        //         \"id\": 58418961892,\n        //         \"client_order_id\": \"r42gdPjNMZN-H_xs8RKl2wljg_dfgdg4\",\n        //         \"symbol\": \"BTCUSDT_PERP\",\n        //         \"side\": \"buy\",\n        //         \"status\": \"new\",\n        //         \"type\": \"limit\",\n        //         \"time_in_force\": \"GTC\",\n        //         \"quantity\": \"0.0005\",\n        //         \"quantity_cumulative\": \"0\",\n        //         \"price\": \"30000.00\",\n        //         \"post_only\": false,\n        //         \"reduce_only\": false,\n        //         \"created_at\": \"2022-03-16T08:16:53.039Z\",\n        //         \"updated_at\": \"2022-03-16T08:16:53.039Z\"\n        //     }\n        //\n        const id = this.safeString (order, 'client_order_id');\n        // we use clientOrderId as the order id with this exchange intentionally\n        // because most of their endpoints will require clientOrderId\n        // explained here: https://github.com/ccxt/ccxt/issues/5674\n        const side = this.safeString (order, 'side');\n        const type = this.safeString (order, 'type');\n        const amount = this.safeString (order, 'quantity');\n        const price = this.safeString (order, 'price');\n        const average = this.safeString (order, 'price_average');\n        const created = this.safeString (order, 'created_at');\n        const timestamp = this.parse8601 (created);\n        const updated = this.safeString (order, 'updated_at');\n        let lastTradeTimestamp = undefined;\n        if (updated !== created) {\n            lastTradeTimestamp = this.parse8601 (updated);\n        }\n        const filled = this.safeString (order, 'quantity_cumulative');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const postOnly = this.safeValue (order, 'post_only');\n        const timeInForce = this.safeString (order, 'time_in_force');\n        const rawTrades = this.safeValue (order, 'trades');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'price': price,\n            'amount': amount,\n            'type': type,\n            'side': side,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeValue (order, 'reduce_only'),\n            'filled': filled,\n            'remaining': undefined,\n            'cost': undefined,\n            'status': status,\n            'average': average,\n            'trades': rawTrades,\n            'fee': undefined,\n            'triggerPrice': this.safeString (order, 'stop_price'),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2473,
        "line_end": 2483,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'open',\n            'suspended': 'open',\n            'partiallyFilled': 'open',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'expired': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3097,
        "line_end": 3182,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n         {\n             \"symbol\": \"ETHUSDT_PERP\",\n             \"type\": \"isolated\",\n             \"leverage\": \"10.00\",\n             \"created_at\": \"2022-03-19T07:54:35.24Z\",\n             \"updated_at\": \"2022-03-19T07:54:58.922Z\",\n             currencies\": [\n                 {\n                     \"code\": \"USDT\",\n                     \"margin_balance\": \"7.478100643043\",\n                     \"reserved_orders\": \"0\",\n                     \"reserved_positions\": \"0.303530761300\"\n                 }\n             ],\n             \"positions\": [\n                 {\n                     \"id\": 2470568,\n                     \"symbol\": \"ETHUSDT_PERP\",\n                     \"quantity\": \"0.001\",\n                     \"price_entry\": \"2927.509\",\n                     \"price_margin_call\": \"0\",\n                     \"price_liquidation\": \"0\",\n                     \"pnl\": \"0\",\n                     \"created_at\": \"2022-03-19T07:54:35.24Z\",\n                     \"updated_at\": \"2022-03-19T07:54:58.922Z\"\n                 }\n             ]\n         },\n     ]"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     [\n        //         {\n        //             \"symbol\": \"ETHUSDT_PERP\",\n        //             \"type\": \"isolated\",\n        //             \"leverage\": \"10.00\",\n        //             \"created_at\": \"2022-03-19T07:54:35.24Z\",\n        //             \"updated_at\": \"2022-03-19T07:54:58.922Z\",\n        //             currencies\": [\n        //                 {\n        //                     \"code\": \"USDT\",\n        //                     \"margin_balance\": \"7.478100643043\",\n        //                     \"reserved_orders\": \"0\",\n        //                     \"reserved_positions\": \"0.303530761300\"\n        //                 }\n        //             ],\n        //             \"positions\": [\n        //                 {\n        //                     \"id\": 2470568,\n        //                     \"symbol\": \"ETHUSDT_PERP\",\n        //                     \"quantity\": \"0.001\",\n        //                     \"price_entry\": \"2927.509\",\n        //                     \"price_margin_call\": \"0\",\n        //                     \"price_liquidation\": \"0\",\n        //                     \"pnl\": \"0\",\n        //                     \"created_at\": \"2022-03-19T07:54:35.24Z\",\n        //                     \"updated_at\": \"2022-03-19T07:54:58.922Z\"\n        //                 }\n        //             ]\n        //         },\n        //     ]\n        //\n        const marginMode = this.safeString (position, 'type');\n        const leverage = this.safeNumber (position, 'leverage');\n        const datetime = this.safeString (position, 'updated_at');\n        const positions = this.safeValue (position, 'positions', []);\n        let liquidationPrice = undefined;\n        let entryPrice = undefined;\n        let contracts = undefined;\n        for (let i = 0; i < positions.length; i++) {\n            const entry = positions[i];\n            liquidationPrice = this.safeNumber (entry, 'price_liquidation');\n            entryPrice = this.safeNumber (entry, 'price_entry');\n            contracts = this.safeNumber (entry, 'quantity');\n        }\n        const currencies = this.safeValue (position, 'currencies', []);\n        let collateral = undefined;\n        for (let i = 0; i < currencies.length; i++) {\n            const entry = currencies[i];\n            collateral = this.safeNumber (entry, 'margin_balance');\n        }\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'notional': undefined,\n            'marginMode': marginMode,\n            'marginType': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': entryPrice,\n            'unrealizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': contracts,\n            'contractSize': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': undefined,\n            'hedged': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': collateral,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': leverage,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1227,
        "line_end": 1269,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"ask\": \"62756.01\",\n       \"bid\": \"62754.09\",\n       \"last\": \"62755.87\",\n       \"low\": \"62010.00\",\n       \"high\": \"66657.99\",\n       \"open\": \"65089.27\",\n       \"volume\": \"16719.50366\",\n       \"volume_quote\": \"1063422878.8156828\",\n       \"timestamp\": \"2021-10-22T07:29:14.585Z\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //       \"ask\": \"62756.01\",\n        //       \"bid\": \"62754.09\",\n        //       \"last\": \"62755.87\",\n        //       \"low\": \"62010.00\",\n        //       \"high\": \"66657.99\",\n        //       \"open\": \"65089.27\",\n        //       \"volume\": \"16719.50366\",\n        //       \"volume_quote\": \"1063422878.8156828\",\n        //       \"timestamp\": \"2021-10-22T07:29:14.585Z\"\n        //     }\n        //\n        const timestamp = this.parse8601 (ticker['timestamp']);\n        const symbol = this.safeSymbol (undefined, market);\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = this.safeString (ticker, 'volume_quote');\n        const open = this.safeString (ticker, 'open');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1366,
        "line_end": 1468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"id\": \"1569252895\",\n      \"position_id\": \"0\",\n      \"quantity\": \"10\",\n      \"price\": \"0.03919424\",\n      \"fee\": \"0.000979856000\",\n      \"timestamp\": \"2022-01-25T19:38:36.153Z\",\n      \"taker\": true\n  }",
          "{\n      \"id\": 974786185,\n      \"price\": \"0.032462\",\n      \"qty\": \"0.3673\",\n      \"side\": \"buy\",\n      \"timestamp\": \"2020-10-16T12:57:39.846Z\"\n  }",
          "{\n      \"id\": 277210397,\n      \"clientOrderId\": \"6e102f3e7f3f4e04aeeb1cdc95592f1a\",\n      \"orderId\": 28102855393,\n      \"symbol\": \"ETHBTC\",\n      \"side\": \"sell\",\n      \"quantity\": \"0.002\",\n      \"price\": \"0.073365\",\n      \"fee\": \"0.000000147\",\n      \"timestamp\": \"2018-04-28T18:39:55.345Z\",\n      \"taker\": true\n  }",
          "{\n      \"id\": 4718564,\n      \"order_id\": 58730811958,\n      \"client_order_id\": \"475c47d97f867f09726186eb22b4c3d4\",\n      \"symbol\": \"BTCUSDT_PERP\",\n      \"side\": \"sell\",\n      \"quantity\": \"0.0001\",\n      \"price\": \"41118.51\",\n      \"fee\": \"0.002055925500\",\n      \"timestamp\": \"2022-03-17T05:23:17.795Z\",\n      \"taker\": true,\n      \"position_id\": 2350122,\n      \"pnl\": \"0.002255000000\",\n      \"liquidation\": false\n  }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // createOrder (market)\n        //\n        //  {\n        //      \"id\": \"1569252895\",\n        //      \"position_id\": \"0\",\n        //      \"quantity\": \"10\",\n        //      \"price\": \"0.03919424\",\n        //      \"fee\": \"0.000979856000\",\n        //      \"timestamp\": \"2022-01-25T19:38:36.153Z\",\n        //      \"taker\": true\n        //  }\n        //\n        // fetchTrades\n        //\n        //  {\n        //      \"id\": 974786185,\n        //      \"price\": \"0.032462\",\n        //      \"qty\": \"0.3673\",\n        //      \"side\": \"buy\",\n        //      \"timestamp\": \"2020-10-16T12:57:39.846Z\"\n        //  }\n        //\n        // fetchMyTrades spot\n        //\n        //  {\n        //      \"id\": 277210397,\n        //      \"clientOrderId\": \"6e102f3e7f3f4e04aeeb1cdc95592f1a\",\n        //      \"orderId\": 28102855393,\n        //      \"symbol\": \"ETHBTC\",\n        //      \"side\": \"sell\",\n        //      \"quantity\": \"0.002\",\n        //      \"price\": \"0.073365\",\n        //      \"fee\": \"0.000000147\",\n        //      \"timestamp\": \"2018-04-28T18:39:55.345Z\",\n        //      \"taker\": true\n        //  }\n        //\n        // fetchMyTrades swap and margin\n        //\n        //  {\n        //      \"id\": 4718564,\n        //      \"order_id\": 58730811958,\n        //      \"client_order_id\": \"475c47d97f867f09726186eb22b4c3d4\",\n        //      \"symbol\": \"BTCUSDT_PERP\",\n        //      \"side\": \"sell\",\n        //      \"quantity\": \"0.0001\",\n        //      \"price\": \"41118.51\",\n        //      \"fee\": \"0.002055925500\",\n        //      \"timestamp\": \"2022-03-17T05:23:17.795Z\",\n        //      \"taker\": true,\n        //      \"position_id\": 2350122,\n        //      \"pnl\": \"0.002255000000\",\n        //      \"liquidation\": false\n        //  }\n        //\n        const timestamp = this.parse8601 (trade['timestamp']);\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        const taker = this.safeValue (trade, 'taker');\n        let takerOrMaker: string;\n        if (taker !== undefined) {\n            takerOrMaker = taker ? 'taker' : 'maker';\n        } else {\n            takerOrMaker = 'taker'; // the only case when `taker` field is missing, is public fetchTrades and it must be taker\n        }\n        if (feeCostString !== undefined) {\n            const info = this.safeValue (market, 'info', {});\n            const feeCurrency = this.safeString (info, 'fee_currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrency);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        // we use clientOrderId as the order id with this exchange intentionally\n        // because most of their endpoints will require clientOrderId\n        // explained here: https://github.com/ccxt/ccxt/issues/5674\n        const orderId = this.safeString2 (trade, 'clientOrderId', 'client_order_id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString2 (trade, 'quantity', 'qty');\n        const side = this.safeString (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1721,
        "line_end": 1741,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"ARVUSDT\", // returned from fetchTradingFees only\n         \"take_rate\":\"0.0009\",\n         \"make_rate\":\"0.0009\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\":\"ARVUSDT\", // returned from fetchTradingFees only\n        //         \"take_rate\":\"0.0009\",\n        //         \"make_rate\":\"0.0009\"\n        //     }\n        //\n        const taker = this.safeNumber (fee, 'take_rate');\n        const maker = this.safeNumber (fee, 'make_rate');\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'taker': taker,\n            'maker': maker,\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1533,
        "line_end": 1617,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txhash",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": \"101609495\",\n       \"created_at\": \"2018-03-06T22:05:06.507Z\",\n       \"updated_at\": \"2018-03-06T22:11:45.03Z\",\n       \"status\": \"SUCCESS\",\n       \"type\": \"DEPOSIT\", // DEPOSIT, WITHDRAW, ..\n       \"subtype\": \"BLOCKCHAIN\",\n       \"native\": {\n         \"tx_id\": \"e20b0965-4024-44d0-b63f-7fb8996a6706\",\n         \"index\": \"881652766\",\n         \"currency\": \"ETH\",\n         \"amount\": \"0.01418088\",\n         \"hash\": \"d95dbbff3f9234114f1211ab0ba2a94f03f394866fd5749d74a1edab80e6c5d3\",\n         \"address\": \"0xd9259302c32c0a0295d86a39185c9e14f6ba0a0d\",\n         \"confirmations\": \"20\",\n         \"senders\": [\n           \"0x243bec9256c9a3469da22103891465b47583d9f1\"\n         ],\n         \"fee\": \"1.22\" // only for WITHDRAW\n       }\n     },",
          "{\n         \"id\":\"084cfcd5-06b9-4826-882e-fdb75ec3625d\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // transaction\n        //\n        //     {\n        //       \"id\": \"101609495\",\n        //       \"created_at\": \"2018-03-06T22:05:06.507Z\",\n        //       \"updated_at\": \"2018-03-06T22:11:45.03Z\",\n        //       \"status\": \"SUCCESS\",\n        //       \"type\": \"DEPOSIT\", // DEPOSIT, WITHDRAW, ..\n        //       \"subtype\": \"BLOCKCHAIN\",\n        //       \"native\": {\n        //         \"tx_id\": \"e20b0965-4024-44d0-b63f-7fb8996a6706\",\n        //         \"index\": \"881652766\",\n        //         \"currency\": \"ETH\",\n        //         \"amount\": \"0.01418088\",\n        //         \"hash\": \"d95dbbff3f9234114f1211ab0ba2a94f03f394866fd5749d74a1edab80e6c5d3\",\n        //         \"address\": \"0xd9259302c32c0a0295d86a39185c9e14f6ba0a0d\",\n        //         \"confirmations\": \"20\",\n        //         \"senders\": [\n        //           \"0x243bec9256c9a3469da22103891465b47583d9f1\"\n        //         ],\n        //         \"fee\": \"1.22\" // only for WITHDRAW\n        //       }\n        //     },\n        //     \"operation_id\": \"084cfcd5-06b9-4826-882e-fdb75ec3625d\", // only for WITHDRAW\n        //     \"commit_risk\": {}\n        // withdraw\n        //\n        //     {\n        //         \"id\":\"084cfcd5-06b9-4826-882e-fdb75ec3625d\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'operation_id', 'id');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n        const updated = this.parse8601 (this.safeString (transaction, 'updated_at'));\n        const type = this.parseTransactionType (this.safeString (transaction, 'type'));\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const native = this.safeValue (transaction, 'native', {});\n        const currencyId = this.safeString (native, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const txhash = this.safeString (native, 'hash');\n        const address = this.safeString (native, 'address');\n        const addressTo = address;\n        const tag = this.safeString (native, 'payment_id');\n        const tagTo = tag;\n        const sender = this.safeValue (native, 'senders');\n        const addressFrom = this.safeString (sender, 0);\n        const amount = this.safeNumber (native, 'amount');\n        const subType = this.safeString (transaction, 'subtype');\n        const internal = subType === 'OFFCHAIN';\n        // https://api.hitbtc.com/#check-if-offchain-is-available\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        const feeCost = this.safeNumber (native, 'fee');\n        if (feeCost !== undefined) {\n            fee['currency'] = code;\n            fee['cost'] = feeCost;\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txhash,\n            'type': type,\n            'currency': code,\n            'network': undefined,\n            'amount': amount,\n            'status': status,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'updated': updated,\n            'comment': undefined,\n            'internal': internal,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1514,
        "line_end": 1523,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'CREATED': 'pending',\n            'PENDING': 'pending',\n            'FAILED': 'failed',\n            'ROLLED_BACK': 'failed',\n            'SUCCESS': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 1525,
        "line_end": 1531,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'DEPOSIT': 'deposit',\n            'WITHDRAW': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2718,
        "line_end": 2737,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 0)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "[\n         \"2db6ebab-fb26-4537-9ef8-1a689472d236\"\n     ]"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     [\n        //         \"2db6ebab-fb26-4537-9ef8-1a689472d236\"\n        //     ]\n        //\n        return {\n            'id': this.safeString (transfer, 0),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n            'info': transfer,\n        };\n    }"
      }
    ],
    "hollaex": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 989,
        "line_end": 1006,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const timestamp = this.parse8601 (this.safeString (response, 'updated_at'));\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const currencyIds = Object.keys (this.currencies_by_id);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (response, currencyId + '_available');\n            account['total'] = this.safeString (response, currencyId + '_balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1494,
        "line_end": 1523,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\":\"usdt\",\n         \"address\":\"TECLD9XBH31XpyykdHU3uEAeUK7E6Lrmik\",\n         \"network\":\"trx\",\n         \"standard\":null,\n         \"is_valid\":true,\n         \"created_at\":\"2021-05-12T02:43:05.446Z\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"currency\":\"usdt\",\n        //         \"address\":\"TECLD9XBH31XpyykdHU3uEAeUK7E6Lrmik\",\n        //         \"network\":\"trx\",\n        //         \"standard\":null,\n        //         \"is_valid\":true,\n        //         \"created_at\":\"2021-05-12T02:43:05.446Z\"\n        //     }\n        //\n        let address = this.safeString (depositAddress, 'address');\n        let tag = undefined;\n        if (address !== undefined) {\n            const parts = address.split (':');\n            address = this.safeString (parts, 0);\n            tag = this.safeString (parts, 1);\n        }\n        this.checkAddress (address);\n        const currencyId = this.safeString (depositAddress, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const network = this.safeString (depositAddress, 'network');\n        return {\n            'info': depositAddress,\n            'currency': currency['code'],\n            'network': network,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 1904,
        "line_end": 1970,
        "comment": null,
        "mappings": [
          {
            "key": "deposit",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "withdrawalFee",
            "comment": null
          }
        ],
        "examples": [
          "\"bch\":{\n        \"id\":4,\n        \"fullname\":\"Bitcoin Cash\",\n        \"symbol\":\"bch\",\n        \"active\":true,\n        \"verified\":true,\n        \"allow_deposit\":true,\n        \"allow_withdrawal\":true,\n        \"withdrawal_fee\":0.0001,\n        \"min\":0.001,\n        \"max\":100000,\n        \"increment_unit\":0.001,\n        \"logo\":\"https://bitholla.s3.ap-northeast-2.amazonaws.com/icon/BCH-hollaex-asset-01.svg\",\n        \"code\":\"bch\",\n        \"is_public\":true,\n        \"meta\":{},\n        \"estimated_price\":null,\n        \"description\":null,\n        \"type\":\"blockchain\",\n        \"network\":null,\n        \"standard\":null,\n        \"issuer\":\"HollaEx\",\n        \"withdrawal_fees\":null,\n        \"created_at\":\"2019-08-09T10:45:43.367Z\",\n        \"updated_at\":\"2021-12-13T03:08:32.372Z\",\n        \"created_by\":1,\n        \"owner_id\":1\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    \"bch\":{\n        //        \"id\":4,\n        //        \"fullname\":\"Bitcoin Cash\",\n        //        \"symbol\":\"bch\",\n        //        \"active\":true,\n        //        \"verified\":true,\n        //        \"allow_deposit\":true,\n        //        \"allow_withdrawal\":true,\n        //        \"withdrawal_fee\":0.0001,\n        //        \"min\":0.001,\n        //        \"max\":100000,\n        //        \"increment_unit\":0.001,\n        //        \"logo\":\"https://bitholla.s3.ap-northeast-2.amazonaws.com/icon/BCH-hollaex-asset-01.svg\",\n        //        \"code\":\"bch\",\n        //        \"is_public\":true,\n        //        \"meta\":{},\n        //        \"estimated_price\":null,\n        //        \"description\":null,\n        //        \"type\":\"blockchain\",\n        //        \"network\":null,\n        //        \"standard\":null,\n        //        \"issuer\":\"HollaEx\",\n        //        \"withdrawal_fees\":null,\n        //        \"created_at\":\"2019-08-09T10:45:43.367Z\",\n        //        \"updated_at\":\"2021-12-13T03:08:32.372Z\",\n        //        \"created_by\":1,\n        //        \"owner_id\":1\n        //    }\n        //\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        const allowWithdrawal = this.safeValue (fee, 'allow_withdrawal');\n        if (allowWithdrawal) {\n            result['withdraw'] = { 'fee': this.safeNumber (fee, 'withdrawal_fee'), 'percentage': false };\n        }\n        const withdrawalFees = this.safeValue (fee, 'withdrawal_fees');\n        if (withdrawalFees !== undefined) {\n            const keys = Object.keys (withdrawalFees);\n            const keysLength = keys.length;\n            for (let i = 0; i < keysLength; i++) {\n                const key = keys[i];\n                const value = withdrawalFees[key];\n                const currencyId = this.safeString (value, 'symbol');\n                const currencyCode = this.safeCurrencyCode (currencyId);\n                const networkCode = this.networkIdToCode (key, currencyCode);\n                const networkCodeUpper = networkCode.toUpperCase (); // default to the upper case network code\n                const withdrawalFee = this.safeNumber (value, 'value');\n                result['networks'][networkCodeUpper] = {\n                    'deposit': undefined,\n                    'withdraw': withdrawalFee,\n                };\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 967,
        "line_end": 987,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"time\":\"2020-03-02T20:00:00.000Z\",\n         \"close\":8872.1,\n         \"high\":8872.1,\n         \"low\":8858.6,\n         \"open\":8858.6,\n         \"symbol\":\"btc-usdt\",\n         \"volume\":1.2922\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"time\":\"2020-03-02T20:00:00.000Z\",\n        //         \"close\":8872.1,\n        //         \"high\":8872.1,\n        //         \"low\":8858.6,\n        //         \"open\":8858.6,\n        //         \"symbol\":\"btc-usdt\",\n        //         \"volume\":1.2922\n        //     }\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'time')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1238,
        "line_end": 1302,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stop')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"id\":\"10644b7e-3c90-4ba9-bc3b-188f3a4e9cfd\",\n          \"created_by\":140093,\n          \"exchange_id\":22,\n          \"side\":\"buy\",\n          \"symbol\":\"doge-usdt\",\n          \"type\":\"limit\",\n          \"price\":0.05,\n          \"size\":10,\n          \"stop\":null,\n          \"filled\":0,\n          \"status\":\"canceled\",\n          \"fee\":0,\n          \"fee_coin\":\"doge\",\n          \"meta\": {                 // optional field only returned for postOnly orders\n              \"post_only\":true\n          },\n          \"fee_structure\": {\n              \"maker\":0.1,\n              \"taker\":0.1\n          },\n          \"created_at\":\"2022-05-31T08:14:14.747Z\",\n          \"updated_at\":\"2022-05-31T08:14:23.727Z\"\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, fetchOpenOrder, fetchOpenOrders\n        //\n        //     {\n        //          \"id\":\"10644b7e-3c90-4ba9-bc3b-188f3a4e9cfd\",\n        //          \"created_by\":140093,\n        //          \"exchange_id\":22,\n        //          \"side\":\"buy\",\n        //          \"symbol\":\"doge-usdt\",\n        //          \"type\":\"limit\",\n        //          \"price\":0.05,\n        //          \"size\":10,\n        //          \"stop\":null,\n        //          \"filled\":0,\n        //          \"status\":\"canceled\",\n        //          \"fee\":0,\n        //          \"fee_coin\":\"doge\",\n        //          \"meta\": {                 // optional field only returned for postOnly orders\n        //              \"post_only\":true\n        //          },\n        //          \"fee_structure\": {\n        //              \"maker\":0.1,\n        //              \"taker\":0.1\n        //          },\n        //          \"created_at\":\"2022-05-31T08:14:14.747Z\",\n        //          \"updated_at\":\"2022-05-31T08:14:23.727Z\"\n        //      }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const id = this.safeString (order, 'id');\n        const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n        const type = this.safeString (order, 'type');\n        const side = this.safeString (order, 'side');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'size');\n        const filled = this.safeString (order, 'filled');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const meta = this.safeValue (order, 'meta', {});\n        const postOnly = this.safeBool (meta, 'post_only', false);\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString (order, 'stop'),\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1228,
        "line_end": 1236,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'new': 'open',\n            'pfilled': 'open',\n            'filled': 'closed',\n            'canceled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 699,
        "line_end": 753,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeString (ticker, 'last', close)",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"open\": 8615.55,\n         \"close\": 8841.05,\n         \"high\": 8921.1,\n         \"low\": 8607,\n         \"last\": 8841.05,\n         \"volume\": 20.2802,\n         \"timestamp\": \"2020-03-03T03:11:18.964Z\",\n     }",
          "{\n         \"time\": \"2020-03-02T04:29:45.011Z\",\n         \"open\": 341.65,\n         \"close\": 337.9,\n         \"high\": 341.65,\n         \"low\": 337.3,\n         \"last\": 337.9,\n         \"volume\": 0.054,\n         \"symbol\": \"bch-usdt\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"open\": 8615.55,\n        //         \"close\": 8841.05,\n        //         \"high\": 8921.1,\n        //         \"low\": 8607,\n        //         \"last\": 8841.05,\n        //         \"volume\": 20.2802,\n        //         \"timestamp\": \"2020-03-03T03:11:18.964Z\",\n        //     }\n        //\n        // fetchTickers\n        //\n        //     {\n        //         \"time\": \"2020-03-02T04:29:45.011Z\",\n        //         \"open\": 341.65,\n        //         \"close\": 337.9,\n        //         \"high\": 341.65,\n        //         \"low\": 337.3,\n        //         \"last\": 337.9,\n        //         \"volume\": 0.054,\n        //         \"symbol\": \"bch-usdt\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const timestamp = this.parse8601 (this.safeString2 (ticker, 'time', 'timestamp'));\n        const close = this.safeString (ticker, 'close');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'info': ticker,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': close,\n            'last': this.safeString (ticker, 'last', close),\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTickers",
        "signature": "parseTickers (tickers, symbols: Strings = undefined, params = {}): Tickers",
        "line_start": 685,
        "line_end": 697,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTickers (tickers, symbols: Strings = undefined, params = {}): Tickers {\n        const result: Dict = {};\n        const keys = Object.keys (tickers);\n        for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const ticker = tickers[key];\n            const marketId = this.safeString (ticker, 'symbol', key);\n            const market = this.safeMarket (marketId, undefined, '-');\n            const symbol = market['symbol'];\n            result[symbol] = this.extend (this.parseTicker (ticker, market), params);\n        }\n        return this.filterByArrayTickers (result, 'symbol', symbols);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 790,
        "line_end": 846,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"size\": 0.5,\n         \"price\": 8830,\n         \"side\": \"buy\",\n         \"timestamp\": \"2020-03-03T04:44:33.034Z\"\n     }",
          "{\n      \"side\":\"sell\",\n      \"symbol\":\"doge-usdt\",\n      \"size\":70,\n      \"price\":0.147411,\n      \"timestamp\":\"2022-01-26T17:53:34.650Z\",\n      \"order_id\":\"cba78ecb-4187-4da2-9d2f-c259aa693b5a\",\n      \"fee\":0.01031877,\n      \"fee_coin\":\"usdt\"\n  }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"size\": 0.5,\n        //         \"price\": 8830,\n        //         \"side\": \"buy\",\n        //         \"timestamp\": \"2020-03-03T04:44:33.034Z\"\n        //     }\n        //\n        // fetchMyTrades (private)\n        //  {\n        //      \"side\":\"sell\",\n        //      \"symbol\":\"doge-usdt\",\n        //      \"size\":70,\n        //      \"price\":0.147411,\n        //      \"timestamp\":\"2022-01-26T17:53:34.650Z\",\n        //      \"order_id\":\"cba78ecb-4187-4da2-9d2f-c259aa693b5a\",\n        //      \"fee\":0.01031877,\n        //      \"fee_coin\":\"usdt\"\n        //  }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const datetime = this.safeString (trade, 'timestamp');\n        const timestamp = this.parse8601 (datetime);\n        const side = this.safeString (trade, 'side');\n        const orderId = this.safeString (trade, 'order_id');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'size');\n        const feeCostString = this.safeString (trade, 'fee');\n        const feeCoin = this.safeString (trade, 'fee_coin');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': feeCostString,\n                'currency': this.safeCurrencyCode (feeCoin),\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': undefined,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'symbol': symbol,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1760,
        "line_end": 1857,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "tagFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'message')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 539,\n         \"amount\": 20,\n         \"fee\": 0,\n         \"address\": \"0x5c0cc98270d7089408fcbcc8e2131287f5be2306\",\n         \"transaction_id\": \"0xd4006327a5ec2c41adbdcf566eaaba6597c3d45906abe78ea1a4a022647c2e28\",\n         \"status\": true,\n         \"dismissed\": false,\n         \"rejected\": false,\n         \"description\": \"\",\n         \"type\": \"withdrawal\",\n         \"currency\": \"usdt\",\n         \"created_at\": \"2020-03-03T07:56:36.198Z\",\n         \"updated_at\": \"2020-03-03T08:00:05.674Z\",\n         \"user_id\": 620\n     }",
          "{\n         \"message\": \"Withdrawal request is in the queue and will be processed.\",\n         \"transaction_id\": \"1d1683c3-576a-4d53-8ff5-27c93fd9758a\",\n         \"amount\": 1,\n         \"currency\": \"xht\",\n         \"fee\": 0,\n         \"fee_coin\": \"xht\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchWithdrawals, fetchDeposits\n        //\n        //     {\n        //         \"id\": 539,\n        //         \"amount\": 20,\n        //         \"fee\": 0,\n        //         \"address\": \"0x5c0cc98270d7089408fcbcc8e2131287f5be2306\",\n        //         \"transaction_id\": \"0xd4006327a5ec2c41adbdcf566eaaba6597c3d45906abe78ea1a4a022647c2e28\",\n        //         \"status\": true,\n        //         \"dismissed\": false,\n        //         \"rejected\": false,\n        //         \"description\": \"\",\n        //         \"type\": \"withdrawal\",\n        //         \"currency\": \"usdt\",\n        //         \"created_at\": \"2020-03-03T07:56:36.198Z\",\n        //         \"updated_at\": \"2020-03-03T08:00:05.674Z\",\n        //         \"user_id\": 620\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"message\": \"Withdrawal request is in the queue and will be processed.\",\n        //         \"transaction_id\": \"1d1683c3-576a-4d53-8ff5-27c93fd9758a\",\n        //         \"amount\": 1,\n        //         \"currency\": \"xht\",\n        //         \"fee\": 0,\n        //         \"fee_coin\": \"xht\"\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        const txid = this.safeString (transaction, 'transaction_id');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n        const updated = this.parse8601 (this.safeString (transaction, 'updated_at'));\n        const type = this.safeString (transaction, 'type');\n        const amount = this.safeNumber (transaction, 'amount');\n        let address = this.safeString (transaction, 'address');\n        let addressTo = undefined;\n        const addressFrom = undefined;\n        let tag = undefined;\n        let tagTo = undefined;\n        const tagFrom = undefined;\n        if (address !== undefined) {\n            const parts = address.split (':');\n            address = this.safeString (parts, 0);\n            tag = this.safeString (parts, 1);\n            addressTo = address;\n            tagTo = tag;\n        }\n        const currencyId = this.safeString (transaction, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        let status = this.safeValue (transaction, 'status');\n        const dismissed = this.safeValue (transaction, 'dismissed');\n        const rejected = this.safeValue (transaction, 'rejected');\n        if (status) {\n            status = 'ok';\n        } else if (dismissed) {\n            status = 'canceled';\n        } else if (rejected) {\n            status = 'failed';\n        } else {\n            status = 'pending';\n        }\n        const feeCurrencyId = this.safeString (transaction, 'fee_coin');\n        const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId, currency);\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': feeCurrencyCode,\n                'cost': feeCost,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'addressFrom': addressFrom,\n            'address': address,\n            'addressTo': addressTo,\n            'tagFrom': tagFrom,\n            'tag': tag,\n            'tagTo': tagTo,\n            'type': type,\n            'amount': amount,\n            'currency': currency['code'],\n            'status': status,\n            'updated': updated,\n            'comment': this.safeString (transaction, 'message'),\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      }
    ],
    "htx": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 3330,
        "line_end": 3348,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "account",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (account, 'id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 5202591,\n         \"type\": \"point\",   // spot, margin, otc, point, super-margin, investment, borrow, grid-trading, deposit-earning, otc-options\n         \"subtype\": \"\",     // The corresponding trading symbol (currency pair) the isolated margin is based on, e.g. btcusdt\n         \"state\": \"working\" // working, lock\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        //     {\n        //         \"id\": 5202591,\n        //         \"type\": \"point\",   // spot, margin, otc, point, super-margin, investment, borrow, grid-trading, deposit-earning, otc-options\n        //         \"subtype\": \"\",     // The corresponding trading symbol (currency pair) the isolated margin is based on, e.g. btcusdt\n        //         \"state\": \"working\" // working, lock\n        //     }\n        //\n        const typeId = this.safeString (account, 'type');\n        const accountsById = this.safeValue (this.options, 'accountsById', {});\n        const type = this.safeValue (accountsById, typeId, typeId);\n        return {\n            'info': account,\n            'id': this.safeString (account, 'id'),\n            'type': type,\n            'code': undefined,\n        };\n    }"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 9761,
        "line_end": 9839,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeInteger (info, 'adl_risk_percent')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC\",\n         \"contract_code\": \"BTC-USDT\",\n         \"volume\": 1.000000000000000000,\n         \"available\": 1.000000000000000000,\n         \"frozen\": 0E-18,\n         \"cost_open\": 96039.700000000000000000,\n         \"cost_hold\": 96039.700000000000000000,\n         \"profit_unreal\": 0.000600000000000000,\n         \"profit_rate\": 0.000006247416432995,\n         \"lever_rate\": 1,\n         \"position_margin\": 96.040300000000000000,\n         \"direction\": \"buy\",\n         \"profit\": 0.000600000000000000,\n         \"last_price\": 96040.3,\n         \"margin_asset\": \"USDT\",\n         \"margin_mode\": \"cross\",\n         \"margin_account\": \"USDT\",\n         \"contract_type\": \"swap\",\n         \"pair\": \"BTC-USDT\",\n         \"business_type\": \"swap\",\n         \"trade_partition\":\"USDT\",\n         \"position_mode\": \"single_side\",\n         \"store_time\": \"2023-10-08 20:05:06\",\n         \"liquidation_price\": null,\n         \"market_closing_slippage\": null,\n         \"risk_rate\": 249.274066168760049797,\n         \"new_risk_rate\": 0.003995619743220614,\n         \"risk_rate_percent\": 0.003995619743220614,\n         \"withdraw_available\": null,\n         \"open_adl\": 1,\n         \"adl_risk_percent\": 3,\n         \"tp_trigger_price\": null,\n         \"sl_trigger_price\": null,\n         \"tp_order_id\": null,\n         \"sl_order_id\": null,\n         \"tp_trigger_type\": null,\n         \"sl_trigger_type\": null,\n         \"adjust_value\": null\n     }",
          "{\n         \"symbol\": \"THETA\"\n         \"contract_code\": \"THETA-USD\"\n         \"volume\": 20\n         \"available\": 20\n         \"frozen\": 0\n         \"cost_open\": 0.6048347107438017\n         \"cost_hold\": 0.65931\n         \"profit_unreal\": -10.5257562398811\n         \"profit_rate\": 1.0158596753357925\n         \"lever_rate\": 20\n         \"position_margin\": 15.693659761456372\n         \"direction\": \"buy\"\n         \"profit\": 16.795657677889032\n         \"last_price\": 0.6372\n         \"adl_risk_percent\": \"3\"\n         \"liq_px\": \"112\"\n         \"new_risk_rate\": \"\"\n         \"trade_partition\": \"\"\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionADLRank linear swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"available\": 1.000000000000000000,\n        //         \"frozen\": 0E-18,\n        //         \"cost_open\": 96039.700000000000000000,\n        //         \"cost_hold\": 96039.700000000000000000,\n        //         \"profit_unreal\": 0.000600000000000000,\n        //         \"profit_rate\": 0.000006247416432995,\n        //         \"lever_rate\": 1,\n        //         \"position_margin\": 96.040300000000000000,\n        //         \"direction\": \"buy\",\n        //         \"profit\": 0.000600000000000000,\n        //         \"last_price\": 96040.3,\n        //         \"margin_asset\": \"USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"contract_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"business_type\": \"swap\",\n        //         \"trade_partition\":\"USDT\",\n        //         \"position_mode\": \"single_side\",\n        //         \"store_time\": \"2023-10-08 20:05:06\",\n        //         \"liquidation_price\": null,\n        //         \"market_closing_slippage\": null,\n        //         \"risk_rate\": 249.274066168760049797,\n        //         \"new_risk_rate\": 0.003995619743220614,\n        //         \"risk_rate_percent\": 0.003995619743220614,\n        //         \"withdraw_available\": null,\n        //         \"open_adl\": 1,\n        //         \"adl_risk_percent\": 3,\n        //         \"tp_trigger_price\": null,\n        //         \"sl_trigger_price\": null,\n        //         \"tp_order_id\": null,\n        //         \"sl_order_id\": null,\n        //         \"tp_trigger_type\": null,\n        //         \"sl_trigger_type\": null,\n        //         \"adjust_value\": null\n        //     }\n        //\n        // fetchPositionADLRank inverse\n        //\n        //     {\n        //         \"symbol\": \"THETA\"\n        //         \"contract_code\": \"THETA-USD\"\n        //         \"volume\": 20\n        //         \"available\": 20\n        //         \"frozen\": 0\n        //         \"cost_open\": 0.6048347107438017\n        //         \"cost_hold\": 0.65931\n        //         \"profit_unreal\": -10.5257562398811\n        //         \"profit_rate\": 1.0158596753357925\n        //         \"lever_rate\": 20\n        //         \"position_margin\": 15.693659761456372\n        //         \"direction\": \"buy\"\n        //         \"profit\": 16.795657677889032\n        //         \"last_price\": 0.6372\n        //         \"adl_risk_percent\": \"3\"\n        //         \"liq_px\": \"112\"\n        //         \"new_risk_rate\": \"\"\n        //         \"trade_partition\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'contract_code');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeInteger (info, 'adl_risk_percent'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        } as ADL;\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 7331,
        "line_end": 7389,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'currency'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest-amount')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interest-rate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'loan-amount')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"interest-rate\":\"0.000040830000000000\",\n        \"user-id\":35930539,\n        \"account-id\":48916071,\n        \"updated-at\":1649320794195,\n        \"deduct-rate\":\"1\",\n        \"day-interest-rate\":\"0.000980000000000000\",\n        \"hour-interest-rate\":\"0.000040830000000000\",\n        \"loan-balance\":\"100.790000000000000000\",\n        \"interest-balance\":\"0.004115260000000000\",\n        \"loan-amount\":\"100.790000000000000000\",\n        \"paid-coin\":\"0.000000000000000000\",\n        \"accrued-at\":1649320794148,\n        \"created-at\":1649320794148,\n        \"interest-amount\":\"0.004115260000000000\",\n        \"deduct-amount\":\"0\",\n        \"deduct-currency\":\"\",\n        \"paid-point\":\"0.000000000000000000\",\n        \"currency\":\"usdt\",\n        \"symbol\":\"ltcusdt\",\n        \"id\":20242721,\n    }",
          "{\n       \"id\":3416576,\n       \"user-id\":35930539,\n       \"account-id\":48956839,\n       \"currency\":\"usdt\",\n       \"loan-amount\":\"102\",\n       \"loan-balance\":\"102\",\n       \"interest-amount\":\"0.00416466\",\n       \"interest-balance\":\"0.00416466\",\n       \"created-at\":1649322735333,\n       \"accrued-at\":1649322735382,\n       \"state\":\"accrual\",\n       \"filled-points\":\"0\",\n       \"filled-ht\":\"0\"\n   }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        // isolated\n        //    {\n        //        \"interest-rate\":\"0.000040830000000000\",\n        //        \"user-id\":35930539,\n        //        \"account-id\":48916071,\n        //        \"updated-at\":1649320794195,\n        //        \"deduct-rate\":\"1\",\n        //        \"day-interest-rate\":\"0.000980000000000000\",\n        //        \"hour-interest-rate\":\"0.000040830000000000\",\n        //        \"loan-balance\":\"100.790000000000000000\",\n        //        \"interest-balance\":\"0.004115260000000000\",\n        //        \"loan-amount\":\"100.790000000000000000\",\n        //        \"paid-coin\":\"0.000000000000000000\",\n        //        \"accrued-at\":1649320794148,\n        //        \"created-at\":1649320794148,\n        //        \"interest-amount\":\"0.004115260000000000\",\n        //        \"deduct-amount\":\"0\",\n        //        \"deduct-currency\":\"\",\n        //        \"paid-point\":\"0.000000000000000000\",\n        //        \"currency\":\"usdt\",\n        //        \"symbol\":\"ltcusdt\",\n        //        \"id\":20242721,\n        //    }\n        //\n        // cross\n        //   {\n        //       \"id\":3416576,\n        //       \"user-id\":35930539,\n        //       \"account-id\":48956839,\n        //       \"currency\":\"usdt\",\n        //       \"loan-amount\":\"102\",\n        //       \"loan-balance\":\"102\",\n        //       \"interest-amount\":\"0.00416466\",\n        //       \"interest-balance\":\"0.00416466\",\n        //       \"created-at\":1649322735333,\n        //       \"accrued-at\":1649322735382,\n        //       \"state\":\"accrual\",\n        //       \"filled-points\":\"0\",\n        //       \"filled-ht\":\"0\"\n        //   }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const marginMode = (marketId === undefined) ? 'cross' : 'isolated';\n        market = this.safeMarket (marketId);\n        const symbol = this.safeString (market, 'symbol');\n        const timestamp = this.safeInteger (info, 'accrued-at');\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'currency')),\n            'interest': this.safeNumber (info, 'interest-amount'),\n            'interestRate': this.safeNumber (info, 'interest-rate'),\n            'amountBorrowed': this.safeNumber (info, 'loan-amount'),\n            'marginMode': marginMode,\n            'timestamp': timestamp,  // Interest accrued time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseCancelOrders",
        "signature": "parseCancelOrders (orders)",
        "line_start": 6188,
        "line_end": 6244,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'order-id', 'order_id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'failed'",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client-order-id')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"success\": [\n            \"5983466\"\n        ],\n        \"failed\": [\n            {\n                \"err-msg\": \"Incorrect order state\",\n                \"order-state\": 7,\n                \"order-id\": \"\",\n                \"err-code\": \"order-orderstate-error\",\n                \"client-order-id\": \"first\"\n            },\n            ...\n        ]\n    }",
          "{\n        \"errors\": [\n            {\n                \"order_id\": \"769206471845261312\",\n                \"err_code\": 1061,\n                \"err_msg\": \"This order doesnt exist.\"\n            }\n        ],\n        \"successes\": \"1258075374411399168,1258075393254871040\"\n    }"
        ],
        "source": "parseCancelOrders (orders) {\n        //\n        //    {\n        //        \"success\": [\n        //            \"5983466\"\n        //        ],\n        //        \"failed\": [\n        //            {\n        //                \"err-msg\": \"Incorrect order state\",\n        //                \"order-state\": 7,\n        //                \"order-id\": \"\",\n        //                \"err-code\": \"order-orderstate-error\",\n        //                \"client-order-id\": \"first\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        //    {\n        //        \"errors\": [\n        //            {\n        //                \"order_id\": \"769206471845261312\",\n        //                \"err_code\": 1061,\n        //                \"err_msg\": \"This order doesnt exist.\"\n        //            }\n        //        ],\n        //        \"successes\": \"1258075374411399168,1258075393254871040\"\n        //    }\n        //\n        const successes = this.safeString (orders, 'successes');\n        let success = undefined;\n        if (successes !== undefined) {\n            success = successes.split (',');\n        } else {\n            success = this.safeList (orders, 'success', []);\n        }\n        const failed = this.safeList2 (orders, 'errors', 'failed', []);\n        const result = [];\n        for (let i = 0; i < success.length; i++) {\n            const order = success[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': order,\n                'status': 'canceled',\n            }));\n        }\n        for (let i = 0; i < failed.length; i++) {\n            const order = failed[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': this.safeString2 (order, 'order-id', 'order_id'),\n                'status': 'failed',\n                'clientOrderId': this.safeString (order, 'client-order-id'),\n            }));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined)",
        "line_start": 6406,
        "line_end": 6431,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "note",
            "value": "note",
            "comment": null
          },
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"usdt\",\n         \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n         \"addressTag\": \"\",\n         \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"currency\": \"usdt\",\n        //         \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n        //         \"addressTag\": \"\",\n        //         \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const tag = this.safeString (depositAddress, 'addressTag');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const note = this.safeString (depositAddress, 'note');\n        const networkId = this.safeString (depositAddress, 'chain');\n        this.checkAddress (address);\n        return {\n            'currency': code,\n            'address': address,\n            'tag': tag,\n            'network': this.networkIdToCode (networkId),\n            'note': note,\n            'info': depositAddress,\n        };\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9197,
        "line_end": 9261,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          }
        ],
        "examples": [
          "{\n              \"currency\": \"sxp\",\n              \"assetType\": \"1\",\n              \"chains\": [\n                  {\n                      \"chain\": \"sxp\",\n                      \"displayName\": \"ERC20\",\n                      \"baseChain\": \"ETH\",\n                      \"baseChainProtocol\": \"ERC20\",\n                      \"isDynamic\": true,\n                      \"numOfConfirmations\": \"12\",\n                      \"numOfFastConfirmations\": \"12\",\n                      \"depositStatus\": \"allowed\",\n                      \"minDepositAmt\": \"0.23\",\n                      \"withdrawStatus\": \"allowed\",\n                      \"minWithdrawAmt\": \"0.23\",\n                      \"withdrawPrecision\": \"8\",\n                      \"maxWithdrawAmt\": \"227000.000000000000000000\",\n                      \"withdrawQuotaPerDay\": \"227000.000000000000000000\",\n                      \"withdrawQuotaPerYear\": null,\n                      \"withdrawQuotaTotal\": null,\n                      \"withdrawFeeType\": \"fixed\",\n                      \"transactFeeWithdraw\": \"11.1653\",\n                      \"addrWithTag\": false,\n                      \"addrDepositTag\": false\n                  }\n              ],\n              \"instStatus\": \"normal\"\n          }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //            {\n        //              \"currency\": \"sxp\",\n        //              \"assetType\": \"1\",\n        //              \"chains\": [\n        //                  {\n        //                      \"chain\": \"sxp\",\n        //                      \"displayName\": \"ERC20\",\n        //                      \"baseChain\": \"ETH\",\n        //                      \"baseChainProtocol\": \"ERC20\",\n        //                      \"isDynamic\": true,\n        //                      \"numOfConfirmations\": \"12\",\n        //                      \"numOfFastConfirmations\": \"12\",\n        //                      \"depositStatus\": \"allowed\",\n        //                      \"minDepositAmt\": \"0.23\",\n        //                      \"withdrawStatus\": \"allowed\",\n        //                      \"minWithdrawAmt\": \"0.23\",\n        //                      \"withdrawPrecision\": \"8\",\n        //                      \"maxWithdrawAmt\": \"227000.000000000000000000\",\n        //                      \"withdrawQuotaPerDay\": \"227000.000000000000000000\",\n        //                      \"withdrawQuotaPerYear\": null,\n        //                      \"withdrawQuotaTotal\": null,\n        //                      \"withdrawFeeType\": \"fixed\",\n        //                      \"transactFeeWithdraw\": \"11.1653\",\n        //                      \"addrWithTag\": false,\n        //                      \"addrDepositTag\": false\n        //                  }\n        //              ],\n        //              \"instStatus\": \"normal\"\n        //          }\n        //\n        const chains = this.safeValue (fee, 'chains', []);\n        let result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < chains.length; j++) {\n            const chainEntry = chains[j];\n            const networkId = this.safeString (chainEntry, 'chain');\n            const withdrawFeeType = this.safeString (chainEntry, 'withdrawFeeType');\n            const networkCode = this.networkIdToCode (networkId);\n            let withdrawFee = undefined;\n            let withdrawResult = undefined;\n            if (withdrawFeeType === 'fixed') {\n                withdrawFee = this.safeNumber (chainEntry, 'transactFeeWithdraw');\n                withdrawResult = {\n                    'fee': withdrawFee,\n                    'percentage': false,\n                };\n            } else {\n                withdrawFee = this.safeNumber (chainEntry, 'transactFeeRateWithdraw');\n                withdrawResult = {\n                    'fee': withdrawFee,\n                    'percentage': true,\n                };\n            }\n            result['networks'][networkCode] = {\n                'withdraw': withdrawResult,\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n            result = this.assignDefaultDepositWithdrawFees (result, currency);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 7155,
        "line_end": 7164,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 7109,
        "line_end": 7153,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"status\": \"ok\",\n      \"data\": {\n         \"estimated_rate\": \"0.000100000000000000\",\n         \"funding_rate\": \"0.000100000000000000\",\n         \"contract_code\": \"BCH-USD\",\n         \"symbol\": \"BCH\",\n         \"fee_asset\": \"BCH\",\n         \"funding_time\": \"1639094400000\",\n         \"next_funding_time\": \"1639123200000\"\n     },\n     \"ts\": 1639085854775\n }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        // {\n        //      \"status\": \"ok\",\n        //      \"data\": {\n        //         \"estimated_rate\": \"0.000100000000000000\",\n        //         \"funding_rate\": \"0.000100000000000000\",\n        //         \"contract_code\": \"BCH-USD\",\n        //         \"symbol\": \"BCH\",\n        //         \"fee_asset\": \"BCH\",\n        //         \"funding_time\": \"1639094400000\",\n        //         \"next_funding_time\": \"1639123200000\"\n        //     },\n        //     \"ts\": 1639085854775\n        // }\n        //\n        const nextFundingRate = this.safeNumber (contract, 'estimated_rate');\n        const fundingTimestamp = this.safeInteger (contract, 'funding_time');\n        const nextFundingTimestamp = this.safeInteger (contract, 'next_funding_time');\n        const fundingTimeString = this.safeString (contract, 'funding_time');\n        const nextFundingTimeString = this.safeString (contract, 'next_funding_time');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        const marketId = this.safeString (contract, 'contract_code');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': nextFundingRate,\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 7730,
        "line_end": 7757,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": \"1667161118\",\n       \"symbol\": \"BTC\",\n       \"type\": \"31\",\n       \"amount\": \"-2.11306593188E-7\",\n       \"ts\": \"1641139308983\",\n       \"contract_code\": \"BTC-USD\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"id\": \"1667161118\",\n        //       \"symbol\": \"BTC\",\n        //       \"type\": \"31\",\n        //       \"amount\": \"-2.11306593188E-7\",\n        //       \"ts\": \"1641139308983\",\n        //       \"contract_code\": \"BTC-USD\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'contract_code');\n        const symbol = this.safeSymbol (marketId, market);\n        const amount = this.safeNumber (income, 'amount');\n        const timestamp = this.safeInteger (income, 'ts');\n        const id = this.safeString (income, 'id');\n        const currencyId = this.safeString2 (income, 'symbol', 'asset');\n        const code = this.safeCurrencyCode (currencyId);\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': id,\n            'amount': amount,\n        };\n    }"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 6981,
        "line_end": 7023,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeCurrencyCode (baseId)",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseData, 'actual-rate')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeCurrencyCode (quoteId)",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteData, 'actual-rate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"1inchusdt\",\n         \"currencies\": [\n             {\n                 \"currency\": \"1inch\",\n                 \"interest-rate\": \"0.00098\",\n                 \"min-loan-amt\": \"90.000000000000000000\",\n                 \"max-loan-amt\": \"1000.000000000000000000\",\n                 \"loanable-amt\": \"0.0\",\n                 \"actual-rate\": \"0.00098\"\n             },\n             {\n                 \"currency\": \"usdt\",\n                 \"interest-rate\": \"0.00098\",\n                 \"min-loan-amt\": \"100.000000000000000000\",\n                 \"max-loan-amt\": \"1000.000000000000000000\",\n                 \"loanable-amt\": \"0.0\",\n                 \"actual-rate\": \"0.00098\"\n             }\n         ]\n     },"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //     {\n        //         \"symbol\": \"1inchusdt\",\n        //         \"currencies\": [\n        //             {\n        //                 \"currency\": \"1inch\",\n        //                 \"interest-rate\": \"0.00098\",\n        //                 \"min-loan-amt\": \"90.000000000000000000\",\n        //                 \"max-loan-amt\": \"1000.000000000000000000\",\n        //                 \"loanable-amt\": \"0.0\",\n        //                 \"actual-rate\": \"0.00098\"\n        //             },\n        //             {\n        //                 \"currency\": \"usdt\",\n        //                 \"interest-rate\": \"0.00098\",\n        //                 \"min-loan-amt\": \"100.000000000000000000\",\n        //                 \"max-loan-amt\": \"1000.000000000000000000\",\n        //                 \"loanable-amt\": \"0.0\",\n        //                 \"actual-rate\": \"0.00098\"\n        //             }\n        //         ]\n        //     },\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const currencies = this.safeValue (info, 'currencies', []);\n        const baseData = this.safeValue (currencies, 0);\n        const quoteData = this.safeValue (currencies, 1);\n        const baseId = this.safeString (baseData, 'currency');\n        const quoteId = this.safeString (quoteData, 'currency');\n        return {\n            'symbol': symbol,\n            'base': this.safeCurrencyCode (baseId),\n            'baseRate': this.safeNumber (baseData, 'actual-rate'),\n            'quote': this.safeCurrencyCode (quoteId),\n            'quoteRate': this.safeNumber (quoteData, 'actual-rate'),\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 2581,
        "line_end": 2596,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "side",
            "value": "direction",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        // example responses are documented in fetchLastPrices\n        const marketId = this.safeString2 (entry, 'symbol', 'contract_code');\n        market = this.safeMarket (marketId, market);\n        const price = this.safeNumber (entry, 'price');\n        const direction = this.safeString (entry, 'direction'); // \"buy\" or \"sell\"\n        // group timestamp should not be assigned to the individual trades' times\n        return {\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'price': price,\n            'side': direction,\n            'info': entry,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 8275,
        "line_end": 8313,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "this.safeString (item, 'direction')",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "id",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "account",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (transferType)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'transactAmt')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"accountId\": 10000001,\n         \"currency\": \"usdt\",\n         \"transactAmt\": 10.000000000000000000,\n         \"transactType\": \"transfer\",\n         \"transferType\": \"margin-transfer-out\",\n         \"transactId\": 0,\n         \"transactTime\": 1629882331066,\n         \"transferer\": 28483123,\n         \"transferee\": 13496526\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"accountId\": 10000001,\n        //         \"currency\": \"usdt\",\n        //         \"transactAmt\": 10.000000000000000000,\n        //         \"transactType\": \"transfer\",\n        //         \"transferType\": \"margin-transfer-out\",\n        //         \"transactId\": 0,\n        //         \"transactTime\": 1629882331066,\n        //         \"transferer\": 28483123,\n        //         \"transferee\": 13496526\n        //     }\n        //\n        const currencyId = this.safeString (item, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const id = this.safeString (item, 'transactId');\n        const transferType = this.safeString (item, 'transferType');\n        const timestamp = this.safeInteger (item, 'transactTime');\n        const account = this.safeString (item, 'accountId');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': this.safeString (item, 'direction'),\n            'account': account,\n            'referenceId': id,\n            'referenceAccount': account,\n            'type': this.parseLedgerEntryType (transferType),\n            'currency': code,\n            'amount': this.safeNumber (item, 'transactAmt'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 8255,
        "line_end": 8273,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'trade': 'trade',\n            'etf': 'trade',\n            'transact-fee': 'fee',\n            'fee-deduction': 'fee',\n            'transfer': 'transfer',\n            'credit': 'credit',\n            'liquidation': 'trade',\n            'interest': 'credit',\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'withdraw-fee': 'fee',\n            'exchange': 'exchange',\n            'other-types': 'transfer',\n            'rebate': 'rebate',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 9424,
        "line_end": 9455,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (liquidation, 'volume')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'direction')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'amount')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.safeNumber (liquidation, 'trade_turnover')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"query_id\": 452057,\n         \"contract_code\": \"BTC-USDT-211210\",\n         \"symbol\": \"USDT\",\n         \"direction\": \"sell\",\n         \"offset\": \"close\",\n         \"volume\": 479.000000000000000000,\n         \"price\": 51441.700000000000000000,\n         \"created_at\": 1638593647864,\n         \"amount\": 0.479000000000000000,\n         \"trade_turnover\": 24640.574300000000000000,\n         \"business_type\": \"futures\",\n         \"pair\": \"BTC-USDT\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"query_id\": 452057,\n        //         \"contract_code\": \"BTC-USDT-211210\",\n        //         \"symbol\": \"USDT\",\n        //         \"direction\": \"sell\",\n        //         \"offset\": \"close\",\n        //         \"volume\": 479.000000000000000000,\n        //         \"price\": 51441.700000000000000000,\n        //         \"created_at\": 1638593647864,\n        //         \"amount\": 0.479000000000000000,\n        //         \"trade_turnover\": 24640.574300000000000000,\n        //         \"business_type\": \"futures\",\n        //         \"pair\": \"BTC-USDT\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'contract_code');\n        const timestamp = this.safeInteger (liquidation, 'created_at');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.safeNumber (liquidation, 'volume'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'price'),\n            'side': this.safeStringLower (liquidation, 'direction'),\n            'baseValue': this.safeNumber (liquidation, 'amount'),\n            'quoteValue': this.safeNumber (liquidation, 'trade_turnover'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseMarginBalanceHelper",
        "signature": "parseMarginBalanceHelper (balance, code, result)",
        "line_start": 4131,
        "line_end": 4145,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarginBalanceHelper (balance, code, result) {\n        let account = undefined;\n        if (code in result) {\n            account = result[code];\n        } else {\n            account = this.account ();\n        }\n        if (balance['type'] === 'trade') {\n            account['free'] = this.safeString (balance, 'balance');\n        }\n        if (balance['type'] === 'frozen') {\n            account['used'] = this.safeString (balance, 'balance');\n        }\n        return account;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 9005,
        "line_end": 9037,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (info, 'repayId', 'data')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"status\": \"ok\",\n         \"data\": null\n     }",
          "{\n         \"data\": 1000\n     }",
          "{\n         \"repayId\":1174424,\n         \"repayTime\":1600747722018\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        // borrowMargin cross\n        //\n        //     {\n        //         \"status\": \"ok\",\n        //         \"data\": null\n        //     }\n        //\n        // borrowMargin isolated\n        //\n        //     {\n        //         \"data\": 1000\n        //     }\n        //\n        // repayMargin\n        //\n        //     {\n        //         \"repayId\":1174424,\n        //         \"repayTime\":1600747722018\n        //     }\n        //\n        const timestamp = this.safeInteger (info, 'repayTime');\n        return {\n            'id': this.safeString2 (info, 'repayId', 'data'),\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 8439,
        "line_end": 8464,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (bracket, 'ladder')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (bracket, 'min_size')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (bracket, 'max_size')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.parseNumber (Precise.stringDiv (adjustFactor, leverage))",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "info",
            "value": "bracket",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        const currencyId = this.safeString (info, 'trade_partition');\n        const marketId = this.safeString (info, 'contract_code');\n        const tiers = [];\n        const brackets = this.safeList (info, 'list', []);\n        for (let i = 0; i < brackets.length; i++) {\n            const item = brackets[i];\n            const leverage = this.safeString (item, 'lever_rate');\n            const ladders = this.safeList (item, 'ladders', []);\n            for (let k = 0; k < ladders.length; k++) {\n                const bracket = ladders[k];\n                const adjustFactor = this.safeString (bracket, 'adjust_factor');\n                tiers.push ({\n                    'tier': this.safeInteger (bracket, 'ladder'),\n                    'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n                    'currency': this.safeCurrencyCode (currencyId),\n                    'minNotional': this.safeNumber (bracket, 'min_size'),\n                    'maxNotional': this.safeNumber (bracket, 'max_size'),\n                    'maintenanceMarginRate': this.parseNumber (Precise.stringDiv (adjustFactor, leverage)),\n                    'maxLeverage': this.parseNumber (leverage),\n                    'info': bracket,\n                });\n            }\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 3136,
        "line_end": 3157,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"amount\":1.2082,\n         \"open\":0.025096,\n         \"close\":0.025095,\n         \"high\":0.025096,\n         \"id\":1591515300,\n         \"count\":6,\n         \"low\":0.025095,\n         \"vol\":0.0303205097\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"amount\":1.2082,\n        //         \"open\":0.025096,\n        //         \"close\":0.025095,\n        //         \"high\":0.025096,\n        //         \"id\":1591515300,\n        //         \"count\":6,\n        //         \"low\":0.025095,\n        //         \"vol\":0.0303205097\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'id'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'amount'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 8787,
        "line_end": 8854,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"volume\": \"4385.4350000000000000\",\n        \"amount_type\": \"2\",\n        \"ts\": \"1648220400000\",\n        \"value\": \"194059884.1850000000000000\"\n    }",
          "{\n         \"volume\": 7192610.000000000000000000,\n         \"amount\": 7192.610000000000000000,\n         \"symbol\": \"BTC\",\n         \"value\": 134654290.332000000000000000,\n         \"contract_code\": \"BTC-USDT\",\n         \"trade_amount\": 70692.804,\n         \"trade_volume\": 70692804,\n         \"trade_turnover\": 1379302592.9518,\n         \"business_type\": \"swap\",\n         \"pair\": \"BTC-USDT\",\n         \"contract_type\": \"swap\",\n         \"trade_partition\": \"USDT\"\n     }",
          "{\n         \"volume\": 518018.000000000000000000,\n         \"amount\": 2769.675777407074725180,\n         \"symbol\": \"BTC\",\n         \"contract_code\": \"BTC-USD\",\n         \"trade_amount\": 9544.4032080046491323463688602729806842458,\n         \"trade_volume\": 1848448,\n         \"trade_turnover\": 184844800.000000000000000000\n     }",
          "{\n         \"volume\": 118850.000000000000000000,\n         \"amount\": 635.502025211544374189,\n         \"symbol\": \"BTC\",\n         \"contract_type\": \"this_week\",\n         \"contract_code\": \"BTC220930\",\n         \"trade_amount\": 1470.9400749347598691119206024033947897351,\n         \"trade_volume\": 286286,\n         \"trade_turnover\": 28628600.000000000000000000\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterestHistory\n        //\n        //    {\n        //        \"volume\": \"4385.4350000000000000\",\n        //        \"amount_type\": \"2\",\n        //        \"ts\": \"1648220400000\",\n        //        \"value\": \"194059884.1850000000000000\"\n        //    }\n        //\n        // fetchOpenInterest: USDT-M\n        //\n        //     {\n        //         \"volume\": 7192610.000000000000000000,\n        //         \"amount\": 7192.610000000000000000,\n        //         \"symbol\": \"BTC\",\n        //         \"value\": 134654290.332000000000000000,\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"trade_amount\": 70692.804,\n        //         \"trade_volume\": 70692804,\n        //         \"trade_turnover\": 1379302592.9518,\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"contract_type\": \"swap\",\n        //         \"trade_partition\": \"USDT\"\n        //     }\n        //\n        // fetchOpenInterest: COIN-M Swap\n        //\n        //     {\n        //         \"volume\": 518018.000000000000000000,\n        //         \"amount\": 2769.675777407074725180,\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USD\",\n        //         \"trade_amount\": 9544.4032080046491323463688602729806842458,\n        //         \"trade_volume\": 1848448,\n        //         \"trade_turnover\": 184844800.000000000000000000\n        //     }\n        //\n        // fetchOpenInterest: COIN-M Futures\n        //\n        //     {\n        //         \"volume\": 118850.000000000000000000,\n        //         \"amount\": 635.502025211544374189,\n        //         \"symbol\": \"BTC\",\n        //         \"contract_type\": \"this_week\",\n        //         \"contract_code\": \"BTC220930\",\n        //         \"trade_amount\": 1470.9400749347598691119206024033947897351,\n        //         \"trade_volume\": 286286,\n        //         \"trade_turnover\": 28628600.000000000000000000\n        //     }\n        //\n        const timestamp = this.safeInteger (interest, 'ts');\n        const amount = this.safeNumber (interest, 'volume');\n        const value = this.safeNumber (interest, 'value');\n        const marketId = this.safeString (interest, 'contract_code');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId, market),\n            'baseVolume': amount,  // deprecated\n            'quoteVolume': value,  // deprecated\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 4875,
        "line_end": 5308,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString2 (order, 'stop-price', 'trigger_price')",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":  13997833014,\n         \"symbol\": \"ethbtc\",\n         \"account-id\":  3398321,\n         \"amount\": \"0.045000000000000000\",\n         \"price\": \"0.034014000000000000\",\n         \"created-at\":  1545836976871,\n         \"type\": \"sell-limit\",\n         \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n         \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n         \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n         \"finished-at\":  1545837948214,\n         \"source\": \"spot-api\",\n         \"state\": \"filled\",\n         \"canceled-at\":  0\n     }",
          "{\n         \"id\":  20395337822,\n         \"symbol\": \"ethbtc\",\n         \"account-id\":  5685075,\n         \"amount\": \"0.001000000000000000\",\n         \"price\": \"0.0\",\n         \"created-at\":  1545831584023,\n         \"type\": \"buy-market\",\n         \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n         \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n         \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n         \"finished-at\":  1545831584181,\n         \"source\": \"spot-api\",\n         \"state\": \"filled\",\n         \"canceled-at\":  0\n     }",
          "{\n         \"order_id\":924660854912552960,\n         \"order_id_str\":\"924660854912552960\"\n     }",
          "{\n         \"business_type\":\"swap\",\n         \"contract_type\":\"swap\",\n         \"pair\":\"BTC-USDT\",\n         \"symbol\":\"BTC\",\n         \"contract_code\":\"BTC-USDT\",\n         \"volume\":1,\n         \"price\":3000,\n         \"order_price_type\":\"limit\",\n         \"order_type\":1,\n         \"direction\":\"buy\",\n         \"offset\":\"open\",\n         \"lever_rate\":1,\n         \"order_id\":924912513206878210,\n         \"client_order_id\":null,\n         \"created_at\":1640557927189,\n         \"trade_volume\":0,\n         \"trade_turnover\":0,\n         \"fee\":0,\n         \"trade_avg_price\":null,\n         \"margin_frozen\":3.000000000000000000,\n         \"profit\":0,\n         \"status\":3,\n         \"order_source\":\"api\",\n         \"order_id_str\":\"924912513206878210\",\n         \"fee_asset\":\"USDT\",\n         \"liquidation_type\":\"0\",\n         \"canceled_at\":0,\n         \"margin_asset\":\"USDT\",\n         \"margin_account\":\"USDT\",\n         \"margin_mode\":\"cross\",\n         \"is_tpsl\":0,\n         \"real_profit\":0\n     }",
          "{\n         \"symbol\": \"BTC\",\n         \"contract_code\": \"BTC-USDT\",\n         \"instrument_price\": 0,\n         \"final_interest\": 0,\n         \"adjust_value\": 0,\n         \"lever_rate\": 10,\n         \"direction\": \"sell\",\n         \"offset\": \"open\",\n         \"volume\": 1.000000000000000000,\n         \"price\": 13059.800000000000000000,\n         \"created_at\": 1603703614712,\n         \"canceled_at\": 0,\n         \"order_source\": \"api\",\n         \"order_price_type\": \"opponent\",\n         \"margin_frozen\": 0,\n         \"profit\": 0,\n         \"trades\": [\n             {\n                 \"trade_id\": 131560927,\n                 \"trade_price\": 13059.800000000000000000,\n                 \"trade_volume\": 1.000000000000000000,\n                 \"trade_turnover\": 13.059800000000000000,\n                 \"trade_fee\": -0.005223920000000000,\n                 \"created_at\": 1603703614715,\n                 \"role\": \"taker\",\n                 \"fee_asset\": \"USDT\",\n                 \"profit\": 0,\n                 \"real_profit\": 0,\n                 \"id\": \"131560927-770334322963152896-1\"\n             }\n         ],\n         \"total_page\": 1,\n         \"current_page\": 1,\n         \"total_size\": 1,\n         \"liquidation_type\": \"0\",\n         \"fee_asset\": \"USDT\",\n         \"fee\": -0.005223920000000000,\n         \"order_id\": 770334322963152896,\n         \"order_id_str\": \"770334322963152896\",\n         \"client_order_id\": 57012021045,\n         \"order_type\": \"1\",\n         \"status\": 6,\n         \"trade_avg_price\": 13059.800000000000000000,\n         \"trade_turnover\": 13.059800000000000000,\n         \"trade_volume\": 1.000000000000000000,\n         \"margin_asset\": \"USDT\",\n         \"margin_mode\": \"isolated\",\n         \"margin_account\": \"BTC-USDT\",\n         \"real_profit\": 0,\n         \"is_tpsl\": 0\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"id\":  13997833014,\n        //         \"symbol\": \"ethbtc\",\n        //         \"account-id\":  3398321,\n        //         \"amount\": \"0.045000000000000000\",\n        //         \"price\": \"0.034014000000000000\",\n        //         \"created-at\":  1545836976871,\n        //         \"type\": \"sell-limit\",\n        //         \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n        //         \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n        //         \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n        //         \"finished-at\":  1545837948214,\n        //         \"source\": \"spot-api\",\n        //         \"state\": \"filled\",\n        //         \"canceled-at\":  0\n        //     }\n        //\n        //     {\n        //         \"id\":  20395337822,\n        //         \"symbol\": \"ethbtc\",\n        //         \"account-id\":  5685075,\n        //         \"amount\": \"0.001000000000000000\",\n        //         \"price\": \"0.0\",\n        //         \"created-at\":  1545831584023,\n        //         \"type\": \"buy-market\",\n        //         \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n        //         \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n        //         \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n        //         \"finished-at\":  1545831584181,\n        //         \"source\": \"spot-api\",\n        //         \"state\": \"filled\",\n        //         \"canceled-at\":  0\n        //     }\n        //\n        // linear swap cross margin createOrder\n        //\n        //     {\n        //         \"order_id\":924660854912552960,\n        //         \"order_id_str\":\"924660854912552960\"\n        //     }\n        //\n        // contracts fetchOrder\n        //\n        //     {\n        //         \"business_type\":\"swap\",\n        //         \"contract_type\":\"swap\",\n        //         \"pair\":\"BTC-USDT\",\n        //         \"symbol\":\"BTC\",\n        //         \"contract_code\":\"BTC-USDT\",\n        //         \"volume\":1,\n        //         \"price\":3000,\n        //         \"order_price_type\":\"limit\",\n        //         \"order_type\":1,\n        //         \"direction\":\"buy\",\n        //         \"offset\":\"open\",\n        //         \"lever_rate\":1,\n        //         \"order_id\":924912513206878210,\n        //         \"client_order_id\":null,\n        //         \"created_at\":1640557927189,\n        //         \"trade_volume\":0,\n        //         \"trade_turnover\":0,\n        //         \"fee\":0,\n        //         \"trade_avg_price\":null,\n        //         \"margin_frozen\":3.000000000000000000,\n        //         \"profit\":0,\n        //         \"status\":3,\n        //         \"order_source\":\"api\",\n        //         \"order_id_str\":\"924912513206878210\",\n        //         \"fee_asset\":\"USDT\",\n        //         \"liquidation_type\":\"0\",\n        //         \"canceled_at\":0,\n        //         \"margin_asset\":\"USDT\",\n        //         \"margin_account\":\"USDT\",\n        //         \"margin_mode\":\"cross\",\n        //         \"is_tpsl\":0,\n        //         \"real_profit\":0\n        //     }\n        //\n        // contracts fetchOrder detailed\n        //\n        //     {\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"instrument_price\": 0,\n        //         \"final_interest\": 0,\n        //         \"adjust_value\": 0,\n        //         \"lever_rate\": 10,\n        //         \"direction\": \"sell\",\n        //         \"offset\": \"open\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"price\": 13059.800000000000000000,\n        //         \"created_at\": 1603703614712,\n        //         \"canceled_at\": 0,\n        //         \"order_source\": \"api\",\n        //         \"order_price_type\": \"opponent\",\n        //         \"margin_frozen\": 0,\n        //         \"profit\": 0,\n        //         \"trades\": [\n        //             {\n        //                 \"trade_id\": 131560927,\n        //                 \"trade_price\": 13059.800000000000000000,\n        //                 \"trade_volume\": 1.000000000000000000,\n        //                 \"trade_turnover\": 13.059800000000000000,\n        //                 \"trade_fee\": -0.005223920000000000,\n        //                 \"created_at\": 1603703614715,\n        //                 \"role\": \"taker\",\n        //                 \"fee_asset\": \"USDT\",\n        //                 \"profit\": 0,\n        //                 \"real_profit\": 0,\n        //                 \"id\": \"131560927-770334322963152896-1\"\n        //             }\n        //         ],\n        //         \"total_page\": 1,\n        //         \"current_page\": 1,\n        //         \"total_size\": 1,\n        //         \"liquidation_type\": \"0\",\n        //         \"fee_asset\": \"USDT\",\n        //         \"fee\": -0.005223920000000000,\n        //         \"order_id\": 770334322963152896,\n        //         \"order_id_str\": \"770334322963152896\",\n        //         \"client_order_id\": 57012021045,\n        //         \"order_type\": \"1\",\n        //         \"status\": 6,\n        //         \"trade_avg_price\": 13059.800000000000000000,\n        //         \"trade_turnover\": 13.059800000000000000,\n        //         \"trade_volume\": 1.000000000000000000,\n        //         \"margin_asset\": \"USDT\",\n        //         \"margin_mode\": \"isolated\",\n        //         \"margin_account\": \"BTC-USDT\",\n        //         \"real_profit\": 0,\n        //         \"is_tpsl\": 0\n        //     }\n        //\n        // future and swap: fetchOrders\n        //\n        //     {\n        //         \"order_id\": 773131315209248768,\n        //         \"contract_code\": \"ADA201225\",\n        //         \"symbol\": \"ADA\",\n        //         \"lever_rate\": 20,\n        //         \"direction\": \"buy\",\n        //         \"offset\": \"close\",\n        //         \"volume\": 1,\n        //         \"price\": 0.0925,\n        //         \"create_date\": 1604370469629,\n        //         \"update_time\": 1603704221118,\n        //         \"order_source\": \"web\",\n        //         \"order_price_type\": 6,\n        //         \"order_type\": 1,\n        //         \"margin_frozen\": 0,\n        //         \"profit\": 0,\n        //         \"contract_type\": \"quarter\",\n        //         \"trade_volume\": 0,\n        //         \"trade_turnover\": 0,\n        //         \"fee\": 0,\n        //         \"trade_avg_price\": 0,\n        //         \"status\": 3,\n        //         \"order_id_str\": \"773131315209248768\",\n        //         \"fee_asset\": \"ADA\",\n        //         \"liquidation_type\": \"0\",\n        //         \"is_tpsl\": 0,\n        //         \"real_profit\": 0\n        //         \"margin_asset\": \"USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"trade_partition\": \"USDT\", // only in isolated & cross of linear\n        //         \"reduce_only\": \"1\", // only in isolated & cross of linear\n        //         \"contract_type\": \"quarter\", // only in cross-margin (inverse & linear)\n        //         \"pair\": \"BTC-USDT\", // only in cross-margin (inverse & linear)\n        //         \"business_type\": \"futures\" // only in cross-margin (inverse & linear)\n        //     }\n        //\n        // trigger: fetchOpenOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"trigger_type\": \"le\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"buy\",\n        //         \"offset\": \"open\",\n        //         \"lever_rate\": 1,\n        //         \"order_id\": 1103670703588327424,\n        //         \"order_id_str\": \"1103670703588327424\",\n        //         \"order_source\": \"web\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"order_price\": 24000.000000000000000000,\n        //         \"created_at\": 1683177200945,\n        //         \"order_price_type\": \"limit\",\n        //         \"status\": 2,\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"trade_partition\": \"USDT\",\n        //         \"reduce_only\": 0\n        //     }\n        //\n        // stop-loss and take-profit: fetchOpenOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"sell\",\n        //         \"order_id\": 1103680386844839936,\n        //         \"order_id_str\": \"1103680386844839936\",\n        //         \"order_source\": \"web\",\n        //         \"trigger_type\": \"le\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"order_price\": 0E-18,\n        //         \"created_at\": 1683179509613,\n        //         \"order_price_type\": \"market\",\n        //         \"status\": 2,\n        //         \"tpsl_order_type\": \"sl\",\n        //         \"source_order_id\": null,\n        //         \"relation_tpsl_order_id\": \"-1\",\n        //         \"trade_partition\": \"USDT\"\n        //     }\n        //\n        // trailing: fetchOpenOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"sell\",\n        //         \"offset\": \"close\",\n        //         \"lever_rate\": 1,\n        //         \"order_id\": 1192021437253877761,\n        //         \"order_id_str\": \"1192021437253877761\",\n        //         \"order_source\": \"api\",\n        //         \"created_at\": 1704241657328,\n        //         \"order_price_type\": \"formula_price\",\n        //         \"status\": 2,\n        //         \"callback_rate\": 0.050000000000000000,\n        //         \"active_price\": 50000.000000000000000000,\n        //         \"is_active\": 0,\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"trade_partition\": \"USDT\",\n        //         \"reduce_only\": 1\n        //     }\n        //\n        // trigger: fetchOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"trigger_type\": \"le\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"buy\",\n        //         \"offset\": \"open\",\n        //         \"lever_rate\": 1,\n        //         \"order_id\": 1103670703588327424,\n        //         \"order_id_str\": \"1103670703588327424\",\n        //         \"relation_order_id\": \"-1\",\n        //         \"order_price_type\": \"limit\",\n        //         \"status\": 6,\n        //         \"order_source\": \"web\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"triggered_price\": null,\n        //         \"order_price\": 24000.000000000000000000,\n        //         \"created_at\": 1683177200945,\n        //         \"triggered_at\": null,\n        //         \"order_insert_at\": 0,\n        //         \"canceled_at\": 1683179075234,\n        //         \"fail_code\": null,\n        //         \"fail_reason\": null,\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"update_time\": 1683179075958,\n        //         \"trade_partition\": \"USDT\",\n        //         \"reduce_only\": 0\n        //     }\n        //\n        // stop-loss and take-profit: fetchOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"tpsl_order_type\": \"sl\",\n        //         \"direction\": \"sell\",\n        //         \"order_id\": 1103680386844839936,\n        //         \"order_id_str\": \"1103680386844839936\",\n        //         \"order_source\": \"web\",\n        //         \"trigger_type\": \"le\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"created_at\": 1683179509613,\n        //         \"order_price_type\": \"market\",\n        //         \"status\": 11,\n        //         \"source_order_id\": null,\n        //         \"relation_tpsl_order_id\": \"-1\",\n        //         \"canceled_at\": 0,\n        //         \"fail_code\": null,\n        //         \"fail_reason\": null,\n        //         \"triggered_price\": null,\n        //         \"relation_order_id\": \"-1\",\n        //         \"update_time\": 1683179968231,\n        //         \"order_price\": 0E-18,\n        //         \"trade_partition\": \"USDT\"\n        //     }\n        //\n        // spot: createOrders\n        //\n        //     [\n        //         {\n        //             \"order-id\": 936847569789079,\n        //             \"client-order-id\": \"AA03022abc3a55e82c-0087-4fc2-beac-112fdebb1ee9\"\n        //         },\n        //         {\n        //             \"client-order-id\": \"AA03022abcdb3baefb-3cfa-4891-8009-082b3d46ca82\",\n        //             \"err-code\": \"account-frozen-balance-insufficient-error\",\n        //             \"err-msg\": \"trade account balance is not enough, left: `89`\"\n        //         }\n        //     ]\n        //\n        // swap and future: createOrders\n        //\n        //     [\n        //         {\n        //             \"index\": 2,\n        //             \"err_code\": 1047,\n        //             \"err_msg\": \"Insufficient margin available.\"\n        //         },\n        //         {\n        //             \"order_id\": 1172923090632953857,\n        //             \"index\": 1,\n        //             \"order_id_str\": \"1172923090632953857\"\n        //         }\n        //     ]\n        //\n        const rejectedCreateOrders = this.safeString2 (order, 'err_code', 'err-code');\n        let status = this.parseOrderStatus (this.safeString2 (order, 'state', 'status'));\n        if (rejectedCreateOrders !== undefined) {\n            status = 'rejected';\n        }\n        const id = this.safeStringN (order, [ 'id', 'order_id_str', 'order-id' ]);\n        let side = this.safeString (order, 'direction');\n        let type = this.safeString (order, 'order_price_type');\n        if ('type' in order) {\n            const orderType = order['type'].split ('-');\n            side = orderType[0];\n            type = orderType[1];\n        }\n        const marketId = this.safeString2 (order, 'contract_code', 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeIntegerN (order, [ 'created_at', 'created-at', 'create_date' ]);\n        const clientOrderId = this.safeString2 (order, 'client_order_id', 'client-or' + 'der-id'); // transpiler regex trick for php issue\n        let cost = undefined;\n        let amount = undefined;\n        if ((type !== undefined) && (type.indexOf ('market') >= 0)) {\n            cost = this.safeString (order, 'field-cash-amount');\n        } else {\n            amount = this.safeString2 (order, 'volume', 'amount');\n            cost = this.safeStringN (order, [ 'filled-cash-amount', 'field-cash-amount', 'trade_turnover' ]); // same typo here\n        }\n        const filled = this.safeStringN (order, [ 'filled-amount', 'field-amount', 'trade_volume' ]); // typo in their API, filled amount\n        const price = this.safeString2 (order, 'price', 'order_price');\n        let feeCost = this.safeString2 (order, 'filled-fees', 'field-fees'); // typo in their API, filled feeSide\n        feeCost = this.safeString (order, 'fee', feeCost);\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            let feeCurrency = undefined;\n            const feeCurrencyId = this.safeString (order, 'fee_asset');\n            if (feeCurrencyId !== undefined) {\n                feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n            } else {\n                feeCurrency = (side === 'sell') ? market['quote'] : market['base'];\n            }\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        const average = this.safeString (order, 'trade_avg_price');\n        const trades = this.safeValue (order, 'trades');\n        const reduceOnlyInteger = this.safeInteger (order, 'reduce_only');\n        let reduceOnly = undefined;\n        if (reduceOnlyInteger !== undefined) {\n            reduceOnly = (reduceOnlyInteger === 0) ? false : true;\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString2 (order, 'stop-price', 'trigger_price'),\n            'average': average,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'reduceOnly': reduceOnly,\n            'fee': fee,\n            'trades': trades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 4853,
        "line_end": 4873,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            // spot\n            'partial-filled': 'open',\n            'partial-canceled': 'canceled',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'submitted': 'open',\n            'created': 'open',  // For stop orders\n            // contract\n            '1': 'open',\n            '2': 'open',\n            '3': 'open',\n            '4': 'open',\n            '5': 'canceled', // partially matched\n            '6': 'closed',\n            '7': 'canceled',\n            '11': 'canceling',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 7759,
        "line_end": 7849,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contracts)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateral)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedProfit",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.parseNumber (percentage)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (intialMarginPercentage)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMargin)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceMarginPercentage)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.parseNumber (marginRatio)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"BTC\",\n        \"contract_code\": \"BTC-USDT\",\n        \"volume\": \"1.000000000000000000\",\n        \"available\": \"1.000000000000000000\",\n        \"frozen\": \"0E-18\",\n        \"cost_open\": \"47162.000000000000000000\",\n        \"cost_hold\": \"47151.300000000000000000\",\n        \"profit_unreal\": \"0.007300000000000000\",\n        \"profit_rate\": \"-0.000144183876850008\",\n        \"lever_rate\": \"2\",\n        \"position_margin\": \"23.579300000000000000\",\n        \"direction\": \"buy\",\n        \"profit\": \"-0.003400000000000000\",\n        \"last_price\": \"47158.6\",\n        \"margin_asset\": \"USDT\",\n        \"margin_mode\": \"isolated\",\n        \"margin_account\": \"BTC-USDT\",\n        \"margin_balance\": \"24.973020070000000000\",\n        \"margin_position\": \"23.579300000000000000\",\n        \"margin_frozen\": \"0\",\n        \"margin_available\": \"1.393720070000000000\",\n        \"profit_real\": \"0E-18\",\n        \"risk_rate\": \"1.044107779705080303\",\n        \"withdraw_available\": \"1.386420070000000000000000000000000000\",\n        \"liquidation_price\": \"22353.229148614609571788\",\n        \"adjust_factor\": \"0.015000000000000000\",\n        \"margin_static\": \"24.965720070000000000\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //    {\n        //        \"symbol\": \"BTC\",\n        //        \"contract_code\": \"BTC-USDT\",\n        //        \"volume\": \"1.000000000000000000\",\n        //        \"available\": \"1.000000000000000000\",\n        //        \"frozen\": \"0E-18\",\n        //        \"cost_open\": \"47162.000000000000000000\",\n        //        \"cost_hold\": \"47151.300000000000000000\",\n        //        \"profit_unreal\": \"0.007300000000000000\",\n        //        \"profit_rate\": \"-0.000144183876850008\",\n        //        \"lever_rate\": \"2\",\n        //        \"position_margin\": \"23.579300000000000000\",\n        //        \"direction\": \"buy\",\n        //        \"profit\": \"-0.003400000000000000\",\n        //        \"last_price\": \"47158.6\",\n        //        \"margin_asset\": \"USDT\",\n        //        \"margin_mode\": \"isolated\",\n        //        \"margin_account\": \"BTC-USDT\",\n        //        \"margin_balance\": \"24.973020070000000000\",\n        //        \"margin_position\": \"23.579300000000000000\",\n        //        \"margin_frozen\": \"0\",\n        //        \"margin_available\": \"1.393720070000000000\",\n        //        \"profit_real\": \"0E-18\",\n        //        \"risk_rate\": \"1.044107779705080303\",\n        //        \"withdraw_available\": \"1.386420070000000000000000000000000000\",\n        //        \"liquidation_price\": \"22353.229148614609571788\",\n        //        \"adjust_factor\": \"0.015000000000000000\",\n        //        \"margin_static\": \"24.965720070000000000\"\n        //    }\n        //\n        market = this.safeMarket (this.safeString (position, 'contract_code'));\n        const symbol = market['symbol'];\n        const contracts = this.safeString (position, 'volume');\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const entryPrice = this.safeNumber (position, 'cost_open');\n        const initialMargin = this.safeString (position, 'position_margin');\n        const rawSide = this.safeString (position, 'direction');\n        const side = (rawSide === 'buy') ? 'long' : 'short';\n        const unrealizedProfit = this.safeNumber (position, 'profit_unreal');\n        let marginMode = this.safeString (position, 'margin_mode');\n        const leverage = this.safeString (position, 'lever_rate');\n        const percentage = Precise.stringMul (this.safeString (position, 'profit_rate'), '100');\n        const lastPrice = this.safeString (position, 'last_price');\n        const faceValue = Precise.stringMul (contracts, contractSizeString);\n        let notional = undefined;\n        if (market['linear']) {\n            notional = Precise.stringMul (faceValue, lastPrice);\n        } else {\n            notional = Precise.stringDiv (faceValue, lastPrice);\n            marginMode = 'cross';\n        }\n        const intialMarginPercentage = Precise.stringDiv (initialMargin, notional);\n        const collateral = this.safeString (position, 'margin_balance');\n        const liquidationPrice = this.safeNumber (position, 'liquidation_price');\n        const adjustmentFactor = this.safeString (position, 'adjust_factor');\n        const maintenanceMarginPercentage = Precise.stringDiv (adjustmentFactor, leverage);\n        const maintenanceMargin = Precise.stringMul (maintenanceMarginPercentage, notional);\n        const marginRatio = Precise.stringDiv (maintenanceMargin, collateral);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': this.parseNumber (contracts),\n            'contractSize': contractSize,\n            'entryPrice': entryPrice,\n            'collateral': this.parseNumber (collateral),\n            'side': side,\n            'unrealizedPnl': unrealizedProfit,\n            'leverage': this.parseNumber (leverage),\n            'percentage': this.parseNumber (percentage),\n            'marginMode': marginMode,\n            'notional': this.parseNumber (notional),\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'liquidationPrice': liquidationPrice,\n            'initialMargin': this.parseNumber (initialMargin),\n            'initialMarginPercentage': this.parseNumber (intialMarginPercentage),\n            'maintenanceMargin': this.parseNumber (maintenanceMargin),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceMarginPercentage),\n            'marginRatio': this.parseNumber (marginRatio),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'hedged': undefined,\n            'lastUpdateTimestamp': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 9322,
        "line_end": 9355,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'settlement_price')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"ADA\",\n        \"contract_code\": \"ADA-USDT\",\n        \"settlement_time\": 1652313600000,\n        \"clawback_ratio\": 0E-18,\n        \"settlement_price\": 0.512303000000000000,\n        \"settlement_type\": \"settlement\",\n        \"business_type\": \"swap\",\n        \"pair\": \"ADA-USDT\",\n        \"trade_partition\": \"USDT\"\n    }",
          "{\n        \"contract_code\": \"FIL220513\",\n        \"settlement_price\": 7.016000000000000000,\n        \"settlement_type\": \"settlement\"\n    }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // linear swap, coin-m swap, fetchSettlementHistory\n        //\n        //    {\n        //        \"symbol\": \"ADA\",\n        //        \"contract_code\": \"ADA-USDT\",\n        //        \"settlement_time\": 1652313600000,\n        //        \"clawback_ratio\": 0E-18,\n        //        \"settlement_price\": 0.512303000000000000,\n        //        \"settlement_type\": \"settlement\",\n        //        \"business_type\": \"swap\",\n        //        \"pair\": \"ADA-USDT\",\n        //        \"trade_partition\": \"USDT\"\n        //    }\n        //\n        // coin-m future, fetchSettlementHistory\n        //\n        //    {\n        //        \"contract_code\": \"FIL220513\",\n        //        \"settlement_price\": 7.016000000000000000,\n        //        \"settlement_type\": \"settlement\"\n        //    }\n        //\n        const timestamp = this.safeInteger (settlement, 'settlement_time');\n        const marketId = this.safeString (settlement, 'contract_code');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'settlement_price'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 9263,
        "line_end": 9320,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "[\n        {\n            \"symbol\": \"ADA\",\n            \"contract_code\": \"ADA-USDT\",\n            \"settlement_time\": 1652313600000,\n            \"clawback_ratio\": 0E-18,\n            \"settlement_price\": 0.512303000000000000,\n            \"settlement_type\": \"settlement\",\n            \"business_type\": \"swap\",\n            \"pair\": \"ADA-USDT\",\n            \"trade_partition\": \"USDT\"\n        },\n        ...\n    ]",
          "[\n        {\n            \"symbol\": \"FIL\",\n            \"settlement_time\": 1652342400000,\n            \"clawback_ratio\": 0E-18,\n            \"list\": [\n                {\n                    \"contract_code\": \"FIL220513\",\n                    \"settlement_price\": 7.016000000000000000,\n                    \"settlement_type\": \"settlement\"\n                },\n                ...\n            ]\n        },\n    ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // linear swap, coin-m swap, fetchSettlementHistory\n        //\n        //    [\n        //        {\n        //            \"symbol\": \"ADA\",\n        //            \"contract_code\": \"ADA-USDT\",\n        //            \"settlement_time\": 1652313600000,\n        //            \"clawback_ratio\": 0E-18,\n        //            \"settlement_price\": 0.512303000000000000,\n        //            \"settlement_type\": \"settlement\",\n        //            \"business_type\": \"swap\",\n        //            \"pair\": \"ADA-USDT\",\n        //            \"trade_partition\": \"USDT\"\n        //        },\n        //        ...\n        //    ]\n        //\n        // coin-m future, fetchSettlementHistory\n        //\n        //    [\n        //        {\n        //            \"symbol\": \"FIL\",\n        //            \"settlement_time\": 1652342400000,\n        //            \"clawback_ratio\": 0E-18,\n        //            \"list\": [\n        //                {\n        //                    \"contract_code\": \"FIL220513\",\n        //                    \"settlement_price\": 7.016000000000000000,\n        //                    \"settlement_type\": \"settlement\"\n        //                },\n        //                ...\n        //            ]\n        //        },\n        //    ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            const settlement = settlements[i];\n            const list = this.safeValue (settlement, 'list');\n            if (list !== undefined) {\n                const timestamp = this.safeInteger (settlement, 'settlement_time');\n                const timestampDetails: Dict = {\n                    'timestamp': timestamp,\n                    'datetime': this.iso8601 (timestamp),\n                };\n                for (let j = 0; j < list.length; j++) {\n                    const item = list[j];\n                    const parsedSettlement = this.parseSettlement (item, market);\n                    result.push (this.extend (parsedSettlement, timestampDetails));\n                }\n            } else {\n                result.push (this.parseSettlement (settlements[i], market));\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2183,
        "line_end": 2281,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 26228.672978342216,\n         \"open\": 9078.95,\n         \"close\": 9146.86,\n         \"high\": 9155.41,\n         \"id\": 209988544334,\n         \"count\": 265846,\n         \"low\": 8988.0,\n         \"version\": 209988544334,\n         \"ask\": [ 9146.87, 0.156134 ],\n         \"vol\": 2.3822168242201668E8,\n         \"bid\": [ 9146.86, 0.080758 ],\n     }",
          "{\n         \"symbol\": \"bhdht\",\n         \"open\":  2.3938,\n         \"high\":  2.4151,\n         \"low\":  2.3323,\n         \"close\":  2.3909,\n         \"amount\":  628.992,\n         \"vol\":  1493.71841095,\n         \"count\":  2088,\n         \"bid\":  2.3643,\n         \"bidSize\":  0.7136,\n         \"ask\":  2.4061,\n         \"askSize\":  0.4156\n     }",
          "{\n         \"seqId\": 161499562790,\n         \"ask\": 16829.51,\n         \"askSize\": 0.707776,\n         \"bid\": 16829.5,\n         \"bidSize\": 1.685945,\n         \"quoteTime\": 1671941599612,\n         \"symbol\": \"btcusdt\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"amount\": 26228.672978342216,\n        //         \"open\": 9078.95,\n        //         \"close\": 9146.86,\n        //         \"high\": 9155.41,\n        //         \"id\": 209988544334,\n        //         \"count\": 265846,\n        //         \"low\": 8988.0,\n        //         \"version\": 209988544334,\n        //         \"ask\": [ 9146.87, 0.156134 ],\n        //         \"vol\": 2.3822168242201668E8,\n        //         \"bid\": [ 9146.86, 0.080758 ],\n        //     }\n        //\n        // fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"bhdht\",\n        //         \"open\":  2.3938,\n        //         \"high\":  2.4151,\n        //         \"low\":  2.3323,\n        //         \"close\":  2.3909,\n        //         \"amount\":  628.992,\n        //         \"vol\":  1493.71841095,\n        //         \"count\":  2088,\n        //         \"bid\":  2.3643,\n        //         \"bidSize\":  0.7136,\n        //         \"ask\":  2.4061,\n        //         \"askSize\":  0.4156\n        //     }\n        //\n        // watchTikcer - bbo\n        //     {\n        //         \"seqId\": 161499562790,\n        //         \"ask\": 16829.51,\n        //         \"askSize\": 0.707776,\n        //         \"bid\": 16829.5,\n        //         \"bidSize\": 1.685945,\n        //         \"quoteTime\": 1671941599612,\n        //         \"symbol\": \"btcusdt\"\n        //     }\n        //\n        const marketId = this.safeString2 (ticker, 'symbol', 'contract_code');\n        let symbol = this.safeSymbol (marketId, market);\n        symbol = this.tryGetSymbolFromFutureMarkets (symbol);\n        const timestamp = this.safeInteger2 (ticker, 'ts', 'quoteTime');\n        let bid = undefined;\n        let bidVolume = undefined;\n        let ask = undefined;\n        let askVolume = undefined;\n        if ('bid' in ticker) {\n            if (ticker['bid'] !== undefined && Array.isArray (ticker['bid'])) {\n                bid = this.safeString (ticker['bid'], 0);\n                bidVolume = this.safeString (ticker['bid'], 1);\n            } else {\n                bid = this.safeString (ticker, 'bid');\n                bidVolume = this.safeString (ticker, 'bidSize');\n            }\n        }\n        if ('ask' in ticker) {\n            if (ticker['ask'] !== undefined && Array.isArray (ticker['ask'])) {\n                ask = this.safeString (ticker['ask'], 0);\n                askVolume = this.safeString (ticker['ask'], 1);\n            } else {\n                ask = this.safeString (ticker, 'ask');\n                askVolume = this.safeString (ticker, 'askSize');\n            }\n        }\n        const open = this.safeString (ticker, 'open');\n        const close = this.safeString (ticker, 'close');\n        const baseVolume = this.safeString (ticker, 'amount');\n        const quoteVolume = this.safeString (ticker, 'vol');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': close,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2692,
        "line_end": 2837,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 0.010411000000000000,\n         \"trade-id\": 102090736910,\n         \"ts\": 1583497692182,\n         \"id\": 10500517034273194594947,\n         \"price\": 9096.050000000000000000,\n         \"direction\": \"sell\"\n     }",
          "{\n          \"symbol\": \"swftcbtc\",\n          \"fee-currency\": \"swftc\",\n          \"filled-fees\": \"0\",\n          \"source\": \"spot-api\",\n          \"id\": 83789509854000,\n          \"type\": \"buy-limit\",\n          \"order-id\": 83711103204909,\n          'filled-points': \"0.005826843283532154\",\n          \"fee-deduct-currency\": \"ht\",\n          'filled-amount': \"45941.53\",\n          \"price\": \"0.0000001401\",\n          \"created-at\": 1597933260729,\n          \"match-id\": 100087455560,\n          \"role\": \"maker\",\n          \"trade-id\": 100050305348\n     }",
          "{\n         \"trade_id\": 131560927,\n         \"trade_price\": 13059.800000000000000000,\n         \"trade_volume\": 1.000000000000000000,\n         \"trade_turnover\": 13.059800000000000000,\n         \"trade_fee\": -0.005223920000000000,\n         \"created_at\": 1603703614715,\n         \"role\": \"taker\",\n         \"fee_asset\": \"USDT\",\n         \"profit\": 0,\n         \"real_profit\": 0,\n         \"id\": \"131560927-770334322963152896-1\"\n     }",
          "{\n         \"contract_type\":\"swap\",\n         \"pair\":\"O3-USDT\",\n         \"business_type\":\"swap\",\n         \"query_id\":652123190,\n         \"match_id\":28306009409,\n         \"order_id\":941137865226903553,\n         \"symbol\":\"O3\",\n         \"contract_code\":\"O3-USDT\",\n         \"direction\":\"sell\",\n         \"offset\":\"open\",\n         \"trade_volume\":100.000000000000000000,\n         \"trade_price\":0.398500000000000000,\n         \"trade_turnover\":39.850000000000000000,\n         \"trade_fee\":-0.007970000000000000,\n         \"offset_profitloss\":0E-18,\n         \"create_date\":1644426352999,\n         \"role\":\"Maker\",\n         \"order_source\":\"api\",\n         \"order_id_str\":\"941137865226903553\",\n         \"id\":\"28306009409-941137865226903553-1\",\n         \"fee_asset\":\"USDT\",\n         \"margin_mode\":\"cross\",\n         \"margin_account\":\"USDT\",\n         \"real_profit\":0E-18,\n         \"trade_partition\":\"USDT\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // spot fetchTrades (public)\n        //\n        //     {\n        //         \"amount\": 0.010411000000000000,\n        //         \"trade-id\": 102090736910,\n        //         \"ts\": 1583497692182,\n        //         \"id\": 10500517034273194594947,\n        //         \"price\": 9096.050000000000000000,\n        //         \"direction\": \"sell\"\n        //     }\n        //\n        // spot fetchMyTrades (private)\n        //\n        //     {\n        //          \"symbol\": \"swftcbtc\",\n        //          \"fee-currency\": \"swftc\",\n        //          \"filled-fees\": \"0\",\n        //          \"source\": \"spot-api\",\n        //          \"id\": 83789509854000,\n        //          \"type\": \"buy-limit\",\n        //          \"order-id\": 83711103204909,\n        //          'filled-points': \"0.005826843283532154\",\n        //          \"fee-deduct-currency\": \"ht\",\n        //          'filled-amount': \"45941.53\",\n        //          \"price\": \"0.0000001401\",\n        //          \"created-at\": 1597933260729,\n        //          \"match-id\": 100087455560,\n        //          \"role\": \"maker\",\n        //          \"trade-id\": 100050305348\n        //     }\n        //\n        // linear swap isolated margin fetchOrder details\n        //\n        //     {\n        //         \"trade_id\": 131560927,\n        //         \"trade_price\": 13059.800000000000000000,\n        //         \"trade_volume\": 1.000000000000000000,\n        //         \"trade_turnover\": 13.059800000000000000,\n        //         \"trade_fee\": -0.005223920000000000,\n        //         \"created_at\": 1603703614715,\n        //         \"role\": \"taker\",\n        //         \"fee_asset\": \"USDT\",\n        //         \"profit\": 0,\n        //         \"real_profit\": 0,\n        //         \"id\": \"131560927-770334322963152896-1\"\n        //     }\n        //\n        // inverse swap cross margin fetchMyTrades\n        //\n        //     {\n        //         \"contract_type\":\"swap\",\n        //         \"pair\":\"O3-USDT\",\n        //         \"business_type\":\"swap\",\n        //         \"query_id\":652123190,\n        //         \"match_id\":28306009409,\n        //         \"order_id\":941137865226903553,\n        //         \"symbol\":\"O3\",\n        //         \"contract_code\":\"O3-USDT\",\n        //         \"direction\":\"sell\",\n        //         \"offset\":\"open\",\n        //         \"trade_volume\":100.000000000000000000,\n        //         \"trade_price\":0.398500000000000000,\n        //         \"trade_turnover\":39.850000000000000000,\n        //         \"trade_fee\":-0.007970000000000000,\n        //         \"offset_profitloss\":0E-18,\n        //         \"create_date\":1644426352999,\n        //         \"role\":\"Maker\",\n        //         \"order_source\":\"api\",\n        //         \"order_id_str\":\"941137865226903553\",\n        //         \"id\":\"28306009409-941137865226903553-1\",\n        //         \"fee_asset\":\"USDT\",\n        //         \"margin_mode\":\"cross\",\n        //         \"margin_account\":\"USDT\",\n        //         \"real_profit\":0E-18,\n        //         \"trade_partition\":\"USDT\"\n        //     }\n        //\n        const marketId = this.safeString2 (trade, 'contract_code', 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let timestamp = this.safeInteger2 (trade, 'ts', 'created-at');\n        timestamp = this.safeInteger2 (trade, 'created_at', 'create_date', timestamp);\n        const order = this.safeString2 (trade, 'order-id', 'order_id');\n        let side = this.safeString (trade, 'direction');\n        let type = this.safeString (trade, 'type');\n        if (type !== undefined) {\n            const typeParts = type.split ('-');\n            side = typeParts[0];\n            type = typeParts[1];\n        }\n        const takerOrMaker = this.safeStringLower (trade, 'role');\n        const priceString = this.safeString2 (trade, 'price', 'trade_price');\n        let amountString = this.safeString2 (trade, 'filled-amount', 'amount');\n        amountString = this.safeString (trade, 'trade_volume', amountString);\n        const costString = this.safeString (trade, 'trade_turnover');\n        let fee = undefined;\n        let feeCost = this.safeString (trade, 'filled-fees');\n        if (feeCost === undefined) {\n            feeCost = Precise.stringNeg (this.safeString (trade, 'trade_fee'));\n        }\n        const feeCurrencyId = this.safeString2 (trade, 'fee-currency', 'fee_asset');\n        let feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n        const filledPoints = this.safeString (trade, 'filled-points');\n        if (filledPoints !== undefined) {\n            if ((feeCost === undefined) || Precise.stringEquals (feeCost, '0')) {\n                const feeDeductCurrency = this.safeString (trade, 'fee-deduct-currency');\n                if (feeDeductCurrency !== undefined) {\n                    feeCost = filledPoints;\n                    feeCurrency = this.safeCurrencyCode (feeDeductCurrency);\n                }\n            }\n        }\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        // htx's multi-market trade-id is a bit complex to parse accordingly.\n        // - for `id` which contains hyphen, it would be the unique id, eg. xxxxxx-1, xxxxxx-2 (this happens mostly for contract markets)\n        // - otherwise the least priority is given to the `id` key\n        let id: Str = undefined;\n        const safeId = this.safeString (trade, 'id');\n        if (safeId !== undefined && safeId.indexOf ('-') >= 0) {\n            id = safeId;\n        } else {\n            id = this.safeStringN (trade, [ 'trade_id', 'trade-id', 'id' ]);\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1666,
        "line_end": 1685,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'actualMakerRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'actualTakerRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"btcusdt\",\n         \"actualMakerRate\":\"0.002\",\n         \"actualTakerRate\":\"0.002\",\n         \"takerFeeRate\":\"0.002\",\n         \"makerFeeRate\":\"0.002\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\":\"btcusdt\",\n        //         \"actualMakerRate\":\"0.002\",\n        //         \"actualTakerRate\":\"0.002\",\n        //         \"takerFeeRate\":\"0.002\",\n        //         \"makerFeeRate\":\"0.002\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (marketId, market),\n            'maker': this.safeNumber (fee, 'actualMakerRate'),\n            'taker': this.safeNumber (fee, 'actualTakerRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTradingLimits",
        "signature": "parseTradingLimits (limits, symbol: Str = undefined, params = {})",
        "line_start": 1772,
        "line_end": 1797,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "limits",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n                    'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n                },\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{                                \"symbol\": \"aidocbtc\",\n                  \"buy-limit-must-less-than\":  1.1,\n              \"sell-limit-must-greater-than\":  0.9,\n             \"limit-order-must-greater-than\":  1,\n                \"limit-order-must-less-than\":  5000000,\n        \"market-buy-order-must-greater-than\":  0.0001,\n           \"market-buy-order-must-less-than\":  100,\n       \"market-sell-order-must-greater-than\":  1,\n          \"market-sell-order-must-less-than\":  500000,\n           \"circuit-break-when-greater-than\":  10000,\n              \"circuit-break-when-less-than\":  10,\n     \"market-sell-order-rate-must-less-than\":  0.1,\n      \"market-buy-order-rate-must-less-than\":  0.1        }"
        ],
        "source": "parseTradingLimits (limits, symbol: Str = undefined, params = {}) {\n        //\n        //   {                                \"symbol\": \"aidocbtc\",\n        //                  \"buy-limit-must-less-than\":  1.1,\n        //              \"sell-limit-must-greater-than\":  0.9,\n        //             \"limit-order-must-greater-than\":  1,\n        //                \"limit-order-must-less-than\":  5000000,\n        //        \"market-buy-order-must-greater-than\":  0.0001,\n        //           \"market-buy-order-must-less-than\":  100,\n        //       \"market-sell-order-must-greater-than\":  1,\n        //          \"market-sell-order-must-less-than\":  500000,\n        //           \"circuit-break-when-greater-than\":  10000,\n        //              \"circuit-break-when-less-than\":  10,\n        //     \"market-sell-order-rate-must-less-than\":  0.1,\n        //      \"market-buy-order-rate-must-less-than\":  0.1        }\n        //\n        return {\n            'info': limits,\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n                    'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n                },\n            },\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 6640,
        "line_end": 6734,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'data')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txHash",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'address')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'address-tag')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'state'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'updated-at')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"75115912\",\n         \"type\": \"deposit\",\n         \"sub-type\": \"NORMAL\",\n         \"request-id\": \"trc20usdt-a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff-200\",\n         \"currency\": \"usdt\",\n         \"chain\": \"trc20usdt\",\n         \"tx-hash\": \"a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff\",\n         \"amount\": \"2849.000000000000000000\",\n         \"from-addr-tag\": \"\",\n         \"address-id\": \"0\",\n         \"address\": \"TRFTd1FxepQE6CnpwzUEMEbFaLm5bJK67s\",\n         \"address-tag\": \"\",\n         \"fee\": \"0\",\n         \"state\": \"safe\",\n         \"wallet-confirm\": \"2\",\n         \"created-at\": \"1621843808662\",\n         \"updated-at\": \"1621843857137\"\n     },",
          "{\n         \"id\": \"61335312\",\n         \"type\": \"withdraw\",\n         \"sub-type\": \"NORMAL\",\n         \"currency\": \"usdt\",\n         \"chain\": \"trc20usdt\",\n         \"tx-hash\": \"30a3111f2fead74fae45c6218ca3150fc33cab2aa59cfe41526b96aae79ce4ec\",\n         \"amount\": \"12.000000000000000000\",\n         \"from-addr-tag\": \"\",\n         \"address-id\": \"27321591\",\n         \"address\": \"TRf5JacJQRsF4Nm2zu11W6maDGeiEWQu9e\",\n         \"address-tag\": \"\",\n         \"fee\": \"1.000000000000000000\",\n         \"state\": \"confirmed\",\n         \"created-at\": \"1621852316553\",\n         \"updated-at\": \"1621852467041\"\n     }",
          "{\n         \"status\": \"ok\",\n         \"data\": \"99562054\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": \"75115912\",\n        //         \"type\": \"deposit\",\n        //         \"sub-type\": \"NORMAL\",\n        //         \"request-id\": \"trc20usdt-a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff-200\",\n        //         \"currency\": \"usdt\",\n        //         \"chain\": \"trc20usdt\",\n        //         \"tx-hash\": \"a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff\",\n        //         \"amount\": \"2849.000000000000000000\",\n        //         \"from-addr-tag\": \"\",\n        //         \"address-id\": \"0\",\n        //         \"address\": \"TRFTd1FxepQE6CnpwzUEMEbFaLm5bJK67s\",\n        //         \"address-tag\": \"\",\n        //         \"fee\": \"0\",\n        //         \"state\": \"safe\",\n        //         \"wallet-confirm\": \"2\",\n        //         \"created-at\": \"1621843808662\",\n        //         \"updated-at\": \"1621843857137\"\n        //     },\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"61335312\",\n        //         \"type\": \"withdraw\",\n        //         \"sub-type\": \"NORMAL\",\n        //         \"currency\": \"usdt\",\n        //         \"chain\": \"trc20usdt\",\n        //         \"tx-hash\": \"30a3111f2fead74fae45c6218ca3150fc33cab2aa59cfe41526b96aae79ce4ec\",\n        //         \"amount\": \"12.000000000000000000\",\n        //         \"from-addr-tag\": \"\",\n        //         \"address-id\": \"27321591\",\n        //         \"address\": \"TRf5JacJQRsF4Nm2zu11W6maDGeiEWQu9e\",\n        //         \"address-tag\": \"\",\n        //         \"fee\": \"1.000000000000000000\",\n        //         \"state\": \"confirmed\",\n        //         \"created-at\": \"1621852316553\",\n        //         \"updated-at\": \"1621852467041\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"status\": \"ok\",\n        //         \"data\": \"99562054\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transaction, 'created-at');\n        const code = this.safeCurrencyCode (this.safeString (transaction, 'currency'));\n        let type = this.safeString (transaction, 'type');\n        if (type === 'withdraw') {\n            type = 'withdrawal';\n        }\n        let feeCost = this.safeString (transaction, 'fee');\n        if (feeCost !== undefined) {\n            feeCost = Precise.stringAbs (feeCost);\n        }\n        const networkId = this.safeString (transaction, 'chain');\n        let txHash = this.safeString (transaction, 'tx-hash');\n        if (networkId === 'ETH' && txHash.indexOf ('0x') < 0) {\n            txHash = '0x' + txHash;\n        }\n        const subType = this.safeString (transaction, 'sub-type');\n        const internal = subType === 'FAST';\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'data'),\n            'txid': txHash,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (networkId),\n            'address': this.safeString (transaction, 'address'),\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': this.safeString (transaction, 'address-tag'),\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'state')),\n            'updated': this.safeInteger (transaction, 'updated-at'),\n            'comment': undefined,\n            'internal': internal,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 6736,
        "line_end": 6759,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // deposit statuses\n            'unknown': 'failed',\n            'confirming': 'pending',\n            'confirmed': 'ok',\n            'safe': 'ok',\n            'orphan': 'failed',\n            // withdrawal statuses\n            'submitted': 'pending',\n            'canceled': 'canceled',\n            'reexamine': 'pending',\n            'reject': 'failed',\n            'pass': 'pending',\n            'wallet-reject': 'failed',\n            // 'confirmed': 'ok', // present in deposit statuses\n            'confirm-error': 'failed',\n            'repealed': 'failed',\n            'wallet-transfer': 'pending',\n            'pre-transfer': 'pending',\n            'verifying': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 6823,
        "line_end": 6845,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"data\": 12345,\n         \"status\": \"ok\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"data\": 12345,\n        //         \"status\": \"ok\"\n        //     }\n        //\n        const id = this.safeString (transfer, 'data');\n        const code = this.safeCurrencyCode (undefined, currency);\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': code,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "huobi": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 3330,
        "line_end": 3348,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "account",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (account, 'id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 5202591,\n         \"type\": \"point\",   // spot, margin, otc, point, super-margin, investment, borrow, grid-trading, deposit-earning, otc-options\n         \"subtype\": \"\",     // The corresponding trading symbol (currency pair) the isolated margin is based on, e.g. btcusdt\n         \"state\": \"working\" // working, lock\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        //     {\n        //         \"id\": 5202591,\n        //         \"type\": \"point\",   // spot, margin, otc, point, super-margin, investment, borrow, grid-trading, deposit-earning, otc-options\n        //         \"subtype\": \"\",     // The corresponding trading symbol (currency pair) the isolated margin is based on, e.g. btcusdt\n        //         \"state\": \"working\" // working, lock\n        //     }\n        //\n        const typeId = this.safeString (account, 'type');\n        const accountsById = this.safeValue (this.options, 'accountsById', {});\n        const type = this.safeValue (accountsById, typeId, typeId);\n        return {\n            'info': account,\n            'id': this.safeString (account, 'id'),\n            'type': type,\n            'code': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 9761,
        "line_end": 9839,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeInteger (info, 'adl_risk_percent')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC\",\n         \"contract_code\": \"BTC-USDT\",\n         \"volume\": 1.000000000000000000,\n         \"available\": 1.000000000000000000,\n         \"frozen\": 0E-18,\n         \"cost_open\": 96039.700000000000000000,\n         \"cost_hold\": 96039.700000000000000000,\n         \"profit_unreal\": 0.000600000000000000,\n         \"profit_rate\": 0.000006247416432995,\n         \"lever_rate\": 1,\n         \"position_margin\": 96.040300000000000000,\n         \"direction\": \"buy\",\n         \"profit\": 0.000600000000000000,\n         \"last_price\": 96040.3,\n         \"margin_asset\": \"USDT\",\n         \"margin_mode\": \"cross\",\n         \"margin_account\": \"USDT\",\n         \"contract_type\": \"swap\",\n         \"pair\": \"BTC-USDT\",\n         \"business_type\": \"swap\",\n         \"trade_partition\":\"USDT\",\n         \"position_mode\": \"single_side\",\n         \"store_time\": \"2023-10-08 20:05:06\",\n         \"liquidation_price\": null,\n         \"market_closing_slippage\": null,\n         \"risk_rate\": 249.274066168760049797,\n         \"new_risk_rate\": 0.003995619743220614,\n         \"risk_rate_percent\": 0.003995619743220614,\n         \"withdraw_available\": null,\n         \"open_adl\": 1,\n         \"adl_risk_percent\": 3,\n         \"tp_trigger_price\": null,\n         \"sl_trigger_price\": null,\n         \"tp_order_id\": null,\n         \"sl_order_id\": null,\n         \"tp_trigger_type\": null,\n         \"sl_trigger_type\": null,\n         \"adjust_value\": null\n     }",
          "{\n         \"symbol\": \"THETA\"\n         \"contract_code\": \"THETA-USD\"\n         \"volume\": 20\n         \"available\": 20\n         \"frozen\": 0\n         \"cost_open\": 0.6048347107438017\n         \"cost_hold\": 0.65931\n         \"profit_unreal\": -10.5257562398811\n         \"profit_rate\": 1.0158596753357925\n         \"lever_rate\": 20\n         \"position_margin\": 15.693659761456372\n         \"direction\": \"buy\"\n         \"profit\": 16.795657677889032\n         \"last_price\": 0.6372\n         \"adl_risk_percent\": \"3\"\n         \"liq_px\": \"112\"\n         \"new_risk_rate\": \"\"\n         \"trade_partition\": \"\"\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionADLRank linear swap and future\n        //\n        //     {\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"available\": 1.000000000000000000,\n        //         \"frozen\": 0E-18,\n        //         \"cost_open\": 96039.700000000000000000,\n        //         \"cost_hold\": 96039.700000000000000000,\n        //         \"profit_unreal\": 0.000600000000000000,\n        //         \"profit_rate\": 0.000006247416432995,\n        //         \"lever_rate\": 1,\n        //         \"position_margin\": 96.040300000000000000,\n        //         \"direction\": \"buy\",\n        //         \"profit\": 0.000600000000000000,\n        //         \"last_price\": 96040.3,\n        //         \"margin_asset\": \"USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"contract_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"business_type\": \"swap\",\n        //         \"trade_partition\":\"USDT\",\n        //         \"position_mode\": \"single_side\",\n        //         \"store_time\": \"2023-10-08 20:05:06\",\n        //         \"liquidation_price\": null,\n        //         \"market_closing_slippage\": null,\n        //         \"risk_rate\": 249.274066168760049797,\n        //         \"new_risk_rate\": 0.003995619743220614,\n        //         \"risk_rate_percent\": 0.003995619743220614,\n        //         \"withdraw_available\": null,\n        //         \"open_adl\": 1,\n        //         \"adl_risk_percent\": 3,\n        //         \"tp_trigger_price\": null,\n        //         \"sl_trigger_price\": null,\n        //         \"tp_order_id\": null,\n        //         \"sl_order_id\": null,\n        //         \"tp_trigger_type\": null,\n        //         \"sl_trigger_type\": null,\n        //         \"adjust_value\": null\n        //     }\n        //\n        // fetchPositionADLRank inverse\n        //\n        //     {\n        //         \"symbol\": \"THETA\"\n        //         \"contract_code\": \"THETA-USD\"\n        //         \"volume\": 20\n        //         \"available\": 20\n        //         \"frozen\": 0\n        //         \"cost_open\": 0.6048347107438017\n        //         \"cost_hold\": 0.65931\n        //         \"profit_unreal\": -10.5257562398811\n        //         \"profit_rate\": 1.0158596753357925\n        //         \"lever_rate\": 20\n        //         \"position_margin\": 15.693659761456372\n        //         \"direction\": \"buy\"\n        //         \"profit\": 16.795657677889032\n        //         \"last_price\": 0.6372\n        //         \"adl_risk_percent\": \"3\"\n        //         \"liq_px\": \"112\"\n        //         \"new_risk_rate\": \"\"\n        //         \"trade_partition\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (info, 'contract_code');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeInteger (info, 'adl_risk_percent'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        } as ADL;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 7331,
        "line_end": 7389,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'currency'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest-amount')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interest-rate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'loan-amount')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"interest-rate\":\"0.000040830000000000\",\n        \"user-id\":35930539,\n        \"account-id\":48916071,\n        \"updated-at\":1649320794195,\n        \"deduct-rate\":\"1\",\n        \"day-interest-rate\":\"0.000980000000000000\",\n        \"hour-interest-rate\":\"0.000040830000000000\",\n        \"loan-balance\":\"100.790000000000000000\",\n        \"interest-balance\":\"0.004115260000000000\",\n        \"loan-amount\":\"100.790000000000000000\",\n        \"paid-coin\":\"0.000000000000000000\",\n        \"accrued-at\":1649320794148,\n        \"created-at\":1649320794148,\n        \"interest-amount\":\"0.004115260000000000\",\n        \"deduct-amount\":\"0\",\n        \"deduct-currency\":\"\",\n        \"paid-point\":\"0.000000000000000000\",\n        \"currency\":\"usdt\",\n        \"symbol\":\"ltcusdt\",\n        \"id\":20242721,\n    }",
          "{\n       \"id\":3416576,\n       \"user-id\":35930539,\n       \"account-id\":48956839,\n       \"currency\":\"usdt\",\n       \"loan-amount\":\"102\",\n       \"loan-balance\":\"102\",\n       \"interest-amount\":\"0.00416466\",\n       \"interest-balance\":\"0.00416466\",\n       \"created-at\":1649322735333,\n       \"accrued-at\":1649322735382,\n       \"state\":\"accrual\",\n       \"filled-points\":\"0\",\n       \"filled-ht\":\"0\"\n   }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        // isolated\n        //    {\n        //        \"interest-rate\":\"0.000040830000000000\",\n        //        \"user-id\":35930539,\n        //        \"account-id\":48916071,\n        //        \"updated-at\":1649320794195,\n        //        \"deduct-rate\":\"1\",\n        //        \"day-interest-rate\":\"0.000980000000000000\",\n        //        \"hour-interest-rate\":\"0.000040830000000000\",\n        //        \"loan-balance\":\"100.790000000000000000\",\n        //        \"interest-balance\":\"0.004115260000000000\",\n        //        \"loan-amount\":\"100.790000000000000000\",\n        //        \"paid-coin\":\"0.000000000000000000\",\n        //        \"accrued-at\":1649320794148,\n        //        \"created-at\":1649320794148,\n        //        \"interest-amount\":\"0.004115260000000000\",\n        //        \"deduct-amount\":\"0\",\n        //        \"deduct-currency\":\"\",\n        //        \"paid-point\":\"0.000000000000000000\",\n        //        \"currency\":\"usdt\",\n        //        \"symbol\":\"ltcusdt\",\n        //        \"id\":20242721,\n        //    }\n        //\n        // cross\n        //   {\n        //       \"id\":3416576,\n        //       \"user-id\":35930539,\n        //       \"account-id\":48956839,\n        //       \"currency\":\"usdt\",\n        //       \"loan-amount\":\"102\",\n        //       \"loan-balance\":\"102\",\n        //       \"interest-amount\":\"0.00416466\",\n        //       \"interest-balance\":\"0.00416466\",\n        //       \"created-at\":1649322735333,\n        //       \"accrued-at\":1649322735382,\n        //       \"state\":\"accrual\",\n        //       \"filled-points\":\"0\",\n        //       \"filled-ht\":\"0\"\n        //   }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const marginMode = (marketId === undefined) ? 'cross' : 'isolated';\n        market = this.safeMarket (marketId);\n        const symbol = this.safeString (market, 'symbol');\n        const timestamp = this.safeInteger (info, 'accrued-at');\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (this.safeString (info, 'currency')),\n            'interest': this.safeNumber (info, 'interest-amount'),\n            'interestRate': this.safeNumber (info, 'interest-rate'),\n            'amountBorrowed': this.safeNumber (info, 'loan-amount'),\n            'marginMode': marginMode,\n            'timestamp': timestamp,  // Interest accrued time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseCancelOrders",
        "signature": "parseCancelOrders (orders)",
        "line_start": 6188,
        "line_end": 6244,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'order-id', 'order_id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'failed'",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client-order-id')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"success\": [\n            \"5983466\"\n        ],\n        \"failed\": [\n            {\n                \"err-msg\": \"Incorrect order state\",\n                \"order-state\": 7,\n                \"order-id\": \"\",\n                \"err-code\": \"order-orderstate-error\",\n                \"client-order-id\": \"first\"\n            },\n            ...\n        ]\n    }",
          "{\n        \"errors\": [\n            {\n                \"order_id\": \"769206471845261312\",\n                \"err_code\": 1061,\n                \"err_msg\": \"This order doesnt exist.\"\n            }\n        ],\n        \"successes\": \"1258075374411399168,1258075393254871040\"\n    }"
        ],
        "source": "parseCancelOrders (orders) {\n        //\n        //    {\n        //        \"success\": [\n        //            \"5983466\"\n        //        ],\n        //        \"failed\": [\n        //            {\n        //                \"err-msg\": \"Incorrect order state\",\n        //                \"order-state\": 7,\n        //                \"order-id\": \"\",\n        //                \"err-code\": \"order-orderstate-error\",\n        //                \"client-order-id\": \"first\"\n        //            },\n        //            ...\n        //        ]\n        //    }\n        //\n        //    {\n        //        \"errors\": [\n        //            {\n        //                \"order_id\": \"769206471845261312\",\n        //                \"err_code\": 1061,\n        //                \"err_msg\": \"This order doesnt exist.\"\n        //            }\n        //        ],\n        //        \"successes\": \"1258075374411399168,1258075393254871040\"\n        //    }\n        //\n        const successes = this.safeString (orders, 'successes');\n        let success = undefined;\n        if (successes !== undefined) {\n            success = successes.split (',');\n        } else {\n            success = this.safeList (orders, 'success', []);\n        }\n        const failed = this.safeList2 (orders, 'errors', 'failed', []);\n        const result = [];\n        for (let i = 0; i < success.length; i++) {\n            const order = success[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': order,\n                'status': 'canceled',\n            }));\n        }\n        for (let i = 0; i < failed.length; i++) {\n            const order = failed[i];\n            result.push (this.safeOrder ({\n                'info': order,\n                'id': this.safeString2 (order, 'order-id', 'order_id'),\n                'status': 'failed',\n                'clientOrderId': this.safeString (order, 'client-order-id'),\n            }));\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined)",
        "line_start": 6406,
        "line_end": 6431,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "note",
            "value": "note",
            "comment": null
          },
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"usdt\",\n         \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n         \"addressTag\": \"\",\n         \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"currency\": \"usdt\",\n        //         \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n        //         \"addressTag\": \"\",\n        //         \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const tag = this.safeString (depositAddress, 'addressTag');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const note = this.safeString (depositAddress, 'note');\n        const networkId = this.safeString (depositAddress, 'chain');\n        this.checkAddress (address);\n        return {\n            'currency': code,\n            'address': address,\n            'tag': tag,\n            'network': this.networkIdToCode (networkId),\n            'note': note,\n            'info': depositAddress,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 9197,
        "line_end": 9261,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "false",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          }
        ],
        "examples": [
          "{\n              \"currency\": \"sxp\",\n              \"assetType\": \"1\",\n              \"chains\": [\n                  {\n                      \"chain\": \"sxp\",\n                      \"displayName\": \"ERC20\",\n                      \"baseChain\": \"ETH\",\n                      \"baseChainProtocol\": \"ERC20\",\n                      \"isDynamic\": true,\n                      \"numOfConfirmations\": \"12\",\n                      \"numOfFastConfirmations\": \"12\",\n                      \"depositStatus\": \"allowed\",\n                      \"minDepositAmt\": \"0.23\",\n                      \"withdrawStatus\": \"allowed\",\n                      \"minWithdrawAmt\": \"0.23\",\n                      \"withdrawPrecision\": \"8\",\n                      \"maxWithdrawAmt\": \"227000.000000000000000000\",\n                      \"withdrawQuotaPerDay\": \"227000.000000000000000000\",\n                      \"withdrawQuotaPerYear\": null,\n                      \"withdrawQuotaTotal\": null,\n                      \"withdrawFeeType\": \"fixed\",\n                      \"transactFeeWithdraw\": \"11.1653\",\n                      \"addrWithTag\": false,\n                      \"addrDepositTag\": false\n                  }\n              ],\n              \"instStatus\": \"normal\"\n          }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //            {\n        //              \"currency\": \"sxp\",\n        //              \"assetType\": \"1\",\n        //              \"chains\": [\n        //                  {\n        //                      \"chain\": \"sxp\",\n        //                      \"displayName\": \"ERC20\",\n        //                      \"baseChain\": \"ETH\",\n        //                      \"baseChainProtocol\": \"ERC20\",\n        //                      \"isDynamic\": true,\n        //                      \"numOfConfirmations\": \"12\",\n        //                      \"numOfFastConfirmations\": \"12\",\n        //                      \"depositStatus\": \"allowed\",\n        //                      \"minDepositAmt\": \"0.23\",\n        //                      \"withdrawStatus\": \"allowed\",\n        //                      \"minWithdrawAmt\": \"0.23\",\n        //                      \"withdrawPrecision\": \"8\",\n        //                      \"maxWithdrawAmt\": \"227000.000000000000000000\",\n        //                      \"withdrawQuotaPerDay\": \"227000.000000000000000000\",\n        //                      \"withdrawQuotaPerYear\": null,\n        //                      \"withdrawQuotaTotal\": null,\n        //                      \"withdrawFeeType\": \"fixed\",\n        //                      \"transactFeeWithdraw\": \"11.1653\",\n        //                      \"addrWithTag\": false,\n        //                      \"addrDepositTag\": false\n        //                  }\n        //              ],\n        //              \"instStatus\": \"normal\"\n        //          }\n        //\n        const chains = this.safeValue (fee, 'chains', []);\n        let result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < chains.length; j++) {\n            const chainEntry = chains[j];\n            const networkId = this.safeString (chainEntry, 'chain');\n            const withdrawFeeType = this.safeString (chainEntry, 'withdrawFeeType');\n            const networkCode = this.networkIdToCode (networkId);\n            let withdrawFee = undefined;\n            let withdrawResult = undefined;\n            if (withdrawFeeType === 'fixed') {\n                withdrawFee = this.safeNumber (chainEntry, 'transactFeeWithdraw');\n                withdrawResult = {\n                    'fee': withdrawFee,\n                    'percentage': false,\n                };\n            } else {\n                withdrawFee = this.safeNumber (chainEntry, 'transactFeeRateWithdraw');\n                withdrawResult = {\n                    'fee': withdrawFee,\n                    'percentage': true,\n                };\n            }\n            result['networks'][networkCode] = {\n                'withdraw': withdrawResult,\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n            result = this.assignDefaultDepositWithdrawFees (result, currency);\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 7155,
        "line_end": 7164,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 7109,
        "line_end": 7153,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"status\": \"ok\",\n      \"data\": {\n         \"estimated_rate\": \"0.000100000000000000\",\n         \"funding_rate\": \"0.000100000000000000\",\n         \"contract_code\": \"BCH-USD\",\n         \"symbol\": \"BCH\",\n         \"fee_asset\": \"BCH\",\n         \"funding_time\": \"1639094400000\",\n         \"next_funding_time\": \"1639123200000\"\n     },\n     \"ts\": 1639085854775\n }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        // {\n        //      \"status\": \"ok\",\n        //      \"data\": {\n        //         \"estimated_rate\": \"0.000100000000000000\",\n        //         \"funding_rate\": \"0.000100000000000000\",\n        //         \"contract_code\": \"BCH-USD\",\n        //         \"symbol\": \"BCH\",\n        //         \"fee_asset\": \"BCH\",\n        //         \"funding_time\": \"1639094400000\",\n        //         \"next_funding_time\": \"1639123200000\"\n        //     },\n        //     \"ts\": 1639085854775\n        // }\n        //\n        const nextFundingRate = this.safeNumber (contract, 'estimated_rate');\n        const fundingTimestamp = this.safeInteger (contract, 'funding_time');\n        const nextFundingTimestamp = this.safeInteger (contract, 'next_funding_time');\n        const fundingTimeString = this.safeString (contract, 'funding_time');\n        const nextFundingTimeString = this.safeString (contract, 'next_funding_time');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        const marketId = this.safeString (contract, 'contract_code');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'funding_rate'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': nextFundingRate,\n            'nextFundingTimestamp': nextFundingTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 7730,
        "line_end": 7757,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"id\": \"1667161118\",\n       \"symbol\": \"BTC\",\n       \"type\": \"31\",\n       \"amount\": \"-2.11306593188E-7\",\n       \"ts\": \"1641139308983\",\n       \"contract_code\": \"BTC-USD\"\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //       \"id\": \"1667161118\",\n        //       \"symbol\": \"BTC\",\n        //       \"type\": \"31\",\n        //       \"amount\": \"-2.11306593188E-7\",\n        //       \"ts\": \"1641139308983\",\n        //       \"contract_code\": \"BTC-USD\"\n        //     }\n        //\n        const marketId = this.safeString (income, 'contract_code');\n        const symbol = this.safeSymbol (marketId, market);\n        const amount = this.safeNumber (income, 'amount');\n        const timestamp = this.safeInteger (income, 'ts');\n        const id = this.safeString (income, 'id');\n        const currencyId = this.safeString2 (income, 'symbol', 'asset');\n        const code = this.safeCurrencyCode (currencyId);\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': id,\n            'amount': amount,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseIsolatedBorrowRate",
        "signature": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate",
        "line_start": 6981,
        "line_end": 7023,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.safeCurrencyCode (baseId)",
            "comment": null
          },
          {
            "key": "baseRate",
            "value": "this.safeNumber (baseData, 'actual-rate')",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.safeCurrencyCode (quoteId)",
            "comment": null
          },
          {
            "key": "quoteRate",
            "value": "this.safeNumber (quoteData, 'actual-rate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"1inchusdt\",\n         \"currencies\": [\n             {\n                 \"currency\": \"1inch\",\n                 \"interest-rate\": \"0.00098\",\n                 \"min-loan-amt\": \"90.000000000000000000\",\n                 \"max-loan-amt\": \"1000.000000000000000000\",\n                 \"loanable-amt\": \"0.0\",\n                 \"actual-rate\": \"0.00098\"\n             },\n             {\n                 \"currency\": \"usdt\",\n                 \"interest-rate\": \"0.00098\",\n                 \"min-loan-amt\": \"100.000000000000000000\",\n                 \"max-loan-amt\": \"1000.000000000000000000\",\n                 \"loanable-amt\": \"0.0\",\n                 \"actual-rate\": \"0.00098\"\n             }\n         ]\n     },"
        ],
        "source": "parseIsolatedBorrowRate (info: Dict, market: Market = undefined): IsolatedBorrowRate {\n        //\n        //     {\n        //         \"symbol\": \"1inchusdt\",\n        //         \"currencies\": [\n        //             {\n        //                 \"currency\": \"1inch\",\n        //                 \"interest-rate\": \"0.00098\",\n        //                 \"min-loan-amt\": \"90.000000000000000000\",\n        //                 \"max-loan-amt\": \"1000.000000000000000000\",\n        //                 \"loanable-amt\": \"0.0\",\n        //                 \"actual-rate\": \"0.00098\"\n        //             },\n        //             {\n        //                 \"currency\": \"usdt\",\n        //                 \"interest-rate\": \"0.00098\",\n        //                 \"min-loan-amt\": \"100.000000000000000000\",\n        //                 \"max-loan-amt\": \"1000.000000000000000000\",\n        //                 \"loanable-amt\": \"0.0\",\n        //                 \"actual-rate\": \"0.00098\"\n        //             }\n        //         ]\n        //     },\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const currencies = this.safeValue (info, 'currencies', []);\n        const baseData = this.safeValue (currencies, 0);\n        const quoteData = this.safeValue (currencies, 1);\n        const baseId = this.safeString (baseData, 'currency');\n        const quoteId = this.safeString (quoteData, 'currency');\n        return {\n            'symbol': symbol,\n            'base': this.safeCurrencyCode (baseId),\n            'baseRate': this.safeNumber (baseData, 'actual-rate'),\n            'quote': this.safeCurrencyCode (quoteId),\n            'quoteRate': this.safeNumber (quoteData, 'actual-rate'),\n            'period': 86400000,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 2581,
        "line_end": 2596,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "side",
            "value": "direction",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        // example responses are documented in fetchLastPrices\n        const marketId = this.safeString2 (entry, 'symbol', 'contract_code');\n        market = this.safeMarket (marketId, market);\n        const price = this.safeNumber (entry, 'price');\n        const direction = this.safeString (entry, 'direction'); // \"buy\" or \"sell\"\n        // group timestamp should not be assigned to the individual trades' times\n        return {\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'price': price,\n            'side': direction,\n            'info': entry,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 8275,
        "line_end": 8313,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "this.safeString (item, 'direction')",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "id",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "account",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (transferType)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'transactAmt')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"accountId\": 10000001,\n         \"currency\": \"usdt\",\n         \"transactAmt\": 10.000000000000000000,\n         \"transactType\": \"transfer\",\n         \"transferType\": \"margin-transfer-out\",\n         \"transactId\": 0,\n         \"transactTime\": 1629882331066,\n         \"transferer\": 28483123,\n         \"transferee\": 13496526\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"accountId\": 10000001,\n        //         \"currency\": \"usdt\",\n        //         \"transactAmt\": 10.000000000000000000,\n        //         \"transactType\": \"transfer\",\n        //         \"transferType\": \"margin-transfer-out\",\n        //         \"transactId\": 0,\n        //         \"transactTime\": 1629882331066,\n        //         \"transferer\": 28483123,\n        //         \"transferee\": 13496526\n        //     }\n        //\n        const currencyId = this.safeString (item, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const id = this.safeString (item, 'transactId');\n        const transferType = this.safeString (item, 'transferType');\n        const timestamp = this.safeInteger (item, 'transactTime');\n        const account = this.safeString (item, 'accountId');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': this.safeString (item, 'direction'),\n            'account': account,\n            'referenceId': id,\n            'referenceAccount': account,\n            'type': this.parseLedgerEntryType (transferType),\n            'currency': code,\n            'amount': this.safeNumber (item, 'transactAmt'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 8255,
        "line_end": 8273,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'trade': 'trade',\n            'etf': 'trade',\n            'transact-fee': 'fee',\n            'fee-deduction': 'fee',\n            'transfer': 'transfer',\n            'credit': 'credit',\n            'liquidation': 'trade',\n            'interest': 'credit',\n            'deposit': 'deposit',\n            'withdraw': 'withdrawal',\n            'withdraw-fee': 'fee',\n            'exchange': 'exchange',\n            'other-types': 'transfer',\n            'rebate': 'rebate',\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 9424,
        "line_end": 9455,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (liquidation, 'volume')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (liquidation, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (liquidation, 'direction')",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "this.safeNumber (liquidation, 'amount')",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "this.safeNumber (liquidation, 'trade_turnover')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"query_id\": 452057,\n         \"contract_code\": \"BTC-USDT-211210\",\n         \"symbol\": \"USDT\",\n         \"direction\": \"sell\",\n         \"offset\": \"close\",\n         \"volume\": 479.000000000000000000,\n         \"price\": 51441.700000000000000000,\n         \"created_at\": 1638593647864,\n         \"amount\": 0.479000000000000000,\n         \"trade_turnover\": 24640.574300000000000000,\n         \"business_type\": \"futures\",\n         \"pair\": \"BTC-USDT\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"query_id\": 452057,\n        //         \"contract_code\": \"BTC-USDT-211210\",\n        //         \"symbol\": \"USDT\",\n        //         \"direction\": \"sell\",\n        //         \"offset\": \"close\",\n        //         \"volume\": 479.000000000000000000,\n        //         \"price\": 51441.700000000000000000,\n        //         \"created_at\": 1638593647864,\n        //         \"amount\": 0.479000000000000000,\n        //         \"trade_turnover\": 24640.574300000000000000,\n        //         \"business_type\": \"futures\",\n        //         \"pair\": \"BTC-USDT\"\n        //     }\n        //\n        const marketId = this.safeString (liquidation, 'contract_code');\n        const timestamp = this.safeInteger (liquidation, 'created_at');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': this.safeSymbol (marketId, market),\n            'contracts': this.safeNumber (liquidation, 'volume'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'price': this.safeNumber (liquidation, 'price'),\n            'side': this.safeStringLower (liquidation, 'direction'),\n            'baseValue': this.safeNumber (liquidation, 'amount'),\n            'quoteValue': this.safeNumber (liquidation, 'trade_turnover'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseMarginBalanceHelper",
        "signature": "parseMarginBalanceHelper (balance, code, result)",
        "line_start": 4131,
        "line_end": 4145,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarginBalanceHelper (balance, code, result) {\n        let account = undefined;\n        if (code in result) {\n            account = result[code];\n        } else {\n            account = this.account ();\n        }\n        if (balance['type'] === 'trade') {\n            account['free'] = this.safeString (balance, 'balance');\n        }\n        if (balance['type'] === 'frozen') {\n            account['used'] = this.safeString (balance, 'balance');\n        }\n        return account;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 9005,
        "line_end": 9037,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (info, 'repayId', 'data')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"status\": \"ok\",\n         \"data\": null\n     }",
          "{\n         \"data\": 1000\n     }",
          "{\n         \"repayId\":1174424,\n         \"repayTime\":1600747722018\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        // borrowMargin cross\n        //\n        //     {\n        //         \"status\": \"ok\",\n        //         \"data\": null\n        //     }\n        //\n        // borrowMargin isolated\n        //\n        //     {\n        //         \"data\": 1000\n        //     }\n        //\n        // repayMargin\n        //\n        //     {\n        //         \"repayId\":1174424,\n        //         \"repayTime\":1600747722018\n        //     }\n        //\n        const timestamp = this.safeInteger (info, 'repayTime');\n        return {\n            'id': this.safeString2 (info, 'repayId', 'data'),\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 8439,
        "line_end": 8464,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (bracket, 'ladder')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (bracket, 'min_size')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (bracket, 'max_size')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.parseNumber (Precise.stringDiv (adjustFactor, leverage))",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "info",
            "value": "bracket",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        const currencyId = this.safeString (info, 'trade_partition');\n        const marketId = this.safeString (info, 'contract_code');\n        const tiers = [];\n        const brackets = this.safeList (info, 'list', []);\n        for (let i = 0; i < brackets.length; i++) {\n            const item = brackets[i];\n            const leverage = this.safeString (item, 'lever_rate');\n            const ladders = this.safeList (item, 'ladders', []);\n            for (let k = 0; k < ladders.length; k++) {\n                const bracket = ladders[k];\n                const adjustFactor = this.safeString (bracket, 'adjust_factor');\n                tiers.push ({\n                    'tier': this.safeInteger (bracket, 'ladder'),\n                    'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n                    'currency': this.safeCurrencyCode (currencyId),\n                    'minNotional': this.safeNumber (bracket, 'min_size'),\n                    'maxNotional': this.safeNumber (bracket, 'max_size'),\n                    'maintenanceMarginRate': this.parseNumber (Precise.stringDiv (adjustFactor, leverage)),\n                    'maxLeverage': this.parseNumber (leverage),\n                    'info': bracket,\n                });\n            }\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 3136,
        "line_end": 3157,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"amount\":1.2082,\n         \"open\":0.025096,\n         \"close\":0.025095,\n         \"high\":0.025096,\n         \"id\":1591515300,\n         \"count\":6,\n         \"low\":0.025095,\n         \"vol\":0.0303205097\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"amount\":1.2082,\n        //         \"open\":0.025096,\n        //         \"close\":0.025095,\n        //         \"high\":0.025096,\n        //         \"id\":1591515300,\n        //         \"count\":6,\n        //         \"low\":0.025095,\n        //         \"vol\":0.0303205097\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'id'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'amount'),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 8787,
        "line_end": 8854,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "amount",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "value",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"volume\": \"4385.4350000000000000\",\n        \"amount_type\": \"2\",\n        \"ts\": \"1648220400000\",\n        \"value\": \"194059884.1850000000000000\"\n    }",
          "{\n         \"volume\": 7192610.000000000000000000,\n         \"amount\": 7192.610000000000000000,\n         \"symbol\": \"BTC\",\n         \"value\": 134654290.332000000000000000,\n         \"contract_code\": \"BTC-USDT\",\n         \"trade_amount\": 70692.804,\n         \"trade_volume\": 70692804,\n         \"trade_turnover\": 1379302592.9518,\n         \"business_type\": \"swap\",\n         \"pair\": \"BTC-USDT\",\n         \"contract_type\": \"swap\",\n         \"trade_partition\": \"USDT\"\n     }",
          "{\n         \"volume\": 518018.000000000000000000,\n         \"amount\": 2769.675777407074725180,\n         \"symbol\": \"BTC\",\n         \"contract_code\": \"BTC-USD\",\n         \"trade_amount\": 9544.4032080046491323463688602729806842458,\n         \"trade_volume\": 1848448,\n         \"trade_turnover\": 184844800.000000000000000000\n     }",
          "{\n         \"volume\": 118850.000000000000000000,\n         \"amount\": 635.502025211544374189,\n         \"symbol\": \"BTC\",\n         \"contract_type\": \"this_week\",\n         \"contract_code\": \"BTC220930\",\n         \"trade_amount\": 1470.9400749347598691119206024033947897351,\n         \"trade_volume\": 286286,\n         \"trade_turnover\": 28628600.000000000000000000\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterestHistory\n        //\n        //    {\n        //        \"volume\": \"4385.4350000000000000\",\n        //        \"amount_type\": \"2\",\n        //        \"ts\": \"1648220400000\",\n        //        \"value\": \"194059884.1850000000000000\"\n        //    }\n        //\n        // fetchOpenInterest: USDT-M\n        //\n        //     {\n        //         \"volume\": 7192610.000000000000000000,\n        //         \"amount\": 7192.610000000000000000,\n        //         \"symbol\": \"BTC\",\n        //         \"value\": 134654290.332000000000000000,\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"trade_amount\": 70692.804,\n        //         \"trade_volume\": 70692804,\n        //         \"trade_turnover\": 1379302592.9518,\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"contract_type\": \"swap\",\n        //         \"trade_partition\": \"USDT\"\n        //     }\n        //\n        // fetchOpenInterest: COIN-M Swap\n        //\n        //     {\n        //         \"volume\": 518018.000000000000000000,\n        //         \"amount\": 2769.675777407074725180,\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USD\",\n        //         \"trade_amount\": 9544.4032080046491323463688602729806842458,\n        //         \"trade_volume\": 1848448,\n        //         \"trade_turnover\": 184844800.000000000000000000\n        //     }\n        //\n        // fetchOpenInterest: COIN-M Futures\n        //\n        //     {\n        //         \"volume\": 118850.000000000000000000,\n        //         \"amount\": 635.502025211544374189,\n        //         \"symbol\": \"BTC\",\n        //         \"contract_type\": \"this_week\",\n        //         \"contract_code\": \"BTC220930\",\n        //         \"trade_amount\": 1470.9400749347598691119206024033947897351,\n        //         \"trade_volume\": 286286,\n        //         \"trade_turnover\": 28628600.000000000000000000\n        //     }\n        //\n        const timestamp = this.safeInteger (interest, 'ts');\n        const amount = this.safeNumber (interest, 'volume');\n        const value = this.safeNumber (interest, 'value');\n        const marketId = this.safeString (interest, 'contract_code');\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId, market),\n            'baseVolume': amount,  // deprecated\n            'quoteVolume': value,  // deprecated\n            'openInterestAmount': amount,\n            'openInterestValue': value,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 4875,
        "line_end": 5308,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString2 (order, 'stop-price', 'trigger_price')",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":  13997833014,\n         \"symbol\": \"ethbtc\",\n         \"account-id\":  3398321,\n         \"amount\": \"0.045000000000000000\",\n         \"price\": \"0.034014000000000000\",\n         \"created-at\":  1545836976871,\n         \"type\": \"sell-limit\",\n         \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n         \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n         \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n         \"finished-at\":  1545837948214,\n         \"source\": \"spot-api\",\n         \"state\": \"filled\",\n         \"canceled-at\":  0\n     }",
          "{\n         \"id\":  20395337822,\n         \"symbol\": \"ethbtc\",\n         \"account-id\":  5685075,\n         \"amount\": \"0.001000000000000000\",\n         \"price\": \"0.0\",\n         \"created-at\":  1545831584023,\n         \"type\": \"buy-market\",\n         \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n         \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n         \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n         \"finished-at\":  1545831584181,\n         \"source\": \"spot-api\",\n         \"state\": \"filled\",\n         \"canceled-at\":  0\n     }",
          "{\n         \"order_id\":924660854912552960,\n         \"order_id_str\":\"924660854912552960\"\n     }",
          "{\n         \"business_type\":\"swap\",\n         \"contract_type\":\"swap\",\n         \"pair\":\"BTC-USDT\",\n         \"symbol\":\"BTC\",\n         \"contract_code\":\"BTC-USDT\",\n         \"volume\":1,\n         \"price\":3000,\n         \"order_price_type\":\"limit\",\n         \"order_type\":1,\n         \"direction\":\"buy\",\n         \"offset\":\"open\",\n         \"lever_rate\":1,\n         \"order_id\":924912513206878210,\n         \"client_order_id\":null,\n         \"created_at\":1640557927189,\n         \"trade_volume\":0,\n         \"trade_turnover\":0,\n         \"fee\":0,\n         \"trade_avg_price\":null,\n         \"margin_frozen\":3.000000000000000000,\n         \"profit\":0,\n         \"status\":3,\n         \"order_source\":\"api\",\n         \"order_id_str\":\"924912513206878210\",\n         \"fee_asset\":\"USDT\",\n         \"liquidation_type\":\"0\",\n         \"canceled_at\":0,\n         \"margin_asset\":\"USDT\",\n         \"margin_account\":\"USDT\",\n         \"margin_mode\":\"cross\",\n         \"is_tpsl\":0,\n         \"real_profit\":0\n     }",
          "{\n         \"symbol\": \"BTC\",\n         \"contract_code\": \"BTC-USDT\",\n         \"instrument_price\": 0,\n         \"final_interest\": 0,\n         \"adjust_value\": 0,\n         \"lever_rate\": 10,\n         \"direction\": \"sell\",\n         \"offset\": \"open\",\n         \"volume\": 1.000000000000000000,\n         \"price\": 13059.800000000000000000,\n         \"created_at\": 1603703614712,\n         \"canceled_at\": 0,\n         \"order_source\": \"api\",\n         \"order_price_type\": \"opponent\",\n         \"margin_frozen\": 0,\n         \"profit\": 0,\n         \"trades\": [\n             {\n                 \"trade_id\": 131560927,\n                 \"trade_price\": 13059.800000000000000000,\n                 \"trade_volume\": 1.000000000000000000,\n                 \"trade_turnover\": 13.059800000000000000,\n                 \"trade_fee\": -0.005223920000000000,\n                 \"created_at\": 1603703614715,\n                 \"role\": \"taker\",\n                 \"fee_asset\": \"USDT\",\n                 \"profit\": 0,\n                 \"real_profit\": 0,\n                 \"id\": \"131560927-770334322963152896-1\"\n             }\n         ],\n         \"total_page\": 1,\n         \"current_page\": 1,\n         \"total_size\": 1,\n         \"liquidation_type\": \"0\",\n         \"fee_asset\": \"USDT\",\n         \"fee\": -0.005223920000000000,\n         \"order_id\": 770334322963152896,\n         \"order_id_str\": \"770334322963152896\",\n         \"client_order_id\": 57012021045,\n         \"order_type\": \"1\",\n         \"status\": 6,\n         \"trade_avg_price\": 13059.800000000000000000,\n         \"trade_turnover\": 13.059800000000000000,\n         \"trade_volume\": 1.000000000000000000,\n         \"margin_asset\": \"USDT\",\n         \"margin_mode\": \"isolated\",\n         \"margin_account\": \"BTC-USDT\",\n         \"real_profit\": 0,\n         \"is_tpsl\": 0\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"id\":  13997833014,\n        //         \"symbol\": \"ethbtc\",\n        //         \"account-id\":  3398321,\n        //         \"amount\": \"0.045000000000000000\",\n        //         \"price\": \"0.034014000000000000\",\n        //         \"created-at\":  1545836976871,\n        //         \"type\": \"sell-limit\",\n        //         \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n        //         \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n        //         \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n        //         \"finished-at\":  1545837948214,\n        //         \"source\": \"spot-api\",\n        //         \"state\": \"filled\",\n        //         \"canceled-at\":  0\n        //     }\n        //\n        //     {\n        //         \"id\":  20395337822,\n        //         \"symbol\": \"ethbtc\",\n        //         \"account-id\":  5685075,\n        //         \"amount\": \"0.001000000000000000\",\n        //         \"price\": \"0.0\",\n        //         \"created-at\":  1545831584023,\n        //         \"type\": \"buy-market\",\n        //         \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n        //         \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n        //         \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n        //         \"finished-at\":  1545831584181,\n        //         \"source\": \"spot-api\",\n        //         \"state\": \"filled\",\n        //         \"canceled-at\":  0\n        //     }\n        //\n        // linear swap cross margin createOrder\n        //\n        //     {\n        //         \"order_id\":924660854912552960,\n        //         \"order_id_str\":\"924660854912552960\"\n        //     }\n        //\n        // contracts fetchOrder\n        //\n        //     {\n        //         \"business_type\":\"swap\",\n        //         \"contract_type\":\"swap\",\n        //         \"pair\":\"BTC-USDT\",\n        //         \"symbol\":\"BTC\",\n        //         \"contract_code\":\"BTC-USDT\",\n        //         \"volume\":1,\n        //         \"price\":3000,\n        //         \"order_price_type\":\"limit\",\n        //         \"order_type\":1,\n        //         \"direction\":\"buy\",\n        //         \"offset\":\"open\",\n        //         \"lever_rate\":1,\n        //         \"order_id\":924912513206878210,\n        //         \"client_order_id\":null,\n        //         \"created_at\":1640557927189,\n        //         \"trade_volume\":0,\n        //         \"trade_turnover\":0,\n        //         \"fee\":0,\n        //         \"trade_avg_price\":null,\n        //         \"margin_frozen\":3.000000000000000000,\n        //         \"profit\":0,\n        //         \"status\":3,\n        //         \"order_source\":\"api\",\n        //         \"order_id_str\":\"924912513206878210\",\n        //         \"fee_asset\":\"USDT\",\n        //         \"liquidation_type\":\"0\",\n        //         \"canceled_at\":0,\n        //         \"margin_asset\":\"USDT\",\n        //         \"margin_account\":\"USDT\",\n        //         \"margin_mode\":\"cross\",\n        //         \"is_tpsl\":0,\n        //         \"real_profit\":0\n        //     }\n        //\n        // contracts fetchOrder detailed\n        //\n        //     {\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"instrument_price\": 0,\n        //         \"final_interest\": 0,\n        //         \"adjust_value\": 0,\n        //         \"lever_rate\": 10,\n        //         \"direction\": \"sell\",\n        //         \"offset\": \"open\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"price\": 13059.800000000000000000,\n        //         \"created_at\": 1603703614712,\n        //         \"canceled_at\": 0,\n        //         \"order_source\": \"api\",\n        //         \"order_price_type\": \"opponent\",\n        //         \"margin_frozen\": 0,\n        //         \"profit\": 0,\n        //         \"trades\": [\n        //             {\n        //                 \"trade_id\": 131560927,\n        //                 \"trade_price\": 13059.800000000000000000,\n        //                 \"trade_volume\": 1.000000000000000000,\n        //                 \"trade_turnover\": 13.059800000000000000,\n        //                 \"trade_fee\": -0.005223920000000000,\n        //                 \"created_at\": 1603703614715,\n        //                 \"role\": \"taker\",\n        //                 \"fee_asset\": \"USDT\",\n        //                 \"profit\": 0,\n        //                 \"real_profit\": 0,\n        //                 \"id\": \"131560927-770334322963152896-1\"\n        //             }\n        //         ],\n        //         \"total_page\": 1,\n        //         \"current_page\": 1,\n        //         \"total_size\": 1,\n        //         \"liquidation_type\": \"0\",\n        //         \"fee_asset\": \"USDT\",\n        //         \"fee\": -0.005223920000000000,\n        //         \"order_id\": 770334322963152896,\n        //         \"order_id_str\": \"770334322963152896\",\n        //         \"client_order_id\": 57012021045,\n        //         \"order_type\": \"1\",\n        //         \"status\": 6,\n        //         \"trade_avg_price\": 13059.800000000000000000,\n        //         \"trade_turnover\": 13.059800000000000000,\n        //         \"trade_volume\": 1.000000000000000000,\n        //         \"margin_asset\": \"USDT\",\n        //         \"margin_mode\": \"isolated\",\n        //         \"margin_account\": \"BTC-USDT\",\n        //         \"real_profit\": 0,\n        //         \"is_tpsl\": 0\n        //     }\n        //\n        // future and swap: fetchOrders\n        //\n        //     {\n        //         \"order_id\": 773131315209248768,\n        //         \"contract_code\": \"ADA201225\",\n        //         \"symbol\": \"ADA\",\n        //         \"lever_rate\": 20,\n        //         \"direction\": \"buy\",\n        //         \"offset\": \"close\",\n        //         \"volume\": 1,\n        //         \"price\": 0.0925,\n        //         \"create_date\": 1604370469629,\n        //         \"update_time\": 1603704221118,\n        //         \"order_source\": \"web\",\n        //         \"order_price_type\": 6,\n        //         \"order_type\": 1,\n        //         \"margin_frozen\": 0,\n        //         \"profit\": 0,\n        //         \"contract_type\": \"quarter\",\n        //         \"trade_volume\": 0,\n        //         \"trade_turnover\": 0,\n        //         \"fee\": 0,\n        //         \"trade_avg_price\": 0,\n        //         \"status\": 3,\n        //         \"order_id_str\": \"773131315209248768\",\n        //         \"fee_asset\": \"ADA\",\n        //         \"liquidation_type\": \"0\",\n        //         \"is_tpsl\": 0,\n        //         \"real_profit\": 0\n        //         \"margin_asset\": \"USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"trade_partition\": \"USDT\", // only in isolated & cross of linear\n        //         \"reduce_only\": \"1\", // only in isolated & cross of linear\n        //         \"contract_type\": \"quarter\", // only in cross-margin (inverse & linear)\n        //         \"pair\": \"BTC-USDT\", // only in cross-margin (inverse & linear)\n        //         \"business_type\": \"futures\" // only in cross-margin (inverse & linear)\n        //     }\n        //\n        // trigger: fetchOpenOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"trigger_type\": \"le\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"buy\",\n        //         \"offset\": \"open\",\n        //         \"lever_rate\": 1,\n        //         \"order_id\": 1103670703588327424,\n        //         \"order_id_str\": \"1103670703588327424\",\n        //         \"order_source\": \"web\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"order_price\": 24000.000000000000000000,\n        //         \"created_at\": 1683177200945,\n        //         \"order_price_type\": \"limit\",\n        //         \"status\": 2,\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"trade_partition\": \"USDT\",\n        //         \"reduce_only\": 0\n        //     }\n        //\n        // stop-loss and take-profit: fetchOpenOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"sell\",\n        //         \"order_id\": 1103680386844839936,\n        //         \"order_id_str\": \"1103680386844839936\",\n        //         \"order_source\": \"web\",\n        //         \"trigger_type\": \"le\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"order_price\": 0E-18,\n        //         \"created_at\": 1683179509613,\n        //         \"order_price_type\": \"market\",\n        //         \"status\": 2,\n        //         \"tpsl_order_type\": \"sl\",\n        //         \"source_order_id\": null,\n        //         \"relation_tpsl_order_id\": \"-1\",\n        //         \"trade_partition\": \"USDT\"\n        //     }\n        //\n        // trailing: fetchOpenOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"sell\",\n        //         \"offset\": \"close\",\n        //         \"lever_rate\": 1,\n        //         \"order_id\": 1192021437253877761,\n        //         \"order_id_str\": \"1192021437253877761\",\n        //         \"order_source\": \"api\",\n        //         \"created_at\": 1704241657328,\n        //         \"order_price_type\": \"formula_price\",\n        //         \"status\": 2,\n        //         \"callback_rate\": 0.050000000000000000,\n        //         \"active_price\": 50000.000000000000000000,\n        //         \"is_active\": 0,\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"trade_partition\": \"USDT\",\n        //         \"reduce_only\": 1\n        //     }\n        //\n        // trigger: fetchOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"trigger_type\": \"le\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"direction\": \"buy\",\n        //         \"offset\": \"open\",\n        //         \"lever_rate\": 1,\n        //         \"order_id\": 1103670703588327424,\n        //         \"order_id_str\": \"1103670703588327424\",\n        //         \"relation_order_id\": \"-1\",\n        //         \"order_price_type\": \"limit\",\n        //         \"status\": 6,\n        //         \"order_source\": \"web\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"triggered_price\": null,\n        //         \"order_price\": 24000.000000000000000000,\n        //         \"created_at\": 1683177200945,\n        //         \"triggered_at\": null,\n        //         \"order_insert_at\": 0,\n        //         \"canceled_at\": 1683179075234,\n        //         \"fail_code\": null,\n        //         \"fail_reason\": null,\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"update_time\": 1683179075958,\n        //         \"trade_partition\": \"USDT\",\n        //         \"reduce_only\": 0\n        //     }\n        //\n        // stop-loss and take-profit: fetchOrders\n        //\n        //     {\n        //         \"contract_type\": \"swap\",\n        //         \"business_type\": \"swap\",\n        //         \"pair\": \"BTC-USDT\",\n        //         \"symbol\": \"BTC\",\n        //         \"contract_code\": \"BTC-USDT\",\n        //         \"margin_mode\": \"cross\",\n        //         \"margin_account\": \"USDT\",\n        //         \"volume\": 1.000000000000000000,\n        //         \"order_type\": 1,\n        //         \"tpsl_order_type\": \"sl\",\n        //         \"direction\": \"sell\",\n        //         \"order_id\": 1103680386844839936,\n        //         \"order_id_str\": \"1103680386844839936\",\n        //         \"order_source\": \"web\",\n        //         \"trigger_type\": \"le\",\n        //         \"trigger_price\": 25000.000000000000000000,\n        //         \"created_at\": 1683179509613,\n        //         \"order_price_type\": \"market\",\n        //         \"status\": 11,\n        //         \"source_order_id\": null,\n        //         \"relation_tpsl_order_id\": \"-1\",\n        //         \"canceled_at\": 0,\n        //         \"fail_code\": null,\n        //         \"fail_reason\": null,\n        //         \"triggered_price\": null,\n        //         \"relation_order_id\": \"-1\",\n        //         \"update_time\": 1683179968231,\n        //         \"order_price\": 0E-18,\n        //         \"trade_partition\": \"USDT\"\n        //     }\n        //\n        // spot: createOrders\n        //\n        //     [\n        //         {\n        //             \"order-id\": 936847569789079,\n        //             \"client-order-id\": \"AA03022abc3a55e82c-0087-4fc2-beac-112fdebb1ee9\"\n        //         },\n        //         {\n        //             \"client-order-id\": \"AA03022abcdb3baefb-3cfa-4891-8009-082b3d46ca82\",\n        //             \"err-code\": \"account-frozen-balance-insufficient-error\",\n        //             \"err-msg\": \"trade account balance is not enough, left: `89`\"\n        //         }\n        //     ]\n        //\n        // swap and future: createOrders\n        //\n        //     [\n        //         {\n        //             \"index\": 2,\n        //             \"err_code\": 1047,\n        //             \"err_msg\": \"Insufficient margin available.\"\n        //         },\n        //         {\n        //             \"order_id\": 1172923090632953857,\n        //             \"index\": 1,\n        //             \"order_id_str\": \"1172923090632953857\"\n        //         }\n        //     ]\n        //\n        const rejectedCreateOrders = this.safeString2 (order, 'err_code', 'err-code');\n        let status = this.parseOrderStatus (this.safeString2 (order, 'state', 'status'));\n        if (rejectedCreateOrders !== undefined) {\n            status = 'rejected';\n        }\n        const id = this.safeStringN (order, [ 'id', 'order_id_str', 'order-id' ]);\n        let side = this.safeString (order, 'direction');\n        let type = this.safeString (order, 'order_price_type');\n        if ('type' in order) {\n            const orderType = order['type'].split ('-');\n            side = orderType[0];\n            type = orderType[1];\n        }\n        const marketId = this.safeString2 (order, 'contract_code', 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeIntegerN (order, [ 'created_at', 'created-at', 'create_date' ]);\n        const clientOrderId = this.safeString2 (order, 'client_order_id', 'client-or' + 'der-id'); // transpiler regex trick for php issue\n        let cost = undefined;\n        let amount = undefined;\n        if ((type !== undefined) && (type.indexOf ('market') >= 0)) {\n            cost = this.safeString (order, 'field-cash-amount');\n        } else {\n            amount = this.safeString2 (order, 'volume', 'amount');\n            cost = this.safeStringN (order, [ 'filled-cash-amount', 'field-cash-amount', 'trade_turnover' ]); // same typo here\n        }\n        const filled = this.safeStringN (order, [ 'filled-amount', 'field-amount', 'trade_volume' ]); // typo in their API, filled amount\n        const price = this.safeString2 (order, 'price', 'order_price');\n        let feeCost = this.safeString2 (order, 'filled-fees', 'field-fees'); // typo in their API, filled feeSide\n        feeCost = this.safeString (order, 'fee', feeCost);\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            let feeCurrency = undefined;\n            const feeCurrencyId = this.safeString (order, 'fee_asset');\n            if (feeCurrencyId !== undefined) {\n                feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n            } else {\n                feeCurrency = (side === 'sell') ? market['quote'] : market['base'];\n            }\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        const average = this.safeString (order, 'trade_avg_price');\n        const trades = this.safeValue (order, 'trades');\n        const reduceOnlyInteger = this.safeInteger (order, 'reduce_only');\n        let reduceOnly = undefined;\n        if (reduceOnlyInteger !== undefined) {\n            reduceOnly = (reduceOnlyInteger === 0) ? false : true;\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString2 (order, 'stop-price', 'trigger_price'),\n            'average': average,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'reduceOnly': reduceOnly,\n            'fee': fee,\n            'trades': trades,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 4853,
        "line_end": 4873,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            // spot\n            'partial-filled': 'open',\n            'partial-canceled': 'canceled',\n            'filled': 'closed',\n            'canceled': 'canceled',\n            'submitted': 'open',\n            'created': 'open',  // For stop orders\n            // contract\n            '1': 'open',\n            '2': 'open',\n            '3': 'open',\n            '4': 'open',\n            '5': 'canceled', // partially matched\n            '6': 'closed',\n            '7': 'canceled',\n            '11': 'canceling',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 7759,
        "line_end": 7849,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contracts)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateral)",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "unrealizedProfit",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.parseNumber (percentage)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (intialMarginPercentage)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMargin)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceMarginPercentage)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.parseNumber (marginRatio)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"BTC\",\n        \"contract_code\": \"BTC-USDT\",\n        \"volume\": \"1.000000000000000000\",\n        \"available\": \"1.000000000000000000\",\n        \"frozen\": \"0E-18\",\n        \"cost_open\": \"47162.000000000000000000\",\n        \"cost_hold\": \"47151.300000000000000000\",\n        \"profit_unreal\": \"0.007300000000000000\",\n        \"profit_rate\": \"-0.000144183876850008\",\n        \"lever_rate\": \"2\",\n        \"position_margin\": \"23.579300000000000000\",\n        \"direction\": \"buy\",\n        \"profit\": \"-0.003400000000000000\",\n        \"last_price\": \"47158.6\",\n        \"margin_asset\": \"USDT\",\n        \"margin_mode\": \"isolated\",\n        \"margin_account\": \"BTC-USDT\",\n        \"margin_balance\": \"24.973020070000000000\",\n        \"margin_position\": \"23.579300000000000000\",\n        \"margin_frozen\": \"0\",\n        \"margin_available\": \"1.393720070000000000\",\n        \"profit_real\": \"0E-18\",\n        \"risk_rate\": \"1.044107779705080303\",\n        \"withdraw_available\": \"1.386420070000000000000000000000000000\",\n        \"liquidation_price\": \"22353.229148614609571788\",\n        \"adjust_factor\": \"0.015000000000000000\",\n        \"margin_static\": \"24.965720070000000000\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //    {\n        //        \"symbol\": \"BTC\",\n        //        \"contract_code\": \"BTC-USDT\",\n        //        \"volume\": \"1.000000000000000000\",\n        //        \"available\": \"1.000000000000000000\",\n        //        \"frozen\": \"0E-18\",\n        //        \"cost_open\": \"47162.000000000000000000\",\n        //        \"cost_hold\": \"47151.300000000000000000\",\n        //        \"profit_unreal\": \"0.007300000000000000\",\n        //        \"profit_rate\": \"-0.000144183876850008\",\n        //        \"lever_rate\": \"2\",\n        //        \"position_margin\": \"23.579300000000000000\",\n        //        \"direction\": \"buy\",\n        //        \"profit\": \"-0.003400000000000000\",\n        //        \"last_price\": \"47158.6\",\n        //        \"margin_asset\": \"USDT\",\n        //        \"margin_mode\": \"isolated\",\n        //        \"margin_account\": \"BTC-USDT\",\n        //        \"margin_balance\": \"24.973020070000000000\",\n        //        \"margin_position\": \"23.579300000000000000\",\n        //        \"margin_frozen\": \"0\",\n        //        \"margin_available\": \"1.393720070000000000\",\n        //        \"profit_real\": \"0E-18\",\n        //        \"risk_rate\": \"1.044107779705080303\",\n        //        \"withdraw_available\": \"1.386420070000000000000000000000000000\",\n        //        \"liquidation_price\": \"22353.229148614609571788\",\n        //        \"adjust_factor\": \"0.015000000000000000\",\n        //        \"margin_static\": \"24.965720070000000000\"\n        //    }\n        //\n        market = this.safeMarket (this.safeString (position, 'contract_code'));\n        const symbol = market['symbol'];\n        const contracts = this.safeString (position, 'volume');\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const entryPrice = this.safeNumber (position, 'cost_open');\n        const initialMargin = this.safeString (position, 'position_margin');\n        const rawSide = this.safeString (position, 'direction');\n        const side = (rawSide === 'buy') ? 'long' : 'short';\n        const unrealizedProfit = this.safeNumber (position, 'profit_unreal');\n        let marginMode = this.safeString (position, 'margin_mode');\n        const leverage = this.safeString (position, 'lever_rate');\n        const percentage = Precise.stringMul (this.safeString (position, 'profit_rate'), '100');\n        const lastPrice = this.safeString (position, 'last_price');\n        const faceValue = Precise.stringMul (contracts, contractSizeString);\n        let notional = undefined;\n        if (market['linear']) {\n            notional = Precise.stringMul (faceValue, lastPrice);\n        } else {\n            notional = Precise.stringDiv (faceValue, lastPrice);\n            marginMode = 'cross';\n        }\n        const intialMarginPercentage = Precise.stringDiv (initialMargin, notional);\n        const collateral = this.safeString (position, 'margin_balance');\n        const liquidationPrice = this.safeNumber (position, 'liquidation_price');\n        const adjustmentFactor = this.safeString (position, 'adjust_factor');\n        const maintenanceMarginPercentage = Precise.stringDiv (adjustmentFactor, leverage);\n        const maintenanceMargin = Precise.stringMul (maintenanceMarginPercentage, notional);\n        const marginRatio = Precise.stringDiv (maintenanceMargin, collateral);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': this.parseNumber (contracts),\n            'contractSize': contractSize,\n            'entryPrice': entryPrice,\n            'collateral': this.parseNumber (collateral),\n            'side': side,\n            'unrealizedPnl': unrealizedProfit,\n            'leverage': this.parseNumber (leverage),\n            'percentage': this.parseNumber (percentage),\n            'marginMode': marginMode,\n            'notional': this.parseNumber (notional),\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'liquidationPrice': liquidationPrice,\n            'initialMargin': this.parseNumber (initialMargin),\n            'initialMarginPercentage': this.parseNumber (intialMarginPercentage),\n            'maintenanceMargin': this.parseNumber (maintenanceMargin),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceMarginPercentage),\n            'marginRatio': this.parseNumber (marginRatio),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'hedged': undefined,\n            'lastUpdateTimestamp': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 9322,
        "line_end": 9355,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'settlement_price')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"ADA\",\n        \"contract_code\": \"ADA-USDT\",\n        \"settlement_time\": 1652313600000,\n        \"clawback_ratio\": 0E-18,\n        \"settlement_price\": 0.512303000000000000,\n        \"settlement_type\": \"settlement\",\n        \"business_type\": \"swap\",\n        \"pair\": \"ADA-USDT\",\n        \"trade_partition\": \"USDT\"\n    }",
          "{\n        \"contract_code\": \"FIL220513\",\n        \"settlement_price\": 7.016000000000000000,\n        \"settlement_type\": \"settlement\"\n    }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        // linear swap, coin-m swap, fetchSettlementHistory\n        //\n        //    {\n        //        \"symbol\": \"ADA\",\n        //        \"contract_code\": \"ADA-USDT\",\n        //        \"settlement_time\": 1652313600000,\n        //        \"clawback_ratio\": 0E-18,\n        //        \"settlement_price\": 0.512303000000000000,\n        //        \"settlement_type\": \"settlement\",\n        //        \"business_type\": \"swap\",\n        //        \"pair\": \"ADA-USDT\",\n        //        \"trade_partition\": \"USDT\"\n        //    }\n        //\n        // coin-m future, fetchSettlementHistory\n        //\n        //    {\n        //        \"contract_code\": \"FIL220513\",\n        //        \"settlement_price\": 7.016000000000000000,\n        //        \"settlement_type\": \"settlement\"\n        //    }\n        //\n        const timestamp = this.safeInteger (settlement, 'settlement_time');\n        const marketId = this.safeString (settlement, 'contract_code');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'settlement_price'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 9263,
        "line_end": 9320,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "[\n        {\n            \"symbol\": \"ADA\",\n            \"contract_code\": \"ADA-USDT\",\n            \"settlement_time\": 1652313600000,\n            \"clawback_ratio\": 0E-18,\n            \"settlement_price\": 0.512303000000000000,\n            \"settlement_type\": \"settlement\",\n            \"business_type\": \"swap\",\n            \"pair\": \"ADA-USDT\",\n            \"trade_partition\": \"USDT\"\n        },\n        ...\n    ]",
          "[\n        {\n            \"symbol\": \"FIL\",\n            \"settlement_time\": 1652342400000,\n            \"clawback_ratio\": 0E-18,\n            \"list\": [\n                {\n                    \"contract_code\": \"FIL220513\",\n                    \"settlement_price\": 7.016000000000000000,\n                    \"settlement_type\": \"settlement\"\n                },\n                ...\n            ]\n        },\n    ]"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        // linear swap, coin-m swap, fetchSettlementHistory\n        //\n        //    [\n        //        {\n        //            \"symbol\": \"ADA\",\n        //            \"contract_code\": \"ADA-USDT\",\n        //            \"settlement_time\": 1652313600000,\n        //            \"clawback_ratio\": 0E-18,\n        //            \"settlement_price\": 0.512303000000000000,\n        //            \"settlement_type\": \"settlement\",\n        //            \"business_type\": \"swap\",\n        //            \"pair\": \"ADA-USDT\",\n        //            \"trade_partition\": \"USDT\"\n        //        },\n        //        ...\n        //    ]\n        //\n        // coin-m future, fetchSettlementHistory\n        //\n        //    [\n        //        {\n        //            \"symbol\": \"FIL\",\n        //            \"settlement_time\": 1652342400000,\n        //            \"clawback_ratio\": 0E-18,\n        //            \"list\": [\n        //                {\n        //                    \"contract_code\": \"FIL220513\",\n        //                    \"settlement_price\": 7.016000000000000000,\n        //                    \"settlement_type\": \"settlement\"\n        //                },\n        //                ...\n        //            ]\n        //        },\n        //    ]\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            const settlement = settlements[i];\n            const list = this.safeValue (settlement, 'list');\n            if (list !== undefined) {\n                const timestamp = this.safeInteger (settlement, 'settlement_time');\n                const timestampDetails: Dict = {\n                    'timestamp': timestamp,\n                    'datetime': this.iso8601 (timestamp),\n                };\n                for (let j = 0; j < list.length; j++) {\n                    const item = list[j];\n                    const parsedSettlement = this.parseSettlement (item, market);\n                    result.push (this.extend (parsedSettlement, timestampDetails));\n                }\n            } else {\n                result.push (this.parseSettlement (settlements[i], market));\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2183,
        "line_end": 2281,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "close",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 26228.672978342216,\n         \"open\": 9078.95,\n         \"close\": 9146.86,\n         \"high\": 9155.41,\n         \"id\": 209988544334,\n         \"count\": 265846,\n         \"low\": 8988.0,\n         \"version\": 209988544334,\n         \"ask\": [ 9146.87, 0.156134 ],\n         \"vol\": 2.3822168242201668E8,\n         \"bid\": [ 9146.86, 0.080758 ],\n     }",
          "{\n         \"symbol\": \"bhdht\",\n         \"open\":  2.3938,\n         \"high\":  2.4151,\n         \"low\":  2.3323,\n         \"close\":  2.3909,\n         \"amount\":  628.992,\n         \"vol\":  1493.71841095,\n         \"count\":  2088,\n         \"bid\":  2.3643,\n         \"bidSize\":  0.7136,\n         \"ask\":  2.4061,\n         \"askSize\":  0.4156\n     }",
          "{\n         \"seqId\": 161499562790,\n         \"ask\": 16829.51,\n         \"askSize\": 0.707776,\n         \"bid\": 16829.5,\n         \"bidSize\": 1.685945,\n         \"quoteTime\": 1671941599612,\n         \"symbol\": \"btcusdt\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"amount\": 26228.672978342216,\n        //         \"open\": 9078.95,\n        //         \"close\": 9146.86,\n        //         \"high\": 9155.41,\n        //         \"id\": 209988544334,\n        //         \"count\": 265846,\n        //         \"low\": 8988.0,\n        //         \"version\": 209988544334,\n        //         \"ask\": [ 9146.87, 0.156134 ],\n        //         \"vol\": 2.3822168242201668E8,\n        //         \"bid\": [ 9146.86, 0.080758 ],\n        //     }\n        //\n        // fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"bhdht\",\n        //         \"open\":  2.3938,\n        //         \"high\":  2.4151,\n        //         \"low\":  2.3323,\n        //         \"close\":  2.3909,\n        //         \"amount\":  628.992,\n        //         \"vol\":  1493.71841095,\n        //         \"count\":  2088,\n        //         \"bid\":  2.3643,\n        //         \"bidSize\":  0.7136,\n        //         \"ask\":  2.4061,\n        //         \"askSize\":  0.4156\n        //     }\n        //\n        // watchTikcer - bbo\n        //     {\n        //         \"seqId\": 161499562790,\n        //         \"ask\": 16829.51,\n        //         \"askSize\": 0.707776,\n        //         \"bid\": 16829.5,\n        //         \"bidSize\": 1.685945,\n        //         \"quoteTime\": 1671941599612,\n        //         \"symbol\": \"btcusdt\"\n        //     }\n        //\n        const marketId = this.safeString2 (ticker, 'symbol', 'contract_code');\n        let symbol = this.safeSymbol (marketId, market);\n        symbol = this.tryGetSymbolFromFutureMarkets (symbol);\n        const timestamp = this.safeInteger2 (ticker, 'ts', 'quoteTime');\n        let bid = undefined;\n        let bidVolume = undefined;\n        let ask = undefined;\n        let askVolume = undefined;\n        if ('bid' in ticker) {\n            if (ticker['bid'] !== undefined && Array.isArray (ticker['bid'])) {\n                bid = this.safeString (ticker['bid'], 0);\n                bidVolume = this.safeString (ticker['bid'], 1);\n            } else {\n                bid = this.safeString (ticker, 'bid');\n                bidVolume = this.safeString (ticker, 'bidSize');\n            }\n        }\n        if ('ask' in ticker) {\n            if (ticker['ask'] !== undefined && Array.isArray (ticker['ask'])) {\n                ask = this.safeString (ticker['ask'], 0);\n                askVolume = this.safeString (ticker['ask'], 1);\n            } else {\n                ask = this.safeString (ticker, 'ask');\n                askVolume = this.safeString (ticker, 'askSize');\n            }\n        }\n        const open = this.safeString (ticker, 'open');\n        const close = this.safeString (ticker, 'close');\n        const baseVolume = this.safeString (ticker, 'amount');\n        const quoteVolume = this.safeString (ticker, 'vol');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': open,\n            'close': close,\n            'last': close,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2692,
        "line_end": 2837,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": 0.010411000000000000,\n         \"trade-id\": 102090736910,\n         \"ts\": 1583497692182,\n         \"id\": 10500517034273194594947,\n         \"price\": 9096.050000000000000000,\n         \"direction\": \"sell\"\n     }",
          "{\n          \"symbol\": \"swftcbtc\",\n          \"fee-currency\": \"swftc\",\n          \"filled-fees\": \"0\",\n          \"source\": \"spot-api\",\n          \"id\": 83789509854000,\n          \"type\": \"buy-limit\",\n          \"order-id\": 83711103204909,\n          'filled-points': \"0.005826843283532154\",\n          \"fee-deduct-currency\": \"ht\",\n          'filled-amount': \"45941.53\",\n          \"price\": \"0.0000001401\",\n          \"created-at\": 1597933260729,\n          \"match-id\": 100087455560,\n          \"role\": \"maker\",\n          \"trade-id\": 100050305348\n     }",
          "{\n         \"trade_id\": 131560927,\n         \"trade_price\": 13059.800000000000000000,\n         \"trade_volume\": 1.000000000000000000,\n         \"trade_turnover\": 13.059800000000000000,\n         \"trade_fee\": -0.005223920000000000,\n         \"created_at\": 1603703614715,\n         \"role\": \"taker\",\n         \"fee_asset\": \"USDT\",\n         \"profit\": 0,\n         \"real_profit\": 0,\n         \"id\": \"131560927-770334322963152896-1\"\n     }",
          "{\n         \"contract_type\":\"swap\",\n         \"pair\":\"O3-USDT\",\n         \"business_type\":\"swap\",\n         \"query_id\":652123190,\n         \"match_id\":28306009409,\n         \"order_id\":941137865226903553,\n         \"symbol\":\"O3\",\n         \"contract_code\":\"O3-USDT\",\n         \"direction\":\"sell\",\n         \"offset\":\"open\",\n         \"trade_volume\":100.000000000000000000,\n         \"trade_price\":0.398500000000000000,\n         \"trade_turnover\":39.850000000000000000,\n         \"trade_fee\":-0.007970000000000000,\n         \"offset_profitloss\":0E-18,\n         \"create_date\":1644426352999,\n         \"role\":\"Maker\",\n         \"order_source\":\"api\",\n         \"order_id_str\":\"941137865226903553\",\n         \"id\":\"28306009409-941137865226903553-1\",\n         \"fee_asset\":\"USDT\",\n         \"margin_mode\":\"cross\",\n         \"margin_account\":\"USDT\",\n         \"real_profit\":0E-18,\n         \"trade_partition\":\"USDT\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // spot fetchTrades (public)\n        //\n        //     {\n        //         \"amount\": 0.010411000000000000,\n        //         \"trade-id\": 102090736910,\n        //         \"ts\": 1583497692182,\n        //         \"id\": 10500517034273194594947,\n        //         \"price\": 9096.050000000000000000,\n        //         \"direction\": \"sell\"\n        //     }\n        //\n        // spot fetchMyTrades (private)\n        //\n        //     {\n        //          \"symbol\": \"swftcbtc\",\n        //          \"fee-currency\": \"swftc\",\n        //          \"filled-fees\": \"0\",\n        //          \"source\": \"spot-api\",\n        //          \"id\": 83789509854000,\n        //          \"type\": \"buy-limit\",\n        //          \"order-id\": 83711103204909,\n        //          'filled-points': \"0.005826843283532154\",\n        //          \"fee-deduct-currency\": \"ht\",\n        //          'filled-amount': \"45941.53\",\n        //          \"price\": \"0.0000001401\",\n        //          \"created-at\": 1597933260729,\n        //          \"match-id\": 100087455560,\n        //          \"role\": \"maker\",\n        //          \"trade-id\": 100050305348\n        //     }\n        //\n        // linear swap isolated margin fetchOrder details\n        //\n        //     {\n        //         \"trade_id\": 131560927,\n        //         \"trade_price\": 13059.800000000000000000,\n        //         \"trade_volume\": 1.000000000000000000,\n        //         \"trade_turnover\": 13.059800000000000000,\n        //         \"trade_fee\": -0.005223920000000000,\n        //         \"created_at\": 1603703614715,\n        //         \"role\": \"taker\",\n        //         \"fee_asset\": \"USDT\",\n        //         \"profit\": 0,\n        //         \"real_profit\": 0,\n        //         \"id\": \"131560927-770334322963152896-1\"\n        //     }\n        //\n        // inverse swap cross margin fetchMyTrades\n        //\n        //     {\n        //         \"contract_type\":\"swap\",\n        //         \"pair\":\"O3-USDT\",\n        //         \"business_type\":\"swap\",\n        //         \"query_id\":652123190,\n        //         \"match_id\":28306009409,\n        //         \"order_id\":941137865226903553,\n        //         \"symbol\":\"O3\",\n        //         \"contract_code\":\"O3-USDT\",\n        //         \"direction\":\"sell\",\n        //         \"offset\":\"open\",\n        //         \"trade_volume\":100.000000000000000000,\n        //         \"trade_price\":0.398500000000000000,\n        //         \"trade_turnover\":39.850000000000000000,\n        //         \"trade_fee\":-0.007970000000000000,\n        //         \"offset_profitloss\":0E-18,\n        //         \"create_date\":1644426352999,\n        //         \"role\":\"Maker\",\n        //         \"order_source\":\"api\",\n        //         \"order_id_str\":\"941137865226903553\",\n        //         \"id\":\"28306009409-941137865226903553-1\",\n        //         \"fee_asset\":\"USDT\",\n        //         \"margin_mode\":\"cross\",\n        //         \"margin_account\":\"USDT\",\n        //         \"real_profit\":0E-18,\n        //         \"trade_partition\":\"USDT\"\n        //     }\n        //\n        const marketId = this.safeString2 (trade, 'contract_code', 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let timestamp = this.safeInteger2 (trade, 'ts', 'created-at');\n        timestamp = this.safeInteger2 (trade, 'created_at', 'create_date', timestamp);\n        const order = this.safeString2 (trade, 'order-id', 'order_id');\n        let side = this.safeString (trade, 'direction');\n        let type = this.safeString (trade, 'type');\n        if (type !== undefined) {\n            const typeParts = type.split ('-');\n            side = typeParts[0];\n            type = typeParts[1];\n        }\n        const takerOrMaker = this.safeStringLower (trade, 'role');\n        const priceString = this.safeString2 (trade, 'price', 'trade_price');\n        let amountString = this.safeString2 (trade, 'filled-amount', 'amount');\n        amountString = this.safeString (trade, 'trade_volume', amountString);\n        const costString = this.safeString (trade, 'trade_turnover');\n        let fee = undefined;\n        let feeCost = this.safeString (trade, 'filled-fees');\n        if (feeCost === undefined) {\n            feeCost = Precise.stringNeg (this.safeString (trade, 'trade_fee'));\n        }\n        const feeCurrencyId = this.safeString2 (trade, 'fee-currency', 'fee_asset');\n        let feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n        const filledPoints = this.safeString (trade, 'filled-points');\n        if (filledPoints !== undefined) {\n            if ((feeCost === undefined) || Precise.stringEquals (feeCost, '0')) {\n                const feeDeductCurrency = this.safeString (trade, 'fee-deduct-currency');\n                if (feeDeductCurrency !== undefined) {\n                    feeCost = filledPoints;\n                    feeCurrency = this.safeCurrencyCode (feeDeductCurrency);\n                }\n            }\n        }\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        // htx's multi-market trade-id is a bit complex to parse accordingly.\n        // - for `id` which contains hyphen, it would be the unique id, eg. xxxxxx-1, xxxxxx-2 (this happens mostly for contract markets)\n        // - otherwise the least priority is given to the `id` key\n        let id: Str = undefined;\n        const safeId = this.safeString (trade, 'id');\n        if (safeId !== undefined && safeId.indexOf ('-') >= 0) {\n            id = safeId;\n        } else {\n            id = this.safeStringN (trade, [ 'trade_id', 'trade-id', 'id' ]);\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1666,
        "line_end": 1685,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'actualMakerRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'actualTakerRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"btcusdt\",\n         \"actualMakerRate\":\"0.002\",\n         \"actualTakerRate\":\"0.002\",\n         \"takerFeeRate\":\"0.002\",\n         \"makerFeeRate\":\"0.002\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"symbol\":\"btcusdt\",\n        //         \"actualMakerRate\":\"0.002\",\n        //         \"actualTakerRate\":\"0.002\",\n        //         \"takerFeeRate\":\"0.002\",\n        //         \"makerFeeRate\":\"0.002\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (marketId, market),\n            'maker': this.safeNumber (fee, 'actualMakerRate'),\n            'taker': this.safeNumber (fee, 'actualTakerRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTradingLimits",
        "signature": "parseTradingLimits (limits, symbol: Str = undefined, params = {})",
        "line_start": 1772,
        "line_end": 1797,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "limits",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n                    'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n                },\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{                                \"symbol\": \"aidocbtc\",\n                  \"buy-limit-must-less-than\":  1.1,\n              \"sell-limit-must-greater-than\":  0.9,\n             \"limit-order-must-greater-than\":  1,\n                \"limit-order-must-less-than\":  5000000,\n        \"market-buy-order-must-greater-than\":  0.0001,\n           \"market-buy-order-must-less-than\":  100,\n       \"market-sell-order-must-greater-than\":  1,\n          \"market-sell-order-must-less-than\":  500000,\n           \"circuit-break-when-greater-than\":  10000,\n              \"circuit-break-when-less-than\":  10,\n     \"market-sell-order-rate-must-less-than\":  0.1,\n      \"market-buy-order-rate-must-less-than\":  0.1        }"
        ],
        "source": "parseTradingLimits (limits, symbol: Str = undefined, params = {}) {\n        //\n        //   {                                \"symbol\": \"aidocbtc\",\n        //                  \"buy-limit-must-less-than\":  1.1,\n        //              \"sell-limit-must-greater-than\":  0.9,\n        //             \"limit-order-must-greater-than\":  1,\n        //                \"limit-order-must-less-than\":  5000000,\n        //        \"market-buy-order-must-greater-than\":  0.0001,\n        //           \"market-buy-order-must-less-than\":  100,\n        //       \"market-sell-order-must-greater-than\":  1,\n        //          \"market-sell-order-must-less-than\":  500000,\n        //           \"circuit-break-when-greater-than\":  10000,\n        //              \"circuit-break-when-less-than\":  10,\n        //     \"market-sell-order-rate-must-less-than\":  0.1,\n        //      \"market-buy-order-rate-must-less-than\":  0.1        }\n        //\n        return {\n            'info': limits,\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n                    'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n                },\n            },\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 6640,
        "line_end": 6734,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'data')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txHash",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'address')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'address-tag')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'state'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'updated-at')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCost)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"75115912\",\n         \"type\": \"deposit\",\n         \"sub-type\": \"NORMAL\",\n         \"request-id\": \"trc20usdt-a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff-200\",\n         \"currency\": \"usdt\",\n         \"chain\": \"trc20usdt\",\n         \"tx-hash\": \"a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff\",\n         \"amount\": \"2849.000000000000000000\",\n         \"from-addr-tag\": \"\",\n         \"address-id\": \"0\",\n         \"address\": \"TRFTd1FxepQE6CnpwzUEMEbFaLm5bJK67s\",\n         \"address-tag\": \"\",\n         \"fee\": \"0\",\n         \"state\": \"safe\",\n         \"wallet-confirm\": \"2\",\n         \"created-at\": \"1621843808662\",\n         \"updated-at\": \"1621843857137\"\n     },",
          "{\n         \"id\": \"61335312\",\n         \"type\": \"withdraw\",\n         \"sub-type\": \"NORMAL\",\n         \"currency\": \"usdt\",\n         \"chain\": \"trc20usdt\",\n         \"tx-hash\": \"30a3111f2fead74fae45c6218ca3150fc33cab2aa59cfe41526b96aae79ce4ec\",\n         \"amount\": \"12.000000000000000000\",\n         \"from-addr-tag\": \"\",\n         \"address-id\": \"27321591\",\n         \"address\": \"TRf5JacJQRsF4Nm2zu11W6maDGeiEWQu9e\",\n         \"address-tag\": \"\",\n         \"fee\": \"1.000000000000000000\",\n         \"state\": \"confirmed\",\n         \"created-at\": \"1621852316553\",\n         \"updated-at\": \"1621852467041\"\n     }",
          "{\n         \"status\": \"ok\",\n         \"data\": \"99562054\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": \"75115912\",\n        //         \"type\": \"deposit\",\n        //         \"sub-type\": \"NORMAL\",\n        //         \"request-id\": \"trc20usdt-a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff-200\",\n        //         \"currency\": \"usdt\",\n        //         \"chain\": \"trc20usdt\",\n        //         \"tx-hash\": \"a2e229a44ef2a948c874366230bb56aa73631cc0a03d177bd8b4c9d38262d7ff\",\n        //         \"amount\": \"2849.000000000000000000\",\n        //         \"from-addr-tag\": \"\",\n        //         \"address-id\": \"0\",\n        //         \"address\": \"TRFTd1FxepQE6CnpwzUEMEbFaLm5bJK67s\",\n        //         \"address-tag\": \"\",\n        //         \"fee\": \"0\",\n        //         \"state\": \"safe\",\n        //         \"wallet-confirm\": \"2\",\n        //         \"created-at\": \"1621843808662\",\n        //         \"updated-at\": \"1621843857137\"\n        //     },\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"61335312\",\n        //         \"type\": \"withdraw\",\n        //         \"sub-type\": \"NORMAL\",\n        //         \"currency\": \"usdt\",\n        //         \"chain\": \"trc20usdt\",\n        //         \"tx-hash\": \"30a3111f2fead74fae45c6218ca3150fc33cab2aa59cfe41526b96aae79ce4ec\",\n        //         \"amount\": \"12.000000000000000000\",\n        //         \"from-addr-tag\": \"\",\n        //         \"address-id\": \"27321591\",\n        //         \"address\": \"TRf5JacJQRsF4Nm2zu11W6maDGeiEWQu9e\",\n        //         \"address-tag\": \"\",\n        //         \"fee\": \"1.000000000000000000\",\n        //         \"state\": \"confirmed\",\n        //         \"created-at\": \"1621852316553\",\n        //         \"updated-at\": \"1621852467041\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"status\": \"ok\",\n        //         \"data\": \"99562054\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transaction, 'created-at');\n        const code = this.safeCurrencyCode (this.safeString (transaction, 'currency'));\n        let type = this.safeString (transaction, 'type');\n        if (type === 'withdraw') {\n            type = 'withdrawal';\n        }\n        let feeCost = this.safeString (transaction, 'fee');\n        if (feeCost !== undefined) {\n            feeCost = Precise.stringAbs (feeCost);\n        }\n        const networkId = this.safeString (transaction, 'chain');\n        let txHash = this.safeString (transaction, 'tx-hash');\n        if (networkId === 'ETH' && txHash.indexOf ('0x') < 0) {\n            txHash = '0x' + txHash;\n        }\n        const subType = this.safeString (transaction, 'sub-type');\n        const internal = subType === 'FAST';\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'data'),\n            'txid': txHash,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (networkId),\n            'address': this.safeString (transaction, 'address'),\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': this.safeString (transaction, 'address-tag'),\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'state')),\n            'updated': this.safeInteger (transaction, 'updated-at'),\n            'comment': undefined,\n            'internal': internal,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCost),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 6736,
        "line_end": 6759,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            // deposit statuses\n            'unknown': 'failed',\n            'confirming': 'pending',\n            'confirmed': 'ok',\n            'safe': 'ok',\n            'orphan': 'failed',\n            // withdrawal statuses\n            'submitted': 'pending',\n            'canceled': 'canceled',\n            'reexamine': 'pending',\n            'reject': 'failed',\n            'pass': 'pending',\n            'wallet-reject': 'failed',\n            // 'confirmed': 'ok', // present in deposit statuses\n            'confirm-error': 'failed',\n            'repealed': 'failed',\n            'wallet-transfer': 'pending',\n            'pre-transfer': 'pending',\n            'verifying': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "htx"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 6823,
        "line_end": 6845,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"data\": 12345,\n         \"status\": \"ok\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"data\": 12345,\n        //         \"status\": \"ok\"\n        //     }\n        //\n        const id = this.safeString (transfer, 'data');\n        const code = this.safeCurrencyCode (undefined, currency);\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': code,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "htx"
      }
    ],
    "hyperliquid": [
      {
        "name": "parseCreateEditOrderArgs",
        "signature": "parseCreateEditOrderArgs (id: Str, symbol: string, type: OrderType, side: OrderSide, amount: number, price: Num = undefined, params = {})",
        "line_start": 4833,
        "line_end": 4855,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type as OrderType",
            "comment": null
          },
          {
            "key": "side",
            "value": "side as OrderSide",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "params",
            "value": "params",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "vaultAddress",
            "value": "vaultAddress",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCreateEditOrderArgs (id: Str, symbol: string, type: OrderType, side: OrderSide, amount: number, price: Num = undefined, params = {}) {\n        const market = this.market (symbol);\n        let vaultAddress = undefined;\n        [ vaultAddress, params ] = this.handleOptionAndParams2 (params, 'createOrder', 'vaultAddress', 'subAccountAddress');\n        vaultAddress = this.formatVaultAddress (vaultAddress);\n        symbol = market['symbol'];\n        const order = {\n            'symbol': symbol,\n            'type': type as OrderType,\n            'side': side as OrderSide,\n            'amount': amount,\n            'price': price,\n            'params': params,\n        };\n        const globalParams = {};\n        if (vaultAddress !== undefined) {\n            globalParams['vaultAddress'] = vaultAddress;\n        }\n        if (id !== undefined) {\n            order['id'] = id;\n        }\n        return [ order, globalParams ];\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (info, market: Market = undefined): FundingRate",
        "line_start": 1348,
        "line_end": 1396,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPx",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "oraclePx",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "funding",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "'1h'",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"maxLeverage\": \"50\",\n         \"name\": \"ETH\",\n         \"onlyIsolated\": false,\n         \"szDecimals\": \"4\",\n         \"dayNtlVlm\": \"1709813.11535\",\n         \"funding\": \"0.00004807\",\n         \"impactPxs\": [\n             \"2369.3\",\n             \"2369.6\"\n         ],\n         \"markPx\": \"2369.6\",\n         \"midPx\": \"2369.45\",\n         \"openInterest\": \"1815.4712\",\n         \"oraclePx\": \"2367.3\",\n         \"premium\": \"0.00090821\",\n         \"prevDayPx\": \"2381.5\"\n     }"
        ],
        "source": "parseFundingRate (info, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"maxLeverage\": \"50\",\n        //         \"name\": \"ETH\",\n        //         \"onlyIsolated\": false,\n        //         \"szDecimals\": \"4\",\n        //         \"dayNtlVlm\": \"1709813.11535\",\n        //         \"funding\": \"0.00004807\",\n        //         \"impactPxs\": [\n        //             \"2369.3\",\n        //             \"2369.6\"\n        //         ],\n        //         \"markPx\": \"2369.6\",\n        //         \"midPx\": \"2369.45\",\n        //         \"openInterest\": \"1815.4712\",\n        //         \"oraclePx\": \"2367.3\",\n        //         \"premium\": \"0.00090821\",\n        //         \"prevDayPx\": \"2381.5\"\n        //     }\n        //\n        const base = this.safeString (info, 'name');\n        const marketId = this.coinToMarketId (base);\n        const symbol = this.safeSymbol (marketId, market);\n        const funding = this.safeNumber (info, 'funding');\n        const markPx = this.safeNumber (info, 'markPx');\n        const oraclePx = this.safeNumber (info, 'oraclePx');\n        const fundingTimestamp = (Math.floor (this.milliseconds () / 60 / 60 / 1000) + 1) * 60 * 60 * 1000;\n        return {\n            'info': info,\n            'symbol': symbol,\n            'markPrice': markPx,\n            'indexPrice': oraclePx,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': funding,\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': '1h',\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 4612,
        "line_end": 4647,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"time\": 1734026400057,\n     \"hash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n     \"delta\": {\n         \"type\": \"funding\",\n         \"coin\": \"SOL\",\n         \"usdc\": \"75.635093\",\n         \"szi\": \"-7375.9\",\n         \"fundingRate\": \"0.00004381\",\n         \"nSamples\": null\n     }\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        // {\n        //     \"time\": 1734026400057,\n        //     \"hash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n        //     \"delta\": {\n        //         \"type\": \"funding\",\n        //         \"coin\": \"SOL\",\n        //         \"usdc\": \"75.635093\",\n        //         \"szi\": \"-7375.9\",\n        //         \"fundingRate\": \"0.00004381\",\n        //         \"nSamples\": null\n        //     }\n        // }\n        //\n        const id = this.safeString (income, 'hash');\n        const timestamp = this.safeInteger (income, 'time');\n        const delta = this.safeDict (income, 'delta');\n        const baseId = this.safeString (delta, 'coin');\n        const marketSymbol = baseId + '/USDC:USDC';\n        market = this.safeMarket (marketSymbol);\n        const symbol = market['symbol'];\n        const amount = this.safeString (delta, 'usdc');\n        const code = this.safeCurrencyCode ('USDC');\n        const rate = this.safeNumber (delta, 'fundingRate');\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': id,\n            'amount': this.parseNumber (amount),\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 4314,
        "line_end": 4355,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'hash')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "this.safeString (delta, 'user')",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'hash')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (type)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"time\":1724762307531,\n     \"hash\":\"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781\",\n     \"delta\":{\n         \"type\":\"accountClassTransfer\",\n         \"usdc\":\"50.0\",\n         \"toPerp\":false\n     }\n }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // {\n        //     \"time\":1724762307531,\n        //     \"hash\":\"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781\",\n        //     \"delta\":{\n        //         \"type\":\"accountClassTransfer\",\n        //         \"usdc\":\"50.0\",\n        //         \"toPerp\":false\n        //     }\n        // }\n        //\n        const timestamp = this.safeInteger (item, 'time');\n        const delta = this.safeDict (item, 'delta', {});\n        let fee = undefined;\n        const feeCost = this.safeInteger (delta, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': 'USDC',\n                'cost': feeCost,\n            };\n        }\n        const type = this.safeString (delta, 'type');\n        const amount = this.safeString (delta, 'usdc');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'hash'),\n            'direction': undefined,\n            'account': undefined,\n            'referenceAccount': this.safeString (delta, 'user'),\n            'referenceId': this.safeString (item, 'hash'),\n            'type': this.parseLedgerEntryType (type),\n            'currency': undefined,\n            'amount': this.parseNumber (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': undefined,\n            'status': undefined,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 4357,
        "line_end": 4363,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType: Dict = {\n            'internalTransfer': 'transfer',\n            'accountClassTransfer': 'transfer',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 3898,
        "line_end": 3916,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (market, 'settle')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        'type': 'default'\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //    {\n        //        'type': 'default'\n        //    }\n        //\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (undefined, market),\n            'type': undefined,\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': this.safeString (market, 'settle'),\n            'status': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 973,
        "line_end": 1080,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "baseName",
            "value": "baseName",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "taker",
            "comment": null
          },
          {
            "key": "maker",
            "value": "maker",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (amountPrecisionStr)),\n                'price': this.parseNumber (this.parsePrecision (pricePrecisionStr)),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': this.safeInteger (market, 'maxLeverage'),\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.parseNumber ('10'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"maxLeverage\": \"50\",\n         \"name\": \"ETH\",\n         \"onlyIsolated\": false,\n         \"szDecimals\": \"4\",\n         \"dayNtlVlm\": \"1709813.11535\",\n         \"funding\": \"0.00004807\",\n         \"impactPxs\": [\n             \"2369.3\",\n             \"2369.6\"\n         ],\n         \"markPx\": \"2369.6\",\n         \"midPx\": \"2369.45\",\n         \"openInterest\": \"1815.4712\",\n         \"oraclePx\": \"2367.3\",\n         \"premium\": \"0.00090821\",\n         \"prevDayPx\": \"2381.5\"\n         \"collateralToken\": \"0\" hip3 tokens only\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"maxLeverage\": \"50\",\n        //         \"name\": \"ETH\",\n        //         \"onlyIsolated\": false,\n        //         \"szDecimals\": \"4\",\n        //         \"dayNtlVlm\": \"1709813.11535\",\n        //         \"funding\": \"0.00004807\",\n        //         \"impactPxs\": [\n        //             \"2369.3\",\n        //             \"2369.6\"\n        //         ],\n        //         \"markPx\": \"2369.6\",\n        //         \"midPx\": \"2369.45\",\n        //         \"openInterest\": \"1815.4712\",\n        //         \"oraclePx\": \"2367.3\",\n        //         \"premium\": \"0.00090821\",\n        //         \"prevDayPx\": \"2381.5\"\n        //         \"collateralToken\": \"0\" hip3 tokens only\n        //     }\n        //\n        const collateralTokenCode = this.safeString (market, 'collateralTokenName');\n        const quoteId = (collateralTokenCode === undefined) ? 'USDC' : collateralTokenCode;\n        const settleId = (collateralTokenCode === undefined) ? 'USDC' : collateralTokenCode;\n        const baseName = this.safeString (market, 'name');\n        let base = this.safeCurrencyCode (baseName);\n        base = base.replace (':', '-'); // handle hip3 tokens and converts from like flx:crcl to FLX-CRCL\n        const quote = this.safeCurrencyCode (quoteId);\n        const baseId = this.safeString (market, 'baseId');\n        const settle = this.safeCurrencyCode (settleId);\n        let symbol = base + '/' + quote;\n        const contract = true;\n        const swap = true;\n        if (contract) {\n            if (swap) {\n                symbol = symbol + ':' + settle;\n            }\n        }\n        const fees = this.safeDict (this.fees, 'swap', {});\n        const taker = this.safeNumber (fees, 'taker');\n        const maker = this.safeNumber (fees, 'maker');\n        const amountPrecisionStr = this.safeString (market, 'szDecimals');\n        const amountPrecision = parseInt (amountPrecisionStr);\n        const price = this.safeNumber (market, 'markPx', 0);\n        let pricePrecision = 0;\n        if (price !== undefined) {\n            pricePrecision = this.calculatePricePrecision (price, amountPrecision, 6);\n        }\n        const pricePrecisionStr = this.numberToString (pricePrecision);\n        const isDelisted = this.safeBool (market, 'isDelisted');\n        let active = true;\n        if (isDelisted !== undefined) {\n            active = !isDelisted;\n        }\n        return this.safeMarketStructure ({\n            'id': baseId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'baseName': baseName,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': 'swap',\n            'spot': false,\n            'margin': undefined,\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': contract,\n            'linear': true,\n            'inverse': false,\n            'taker': taker,\n            'maker': maker,\n            'contractSize': this.parseNumber ('1'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (amountPrecisionStr)),\n                'price': this.parseNumber (this.parsePrecision (pricePrecisionStr)),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': this.safeInteger (market, 'maxLeverage'),\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.parseNumber ('10'),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1494,
        "line_end": 1517,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"T\": 1704287699999,\n         \"c\": \"2226.4\",\n         \"h\": \"2247.9\",\n         \"i\": \"15m\",\n         \"l\": \"2224.6\",\n         \"n\": 46,\n         \"o\": \"2247.9\",\n         \"s\": \"ETH\",\n         \"t\": 1704286800000,\n         \"v\": \"591.6427\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"T\": 1704287699999,\n        //         \"c\": \"2226.4\",\n        //         \"h\": \"2247.9\",\n        //         \"i\": \"15m\",\n        //         \"l\": \"2224.6\",\n        //         \"n\": 46,\n        //         \"o\": \"2247.9\",\n        //         \"s\": \"ETH\",\n        //         \"t\": 1704286800000,\n        //         \"v\": \"591.6427\"\n        //     }\n        //\n        return [\n            this.safeInteger (ohlcv, 't'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber (ohlcv, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 4526,
        "line_end": 4559,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId)",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeNumber (interest, 'openInterest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n      szDecimals: '2',\n      name: 'HYPE',\n      maxLeverage: '3',\n      funding: '0.00014735',\n      openInterest: '14677900.74',\n      prevDayPx: '26.145',\n      dayNtlVlm: '299643445.12560016',\n      premium: '0.00081613',\n      oraclePx: '27.569',\n      markPx: '27.63',\n      midPx: '27.599',\n      impactPxs: [ '27.5915', '27.6319' ],\n      dayBaseVlm: '10790652.83',\n      baseId: 159\n  }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //  {\n        //      szDecimals: '2',\n        //      name: 'HYPE',\n        //      maxLeverage: '3',\n        //      funding: '0.00014735',\n        //      openInterest: '14677900.74',\n        //      prevDayPx: '26.145',\n        //      dayNtlVlm: '299643445.12560016',\n        //      premium: '0.00081613',\n        //      oraclePx: '27.569',\n        //      markPx: '27.63',\n        //      midPx: '27.599',\n        //      impactPxs: [ '27.5915', '27.6319' ],\n        //      dayBaseVlm: '10790652.83',\n        //      baseId: 159\n        //  }\n        //\n        interest = this.safeDict (interest, 'info', {});\n        const coin = this.safeString (interest, 'name');\n        let marketId = undefined;\n        if (coin !== undefined) {\n            marketId = this.coinToMarketId (coin);\n        }\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (marketId),\n            'openInterestAmount': this.safeNumber (interest, 'openInterest'),\n            'openInterestValue': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3201,
        "line_end": 3359,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (entry, 'oid')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (entry, 'cloid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'statusTimestamp')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (this.safeStringLower (entry, 'orderType'))",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "tif",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (entry, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (entry, 'limitPx')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeBool (entry, 'isTrigger') ? this.safeNumber (entry, 'triggerPx') : undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "totalAmount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (entry, 'avgPx')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (filled, 'totalSz', Precise.stringSub (totalAmount, remaining))",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{error: 'Insufficient margin to place order. asset=159'}",
          "{\n         \"coin\": \"ETH\",\n         \"limitPx\": \"2000.0\",\n         \"oid\": 3991946565,\n         \"origSz\": \"0.1\",\n         \"side\": \"B\",\n         \"sz\": \"0.1\",\n         \"timestamp\": 1704346468838\n     }",
          "{\n        \"cloid\": null,\n        \"closedPnl\": \"0.0\",\n        \"coin\": \"SOL\",\n        \"crossed\": true,\n        \"dir\": \"Open Long\",\n        \"fee\": \"0.003879\",\n        \"hash\": \"0x4a2647998682b7f07bc5040ab531e1011400f9a51bfa0346a0b41ebe510e8875\",\n        \"liquidationMarkPx\": null,\n        \"oid\": \"6463280784\",\n        \"px\": \"110.83\",\n        \"side\": \"B\",\n        \"startPosition\": \"1.64\",\n        \"sz\": \"0.1\",\n        \"tid\": \"232174667018988\",\n        \"time\": \"1709142268394\"\n    }",
          "{\n         \"order\": {\n             \"children\": [],\n             \"cloid\": null,\n             \"coin\": \"ETH\",\n             \"isPositionTpsl\": false,\n             \"isTrigger\": false,\n             \"limitPx\": \"2000.0\",\n             \"oid\": \"3991946565\",\n             \"orderType\": \"Limit\",\n             \"origSz\": \"0.1\",\n             \"reduceOnly\": false,\n             \"side\": \"B\",\n             \"sz\": \"0.1\",\n             \"tif\": \"Gtc\",\n             \"timestamp\": \"1704346468838\",\n             \"triggerCondition\": \"N/A\",\n             \"triggerPx\": \"0.0\"\n         },\n         \"status\": \"open\",\n         \"statusTimestamp\": \"1704346468838\"\n     }",
          "{\n         \"resting\": {\n             \"oid\": 5063830287\n         }\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrdersWs error\n        //\n        //  {error: 'Insufficient margin to place order. asset=159'}\n        //\n        //  fetchOpenOrders\n        //\n        //     {\n        //         \"coin\": \"ETH\",\n        //         \"limitPx\": \"2000.0\",\n        //         \"oid\": 3991946565,\n        //         \"origSz\": \"0.1\",\n        //         \"side\": \"B\",\n        //         \"sz\": \"0.1\",\n        //         \"timestamp\": 1704346468838\n        //     }\n        // fetchClosedorders\n        //    {\n        //        \"cloid\": null,\n        //        \"closedPnl\": \"0.0\",\n        //        \"coin\": \"SOL\",\n        //        \"crossed\": true,\n        //        \"dir\": \"Open Long\",\n        //        \"fee\": \"0.003879\",\n        //        \"hash\": \"0x4a2647998682b7f07bc5040ab531e1011400f9a51bfa0346a0b41ebe510e8875\",\n        //        \"liquidationMarkPx\": null,\n        //        \"oid\": \"6463280784\",\n        //        \"px\": \"110.83\",\n        //        \"side\": \"B\",\n        //        \"startPosition\": \"1.64\",\n        //        \"sz\": \"0.1\",\n        //        \"tid\": \"232174667018988\",\n        //        \"time\": \"1709142268394\"\n        //    }\n        //\n        //  fetchOrder\n        //\n        //     {\n        //         \"order\": {\n        //             \"children\": [],\n        //             \"cloid\": null,\n        //             \"coin\": \"ETH\",\n        //             \"isPositionTpsl\": false,\n        //             \"isTrigger\": false,\n        //             \"limitPx\": \"2000.0\",\n        //             \"oid\": \"3991946565\",\n        //             \"orderType\": \"Limit\",\n        //             \"origSz\": \"0.1\",\n        //             \"reduceOnly\": false,\n        //             \"side\": \"B\",\n        //             \"sz\": \"0.1\",\n        //             \"tif\": \"Gtc\",\n        //             \"timestamp\": \"1704346468838\",\n        //             \"triggerCondition\": \"N/A\",\n        //             \"triggerPx\": \"0.0\"\n        //         },\n        //         \"status\": \"open\",\n        //         \"statusTimestamp\": \"1704346468838\"\n        //     }\n        //\n        // createOrder\n        //\n        //     {\n        //         \"resting\": {\n        //             \"oid\": 5063830287\n        //         }\n        //     }\n        //\n        //     {\n        //        \"filled\":{\n        //           \"totalSz\":\"0.1\",\n        //           \"avgPx\":\"100.84\",\n        //           \"oid\":6195281425\n        //        }\n        //     }\n        // frontendOrder\n        // {\n        //     \"children\": [],\n        //     \"cloid\": null,\n        //     \"coin\": \"BLUR\",\n        //     \"isPositionTpsl\": false,\n        //     \"isTrigger\": true,\n        //     \"limitPx\": \"0.5\",\n        //     \"oid\": 8670487141,\n        //     \"orderType\": \"Stop Limit\",\n        //     \"origSz\": \"20.0\",\n        //     \"reduceOnly\": false,\n        //     \"side\": \"B\",\n        //     \"sz\": \"20.0\",\n        //     \"tif\": null,\n        //     \"timestamp\": 1715523663687,\n        //     \"triggerCondition\": \"Price above 0.6\",\n        //     \"triggerPx\": \"0.6\"\n        // }\n        //\n        const error = this.safeString (order, 'error');\n        if (error !== undefined) {\n            return this.safeOrder ({\n                'info': order,\n                'status': 'rejected',\n            });\n        }\n        let entry = this.safeDictN (order, [ 'order', 'resting', 'filled' ]);\n        if (entry === undefined) {\n            entry = order;\n        }\n        const filled = this.safeDict (order, 'filled', {});\n        const coin = this.safeString (entry, 'coin');\n        let marketId = undefined;\n        if (coin !== undefined) {\n            marketId = this.coinToMarketId (coin);\n        }\n        if (this.safeString (entry, 'id') === undefined) {\n            market = this.safeMarket (marketId, undefined);\n        } else {\n            market = this.safeMarket (marketId, market);\n        }\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (entry, 'timestamp');\n        const status = this.safeString2 (order, 'status', 'ccxtStatus');\n        order = this.omit (order, [ 'ccxtStatus' ]);\n        let side = this.safeString (entry, 'side');\n        if (side !== undefined) {\n            side = (side === 'A') ? 'sell' : 'buy';\n        }\n        const totalAmount = this.safeString2 (entry, 'origSz', 'totalSz');\n        const remaining = this.safeString (entry, 'sz');\n        const tif = this.safeStringUpper (entry, 'tif');\n        let postOnly = undefined;\n        if (tif !== undefined) {\n            postOnly = (tif === 'ALO');\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (entry, 'oid'),\n            'clientOrderId': this.safeString (entry, 'cloid'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (order, 'statusTimestamp'),\n            'symbol': symbol,\n            'type': this.parseOrderType (this.safeStringLower (entry, 'orderType')),\n            'timeInForce': tif,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeBool (entry, 'reduceOnly'),\n            'side': side,\n            'price': this.safeString (entry, 'limitPx'),\n            'triggerPrice': this.safeBool (entry, 'isTrigger') ? this.safeNumber (entry, 'triggerPx') : undefined,\n            'amount': totalAmount,\n            'cost': undefined,\n            'average': this.safeString (entry, 'avgPx'),\n            'filled': this.safeString (filled, 'totalSz', Precise.stringSub (totalAmount, remaining)),\n            'remaining': remaining,\n            'status': this.parseOrderStatus (status),\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3361,
        "line_end": 3380,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status === undefined) {\n            return undefined;\n        }\n        const statuses: Dict = {\n            'triggered': 'open',\n            'filled': 'closed',\n            'open': 'open',\n            'canceled': 'canceled',\n            'rejected': 'rejected',\n            'marginCanceled': 'canceled',\n        };\n        if (status.endsWith ('Rejected')) {\n            return 'rejected';\n        }\n        if (status.endsWith ('Canceled')) {\n            return 'canceled';\n        }\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 3382,
        "line_end": 3388,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'stop limit': 'limit',\n            'stop market': 'market',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3631,
        "line_end": 3708,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "isolated",
            "value": "isIsolated",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (entry, 'entryPx')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (entry, 'positionValue')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (leverage, 'value')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (marginUsed)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (rawUnrealizedPnl)",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (entry, 'liquidationPx')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.parseNumber (percentage)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"position\": {\n             \"coin\": \"ETH\",\n             \"cumFunding\": {\n                 \"allTime\": \"0.0\",\n                 \"sinceChange\": \"0.0\",\n                 \"sinceOpen\": \"0.0\"\n             },\n             \"entryPx\": \"2213.9\",\n             \"leverage\": {\n                 \"rawUsd\": \"-475.23904\",\n                 \"type\": \"isolated\",\n                 \"value\": \"20\"\n             },\n             \"liquidationPx\": \"2125.00856238\",\n             \"marginUsed\": \"24.88097\",\n             \"maxLeverage\": \"50\",\n             \"positionValue\": \"500.12001\",\n             \"returnOnEquity\": \"0.0\",\n             \"szi\": \"0.2259\",\n             \"unrealizedPnl\": \"0.0\"\n         },\n         \"type\": \"oneWay\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"position\": {\n        //             \"coin\": \"ETH\",\n        //             \"cumFunding\": {\n        //                 \"allTime\": \"0.0\",\n        //                 \"sinceChange\": \"0.0\",\n        //                 \"sinceOpen\": \"0.0\"\n        //             },\n        //             \"entryPx\": \"2213.9\",\n        //             \"leverage\": {\n        //                 \"rawUsd\": \"-475.23904\",\n        //                 \"type\": \"isolated\",\n        //                 \"value\": \"20\"\n        //             },\n        //             \"liquidationPx\": \"2125.00856238\",\n        //             \"marginUsed\": \"24.88097\",\n        //             \"maxLeverage\": \"50\",\n        //             \"positionValue\": \"500.12001\",\n        //             \"returnOnEquity\": \"0.0\",\n        //             \"szi\": \"0.2259\",\n        //             \"unrealizedPnl\": \"0.0\"\n        //         },\n        //         \"type\": \"oneWay\"\n        //     }\n        //\n        const entry = this.safeDict (position, 'position', {});\n        const coin = this.safeString (entry, 'coin');\n        const marketId = this.coinToMarketId (coin);\n        market = this.safeMarket (marketId, undefined);\n        const symbol = market['symbol'];\n        const leverage = this.safeDict (entry, 'leverage', {});\n        const marginMode = this.safeString (leverage, 'type');\n        const isIsolated = (marginMode === 'isolated');\n        const rawSize = this.safeString (entry, 'szi');\n        let size = rawSize;\n        let side = undefined;\n        if (size !== undefined) {\n            side = Precise.stringGt (rawSize, '0') ? 'long' : 'short';\n            size = Precise.stringAbs (size);\n        }\n        const rawUnrealizedPnl = this.safeString (entry, 'unrealizedPnl');\n        const absRawUnrealizedPnl = Precise.stringAbs (rawUnrealizedPnl);\n        const marginUsed = this.safeString (entry, 'marginUsed');\n        let initialMargin = undefined;\n        if (isIsolated) {\n            initialMargin = Precise.stringSub (marginUsed, rawUnrealizedPnl);\n        } else {\n            initialMargin = marginUsed;\n        }\n        const percentage = Precise.stringMul (Precise.stringDiv (absRawUnrealizedPnl, marginUsed), '100');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'isolated': isIsolated,\n            'hedged': undefined,\n            'side': side,\n            'contracts': this.parseNumber (size),\n            'contractSize': undefined,\n            'entryPrice': this.safeNumber (entry, 'entryPx'),\n            'markPrice': undefined,\n            'notional': this.safeNumber (entry, 'positionValue'),\n            'leverage': this.safeNumber (leverage, 'value'),\n            'collateral': this.parseNumber (marginUsed),\n            'initialMargin': this.parseNumber (initialMargin),\n            'maintenanceMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'unrealizedPnl': this.parseNumber (rawUnrealizedPnl),\n            'liquidationPrice': this.safeNumber (entry, 'liquidationPx'),\n            'marginMode': marginMode,\n            'percentage': this.parseNumber (percentage),\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1398,
        "line_end": 1430,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeNumber (ticker, 'prevDayPx')",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeNumber (ticker, 'midPx')",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeNumber (ticker, 'price')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (bidAsk, 0)",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (bidAsk, 1)",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (ticker, 'dayNtlVlm')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"prevDayPx\": \"3400.5\",\n         \"dayNtlVlm\": \"511297257.47936022\",\n         \"markPx\": \"3464.7\",\n         \"midPx\": \"3465.05\",\n         \"oraclePx\": \"3460.1\", // only in swap\n         \"openInterest\": \"64638.1108\", // only in swap\n         \"premium\": \"0.00141614\", // only in swap\n         \"funding\": \"0.00008727\", // only in swap\n         \"impactPxs\": [ \"3465.0\", \"3465.1\" ], // only in swap\n         \"coin\": \"PURR\", // only in spot\n         \"circulatingSupply\": \"998949190.03400207\", // only in spot\n     },"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"prevDayPx\": \"3400.5\",\n        //         \"dayNtlVlm\": \"511297257.47936022\",\n        //         \"markPx\": \"3464.7\",\n        //         \"midPx\": \"3465.05\",\n        //         \"oraclePx\": \"3460.1\", // only in swap\n        //         \"openInterest\": \"64638.1108\", // only in swap\n        //         \"premium\": \"0.00141614\", // only in swap\n        //         \"funding\": \"0.00008727\", // only in swap\n        //         \"impactPxs\": [ \"3465.0\", \"3465.1\" ], // only in swap\n        //         \"coin\": \"PURR\", // only in spot\n        //         \"circulatingSupply\": \"998949190.03400207\", // only in spot\n        //     },\n        //\n        const name = this.safeString (ticker, 'name');\n        const marketId = this.coinToMarketId (name);\n        market = this.safeMarket (marketId, market);\n        const bidAsk = this.safeList (ticker, 'impactPxs');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'previousClose': this.safeNumber (ticker, 'prevDayPx'),\n            'close': this.safeNumber (ticker, 'midPx'),\n            'last': this.safeNumber (ticker, 'price'),\n            'bid': this.safeNumber (bidAsk, 0),\n            'ask': this.safeNumber (bidAsk, 1),\n            'quoteVolume': this.safeNumber (ticker, 'dayNtlVlm'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 3451,
        "line_end": 3511,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'oid')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': fee,\n                'currency': this.safeString (trade, 'feeToken'),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (trade, 'feeToken')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"closedPnl\": \"0.19343\",\n         \"coin\": \"ETH\",\n         \"crossed\": true,\n         \"dir\": \"Close Long\",\n         \"fee\": \"0.050062\",\n         \"hash\": \"0x09d77c96791e98b5775a04092584ab010d009445119c71e4005c0d634ea322bc\",\n         \"liquidationMarkPx\": null,\n         \"oid\": 3929354691,\n         \"px\": \"2381.1\",\n         \"side\": \"A\",\n         \"startPosition\": \"0.0841\",\n         \"sz\": \"0.0841\",\n         \"tid\": 128423918764978,\n         \"time\": 1704262888911\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        //     {\n        //         \"closedPnl\": \"0.19343\",\n        //         \"coin\": \"ETH\",\n        //         \"crossed\": true,\n        //         \"dir\": \"Close Long\",\n        //         \"fee\": \"0.050062\",\n        //         \"hash\": \"0x09d77c96791e98b5775a04092584ab010d009445119c71e4005c0d634ea322bc\",\n        //         \"liquidationMarkPx\": null,\n        //         \"oid\": 3929354691,\n        //         \"px\": \"2381.1\",\n        //         \"side\": \"A\",\n        //         \"startPosition\": \"0.0841\",\n        //         \"sz\": \"0.0841\",\n        //         \"tid\": 128423918764978,\n        //         \"time\": 1704262888911\n        //     }\n        //\n        const timestamp = this.safeInteger (trade, 'time');\n        const price = this.safeString (trade, 'px');\n        const amount = this.safeString (trade, 'sz');\n        const coin = this.safeString (trade, 'coin');\n        const marketId = this.coinToMarketId (coin);\n        market = this.safeMarket (marketId, undefined);\n        const symbol = market['symbol'];\n        const id = this.safeString (trade, 'tid');\n        let side = this.safeString (trade, 'side');\n        if (side !== undefined) {\n            side = (side === 'A') ? 'sell' : 'buy';\n        }\n        let fee = this.safeString (trade, 'fee');\n        let takerOrMaker = undefined;\n        const crossed = this.safeBool (trade, 'crossed');\n        if (crossed !== undefined) {\n            takerOrMaker = crossed ? 'taker' : 'maker';\n        }\n        const builderFee = this.safeString (trade, 'builderFee');\n        if (builderFee !== undefined) {\n            fee = Precise.stringAdd (fee, builderFee);\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': this.safeString (trade, 'oid'),\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': {\n                'cost': fee,\n                'currency': this.safeString (trade, 'feeToken'),\n                'rate': undefined,\n            },\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 4222,
        "line_end": 4267,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'userAddRate')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'userCrossRate')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"dailyUserVlm\": [\n             {\n                 \"date\": \"2024-07-08\",\n                 \"userCross\": \"0.0\",\n                 \"userAdd\": \"0.0\",\n                 \"exchange\": \"90597185.23639999\"\n             }\n         ],\n         \"feeSchedule\": {\n             \"cross\": \"0.00035\",\n             \"add\": \"0.0001\",\n             \"tiers\": {\n                 \"vip\": [\n                     {\n                         \"ntlCutoff\": \"5000000.0\",\n                         \"cross\": \"0.0003\",\n                         \"add\": \"0.00005\"\n                     }\n                 ],\n                 \"mm\": [\n                     {\n                         \"makerFractionCutoff\": \"0.005\",\n                         \"add\": \"-0.00001\"\n                     }\n                 ]\n             },\n             \"referralDiscount\": \"0.04\"\n         },\n         \"userCrossRate\": \"0.00035\",\n         \"userAddRate\": \"0.0001\",\n         \"activeReferralDiscount\": \"0.0\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"dailyUserVlm\": [\n        //             {\n        //                 \"date\": \"2024-07-08\",\n        //                 \"userCross\": \"0.0\",\n        //                 \"userAdd\": \"0.0\",\n        //                 \"exchange\": \"90597185.23639999\"\n        //             }\n        //         ],\n        //         \"feeSchedule\": {\n        //             \"cross\": \"0.00035\",\n        //             \"add\": \"0.0001\",\n        //             \"tiers\": {\n        //                 \"vip\": [\n        //                     {\n        //                         \"ntlCutoff\": \"5000000.0\",\n        //                         \"cross\": \"0.0003\",\n        //                         \"add\": \"0.00005\"\n        //                     }\n        //                 ],\n        //                 \"mm\": [\n        //                     {\n        //                         \"makerFractionCutoff\": \"0.005\",\n        //                         \"add\": \"-0.00001\"\n        //                     }\n        //                 ]\n        //             },\n        //             \"referralDiscount\": \"0.04\"\n        //         },\n        //         \"userCrossRate\": \"0.00035\",\n        //         \"userAddRate\": \"0.0001\",\n        //         \"activeReferralDiscount\": \"0.0\"\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'userAddRate'),\n            'taker': this.safeNumber (fee, 'userCrossRate'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4106,
        "line_end": 4158,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'hash')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "this.safeString (delta, 'destination')",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (delta, 'user')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (delta, 'usdc')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.safeString (transaction, 'status')",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{ status: 'ok', response: { type: 'default' } }",
          "{\n     \"time\":1724762307531,\n     \"hash\":\"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781\",\n     \"delta\":{\n         \"type\":\"accountClassTransfer\",\n         \"usdc\":\"50.0\",\n         \"toPerp\":false\n     }\n }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // { status: 'ok', response: { type: 'default' } }\n        //\n        // fetchDeposits / fetchWithdrawals\n        // {\n        //     \"time\":1724762307531,\n        //     \"hash\":\"0x620a234a7e0eb7930575040f59482a01050058b0802163b4767bfd9033e77781\",\n        //     \"delta\":{\n        //         \"type\":\"accountClassTransfer\",\n        //         \"usdc\":\"50.0\",\n        //         \"toPerp\":false\n        //     }\n        // }\n        //\n        const timestamp = this.safeInteger (transaction, 'time');\n        const delta = this.safeDict (transaction, 'delta', {});\n        let fee = undefined;\n        const feeCost = this.safeInteger (delta, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': 'USDC',\n                'cost': feeCost,\n            };\n        }\n        let internal = undefined;\n        const type = this.safeString (delta, 'type');\n        if (type !== undefined) {\n            internal = (type === 'internalTransfer');\n        }\n        return {\n            'info': transaction,\n            'id': undefined,\n            'txid': this.safeString (transaction, 'hash'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': undefined,\n            'addressTo': this.safeString (delta, 'destination'),\n            'addressFrom': this.safeString (delta, 'user'),\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': this.safeNumber (delta, 'usdc'),\n            'currency': undefined,\n            'status': this.safeString (transaction, 'status'),\n            'updated': undefined,\n            'comment': undefined,\n            'internal': internal,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 4023,
        "line_end": 4038,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          }
        ],
        "examples": [
          "{'response': {'type': 'default'}, 'status': 'ok'}"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // {'response': {'type': 'default'}, 'status': 'ok'}\n        //\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': undefined,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': 'ok',\n        };\n    }"
      }
    ],
    "independentreserve": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 401,
        "line_end": 413,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'CurrencyCode');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'AvailableBalance');\n            account['total'] = this.safeString (balance, 'TotalBalance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 970,
        "line_end": 988,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'Tag')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        Tag: '3307446684',\n        DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',\n        LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',\n        NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'\n    }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        Tag: '3307446684',\n        //        DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',\n        //        LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',\n        //        NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'\n        //    }\n        //\n        const address = this.safeString (depositAddress, 'DepositAddress');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeString (currency, 'code'),\n            'network': undefined,\n            'address': address,\n            'tag': this.safeString (depositAddress, 'Tag'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 529,
        "line_end": 641,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'OrderGuid')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'Price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'Value')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'AvgPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString2 (order, 'VolumeOrdered', 'Volume')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.safeString (order, 'Outstanding')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'Status'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'rate': feeRate,\n                'cost': feeCost,\n                'currency': base,\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "feeRate",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "base",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"OrderGuid\": \"c7347e4c-b865-4c94-8f74-d934d4b0b177\",\n         \"CreatedTimestampUtc\": \"2014-09-23T12:39:34.3817763Z\",\n         \"Type\": \"MarketBid\",\n         \"VolumeOrdered\": 5.0,\n         \"VolumeFilled\": 5.0,\n         \"Price\": null,\n         \"AvgPrice\": 100.0,\n         \"ReservedAmount\": 0.0,\n         \"Status\": \"Filled\",\n         \"PrimaryCurrencyCode\": \"Xbt\",\n         \"SecondaryCurrencyCode\": \"Usd\"\n     }",
          "{\n         \"OrderGuid\": \"b8f7ad89-e4e4-4dfe-9ea3-514d38b5edb3\",\n         \"CreatedTimestampUtc\": \"2020-09-08T03:04:18.616367Z\",\n         \"OrderType\": \"LimitOffer\",\n         \"Volume\": 0.0005,\n         \"Outstanding\": 0.0005,\n         \"Price\": 113885.83,\n         \"AvgPrice\": 113885.83,\n         \"Value\": 56.94,\n         \"Status\": \"Open\",\n         \"PrimaryCurrencyCode\": \"Xbt\",\n         \"SecondaryCurrencyCode\": \"Usd\",\n         \"FeePercent\": 0.005,\n     }",
          "{\n        \"AvgPrice\": 455.48,\n        \"CreatedTimestampUtc\": \"2022-08-05T06:42:11.3032208Z\",\n        \"OrderGuid\": \"719c495c-a39e-4884-93ac-280b37245037\",\n        \"Price\": 485.76,\n        \"PrimaryCurrencyCode\": \"Xbt\",\n        \"ReservedAmount\": 0.358,\n        \"SecondaryCurrencyCode\": \"Usd\",\n        \"Status\": \"Cancelled\",\n        \"Type\": \"LimitOffer\",\n        \"VolumeFilled\": 0,\n        \"VolumeOrdered\": 0.358\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrder\n        //\n        //     {\n        //         \"OrderGuid\": \"c7347e4c-b865-4c94-8f74-d934d4b0b177\",\n        //         \"CreatedTimestampUtc\": \"2014-09-23T12:39:34.3817763Z\",\n        //         \"Type\": \"MarketBid\",\n        //         \"VolumeOrdered\": 5.0,\n        //         \"VolumeFilled\": 5.0,\n        //         \"Price\": null,\n        //         \"AvgPrice\": 100.0,\n        //         \"ReservedAmount\": 0.0,\n        //         \"Status\": \"Filled\",\n        //         \"PrimaryCurrencyCode\": \"Xbt\",\n        //         \"SecondaryCurrencyCode\": \"Usd\"\n        //     }\n        //\n        // fetchOpenOrders & fetchClosedOrders\n        //\n        //     {\n        //         \"OrderGuid\": \"b8f7ad89-e4e4-4dfe-9ea3-514d38b5edb3\",\n        //         \"CreatedTimestampUtc\": \"2020-09-08T03:04:18.616367Z\",\n        //         \"OrderType\": \"LimitOffer\",\n        //         \"Volume\": 0.0005,\n        //         \"Outstanding\": 0.0005,\n        //         \"Price\": 113885.83,\n        //         \"AvgPrice\": 113885.83,\n        //         \"Value\": 56.94,\n        //         \"Status\": \"Open\",\n        //         \"PrimaryCurrencyCode\": \"Xbt\",\n        //         \"SecondaryCurrencyCode\": \"Usd\",\n        //         \"FeePercent\": 0.005,\n        //     }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"AvgPrice\": 455.48,\n        //        \"CreatedTimestampUtc\": \"2022-08-05T06:42:11.3032208Z\",\n        //        \"OrderGuid\": \"719c495c-a39e-4884-93ac-280b37245037\",\n        //        \"Price\": 485.76,\n        //        \"PrimaryCurrencyCode\": \"Xbt\",\n        //        \"ReservedAmount\": 0.358,\n        //        \"SecondaryCurrencyCode\": \"Usd\",\n        //        \"Status\": \"Cancelled\",\n        //        \"Type\": \"LimitOffer\",\n        //        \"VolumeFilled\": 0,\n        //        \"VolumeOrdered\": 0.358\n        //    }\n        let symbol = undefined;\n        const baseId = this.safeString (order, 'PrimaryCurrencyCode');\n        const quoteId = this.safeString (order, 'SecondaryCurrencyCode');\n        let base = undefined;\n        let quote = undefined;\n        if ((baseId !== undefined) && (quoteId !== undefined)) {\n            base = this.safeCurrencyCode (baseId);\n            quote = this.safeCurrencyCode (quoteId);\n            symbol = base + '/' + quote;\n        } else if (market !== undefined) {\n            symbol = market['symbol'];\n            base = market['base'];\n            quote = market['quote'];\n        }\n        let orderType = this.safeString2 (order, 'Type', 'OrderType');\n        let side = undefined;\n        if (orderType !== undefined) {\n            if (orderType.indexOf ('Bid') >= 0) {\n                side = 'buy';\n            } else if (orderType.indexOf ('Offer') >= 0) {\n                side = 'sell';\n            }\n            if (orderType.indexOf ('Market') >= 0) {\n                orderType = 'market';\n            } else if (orderType.indexOf ('Limit') >= 0) {\n                orderType = 'limit';\n            }\n        }\n        const timestamp = this.parse8601 (this.safeString (order, 'CreatedTimestampUtc'));\n        const filled = this.safeString (order, 'VolumeFilled');\n        const feeRate = this.safeString (order, 'FeePercent');\n        let feeCost = undefined;\n        if (feeRate !== undefined && filled !== undefined) {\n            feeCost = Precise.stringMul (feeRate, filled);\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'OrderGuid'),\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': orderType,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': this.safeString (order, 'Price'),\n            'triggerPrice': undefined,\n            'cost': this.safeString (order, 'Value'),\n            'average': this.safeString (order, 'AvgPrice'),\n            'amount': this.safeString2 (order, 'VolumeOrdered', 'Volume'),\n            'filled': filled,\n            'remaining': this.safeString (order, 'Outstanding'),\n            'status': this.parseOrderStatus (this.safeString (order, 'Status')),\n            'fee': {\n                'rate': feeRate,\n                'cost': feeCost,\n                'currency': base,\n            },\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 643,
        "line_end": 654,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Open': 'open',\n            'PartiallyFilled': 'open',\n            'Filled': 'closed',\n            'PartiallyFilledAndCancelled': 'canceled',\n            'Cancelled': 'canceled',\n            'PartiallyFilledAndExpired': 'canceled',\n            'Expired': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 449,
        "line_end": 495,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'DayHighestPrice')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'DayLowestPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'CurrentHighestBidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'CurrentLowestOfferPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'DayAvgPrice')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'DayVolumeXbtInSecondaryCurrrency')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"DayHighestPrice\":43489.49,\n     \"DayLowestPrice\":41998.32,\n     \"DayAvgPrice\":42743.9,\n     \"DayVolumeXbt\":44.54515625000,\n     \"DayVolumeXbtInSecondaryCurrrency\":0.12209818,\n     \"CurrentLowestOfferPrice\":43619.64,\n     \"CurrentHighestBidPrice\":43153.58,\n     \"LastPrice\":43378.43,\n     \"PrimaryCurrencyCode\":\"Xbt\",\n     \"SecondaryCurrencyCode\":\"Usd\",\n     \"CreatedTimestampUtc\":\"2022-01-14T22:52:29.5029223Z\"\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // {\n        //     \"DayHighestPrice\":43489.49,\n        //     \"DayLowestPrice\":41998.32,\n        //     \"DayAvgPrice\":42743.9,\n        //     \"DayVolumeXbt\":44.54515625000,\n        //     \"DayVolumeXbtInSecondaryCurrrency\":0.12209818,\n        //     \"CurrentLowestOfferPrice\":43619.64,\n        //     \"CurrentHighestBidPrice\":43153.58,\n        //     \"LastPrice\":43378.43,\n        //     \"PrimaryCurrencyCode\":\"Xbt\",\n        //     \"SecondaryCurrencyCode\":\"Usd\",\n        //     \"CreatedTimestampUtc\":\"2022-01-14T22:52:29.5029223Z\"\n        // }\n        const timestamp = this.parse8601 (this.safeString (ticker, 'CreatedTimestampUtc'));\n        const baseId = this.safeString (ticker, 'PrimaryCurrencyCode');\n        const quoteId = this.safeString (ticker, 'SecondaryCurrencyCode');\n        let defaultMarketId = undefined;\n        if ((baseId !== undefined) && (quoteId !== undefined)) {\n            defaultMarketId = baseId + '/' + quoteId;\n        }\n        market = this.safeMarket (defaultMarketId, market, '/');\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'LastPrice');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'DayHighestPrice'),\n            'low': this.safeString (ticker, 'DayLowestPrice'),\n            'bid': this.safeString (ticker, 'CurrentHighestBidPrice'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'CurrentLowestOfferPrice'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': this.safeString (ticker, 'DayAvgPrice'),\n            'baseVolume': this.safeString (ticker, 'DayVolumeXbtInSecondaryCurrrency'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 763,
        "line_end": 802,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        const timestamp = this.parse8601 (trade['TradeTimestampUtc']);\n        const id = this.safeString (trade, 'TradeGuid');\n        const orderId = this.safeString (trade, 'OrderGuid');\n        const priceString = this.safeString2 (trade, 'Price', 'SecondaryCurrencyTradePrice');\n        const amountString = this.safeString2 (trade, 'VolumeTraded', 'PrimaryCurrencyAmount');\n        const price = this.parseNumber (priceString);\n        const amount = this.parseNumber (amountString);\n        const cost = this.parseNumber (Precise.stringMul (priceString, amountString));\n        const baseId = this.safeString (trade, 'PrimaryCurrencyCode');\n        const quoteId = this.safeString (trade, 'SecondaryCurrencyCode');\n        let marketId = undefined;\n        if ((baseId !== undefined) && (quoteId !== undefined)) {\n            marketId = baseId + '/' + quoteId;\n        }\n        const symbol = this.safeSymbol (marketId, market, '/');\n        let side = this.safeString (trade, 'OrderType');\n        if (side !== undefined) {\n            if (side.indexOf ('Bid') >= 0) {\n                side = 'buy';\n            } else if (side.indexOf ('Offer') >= 0) {\n                side = 'sell';\n            }\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1043,
        "line_end": 1094,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'TransactionGuid')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'withdraw'",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (amount, 'Total')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.safeString (transaction, 'Status')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.safeNumber (amount, 'Fee'),\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "internal",
            "value": "false",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (amount, 'Fee')",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"TransactionGuid\": \"dc932e19-562b-4c50-821e-a73fd048b93b\",\n        \"PrimaryCurrencyCode\": \"Bch\",\n        \"CreatedTimestampUtc\": \"2020-04-01T05:26:30.5093622+00:00\",\n        \"Amount\": {\n            \"Total\": 0.1231,\n            \"Fee\": 0.0001\n        },\n        \"Destination\": {\n            \"Address\": \"bc1qhpqxkjpvgkckw530yfmxyr53c94q8f4273a7ez\",\n            \"Tag\": null\n        },\n        \"Status\": \"Pending\",\n        \"Transaction\": null\n    }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //    {\n        //        \"TransactionGuid\": \"dc932e19-562b-4c50-821e-a73fd048b93b\",\n        //        \"PrimaryCurrencyCode\": \"Bch\",\n        //        \"CreatedTimestampUtc\": \"2020-04-01T05:26:30.5093622+00:00\",\n        //        \"Amount\": {\n        //            \"Total\": 0.1231,\n        //            \"Fee\": 0.0001\n        //        },\n        //        \"Destination\": {\n        //            \"Address\": \"bc1qhpqxkjpvgkckw530yfmxyr53c94q8f4273a7ez\",\n        //            \"Tag\": null\n        //        },\n        //        \"Status\": \"Pending\",\n        //        \"Transaction\": null\n        //    }\n        //\n        const amount = this.safeDict (transaction, 'Amount');\n        const destination = this.safeDict (transaction, 'Destination');\n        const currencyId = this.safeString (transaction, 'PrimaryCurrencyCode');\n        const datetime = this.safeString (transaction, 'CreatedTimestampUtc');\n        const address = this.safeString (destination, 'Address');\n        const tag = this.safeString (destination, 'Tag');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'TransactionGuid'),\n            'txid': undefined,\n            'type': 'withdraw',\n            'currency': code,\n            'network': undefined,\n            'amount': this.safeNumber (amount, 'Total'),\n            'status': this.safeString (transaction, 'Status'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tag,\n            'updated': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.safeNumber (amount, 'Fee'),\n                'rate': undefined,\n            },\n            'internal': false,\n        } as Transaction;\n    }"
      }
    ],
    "indodax": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 434,
        "line_end": 454,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response, 'return', {});\n        const free = this.safeValue (balances, 'balance', {});\n        const used = this.safeValue (balances, 'balance_hold', {});\n        const timestamp = this.safeTimestamp (balances, 'server_time');\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const currencyIds = Object.keys (free);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (free, currencyId);\n            account['used'] = this.safeString (used, currencyId);\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 678,
        "line_end": 697,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"Time\": 1708416900,\n         \"Open\": 51707.52,\n         \"High\": 51707.52,\n         \"Low\": 51707.52,\n         \"Close\": 51707.52,\n         \"Volume\": \"0\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"Time\": 1708416900,\n        //         \"Open\": 51707.52,\n        //         \"High\": 51707.52,\n        //         \"Low\": 51707.52,\n        //         \"Close\": 51707.52,\n        //         \"Volume\": \"0\"\n        //     }\n        //\n        return [\n            this.safeTimestamp (ohlcv, 'Time'),\n            this.safeNumber (ohlcv, 'Open'),\n            this.safeNumber (ohlcv, 'High'),\n            this.safeNumber (ohlcv, 'Low'),\n            this.safeNumber (ohlcv, 'Close'),\n            this.safeNumber (ohlcv, 'Volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 757,
        "line_end": 853,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'client_order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"12345\",\n         \"submit_time\": \"1392228122\",\n         \"price\": \"8000000\",\n         \"type\": \"sell\",\n         \"order_ltc\": \"100000000\",\n         \"remain_ltc\": \"100000000\"\n     }",
          "{\n       \"order_id\": \"49326856\",\n       \"type\": \"sell\",\n       \"price\": \"1000000000\",\n       \"submit_time\": \"1618314671\",\n       \"finish_time\": \"1618314671\",\n       \"status\": \"filled\",\n       \"order_xrp\": \"30.45000000\",\n       \"remain_xrp\": \"0.00000000\"\n     }",
          "{\n        \"order_id\": 666883,\n        \"client_order_id\": \"clientx-sj82ks82j\",\n        \"type\": \"sell\",\n        \"pair\": \"btc_idr\",\n        \"balance\": {\n            \"idr\": \"33605800\",\n            \"btc\": \"0.00000000\",\n            ...\n            \"frozen_idr\": \"0\",\n            \"frozen_btc\": \"0.00000000\",\n            ...\n        }\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"order_id\": \"12345\",\n        //         \"submit_time\": \"1392228122\",\n        //         \"price\": \"8000000\",\n        //         \"type\": \"sell\",\n        //         \"order_ltc\": \"100000000\",\n        //         \"remain_ltc\": \"100000000\"\n        //     }\n        //\n        // market closed orders - note that the price is very high\n        // and does not reflect actual price the order executed at\n        //\n        //     {\n        //       \"order_id\": \"49326856\",\n        //       \"type\": \"sell\",\n        //       \"price\": \"1000000000\",\n        //       \"submit_time\": \"1618314671\",\n        //       \"finish_time\": \"1618314671\",\n        //       \"status\": \"filled\",\n        //       \"order_xrp\": \"30.45000000\",\n        //       \"remain_xrp\": \"0.00000000\"\n        //     }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"order_id\": 666883,\n        //        \"client_order_id\": \"clientx-sj82ks82j\",\n        //        \"type\": \"sell\",\n        //        \"pair\": \"btc_idr\",\n        //        \"balance\": {\n        //            \"idr\": \"33605800\",\n        //            \"btc\": \"0.00000000\",\n        //            ...\n        //            \"frozen_idr\": \"0\",\n        //            \"frozen_btc\": \"0.00000000\",\n        //            ...\n        //        }\n        //    }\n        //\n        let side = undefined;\n        if ('type' in order) {\n            side = order['type'];\n        }\n        const status = this.parseOrderStatus (this.safeString (order, 'status', 'open'));\n        let symbol = undefined;\n        let cost = undefined;\n        const price = this.safeString (order, 'price');\n        let amount = undefined;\n        let remaining = undefined;\n        const marketId = this.safeString (order, 'pair');\n        market = this.safeMarket (marketId, market);\n        if (market !== undefined) {\n            symbol = market['symbol'];\n            let quoteId = market['quoteId'];\n            let baseId = market['baseId'];\n            if ((market['quoteId'] === 'idr') && ('order_rp' in order)) {\n                quoteId = 'rp';\n            }\n            if ((market['baseId'] === 'idr') && ('remain_rp' in order)) {\n                baseId = 'rp';\n            }\n            cost = this.safeString (order, 'order_' + quoteId);\n            if (!cost) {\n                amount = this.safeString (order, 'order_' + baseId);\n                remaining = this.safeString (order, 'remain_' + baseId);\n            }\n        }\n        const timestamp = this.safeInteger (order, 'submit_time');\n        const fee = undefined;\n        const id = this.safeString (order, 'order_id');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': this.safeString (order, 'client_order_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': 'limit',\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': cost,\n            'average': undefined,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        });\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 748,
        "line_end": 755,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'open': 'open',\n            'filled': 'closed',\n            'cancelled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 520,
        "line_end": 560,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, baseVolume)",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, quoteVolume)",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"high\":\"0.01951\",\n         \"low\":\"0.01877\",\n         \"vol_eth\":\"39.38839319\",\n         \"vol_btc\":\"0.75320886\",\n         \"last\":\"0.01896\",\n         \"buy\":\"0.01896\",\n         \"sell\":\"0.019\",\n         \"server_time\":1565248908\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"high\":\"0.01951\",\n        //         \"low\":\"0.01877\",\n        //         \"vol_eth\":\"39.38839319\",\n        //         \"vol_btc\":\"0.75320886\",\n        //         \"last\":\"0.01896\",\n        //         \"buy\":\"0.01896\",\n        //         \"sell\":\"0.019\",\n        //         \"server_time\":1565248908\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeTimestamp (ticker, 'server_time');\n        const baseVolume = 'vol_' + market['baseId'].toLowerCase ();\n        const quoteVolume = 'vol_' + market['quoteId'].toLowerCase ();\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, baseVolume),\n            'quoteVolume': this.safeString (ticker, quoteVolume),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 638,
        "line_end": 655,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (trade, 'tid')",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (trade, 'type')",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'amount')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        const timestamp = this.safeTimestamp (trade, 'date');\n        return this.safeTrade ({\n            'id': this.safeString (trade, 'tid'),\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': this.safeSymbol (undefined, market),\n            'type': undefined,\n            'side': this.safeString (trade, 'type'),\n            'order': undefined,\n            'takerOrMaker': undefined,\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString (trade, 'amount'),\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1256,
        "line_end": 1332,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'withdraw_id', 'deposit_id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString2 (transaction, 'txid', 'tx')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (transaction, 'withdraw_address')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumberN (transaction, [ 'amount', 'withdraw_amount', 'deposit_amount' ])",
            "comment": null
          },
          {
            "key": "type",
            "value": "(depositId === undefined) ? 'withdraw' : 'deposit'",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'withdraw_memo')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"success\": 1,\n         \"status\": \"approved\",\n         \"withdraw_currency\": \"xrp\",\n         \"withdraw_address\": \"rwWr7KUZ3ZFwzgaDGjKBysADByzxvohQ3C\",\n         \"withdraw_amount\": \"10000.00000000\",\n         \"fee\": \"2.00000000\",\n         \"amount_after_fee\": \"9998.00000000\",\n         \"submit_time\": \"1509469200\",\n         \"withdraw_id\": \"xrp-12345\",\n         \"txid\": \"\",\n         \"withdraw_memo\": \"123123\"\n     }",
          "{\n         \"status\": \"success\",\n         \"type\": \"coupon\",\n         \"rp\": \"115205\",\n         \"fee\": \"500\",\n         \"amount\": \"114705\",\n         \"submit_time\": \"1539844166\",\n         \"success_time\": \"1539844189\",\n         \"withdraw_id\": \"1783717\",\n         \"tx\": \"BTC-IDR-RDTVVO2P-ETD0EVAW-VTNZGMIR-HTNTUAPI-84ULM9OI\",\n         \"sender\": \"boris\",\n         \"used_by\": \"viginia88\"\n     }",
          "{\n         \"status\": \"success\",\n         \"btc\": \"0.00118769\",\n         \"amount\": \"0.00118769\",\n         \"success_time\": \"1539529208\",\n         \"deposit_id\": \"3602369\",\n         \"tx\": \"c816aeb35a5b42f389970325a32aff69bb6b2126784dcda8f23b9dd9570d6573\"\n     },"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"success\": 1,\n        //         \"status\": \"approved\",\n        //         \"withdraw_currency\": \"xrp\",\n        //         \"withdraw_address\": \"rwWr7KUZ3ZFwzgaDGjKBysADByzxvohQ3C\",\n        //         \"withdraw_amount\": \"10000.00000000\",\n        //         \"fee\": \"2.00000000\",\n        //         \"amount_after_fee\": \"9998.00000000\",\n        //         \"submit_time\": \"1509469200\",\n        //         \"withdraw_id\": \"xrp-12345\",\n        //         \"txid\": \"\",\n        //         \"withdraw_memo\": \"123123\"\n        //     }\n        //\n        // transHistory\n        //\n        //     {\n        //         \"status\": \"success\",\n        //         \"type\": \"coupon\",\n        //         \"rp\": \"115205\",\n        //         \"fee\": \"500\",\n        //         \"amount\": \"114705\",\n        //         \"submit_time\": \"1539844166\",\n        //         \"success_time\": \"1539844189\",\n        //         \"withdraw_id\": \"1783717\",\n        //         \"tx\": \"BTC-IDR-RDTVVO2P-ETD0EVAW-VTNZGMIR-HTNTUAPI-84ULM9OI\",\n        //         \"sender\": \"boris\",\n        //         \"used_by\": \"viginia88\"\n        //     }\n        //\n        //     {\n        //         \"status\": \"success\",\n        //         \"btc\": \"0.00118769\",\n        //         \"amount\": \"0.00118769\",\n        //         \"success_time\": \"1539529208\",\n        //         \"deposit_id\": \"3602369\",\n        //         \"tx\": \"c816aeb35a5b42f389970325a32aff69bb6b2126784dcda8f23b9dd9570d6573\"\n        //     },\n        const status = this.safeString (transaction, 'status');\n        const timestamp = this.safeTimestamp2 (transaction, 'success_time', 'submit_time');\n        const depositId = this.safeString (transaction, 'deposit_id');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': this.safeCurrencyCode (undefined, currency),\n                'cost': feeCost,\n                'rate': undefined,\n            };\n        }\n        return {\n            'id': this.safeString2 (transaction, 'withdraw_id', 'deposit_id'),\n            'txid': this.safeString2 (transaction, 'txid', 'tx'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': this.safeString (transaction, 'withdraw_address'),\n            'addressTo': undefined,\n            'amount': this.safeNumberN (transaction, [ 'amount', 'withdraw_amount', 'deposit_amount' ]),\n            'type': (depositId === undefined) ? 'withdraw' : 'deposit',\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'status': this.parseTransactionStatus (status),\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': this.safeString (transaction, 'withdraw_memo'),\n            'internal': undefined,\n            'fee': fee,\n            'info': transaction,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1334,
        "line_end": 1339,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'success': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "kraken": [
      {
        "name": "parseAccountType",
        "signature": "parseAccountType (account)",
        "line_start": 3470,
        "line_end": 3477,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseAccountType (account) {\n        const accountByType: Dict = {\n            'spot': 'Spot Wallet',\n            'swap': 'Futures Wallet',\n            'future': 'Futures Wallet',\n        };\n        return this.safeString (accountByType, account, account);\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1568,
        "line_end": 1586,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response, 'result', {});\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const currencyIds = Object.keys (balances);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const balance = this.safeValue (balances, currencyId, {});\n            const account = this.account ();\n            account['used'] = this.safeString (balance, 'hold_trade');\n            account['total'] = this.safeString (balance, 'balance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBidAsk",
        "signature": "parseBidAsk (bidask, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2)",
        "line_start": 968,
        "line_end": 973,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBidAsk (bidask, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2) {\n        const price = this.safeNumber (bidask, priceKey);\n        const amount = this.safeNumber (bidask, amountKey);\n        const timestamp = this.safeInteger (bidask, 2);\n        return [ price, amount, timestamp ];\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 3291,
        "line_end": 3310,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\":\"0x77b5051f97efa9cc52c9ad5b023a53fc15c200d3\",\n         \"expiretm\":\"0\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\":\"0x77b5051f97efa9cc52c9ad5b023a53fc15c200d3\",\n        //         \"expiretm\":\"0\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const tag = this.safeString (depositAddress, 'tag');\n        currency = this.safeCurrency (undefined, currency);\n        const code = currency['code'];\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': undefined,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1222,
        "line_end": 1275,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "referenceAccount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'balance')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (item, 'fee'),\n                'currency': code,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (item, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         'LTFK7F-N2CUX-PNY4SX': {\n             \"refid\": \"TSJTGT-DT7WN-GPPQMJ\",\n             \"time\":  1520102320.555,\n             \"type\": \"trade\",\n             \"aclass\": \"currency\",\n             \"asset\": \"XETH\",\n             \"amount\": \"0.1087194600\",\n             \"fee\": \"0.0000000000\",\n             \"balance\": \"0.2855851000\"\n         },\n         ...\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         'LTFK7F-N2CUX-PNY4SX': {\n        //             \"refid\": \"TSJTGT-DT7WN-GPPQMJ\",\n        //             \"time\":  1520102320.555,\n        //             \"type\": \"trade\",\n        //             \"aclass\": \"currency\",\n        //             \"asset\": \"XETH\",\n        //             \"amount\": \"0.1087194600\",\n        //             \"fee\": \"0.0000000000\",\n        //             \"balance\": \"0.2855851000\"\n        //         },\n        //         ...\n        //     }\n        //\n        const id = this.safeString (item, 'id');\n        let direction = undefined;\n        const account = undefined;\n        const referenceId = this.safeString (item, 'refid');\n        const referenceAccount = undefined;\n        const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n        const currencyId = this.safeString (item, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        let amount = this.safeString (item, 'amount');\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringAbs (amount);\n        } else {\n            direction = 'in';\n        }\n        const timestamp = this.safeIntegerProduct (item, 'time', 1000);\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': direction,\n            'account': account,\n            'referenceId': referenceId,\n            'referenceAccount': referenceAccount,\n            'type': type,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'before': undefined,\n            'after': this.safeNumber (item, 'balance'),\n            'status': 'ok',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': {\n                'cost': this.safeNumber (item, 'fee'),\n                'currency': code,\n            },\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1211,
        "line_end": 1220,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'trade': 'trade',\n            'withdrawal': 'transaction',\n            'deposit': 'transaction',\n            'transfer': 'transfer',\n            'margin': 'margin',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseNetwork",
        "signature": "parseNetwork (network)",
        "line_start": 2874,
        "line_end": 2877,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseNetwork (network) {\n        const withdrawMethods = this.safeValue (this.options, 'withdrawMethods', {});\n        return this.safeString (withdrawMethods, network, network);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1134,
        "line_end": 1155,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591475640,\n         \"0.02500\",\n         \"0.02500\",\n         \"0.02500\",\n         \"0.02500\",\n         \"0.02500\",\n         \"9.12201000\",\n         5\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1591475640,\n        //         \"0.02500\",\n        //         \"0.02500\",\n        //         \"0.02500\",\n        //         \"0.02500\",\n        //         \"0.02500\",\n        //         \"9.12201000\",\n        //         5\n        //     ]\n        //\n        return [\n            this.safeTimestamp (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 6),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1851,
        "line_end": 2108,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "finalType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "isPostOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool2 (order, 'reduceOnly', 'reduce_only')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "id",
            "value": "rawTrade",
            "comment": null
          },
          {
            "key": "orderId",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "{}",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"descr\": {\n            \"order\": \"buy 0.02100000 ETHUSDT @ limit 330.00\" // limit orders\n                     \"buy 0.12345678 ETHUSDT @ market\" // market order\n                     \"sell 0.28002676 ETHUSDT @ stop loss 0.0123 -> limit 0.0.1222\" // stop order\n                     \"sell 0.00100000 ETHUSDT @ stop loss 2677.00 -> limit 2577.00 with 5:1 leverage\"\n                     \"buy 0.10000000 LTCUSDT @ take profit 75.00000 -> limit 74.00000\"\n                     \"sell 10.00000000 XRPEUR @ trailing stop +50.0000%\" // trailing stop\n         },\n         \"txid\": [ 'OEKVV2-IH52O-TPL6GZ' ]\n     }",
          "{\n         \"amend_id\": \"TJSMEH-AA67V-YUSQ6O\"\n     }",
          "{\n         \"order_id\": \"OXM2QD-EALR2-YBAVEU\"\n     }",
          "{\n         \"amend_id\": \"TJSMEH-AA67V-YUSQ6O\",\n         \"order_id\": \"OXM2QD-EALR2-YBAVEU\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"descr\": {\n        //            \"order\": \"buy 0.02100000 ETHUSDT @ limit 330.00\" // limit orders\n        //                     \"buy 0.12345678 ETHUSDT @ market\" // market order\n        //                     \"sell 0.28002676 ETHUSDT @ stop loss 0.0123 -> limit 0.0.1222\" // stop order\n        //                     \"sell 0.00100000 ETHUSDT @ stop loss 2677.00 -> limit 2577.00 with 5:1 leverage\"\n        //                     \"buy 0.10000000 LTCUSDT @ take profit 75.00000 -> limit 74.00000\"\n        //                     \"sell 10.00000000 XRPEUR @ trailing stop +50.0000%\" // trailing stop\n        //         },\n        //         \"txid\": [ 'OEKVV2-IH52O-TPL6GZ' ]\n        //     }\n        //\n        // editOrder\n        //\n        //     {\n        //         \"amend_id\": \"TJSMEH-AA67V-YUSQ6O\"\n        //     }\n        //\n        //  ws - createOrder\n        //     {\n        //         \"order_id\": \"OXM2QD-EALR2-YBAVEU\"\n        //     }\n        //\n        //  ws - editOrder\n        //     {\n        //         \"amend_id\": \"TJSMEH-AA67V-YUSQ6O\",\n        //         \"order_id\": \"OXM2QD-EALR2-YBAVEU\"\n        //     }\n        //\n        //  {\n        //      \"error\": [],\n        //      \"result\": {\n        //          \"open\": {\n        //              \"OXVPSU-Q726F-L3SDEP\": {\n        //                  \"refid\": null,\n        //                  \"userref\": 0,\n        //                  \"status\": \"open\",\n        //                  \"opentm\": 1706893367.4656649,\n        //                  \"starttm\": 0,\n        //                  \"expiretm\": 0,\n        //                  \"descr\": {\n        //                      \"pair\": \"XRPEUR\",\n        //                      \"type\": \"sell\",\n        //                      \"ordertype\": \"trailing-stop\",\n        //                      \"price\": \"+50.0000%\",\n        //                      \"price2\": \"0\",\n        //                      \"leverage\": \"none\",\n        //                      \"order\": \"sell 10.00000000 XRPEUR @ trailing stop +50.0000%\",\n        //                      \"close\": \"\"\n        //                  },\n        //                  \"vol\": \"10.00000000\",\n        //                  \"vol_exec\": \"0.00000000\",\n        //                  \"cost\": \"0.00000000\",\n        //                  \"fee\": \"0.00000000\",\n        //                  \"price\": \"0.00000000\",\n        //                  \"stopprice\": \"0.23424000\",\n        //                  \"limitprice\": \"0.46847000\",\n        //                  \"misc\": \"\",\n        //                  \"oflags\": \"fciq\",\n        //                  \"trigger\": \"index\"\n        //              }\n        //      }\n        //  }\n        //\n        // fetchOpenOrders\n        //\n        //      {\n        //         \"refid\": null,\n        //         \"userref\": null,\n        //         \"cl_ord_id\": \"1234\",\n        //         \"status\": \"open\",\n        //         \"opentm\": 1733815269.370054,\n        //         \"starttm\": 0,\n        //         \"expiretm\": 0,\n        //         \"descr\": {\n        //             \"pair\": \"XBTUSD\",\n        //             \"type\": \"buy\",\n        //             \"ordertype\": \"limit\",\n        //             \"price\": \"70000.0\",\n        //             \"price2\": \"0\",\n        //             \"leverage\": \"none\",\n        //             \"order\": \"buy 0.00010000 XBTUSD @ limit 70000.0\",\n        //             \"close\": \"\"\n        //         },\n        //         \"vol\": \"0.00010000\",\n        //         \"vol_exec\": \"0.00000000\",\n        //         \"cost\": \"0.00000\",\n        //         \"fee\": \"0.00000\",\n        //         \"price\": \"0.00000\",\n        //         \"stopprice\": \"0.00000\",\n        //         \"limitprice\": \"0.00000\",\n        //         \"misc\": \"\",\n        //         \"oflags\": \"fciq\"\n        //     }\n        //\n        const isUsingCost = this.safeBool (order, 'usingCost', false);\n        order = this.omit (order, 'usingCost');\n        const description = this.safeDict (order, 'descr', {});\n        const orderDescriptionObj = this.safeDict (order, 'descr'); // can be null\n        let orderDescription = undefined;\n        if (orderDescriptionObj !== undefined) {\n            orderDescription = this.safeString (orderDescriptionObj, 'order');\n        } else {\n            orderDescription = this.safeString (order, 'descr');\n        }\n        let side = undefined;\n        let rawType = undefined;\n        let marketId = undefined;\n        let price = undefined;\n        let amount = undefined;\n        let cost = undefined;\n        let triggerPrice = undefined;\n        if (orderDescription !== undefined) {\n            const parts = orderDescription.split (' ');\n            side = this.safeString (parts, 0);\n            if (!isUsingCost) {\n                amount = this.safeString (parts, 1);\n            } else {\n                cost = this.safeString (parts, 1);\n            }\n            marketId = this.safeString (parts, 2);\n            const part4 = this.safeString (parts, 4);\n            const part5 = this.safeString (parts, 5);\n            if (part4 === 'limit' || part4 === 'market') {\n                rawType = part4; // eg, limit, market\n            } else {\n                rawType = part4 + ' ' + part5; // eg. stop loss, take profit, trailing stop\n            }\n            if (rawType === 'stop loss' || rawType === 'take profit') {\n                triggerPrice = this.safeString (parts, 6);\n                price = this.safeString (parts, 9);\n            } else if (rawType === 'limit') {\n                price = this.safeString (parts, 5);\n            }\n        }\n        side = this.safeString (description, 'type', side);\n        rawType = this.safeString (description, 'ordertype', rawType); // orderType has dash, e.g. trailing-stop\n        marketId = this.safeString (description, 'pair', marketId);\n        const foundMarket = this.findMarketByAltnameOrId (marketId);\n        let symbol = undefined;\n        if (foundMarket !== undefined) {\n            market = foundMarket;\n        } else if (marketId !== undefined) {\n            // delisted market ids go here\n            market = this.getDelistedMarketById (marketId);\n        }\n        const timestamp = this.safeTimestamp (order, 'opentm');\n        amount = this.safeString (order, 'vol', amount);\n        const filled = this.safeString (order, 'vol_exec');\n        let fee = undefined;\n        // kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled\n        // const cost = this.safeString (order, 'cost');\n        price = this.safeString (description, 'price', price);\n        // when type = trailing stop returns price = '+50.0000%'\n        if ((price !== undefined) && (price.endsWith ('%') || Precise.stringEquals (price, '0.00000') || Precise.stringEquals (price, '0'))) {\n            price = undefined; // this is not the price we want\n        }\n        if (price === undefined) {\n            price = this.safeString (description, 'price2');\n            price = this.safeString2 (order, 'limitprice', 'price', price);\n        }\n        const flags = this.safeString (order, 'oflags', '');\n        let isPostOnly = flags.indexOf ('post') > -1;\n        const average = this.safeNumber (order, 'price');\n        if (market !== undefined) {\n            symbol = market['symbol'];\n            if ('fee' in order) {\n                const feeCost = this.safeString (order, 'fee');\n                fee = {\n                    'cost': feeCost,\n                    'rate': undefined,\n                };\n                if (flags.indexOf ('fciq') >= 0) {\n                    fee['currency'] = market['quote'];\n                } else if (flags.indexOf ('fcib') >= 0) {\n                    fee['currency'] = market['base'];\n                }\n            }\n        }\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        let id = this.safeStringN (order, [ 'id', 'txid', 'order_id', 'amend_id' ]);\n        if ((id === undefined) || (id.startsWith ('['))) {\n            const txid = this.safeList (order, 'txid');\n            id = this.safeString (txid, 0);\n        }\n        const userref = this.safeString (order, 'userref');\n        const clientOrderId = this.safeString (order, 'cl_ord_id', userref);\n        const rawTrades = this.safeValue (order, 'trades', []);\n        const trades = [];\n        for (let i = 0; i < rawTrades.length; i++) {\n            const rawTrade = rawTrades[i];\n            if (typeof rawTrade === 'string') {\n                trades.push (this.safeTrade ({ 'id': rawTrade, 'orderId': id, 'symbol': symbol, 'info': {}}));\n            } else {\n                trades.push (rawTrade);\n            }\n        }\n        // as mentioned in #24192 PR, this field is not something consistent/actual\n        // triggerPrice = this.omitZero (this.safeString (order, 'stopprice', triggerPrice));\n        let stopLossPrice = undefined;\n        let takeProfitPrice = undefined;\n        // the dashed strings are not provided from fields (eg. fetch order)\n        // while spaced strings from \"order\" sentence (when other fields not available)\n        if (rawType !== undefined) {\n            if (rawType.startsWith ('take-profit')) {\n                takeProfitPrice = this.safeString (description, 'price');\n                price = this.omitZero (this.safeString (description, 'price2'));\n            } else if (rawType.startsWith ('stop-loss')) {\n                stopLossPrice = this.safeString (description, 'price');\n                price = this.omitZero (this.safeString (description, 'price2'));\n            } else if (rawType === 'take profit') {\n                takeProfitPrice = triggerPrice;\n            } else if (rawType === 'stop loss') {\n                stopLossPrice = triggerPrice;\n            }\n        }\n        let finalType = this.parseOrderType (rawType);\n        // unlike from endpoints which provide eg: \"take-profit-limit\"\n        // for \"space-delimited\" orders we dont have market/limit suffixes, their format is\n        // eg: `stop loss > limit 123`, so we need to parse them manually\n        if (this.inArray (finalType, [ 'stop loss', 'take profit' ])) {\n            finalType = (price === undefined) ? 'market' : 'limit';\n        }\n        const amendId = this.safeString (order, 'amend_id');\n        if (amendId !== undefined) {\n            isPostOnly = undefined;\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': finalType,\n            'timeInForce': undefined,\n            'postOnly': isPostOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'average': average,\n            'remaining': undefined,\n            'reduceOnly': this.safeBool2 (order, 'reduceOnly', 'reduce_only'),\n            'fee': fee,\n            'trades': trades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1824,
        "line_end": 1837,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'pending': 'open', // order pending book entry\n            'open': 'open',\n            'pending_new': 'open',\n            'new': 'open',\n            'partially_filled': 'open',\n            'filled': 'closed',\n            'closed': 'closed',\n            'canceled': 'canceled',\n            'expired': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1839,
        "line_end": 1849,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            // we dont add \"space\" delimited orders here (eg. stop loss) because they need separate parsing\n            'take-profit': 'market',\n            'stop-loss': 'market',\n            'stop-loss-limit': 'limit',\n            'take-profit-limit': 'limit',\n            'trailing-stop-limit': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3421,
        "line_end": 3468,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'net')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'vol')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'margin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n                 \"pair\": \"ETHUSDT\",\n                 \"positions\": \"1\",\n                 \"type\": \"buy\",\n                 \"leverage\": \"2.00000\",\n                 \"cost\": \"28.49800\",\n                 \"fee\": \"0.07979\",\n                 \"vol\": \"0.02000000\",\n                 \"vol_closed\": \"0.00000000\",\n                 \"margin\": \"14.24900\"\n             }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //             {\n        //                 \"pair\": \"ETHUSDT\",\n        //                 \"positions\": \"1\",\n        //                 \"type\": \"buy\",\n        //                 \"leverage\": \"2.00000\",\n        //                 \"cost\": \"28.49800\",\n        //                 \"fee\": \"0.07979\",\n        //                 \"vol\": \"0.02000000\",\n        //                 \"vol_closed\": \"0.00000000\",\n        //                 \"margin\": \"14.24900\"\n        //             }\n        //\n        const marketId = this.safeString (position, 'pair');\n        const rawSide = this.safeString (position, 'type');\n        const side = (rawSide === 'buy') ? 'long' : 'short';\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeSymbol (marketId, market),\n            'notional': undefined,\n            'marginMode': undefined,\n            'liquidationPrice': undefined,\n            'entryPrice': undefined,\n            'unrealizedPnl': this.safeNumber (position, 'net'),\n            'realizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'vol'),\n            'contractSize': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': side,\n            'hedged': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': undefined,\n            'initialMargin': this.safeNumber (position, 'margin'),\n            'initialMarginPercentage': undefined,\n            'leverage': this.safeNumber (position, 'leverage'),\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1026,
        "line_end": 1074,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (high, 1)",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (low, 1)",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (bid, 0)",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (bid, 2)",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ask, 0)",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ask, 2)",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'o')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"a\":[\"2432.77000\",\"1\",\"1.000\"],\n         \"b\":[\"2431.37000\",\"2\",\"2.000\"],\n         \"c\":[\"2430.58000\",\"0.04408910\"],\n         \"v\":[\"4147.94474901\",\"8896.96086304\"],\n         \"p\":[\"2456.22239\",\"2568.63032\"],\n         \"t\":[3907,10056],\n         \"l\":[\"2302.18000\",\"2302.18000\"],\n         \"h\":[\"2621.14000\",\"2860.01000\"],\n         \"o\":\"2571.56000\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"a\":[\"2432.77000\",\"1\",\"1.000\"],\n        //         \"b\":[\"2431.37000\",\"2\",\"2.000\"],\n        //         \"c\":[\"2430.58000\",\"0.04408910\"],\n        //         \"v\":[\"4147.94474901\",\"8896.96086304\"],\n        //         \"p\":[\"2456.22239\",\"2568.63032\"],\n        //         \"t\":[3907,10056],\n        //         \"l\":[\"2302.18000\",\"2302.18000\"],\n        //         \"h\":[\"2621.14000\",\"2860.01000\"],\n        //         \"o\":\"2571.56000\"\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const v = this.safeValue (ticker, 'v', []);\n        const baseVolume = this.safeString (v, 1);\n        const p = this.safeValue (ticker, 'p', []);\n        const vwap = this.safeString (p, 1);\n        const quoteVolume = Precise.stringMul (baseVolume, vwap);\n        const c = this.safeValue (ticker, 'c', []);\n        const last = this.safeString (c, 0);\n        const high = this.safeValue (ticker, 'h', []);\n        const low = this.safeValue (ticker, 'l', []);\n        const bid = this.safeValue (ticker, 'b', []);\n        const ask = this.safeValue (ticker, 'a', []);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString (high, 1),\n            'low': this.safeString (low, 1),\n            'bid': this.safeString (bid, 0),\n            'bidVolume': this.safeString (bid, 2),\n            'ask': this.safeString (ask, 0),\n            'askVolume': this.safeString (ask, 2),\n            'vwap': vwap,\n            'open': this.safeString (ticker, 'o'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1365,
        "line_end": 1514,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "[\n         \"0.032310\", // price\n         \"4.28169434\", // amount\n         1541390792.763, // timestamp\n         \"s\", // sell or buy\n         \"l\", // limit or market\n         \"\"\n     ]",
          "{\n         \"id\": 'TIMIRG-WUNNE-RRJ6GT', // injected from outside\n         \"ordertxid\": 'OQRPN2-LRHFY-HIFA7D',\n         \"postxid\": 'TKH2SE-M7IF5-CFI7LT',\n         \"pair\": 'USDCUSDT',\n         \"time\": 1586340086.457,\n         \"type\": 'sell',\n         \"ordertype\": 'market',\n         \"price\": '0.99860000',\n         \"cost\": '22.16892001',\n         \"fee\": '0.04433784',\n         \"vol\": '22.20000000',\n         \"margin\": '0.00000000',\n         \"misc\": ''\n     }",
          "{\n         \"ordertxid\": \"OSJVN7-A2AE-63WZV\",\n         \"postxid\": \"TBP7O6-PNXI-CONU\",\n         \"pair\": \"XXBTZUSD\",\n         \"time\": 1710429248.3052235,\n         \"type\": \"sell\",\n         \"ordertype\": \"liquidation market\",\n         \"price\": \"72026.50000\",\n         \"cost\": \"7.20265\",\n         \"fee\": \"0.01873\",\n         \"vol\": \"0.00010000\",\n         \"margin\": \"1.44053\",\n         \"leverage\": \"5\",\n         \"misc\": \"closing\",\n         \"trade_id\": 68230622,\n         \"maker\": false\n     }",
          "{\n         \"symbol\": \"BTC/USD\",\n         \"side\": \"buy\",\n         \"price\": 109601.2,\n         \"qty\": 0.04561994,\n         \"ord_type\": \"market\",\n         \"trade_id\": 83449369,\n         \"timestamp\": \"2025-05-27T11:24:03.847761Z\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     [\n        //         \"0.032310\", // price\n        //         \"4.28169434\", // amount\n        //         1541390792.763, // timestamp\n        //         \"s\", // sell or buy\n        //         \"l\", // limit or market\n        //         \"\"\n        //     ]\n        //\n        // fetchOrderTrades (private)\n        //\n        //     {\n        //         \"id\": 'TIMIRG-WUNNE-RRJ6GT', // injected from outside\n        //         \"ordertxid\": 'OQRPN2-LRHFY-HIFA7D',\n        //         \"postxid\": 'TKH2SE-M7IF5-CFI7LT',\n        //         \"pair\": 'USDCUSDT',\n        //         \"time\": 1586340086.457,\n        //         \"type\": 'sell',\n        //         \"ordertype\": 'market',\n        //         \"price\": '0.99860000',\n        //         \"cost\": '22.16892001',\n        //         \"fee\": '0.04433784',\n        //         \"vol\": '22.20000000',\n        //         \"margin\": '0.00000000',\n        //         \"misc\": ''\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"ordertxid\": \"OSJVN7-A2AE-63WZV\",\n        //         \"postxid\": \"TBP7O6-PNXI-CONU\",\n        //         \"pair\": \"XXBTZUSD\",\n        //         \"time\": 1710429248.3052235,\n        //         \"type\": \"sell\",\n        //         \"ordertype\": \"liquidation market\",\n        //         \"price\": \"72026.50000\",\n        //         \"cost\": \"7.20265\",\n        //         \"fee\": \"0.01873\",\n        //         \"vol\": \"0.00010000\",\n        //         \"margin\": \"1.44053\",\n        //         \"leverage\": \"5\",\n        //         \"misc\": \"closing\",\n        //         \"trade_id\": 68230622,\n        //         \"maker\": false\n        //     }\n        //\n        // watchTrades\n        //\n        //     {\n        //         \"symbol\": \"BTC/USD\",\n        //         \"side\": \"buy\",\n        //         \"price\": 109601.2,\n        //         \"qty\": 0.04561994,\n        //         \"ord_type\": \"market\",\n        //         \"trade_id\": 83449369,\n        //         \"timestamp\": \"2025-05-27T11:24:03.847761Z\"\n        //     }\n        //\n        let timestamp = undefined;\n        let datetime = undefined;\n        let side = undefined;\n        let type = undefined;\n        let price = undefined;\n        let amount = undefined;\n        let id = undefined;\n        let orderId = undefined;\n        let fee = undefined;\n        let symbol = undefined;\n        if (Array.isArray (trade)) {\n            timestamp = this.safeTimestamp (trade, 2);\n            side = (trade[3] === 's') ? 'sell' : 'buy';\n            type = (trade[4] === 'l') ? 'limit' : 'market';\n            price = this.safeString (trade, 0);\n            amount = this.safeString (trade, 1);\n            const tradeLength = trade.length;\n            if (tradeLength > 6) {\n                id = this.safeString (trade, 6); // artificially added as per #1794\n            }\n        } else if (typeof trade === 'string') {\n            id = trade;\n        } else if ('ordertxid' in trade) {\n            const marketId = this.safeString (trade, 'pair');\n            const foundMarket = this.findMarketByAltnameOrId (marketId);\n            if (foundMarket !== undefined) {\n                market = foundMarket;\n            } else if (marketId !== undefined) {\n                // delisted market ids go here\n                market = this.getDelistedMarketById (marketId);\n            }\n            orderId = this.safeString (trade, 'ordertxid');\n            id = this.safeString2 (trade, 'id', 'postxid');\n            timestamp = this.safeTimestamp (trade, 'time');\n            side = this.safeString (trade, 'type');\n            type = this.safeString (trade, 'ordertype');\n            price = this.safeString (trade, 'price');\n            amount = this.safeString (trade, 'vol');\n            if ('fee' in trade) {\n                let currency = undefined;\n                if (market !== undefined) {\n                    currency = market['quote'];\n                }\n                fee = {\n                    'cost': this.safeString (trade, 'fee'),\n                    'currency': currency,\n                };\n            }\n        } else {\n            symbol = this.safeString (trade, 'symbol');\n            datetime = this.safeString (trade, 'timestamp');\n            id = this.safeString (trade, 'trade_id');\n            side = this.safeString (trade, 'side');\n            type = this.safeString (trade, 'ord_type');\n            price = this.safeString (trade, 'price');\n            amount = this.safeString (trade, 'qty');\n        }\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        const cost = this.safeString (trade, 'cost');\n        const maker = this.safeBool (trade, 'maker');\n        let takerOrMaker = undefined;\n        if (maker !== undefined) {\n            takerOrMaker = maker ? 'maker' : 'taker';\n        }\n        if (datetime === undefined) {\n            datetime = this.iso8601 (timestamp);\n        } else {\n            timestamp = this.parse8601 (datetime);\n        }\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (response, market)",
        "line_start": 953,
        "line_end": 966,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (symbolMakerFee, 'fee'), '100'))",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (symbolTakerFee, 'fee'), '100'))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "true",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "true",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (response, market) {\n        const makerFees = this.safeValue (response, 'fees_maker', {});\n        const takerFees = this.safeValue (response, 'fees', {});\n        const symbolMakerFee = this.safeValue (makerFees, market['id'], {});\n        const symbolTakerFee = this.safeValue (takerFees, market['id'], {});\n        return {\n            'info': response,\n            'symbol': market['symbol'],\n            'maker': this.parseNumber (Precise.stringDiv (this.safeString (symbolMakerFee, 'fee'), '100')),\n            'taker': this.parseNumber (Precise.stringDiv (this.safeString (symbolTakerFee, 'fee'), '100')),\n            'percentage': true,\n            'tierBased': true,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2879,
        "line_end": 2987,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.parseNetwork (this.safeString (transaction, 'network'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': feeCost,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"method\": \"Ether (Hex)\",\n         \"aclass\": \"currency\",\n         \"asset\": \"XETH\",\n         \"refid\": \"Q2CANKL-LBFVEE-U4Y2WQ\",\n         \"txid\": \"0x57fd704dab1a73c20e24c8696099b695d596924b401b261513cfdab23…\",\n         \"info\": \"0x615f9ba7a9575b0ab4d571b2b36b1b324bd83290\",\n         \"amount\": \"7.9999257900\",\n         \"fee\": \"0.0000000000\",\n         \"time\":  1529223212,\n         \"status\": \"Success\"\n     }",
          "{\n          \"type\": 'deposit',\n          \"method\": 'Fidor Bank AG (Wire Transfer)',\n          \"aclass\": 'currency',\n          \"asset\": 'ZEUR',\n          \"refid\": 'xxx-xxx-xxx',\n          \"txid\": '12341234',\n          \"info\": 'BANKCODEXXX',\n          \"amount\": '38769.08',\n          \"fee\": '0.0000',\n          \"time\": 1644306552,\n          \"status\": 'Success',\n          status-prop: 'on-hold'\n      }",
          "{\n         \"method\": \"Ether\",\n         \"aclass\": \"currency\",\n         \"asset\": \"XETH\",\n         \"refid\": \"A2BF34S-O7LBNQ-UE4Y4O\",\n         \"txid\": \"0x288b83c6b0904d8400ef44e1c9e2187b5c8f7ea3d838222d53f701a15b5c274d\",\n         \"info\": \"0x7cb275a5e07ba943fee972e165d80daa67cb2dd0\",\n         \"amount\": \"9.9950000000\",\n         \"fee\": \"0.0050000000\",\n         \"time\":  1530481750,\n         \"status\": \"Success\"\n         \"key\":\"Huobi wallet\",\n         \"network\":\"Tron\"\n         status-prop: 'on-hold' // this field might not be present in some cases\n     }",
          "{\n         \"refid\": \"AGBSO6T-UFMTTQ-I7KGS6\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"method\": \"Ether (Hex)\",\n        //         \"aclass\": \"currency\",\n        //         \"asset\": \"XETH\",\n        //         \"refid\": \"Q2CANKL-LBFVEE-U4Y2WQ\",\n        //         \"txid\": \"0x57fd704dab1a73c20e24c8696099b695d596924b401b261513cfdab23…\",\n        //         \"info\": \"0x615f9ba7a9575b0ab4d571b2b36b1b324bd83290\",\n        //         \"amount\": \"7.9999257900\",\n        //         \"fee\": \"0.0000000000\",\n        //         \"time\":  1529223212,\n        //         \"status\": \"Success\"\n        //     }\n        //\n        // there can be an additional 'status-prop' field present\n        // deposit pending review by exchange => 'on-hold'\n        // the deposit is initiated by the exchange => 'return'\n        //\n        //      {\n        //          \"type\": 'deposit',\n        //          \"method\": 'Fidor Bank AG (Wire Transfer)',\n        //          \"aclass\": 'currency',\n        //          \"asset\": 'ZEUR',\n        //          \"refid\": 'xxx-xxx-xxx',\n        //          \"txid\": '12341234',\n        //          \"info\": 'BANKCODEXXX',\n        //          \"amount\": '38769.08',\n        //          \"fee\": '0.0000',\n        //          \"time\": 1644306552,\n        //          \"status\": 'Success',\n        //          status-prop: 'on-hold'\n        //      }\n        //\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"method\": \"Ether\",\n        //         \"aclass\": \"currency\",\n        //         \"asset\": \"XETH\",\n        //         \"refid\": \"A2BF34S-O7LBNQ-UE4Y4O\",\n        //         \"txid\": \"0x288b83c6b0904d8400ef44e1c9e2187b5c8f7ea3d838222d53f701a15b5c274d\",\n        //         \"info\": \"0x7cb275a5e07ba943fee972e165d80daa67cb2dd0\",\n        //         \"amount\": \"9.9950000000\",\n        //         \"fee\": \"0.0050000000\",\n        //         \"time\":  1530481750,\n        //         \"status\": \"Success\"\n        //         \"key\":\"Huobi wallet\",\n        //         \"network\":\"Tron\"\n        //         status-prop: 'on-hold' // this field might not be present in some cases\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"refid\": \"AGBSO6T-UFMTTQ-I7KGS6\"\n        //     }\n        //\n        const id = this.safeString (transaction, 'refid');\n        const txid = this.safeString (transaction, 'txid');\n        const timestamp = this.safeTimestamp (transaction, 'time');\n        const currencyId = this.safeString (transaction, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const address = this.safeString (transaction, 'info');\n        const amount = this.safeNumber (transaction, 'amount');\n        let status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const statusProp = this.safeString (transaction, 'status-prop');\n        const isOnHoldDeposit = statusProp === 'on-hold';\n        const isCancellationRequest = statusProp === 'cancel-pending';\n        const isOnHoldWithdrawal = statusProp === 'onhold';\n        if (isOnHoldDeposit || isCancellationRequest || isOnHoldWithdrawal) {\n            status = 'pending';\n        }\n        const type = this.safeString (transaction, 'type'); // injected from the outside\n        let feeCost = this.safeNumber (transaction, 'fee');\n        if (feeCost === undefined) {\n            if (type === 'deposit') {\n                feeCost = 0;\n            }\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': this.parseNetwork (this.safeString (transaction, 'network')),\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'currency': code,\n                'cost': feeCost,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionsByType",
        "signature": "parseTransactionsByType (type, transactions, code: Str = undefined, since: Int = undefined, limit: Int = undefined)",
        "line_start": 2989,
        "line_end": 2998,
        "comment": null,
        "mappings": [
          {
            "key": "type",
            "value": "type",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransactionsByType (type, transactions, code: Str = undefined, since: Int = undefined, limit: Int = undefined) {\n        const result = [];\n        for (let i = 0; i < transactions.length; i++) {\n            const transaction = this.parseTransaction (this.extend ({\n                'type': type,\n            }, transactions[i]));\n            result.push (transaction);\n        }\n        return this.filterByCurrencySinceLimit (result, code, since, limit);\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2861,
        "line_end": 2872,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        // IFEX transaction states\n        const statuses: Dict = {\n            'Initial': 'pending',\n            'Pending': 'pending',\n            'Success': 'ok',\n            'Settled': 'pending',\n            'Failure': 'failed',\n            'Partial': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 3537,
        "line_end": 3562,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "refid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'sucess'",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"error\":[\n        ],\n        \"result\":{\n           \"refid\":\"BOIUSIF-M7DLMN-UXZ3P5\"\n        }\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //    {\n        //        \"error\":[\n        //        ],\n        //        \"result\":{\n        //           \"refid\":\"BOIUSIF-M7DLMN-UXZ3P5\"\n        //        }\n        //    }\n        //\n        const result = this.safeValue (transfer, 'result', {});\n        const refid = this.safeString (result, 'refid');\n        return {\n            'info': transfer,\n            'id': refid,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeString (currency, 'code'),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': 'sucess',\n        };\n    }"
      }
    ],
    "krakenfutures": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 2821,
        "line_end": 2846,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseAccount (account) {\n        const accountByType: Dict = {\n            'main': 'cash',\n            'funding': 'cash',\n            'future': 'cash',\n            'futures': 'cash',\n            'cashAccount': 'cash',\n            'multiCollateralMarginAccount': 'flex',\n            'multiCollateral': 'flex',\n            'multiCollateralMargin': 'flex',\n        };\n        if (account in accountByType) {\n            return accountByType[account];\n        } else if (account in this.markets) {\n            const market = this.market (account);\n            const marketId = market['id'];\n            const splitId = marketId.split ('_');\n            if (market['inverse']) {\n                return 'fi_' + this.safeString (splitId, 1);\n            } else {\n                return 'fv_' + this.safeString (splitId, 1);\n            }\n        } else {\n            return account;\n        }\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2323,
        "line_end": 2416,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"balances\": {\n            \"eur\": \"0.0\",\n            \"gbp\": \"0.0\",\n            \"bch\": \"0.0\",\n            \"xrp\": \"2.20188538338\",\n            \"usd\": \"0.0\",\n            \"eth\": \"0.0\",\n            \"usdt\": \"0.0\",\n            \"ltc\": \"0.0\",\n            \"usdc\": \"0.0\",\n            \"xbt\": \"0.0\"\n        },\n        \"type\": \"cashAccount\"\n    }",
          "{\n        \"auxiliary\": {\n            \"usd\": \"0\",\n            \"pv\": \"11.0\",\n            \"pnl\": \"0.0\",\n            \"af\": \"11.0\",\n            \"funding\": \"0.0\"\n        },\n        \"marginRequirements\": { im: '0.0', mm: '0.0', lt: '0.0', tt: \"0.0\" },\n        \"triggerEstimates\": { im: '0', mm: '0', lt: \"0\", tt: \"0\" },\n        \"balances\": { xrp: \"11.0\" },\n        \"currency\": \"xrp\",\n        \"type\": \"marginAccount\"\n    }",
          "{\n       \"currencies\": {\n            \"USDT\": {\n                \"quantity\": \"1\",\n                \"value\": \"1.0001\",\n                \"collateral\": \"0.9477197625\",\n                \"available\": \"1.0\"\n             }\n       },\n       \"initialMargin\": \"0.0\",\n       \"initialMarginWithOrders\": \"0.0\",\n       \"maintenanceMargin\": \"0.0\",\n       \"balanceValue\": \"1.0\",\n       \"portfolioValue\": \"1.0\",\n       \"collateralValue\": \"0.95\",\n       \"pnl\": \"0.0\",\n       \"unrealizedFunding\": \"0.0\",\n       \"totalUnrealized\": \"0.0\",\n       \"totalUnrealizedAsMargin\": \"0.0\",\n       \"availableMargin\": \"0.95\",\n       \"marginEquity\": \"0.95\",\n       \"type\": \"multiCollateralMarginAccount\"\n    }"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // cashAccount\n        //\n        //    {\n        //        \"balances\": {\n        //            \"eur\": \"0.0\",\n        //            \"gbp\": \"0.0\",\n        //            \"bch\": \"0.0\",\n        //            \"xrp\": \"2.20188538338\",\n        //            \"usd\": \"0.0\",\n        //            \"eth\": \"0.0\",\n        //            \"usdt\": \"0.0\",\n        //            \"ltc\": \"0.0\",\n        //            \"usdc\": \"0.0\",\n        //            \"xbt\": \"0.0\"\n        //        },\n        //        \"type\": \"cashAccount\"\n        //    }\n        //\n        // marginAccount e,g, fi_xrpusd\n        //\n        //    {\n        //        \"auxiliary\": {\n        //            \"usd\": \"0\",\n        //            \"pv\": \"11.0\",\n        //            \"pnl\": \"0.0\",\n        //            \"af\": \"11.0\",\n        //            \"funding\": \"0.0\"\n        //        },\n        //        \"marginRequirements\": { im: '0.0', mm: '0.0', lt: '0.0', tt: \"0.0\" },\n        //        \"triggerEstimates\": { im: '0', mm: '0', lt: \"0\", tt: \"0\" },\n        //        \"balances\": { xrp: \"11.0\" },\n        //        \"currency\": \"xrp\",\n        //        \"type\": \"marginAccount\"\n        //    }\n        //\n        // flex/multiCollateralMarginAccount\n        //\n        //    {\n        //       \"currencies\": {\n        //            \"USDT\": {\n        //                \"quantity\": \"1\",\n        //                \"value\": \"1.0001\",\n        //                \"collateral\": \"0.9477197625\",\n        //                \"available\": \"1.0\"\n        //             }\n        //       },\n        //       \"initialMargin\": \"0.0\",\n        //       \"initialMarginWithOrders\": \"0.0\",\n        //       \"maintenanceMargin\": \"0.0\",\n        //       \"balanceValue\": \"1.0\",\n        //       \"portfolioValue\": \"1.0\",\n        //       \"collateralValue\": \"0.95\",\n        //       \"pnl\": \"0.0\",\n        //       \"unrealizedFunding\": \"0.0\",\n        //       \"totalUnrealized\": \"0.0\",\n        //       \"totalUnrealizedAsMargin\": \"0.0\",\n        //       \"availableMargin\": \"0.95\",\n        //       \"marginEquity\": \"0.95\",\n        //       \"type\": \"multiCollateralMarginAccount\"\n        //    }\n        //\n        const accountType = this.safeString2 (response, 'accountType', 'type');\n        const isFlex = (accountType === 'multiCollateralMarginAccount');\n        const isCash = (accountType === 'cashAccount');\n        const balances = this.safeValue2 (response, 'balances', 'currencies', {});\n        const result: Dict = {};\n        const currencyIds = Object.keys (balances);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const balance = balances[currencyId];\n            const code = this.safeCurrencyCode (currencyId);\n            const splitCode = code.split ('_');\n            const codeLength = splitCode.length;\n            if (codeLength > 1) {\n                continue;   // Removes contract codes like PI_XRPUSD\n            }\n            const account = this.account ();\n            if (isFlex) {\n                account['total'] = this.safeString (balance, 'quantity');\n                account['free'] = this.safeString (balance, 'available');\n            } else if (isCash) {\n                account['used'] = '0.0';\n                account['total'] = balance;\n            } else {\n                const auxiliary = this.safeValue (response, 'auxiliary');\n                account['free'] = this.safeString (auxiliary, 'af');\n                account['total'] = this.safeString (auxiliary, 'pv');\n            }\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (ticker, market: Market = undefined): FundingRate",
        "line_start": 2448,
        "line_end": 2514,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPriceString)",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.parseNumber (fundingRateResult)",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.parseNumber (nextFundingRateResult)",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "'1h'",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PF_ENJUSD\",\n         \"last\": 0.0433,\n         \"lastTime\": \"2025-10-22T11:02:25.599Z\",\n         \"tag\": \"perpetual\",\n         \"pair\": \"ENJ:USD\",\n         \"markPrice\": 0.0434,\n         \"bid\": 0.0433,\n         \"bidSize\": 4609,\n         \"ask\": 0.0435,\n         \"askSize\": 4609,\n         \"vol24h\": 1696,\n         \"volumeQuote\": 73.5216,\n         \"openInterest\": 72513.00000000000,\n         \"open24h\": 0.0435,\n         \"high24h\": 0.0435,\n         \"low24h\": 0.0433,\n         \"lastSize\": 1272,\n         \"fundingRate\": -0.000000756414717067,\n         \"fundingRatePrediction\": 0.000000195218676,\n         \"suspended\": false,\n         \"indexPrice\": 0.043391,\n         \"postOnly\": false,\n         \"change24h\": -0.46\n     }"
        ],
        "source": "parseFundingRate (ticker, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"PF_ENJUSD\",\n        //         \"last\": 0.0433,\n        //         \"lastTime\": \"2025-10-22T11:02:25.599Z\",\n        //         \"tag\": \"perpetual\",\n        //         \"pair\": \"ENJ:USD\",\n        //         \"markPrice\": 0.0434,\n        //         \"bid\": 0.0433,\n        //         \"bidSize\": 4609,\n        //         \"ask\": 0.0435,\n        //         \"askSize\": 4609,\n        //         \"vol24h\": 1696,\n        //         \"volumeQuote\": 73.5216,\n        //         \"openInterest\": 72513.00000000000,\n        //         \"open24h\": 0.0435,\n        //         \"high24h\": 0.0435,\n        //         \"low24h\": 0.0433,\n        //         \"lastSize\": 1272,\n        //         \"fundingRate\": -0.000000756414717067,\n        //         \"fundingRatePrediction\": 0.000000195218676,\n        //         \"suspended\": false,\n        //         \"indexPrice\": 0.043391,\n        //         \"postOnly\": false,\n        //         \"change24h\": -0.46\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.symbol (marketId);\n        const timestamp = this.parse8601 (this.safeString (ticker, 'lastTime'));\n        const markPriceString = this.safeString (ticker, 'markPrice');\n        const fundingRateString = this.safeString (ticker, 'fundingRate');\n        let fundingRateResult = Precise.stringDiv (fundingRateString, markPriceString);\n        const nextFundingRateString = this.safeString (ticker, 'fundingRatePrediction');\n        let nextFundingRateResult = Precise.stringDiv (nextFundingRateString, markPriceString);\n        if (Precise.stringGt (fundingRateResult, '0.25')) {\n            fundingRateResult = '0.25';\n        } else if (Precise.stringLt (fundingRateResult, '-0.25')) {\n            fundingRateResult = '-0.25';\n        }\n        if (Precise.stringGt (nextFundingRateResult, '0.25')) {\n            nextFundingRateResult = '0.25';\n        } else if (Precise.stringLt (nextFundingRateResult, '-0.25')) {\n            nextFundingRateResult = '-0.25';\n        }\n        return {\n            'info': ticker,\n            'symbol': symbol,\n            'markPrice': this.parseNumber (markPriceString),\n            'indexPrice': this.safeNumber (ticker, 'indexPrice'),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.parseNumber (fundingRateResult),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': this.parseNumber (nextFundingRateResult),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': '1h',\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2994,
        "line_end": 3004,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'maxLeverage');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': undefined,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 2728,
        "line_end": 2796,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"symbol\": \"fi_ethusd_180928\",\n        \"type\": \"futures_inverse\",  // futures_vanilla  // spot index\n        \"underlying\": \"rr_ethusd\",\n        \"lastTradingTime\": \"2018-09-28T15:00:00.000Z\",\n        \"tickSize\": 0.1,\n        \"contractSize\": 1,\n        \"tradeable\": true,\n        \"marginLevels\": [\n            {\n                \"contracts\":0,\n                \"initialMargin\":0.02,\n                \"maintenanceMargin\":0.01\n            },\n            {\n                \"contracts\":250000,\n                \"initialMargin\":0.04,\n                \"maintenanceMargin\":0.02\n            },\n            ...\n        ],\n        \"isin\": \"GB00JVMLMP88\",\n        \"retailMarginLevels\": [\n            {\n                \"contracts\": 0,\n                \"initialMargin\": 0.5,\n                \"maintenanceMargin\": 0.25\n            }\n        ],\n        \"tags\": [],\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @method\n         * @ignore\n         * @param info Exchange market response for 1 market\n         * @param market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\": \"fi_ethusd_180928\",\n        //        \"type\": \"futures_inverse\",  // futures_vanilla  // spot index\n        //        \"underlying\": \"rr_ethusd\",\n        //        \"lastTradingTime\": \"2018-09-28T15:00:00.000Z\",\n        //        \"tickSize\": 0.1,\n        //        \"contractSize\": 1,\n        //        \"tradeable\": true,\n        //        \"marginLevels\": [\n        //            {\n        //                \"contracts\":0,\n        //                \"initialMargin\":0.02,\n        //                \"maintenanceMargin\":0.01\n        //            },\n        //            {\n        //                \"contracts\":250000,\n        //                \"initialMargin\":0.04,\n        //                \"maintenanceMargin\":0.02\n        //            },\n        //            ...\n        //        ],\n        //        \"isin\": \"GB00JVMLMP88\",\n        //        \"retailMarginLevels\": [\n        //            {\n        //                \"contracts\": 0,\n        //                \"initialMargin\": 0.5,\n        //                \"maintenanceMargin\": 0.25\n        //            }\n        //        ],\n        //        \"tags\": [],\n        //    }\n        //\n        const marginLevels = this.safeValue (info, 'marginLevels');\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const tiers = [];\n        if (marginLevels === undefined) {\n            return tiers;\n        }\n        for (let i = 0; i < marginLevels.length; i++) {\n            const tier = marginLevels[i];\n            const initialMargin = this.safeString (tier, 'initialMargin');\n            const minNotional = this.safeNumber2 (tier, 'numNonContractUnits', 'contracts');\n            if (i !== 0) {\n                const tiersLength = tiers.length;\n                const previousTier = tiers[tiersLength - 1];\n                previousTier['maxNotional'] = minNotional;\n            }\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': minNotional,\n                'maxNotional': undefined,\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintenanceMargin'),\n                'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMargin)),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 776,
        "line_end": 795,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"time\": 1645198500000,\n        \"open\": \"309.15000000000\",\n        \"high\": \"309.15000000000\",\n        \"low\": \"308.70000000000\",\n        \"close\": \"308.85000000000\",\n        \"volume\": 0\n    }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //    {\n        //        \"time\": 1645198500000,\n        //        \"open\": \"309.15000000000\",\n        //        \"high\": \"309.15000000000\",\n        //        \"low\": \"308.70000000000\",\n        //        \"close\": \"308.85000000000\",\n        //        \"volume\": 0\n        //    }\n        //\n        return [\n            this.safeInteger (ohlcv, 'time'),       // unix timestamp in milliseconds\n            this.safeNumber (ohlcv, 'open'),        // open price\n            this.safeNumber (ohlcv, 'high'),        // highest price\n            this.safeNumber (ohlcv, 'low'),         // lowest price\n            this.safeNumber (ohlcv, 'close'),       // close price\n            this.safeNumber (ohlcv, 'volume'),      // trading volume, undefined for mark or index price\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1701,
        "line_end": 2150,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (orderDictFromFetchOrder, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (orderDictFromFetchOrder, [ 'cliOrdId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.parse8601 (this.safeString (orderDictFromFetchOrder, 'lastUpdateTimestamp'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (this.safeString (orderDictFromFetchOrder, 'symbol'), market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool (orderDictFromFetchOrder, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (orderDictFromFetchOrder, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (orderDictFromFetchOrder, 'limitPrice')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (orderDictFromFetchOrder, 'quantity')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (orderDictFromFetchOrder, 'filled')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (innerStatus)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fees",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeStringN (details, [ 'clientOrderId', 'clientId', 'cliOrdId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "ts",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (ts)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (details, 'lastUpdateTimestamp', lastUpdateTimestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "type === 'post'",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeBool2 (details, 'reduceOnly', 'reduce_only')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower2 (details, 'side', 'direction')",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (details, 'triggerPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"order_id\": \"179f9af8-e45e-469d-b3e9-2fd4675cb7d0\",\n        \"status\": \"placed\",\n        \"receivedTime\": \"2019-09-05T16:33:50.734Z\",\n        \"orderEvents\": [\n            {\n                \"uid\": \"614a5298-0071-450f-83c6-0617ce8c6bc4\",\n                \"order\": {\n                    \"orderId\": \"179f9af8-e45e-469d-b3e9-2fd4675cb7d0\",\n                    \"cliOrdId\": null,\n                    \"type\": \"lmt\",\n                    \"symbol\": \"pi_xbtusd\",\n                    \"side\": \"buy\",\n                    \"quantity\": 10000,\n                    \"filled\": 0,\n                    \"limitPrice\": 9400,\n                    \"reduceOnly\": false,\n                    \"timestamp\": \"2019-09-05T16:33:50.734Z\",\n                    \"lastUpdateTimestamp\": \"2019-09-05T16:33:50.734Z\"\n                },\n                \"reducedQuantity\": null,\n                \"reason\": \"WOULD_NOT_REDUCE_POSITION\", // REJECTED\n                \"type\": \"PLACE\"\n            }\n        ]\n    }",
          "{\n        \"order_id\": \"1abfd3c6-af93-4b30-91cc-e4a93797f3f5\",\n        \"status\": \"placed\",\n        \"receivedTime\": \"2019-12-05T10:20:50.701Z\",\n        \"orderEvents\": [\n            {\n                \"orderTrigger\": {\n                    \"uid\": \"1abfd3c6-af93-4b30-91cc-e4a93797f3f5\",\n                    \"clientId\":null,\n                    \"type\": \"lmt\",                                // \"ioc\" if stop market\n                    \"symbol\": \"pi_xbtusd\",\n                    \"side\": \"buy\",\n                    \"quantity\":10,\n                    \"limitPrice\":15000,\n                    \"triggerPrice\":9500,\n                    \"triggerSide\": \"trigger_below\",\n                    \"triggerSignal\": \"mark_price\",\n                    \"reduceOnly\":false,\n                    \"timestamp\": \"2019-12-05T10:20:50.701Z\",\n                    \"lastUpdateTimestamp\": \"2019-12-05T10:20:50.701Z\"\n                },\n                \"type\": \"PLACE\"\n            }\n        ]\n    }",
          "{\n        \"order_id\": \"61ca5732-3478-42fe-8362-abbfd9465294\",\n        \"status\": \"placed\",\n        \"receivedTime\": \"2019-12-11T17:17:33.888Z\",\n        \"orderEvents\": [\n            {\n                \"executionId\": \"e1ec9f63-2338-4c44-b40a-43486c6732d7\",\n                \"price\": 7244.5,\n                \"amount\": 10,\n                \"orderPriorEdit\": null,\n                \"orderPriorExecution\": {\n                    \"orderId\": \"61ca5732-3478-42fe-8362-abbfd9465294\",\n                    \"cliOrdId\": null,\n                    \"type\": \"lmt\",\n                    \"symbol\": \"pi_xbtusd\",\n                    \"side\": \"buy\",\n                    \"quantity\": 10,\n                    \"filled\": 0,\n                    \"limitPrice\": 7500,\n                    \"reduceOnly\": false,\n                    \"timestamp\": \"2019-12-11T17:17:33.888Z\",\n                    \"lastUpdateTimestamp\": \"2019-12-11T17:17:33.888Z\"\n                },\n                \"takerReducedQuantity\": null,\n                \"type\": \"EXECUTION\"\n            }\n        ]\n    }",
          "{\n        \"status\": \"edited\",\n        \"orderId\": \"022774bc-2c4a-4f26-9317-436c8d85746d\",\n        \"receivedTime\": \"2019-09-05T16:47:47.521Z\",\n        \"orderEvents\": [\n            {\n                \"old\": {\n                    \"orderId\": \"022774bc-2c4a-4f26-9317-436c8d85746d\",\n                    \"cliOrdId\":null,\n                    \"type\": \"lmt\",\n                    \"symbol\": \"pi_xbtusd\",\n                    \"side\": \"buy\",\n                    \"quantity\":1000,\n                    \"filled\":0,\n                    \"limitPrice\":9400.0,\n                    \"reduceOnly\":false,\n                    \"timestamp\": \"2019-09-05T16:41:35.173Z\",\n                    \"lastUpdateTimestamp\": \"2019-09-05T16:41:35.173Z\"\n                },\n                \"new\": {\n                    \"orderId\": \"022774bc-2c4a-4f26-9317-436c8d85746d\",\n                    \"cliOrdId\": null,\n                    \"type\": \"lmt\",\n                    \"symbol\": \"pi_xbtusd\",\n                    \"side\": \"buy\",\n                    \"quantity\": 1501,\n                    \"filled\": 0,\n                    \"limitPrice\": 7200,\n                    \"reduceOnly\": false,\n                    \"timestamp\": \"2019-09-05T16:41:35.173Z\",\n                    \"lastUpdateTimestamp\": \"2019-09-05T16:47:47.519Z\"\n                },\n                \"reducedQuantity\": null,\n                \"type\": \"EDIT\"\n            }\n        ]\n    }",
          "{\n        \"status\": \"cancelled\",\n        \"orderEvents\": [\n            {\n                \"uid\": \"85c40002-3f20-4e87-9302-262626c3531b\",\n                \"order\": {\n                    \"orderId\": \"85c40002-3f20-4e87-9302-262626c3531b\",\n                    \"cliOrdId\": null,\n                    \"type\": \"lmt\",\n                    \"symbol\": \"pi_xbtusd\",\n                    \"side\": \"buy\",\n                    \"quantity\": 1000,\n                    \"filled\": 0,\n                    \"limitPrice\": 10144,\n                    \"stopPrice\": null,\n                    \"reduceOnly\": false,\n                    \"timestamp\": \"2019-08-01T15:26:27.790Z\"\n                },\n                \"type\": \"CANCEL\"\n            }\n        ]\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // LIMIT\n        //\n        //    {\n        //        \"order_id\": \"179f9af8-e45e-469d-b3e9-2fd4675cb7d0\",\n        //        \"status\": \"placed\",\n        //        \"receivedTime\": \"2019-09-05T16:33:50.734Z\",\n        //        \"orderEvents\": [\n        //            {\n        //                \"uid\": \"614a5298-0071-450f-83c6-0617ce8c6bc4\",\n        //                \"order\": {\n        //                    \"orderId\": \"179f9af8-e45e-469d-b3e9-2fd4675cb7d0\",\n        //                    \"cliOrdId\": null,\n        //                    \"type\": \"lmt\",\n        //                    \"symbol\": \"pi_xbtusd\",\n        //                    \"side\": \"buy\",\n        //                    \"quantity\": 10000,\n        //                    \"filled\": 0,\n        //                    \"limitPrice\": 9400,\n        //                    \"reduceOnly\": false,\n        //                    \"timestamp\": \"2019-09-05T16:33:50.734Z\",\n        //                    \"lastUpdateTimestamp\": \"2019-09-05T16:33:50.734Z\"\n        //                },\n        //                \"reducedQuantity\": null,\n        //                \"reason\": \"WOULD_NOT_REDUCE_POSITION\", // REJECTED\n        //                \"type\": \"PLACE\"\n        //            }\n        //        ]\n        //    }\n        //\n        // CONDITIONAL\n        //\n        //    {\n        //        \"order_id\": \"1abfd3c6-af93-4b30-91cc-e4a93797f3f5\",\n        //        \"status\": \"placed\",\n        //        \"receivedTime\": \"2019-12-05T10:20:50.701Z\",\n        //        \"orderEvents\": [\n        //            {\n        //                \"orderTrigger\": {\n        //                    \"uid\": \"1abfd3c6-af93-4b30-91cc-e4a93797f3f5\",\n        //                    \"clientId\":null,\n        //                    \"type\": \"lmt\",                                // \"ioc\" if stop market\n        //                    \"symbol\": \"pi_xbtusd\",\n        //                    \"side\": \"buy\",\n        //                    \"quantity\":10,\n        //                    \"limitPrice\":15000,\n        //                    \"triggerPrice\":9500,\n        //                    \"triggerSide\": \"trigger_below\",\n        //                    \"triggerSignal\": \"mark_price\",\n        //                    \"reduceOnly\":false,\n        //                    \"timestamp\": \"2019-12-05T10:20:50.701Z\",\n        //                    \"lastUpdateTimestamp\": \"2019-12-05T10:20:50.701Z\"\n        //                },\n        //                \"type\": \"PLACE\"\n        //            }\n        //        ]\n        //    }\n        //\n        // EXECUTION\n        //\n        //    {\n        //        \"order_id\": \"61ca5732-3478-42fe-8362-abbfd9465294\",\n        //        \"status\": \"placed\",\n        //        \"receivedTime\": \"2019-12-11T17:17:33.888Z\",\n        //        \"orderEvents\": [\n        //            {\n        //                \"executionId\": \"e1ec9f63-2338-4c44-b40a-43486c6732d7\",\n        //                \"price\": 7244.5,\n        //                \"amount\": 10,\n        //                \"orderPriorEdit\": null,\n        //                \"orderPriorExecution\": {\n        //                    \"orderId\": \"61ca5732-3478-42fe-8362-abbfd9465294\",\n        //                    \"cliOrdId\": null,\n        //                    \"type\": \"lmt\",\n        //                    \"symbol\": \"pi_xbtusd\",\n        //                    \"side\": \"buy\",\n        //                    \"quantity\": 10,\n        //                    \"filled\": 0,\n        //                    \"limitPrice\": 7500,\n        //                    \"reduceOnly\": false,\n        //                    \"timestamp\": \"2019-12-11T17:17:33.888Z\",\n        //                    \"lastUpdateTimestamp\": \"2019-12-11T17:17:33.888Z\"\n        //                },\n        //                \"takerReducedQuantity\": null,\n        //                \"type\": \"EXECUTION\"\n        //            }\n        //        ]\n        //    }\n        //\n        // EDIT ORDER\n        //\n        //    {\n        //        \"status\": \"edited\",\n        //        \"orderId\": \"022774bc-2c4a-4f26-9317-436c8d85746d\",\n        //        \"receivedTime\": \"2019-09-05T16:47:47.521Z\",\n        //        \"orderEvents\": [\n        //            {\n        //                \"old\": {\n        //                    \"orderId\": \"022774bc-2c4a-4f26-9317-436c8d85746d\",\n        //                    \"cliOrdId\":null,\n        //                    \"type\": \"lmt\",\n        //                    \"symbol\": \"pi_xbtusd\",\n        //                    \"side\": \"buy\",\n        //                    \"quantity\":1000,\n        //                    \"filled\":0,\n        //                    \"limitPrice\":9400.0,\n        //                    \"reduceOnly\":false,\n        //                    \"timestamp\": \"2019-09-05T16:41:35.173Z\",\n        //                    \"lastUpdateTimestamp\": \"2019-09-05T16:41:35.173Z\"\n        //                },\n        //                \"new\": {\n        //                    \"orderId\": \"022774bc-2c4a-4f26-9317-436c8d85746d\",\n        //                    \"cliOrdId\": null,\n        //                    \"type\": \"lmt\",\n        //                    \"symbol\": \"pi_xbtusd\",\n        //                    \"side\": \"buy\",\n        //                    \"quantity\": 1501,\n        //                    \"filled\": 0,\n        //                    \"limitPrice\": 7200,\n        //                    \"reduceOnly\": false,\n        //                    \"timestamp\": \"2019-09-05T16:41:35.173Z\",\n        //                    \"lastUpdateTimestamp\": \"2019-09-05T16:47:47.519Z\"\n        //                },\n        //                \"reducedQuantity\": null,\n        //                \"type\": \"EDIT\"\n        //            }\n        //        ]\n        //    }\n        //\n        // CANCEL ORDER\n        //\n        //    {\n        //        \"status\": \"cancelled\",\n        //        \"orderEvents\": [\n        //            {\n        //                \"uid\": \"85c40002-3f20-4e87-9302-262626c3531b\",\n        //                \"order\": {\n        //                    \"orderId\": \"85c40002-3f20-4e87-9302-262626c3531b\",\n        //                    \"cliOrdId\": null,\n        //                    \"type\": \"lmt\",\n        //                    \"symbol\": \"pi_xbtusd\",\n        //                    \"side\": \"buy\",\n        //                    \"quantity\": 1000,\n        //                    \"filled\": 0,\n        //                    \"limitPrice\": 10144,\n        //                    \"stopPrice\": null,\n        //                    \"reduceOnly\": false,\n        //                    \"timestamp\": \"2019-08-01T15:26:27.790Z\"\n        //                },\n        //                \"type\": \"CANCEL\"\n        //            }\n        //        ]\n        //    }\n        //\n        // cancelAllOrders\n        //\n        //    {\n        //        \"orderId\": \"85c40002-3f20-4e87-9302-262626c3531b\",\n        //        \"cliOrdId\": null,\n        //        \"type\": \"lmt\",\n        //        \"symbol\": \"pi_xbtusd\",\n        //        \"side\": \"buy\",\n        //        \"quantity\": 1000,\n        //        \"filled\": 0,\n        //        \"limitPrice\": 10144,\n        //        \"stopPrice\": null,\n        //        \"reduceOnly\": false,\n        //        \"timestamp\": \"2019-08-01T15:26:27.790Z\"\n        //    }\n        //\n        // FETCH OPEN ORDERS\n        //\n        //    {\n        //        \"order_id\": \"59302619-41d2-4f0b-941f-7e7914760ad3\",\n        //        \"symbol\": \"pi_xbtusd\",\n        //        \"side\": \"sell\",\n        //        \"orderType\": \"lmt\",\n        //        \"limitPrice\": 10640,\n        //        \"unfilledSize\": 304,\n        //        \"receivedTime\": \"2019-09-05T17:01:17.410Z\",\n        //        \"status\": \"untouched\",\n        //        \"filledSize\": 0,\n        //        \"reduceOnly\": true,\n        //        \"lastUpdateTime\": \"2019-09-05T17:01:17.410Z\"\n        //    }\n        //\n        // createOrders error\n        //    {\n        //       \"status\": \"requiredArgumentMissing\",\n        //       \"orderEvents\": []\n        //    }\n        // closed orders\n        //    {\n        //        uid: '2f00cd63-e61d-44f8-8569-adabde885941',\n        //        timestamp: '1707258274849',\n        //        event: {\n        //          OrderPlaced: {\n        //            order: {\n        //              uid: '85805e01-9eed-4395-8360-ed1a228237c9',\n        //              accountUid: '406142dd-7c5c-4a8b-acbc-5f16eca30009',\n        //              tradeable: 'PF_LTCUSD',\n        //              direction: 'Buy',\n        //              quantity: '0',\n        //              filled: '0.1',\n        //              timestamp: '1707258274849',\n        //              limitPrice: '69.2200000000',\n        //              orderType: 'IoC',\n        //              clientId: '',\n        //              reduceOnly: false,\n        //              lastUpdateTimestamp: '1707258274849'\n        //            },\n        //            reason: 'new_user_order',\n        //            reducedQuantity: '',\n        //            algoId: ''\n        //          }\n        //        }\n        //    }\n        //\n        //   {\n        //     uid: '85805e01-9eed-4395-8360-ed1a228237c9',\n        //     accountUid: '406142dd-7c5c-4a8b-acbc-5f16eca30009',\n        //     tradeable: 'PF_LTCUSD',\n        //     direction: 'Buy',\n        //     quantity: '0',\n        //     filled: '0.1',\n        //     timestamp: '1707258274849',\n        //     limitPrice: '69.2200000000',\n        //     orderType: 'IoC',\n        //     clientId: '',\n        //     reduceOnly: false,\n        //     lastUpdateTimestamp: '1707258274849',\n        //     status: 'closed'\n        //   }\n        //\n        // order: {\n        //     type: 'ORDER',\n        //     orderId: 'a111f276-95fd-47fc-b77b-709c5ab2e9e1',\n        //     cliOrdId: null,\n        //     symbol: 'PF_LTCUSD',\n        //     side: 'buy',\n        //     quantity: '0.1',\n        //     filled: '0',\n        //     limitPrice: '40',\n        //     reduceOnly: false,\n        //     timestamp: '2026-02-13T12:09:03.738Z',\n        //     lastUpdateTimestamp: '2026-02-13T12:09:03.738Z'\n        // },\n        //     status: 'ENTERED_BOOK',\n        //     updateReason: null,\n        //     error: null\n        // }\n        //\n        const orderDictFromFetchOrder = this.safeDict (order, 'order');\n        if (orderDictFromFetchOrder !== undefined) {\n            // order: {\n            //     type: 'ORDER',\n            //     orderId: 'a111f276-95fd-47fc-b77b-709c5ab2e9e1',\n            //     cliOrdId: null,\n            //     symbol: 'PF_LTCUSD',\n            //     side: 'buy',\n            //     quantity: '0.1',\n            //     filled: '0',\n            //     limitPrice: '40',\n            //     reduceOnly: false,\n            //     timestamp: '2026-02-13T12:09:03.738Z',\n            //     lastUpdateTimestamp: '2026-02-13T12:09:03.738Z'\n            // },\n            //     status: 'ENTERED_BOOK',\n            //     updateReason: null,\n            //     error: null\n            //\n            const datetime = this.safeString (orderDictFromFetchOrder, 'timestamp');\n            const innerStatus = this.safeString (order, 'status');\n            return this.safeOrder ({\n                'info': order,\n                'id': this.safeString (orderDictFromFetchOrder, 'orderId'),\n                'clientOrderId': this.safeStringN (orderDictFromFetchOrder, [ 'cliOrdId' ]),\n                'timestamp': this.parse8601 (datetime),\n                'datetime': datetime,\n                'lastTradeTimestamp': undefined,\n                'lastUpdateTimestamp': this.parse8601 (this.safeString (orderDictFromFetchOrder, 'lastUpdateTimestamp')),\n                'symbol': this.safeSymbol (this.safeString (orderDictFromFetchOrder, 'symbol'), market),\n                'type': undefined,\n                'timeInForce': undefined,\n                'postOnly': undefined,\n                'reduceOnly': this.safeBool (orderDictFromFetchOrder, 'reduceOnly'),\n                'side': this.safeString (orderDictFromFetchOrder, 'side'),\n                'price': this.safeString (orderDictFromFetchOrder, 'limitPrice'),\n                'triggerPrice': undefined,\n                'amount': this.safeString (orderDictFromFetchOrder, 'quantity'),\n                'cost': undefined,\n                'average': undefined,\n                'filled': this.safeString (orderDictFromFetchOrder, 'filled'),\n                'remaining': undefined,\n                'status': this.parseOrderStatus (innerStatus),\n                'fee': undefined,\n                'fees': undefined,\n                'trades': undefined,\n            });\n        }\n        const orderEvents = this.safeValue (order, 'orderEvents', []);\n        const errorStatus = this.safeString (order, 'status');\n        const orderEventsLength = orderEvents.length;\n        if (('orderEvents' in order) && (errorStatus !== undefined) && (orderEventsLength === 0)) {\n            // creteOrders error response\n            return this.safeOrder ({ 'info': order, 'status': 'rejected' });\n        }\n        let details = undefined;\n        let isPrior = false;\n        let fixed = false;\n        let statusId = undefined;\n        let price = undefined;\n        let trades = [];\n        if (orderEventsLength) {\n            const executions = [];\n            for (let i = 0; i < orderEvents.length; i++) {\n                const item = orderEvents[i];\n                if (this.safeString (item, 'type') === 'EXECUTION') {\n                    executions.push (item);\n                }\n                // Final order (after placement / editing / execution / canceling)\n                const orderTrigger = this.safeValue (item, 'orderTrigger');\n                if (details === undefined) {\n                    details = this.safeValue2 (item, 'new', 'order', orderTrigger);\n                    if (details !== undefined) {\n                        isPrior = false;\n                        fixed = true;\n                    } else if (!fixed) {\n                        const orderPriorExecution = this.safeValue (item, 'orderPriorExecution');\n                        details = this.safeValue2 (item, 'orderPriorExecution', 'orderPriorEdit');\n                        price = this.safeString (orderPriorExecution, 'limitPrice');\n                        if (details !== undefined) {\n                            isPrior = true;\n                        }\n                    }\n                }\n            }\n            trades = this.parseTrades (executions);\n            statusId = this.safeString (order, 'status');\n        }\n        if (details === undefined) {\n            details = order;\n        }\n        if (statusId === undefined) {\n            statusId = this.safeString (details, 'status');\n        }\n        // This may be incorrectly marked as \"open\" if only execution report is given,\n        // but will be fixed below\n        let status = this.parseOrderStatus (statusId);\n        let isClosed = this.inArray (status, [ 'canceled', 'rejected', 'closed' ]);\n        const marketId = this.safeString (details, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.parse8601 (this.safeString2 (details, 'timestamp', 'receivedTime'));\n        const lastUpdateTimestamp = this.parse8601 (this.safeString (details, 'lastUpdateTime'));\n        if (price === undefined) {\n            price = this.safeString (details, 'limitPrice');\n        }\n        let amount = this.safeString (details, 'quantity');\n        let filled = this.safeString2 (details, 'filledSize', 'filled', '0.0');\n        let remaining = this.safeString (details, 'unfilledSize');\n        let average = undefined;\n        let filled2 = '0.0';\n        const tradesLength = trades.length;\n        if (tradesLength > 0) {\n            let vwapSum = '0.0';\n            for (let i = 0; i < trades.length; i++) {\n                const trade = trades[i];\n                const tradeAmount = this.safeString (trade, 'amount');\n                const tradePrice = this.safeString (trade, 'price');\n                filled2 = Precise.stringAdd (filled2, tradeAmount);\n                vwapSum = Precise.stringAdd (vwapSum, Precise.stringMul (tradeAmount, tradePrice));\n            }\n            average = Precise.stringDiv (vwapSum, filled2);\n            if ((amount !== undefined) && (!isClosed) && isPrior && Precise.stringGe (filled2, amount)) {\n                status = 'closed';\n                isClosed = true;\n            }\n            if (isPrior) {\n                filled = Precise.stringAdd (filled, filled2);\n            } else {\n                filled = Precise.stringMax (filled, filled2);\n            }\n        }\n        if (remaining === undefined) {\n            if (isPrior) {\n                if (amount !== undefined) {\n                    // remaining amount before execution minus executed amount\n                    remaining = Precise.stringSub (amount, filled2);\n                }\n            } else {\n                remaining = amount;\n            }\n        }\n        // if fetchOpenOrders are parsed\n        if ((amount === undefined) && (!isPrior) && (remaining !== undefined)) {\n            amount = Precise.stringAdd (filled, remaining);\n        }\n        let cost = undefined;\n        if ((filled !== undefined) && (market !== undefined)) {\n            const whichPrice = (average !== undefined) ? average : price;\n            if (whichPrice !== undefined) {\n                if (market['linear']) {\n                    cost = Precise.stringMul (filled, whichPrice); // in quote\n                } else {\n                    cost = Precise.stringDiv (filled, whichPrice); // in base\n                }\n            }\n        }\n        let id = this.safeString2 (order, 'order_id', 'orderId');\n        if (id === undefined) {\n            id = this.safeString2 (details, 'orderId', 'uid');\n        }\n        const type = this.safeStringLower2 (details, 'type', 'orderType');\n        let timeInForce = 'gtc';\n        if (type === 'ioc' || this.parseOrderType (type) === 'market') {\n            timeInForce = 'ioc';\n        }\n        let symbol = this.safeString (market, 'symbol');\n        if ('tradeable' in details) {\n            symbol = this.safeSymbol (this.safeString (details, 'tradeable'), market);\n        }\n        const ts = this.safeInteger (details, 'timestamp', timestamp);\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': this.safeStringN (details, [ 'clientOrderId', 'clientId', 'cliOrdId' ]),\n            'timestamp': ts,\n            'datetime': this.iso8601 (ts),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (details, 'lastUpdateTimestamp', lastUpdateTimestamp),\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': type === 'post',\n            'reduceOnly': this.safeBool2 (details, 'reduceOnly', 'reduce_only'),\n            'side': this.safeStringLower2 (details, 'side', 'direction'),\n            'price': price,\n            'triggerPrice': this.safeString (details, 'triggerPrice'),\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': remaining,\n            'status': status,\n            'fee': undefined,\n            'fees': undefined,\n            'trades': trades,\n        });\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1663,
        "line_end": 1699,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'placed': 'open', // the order was placed successfully\n            'cancelled': 'canceled', // the order was cancelled successfully\n            'invalidOrderType': 'rejected', // the order was not placed because orderType is invalid\n            'invalidSide': 'rejected', // the order was not placed because side is invalid\n            'invalidSize': 'rejected', // the order was not placed because size is invalid\n            'invalidPrice': 'rejected', // the order was not placed because limitPrice and/or stopPrice are invalid\n            'insufficientAvailableFunds': 'rejected', // the order was not placed because available funds are insufficient\n            'selfFill': 'rejected', // the order was not placed because it would be filled against an existing order belonging to the same account\n            'tooManySmallOrders': 'rejected', // the order was not placed because the number of small open orders would exceed the permissible limit\n            'maxPositionViolation': 'rejected', // Order would cause you to exceed your maximum position in this contract.\n            'marketSuspended': 'rejected', // the order was not placed because the market is suspended\n            'marketInactive': 'rejected', // the order was not placed because the market is inactive\n            'clientOrderIdAlreadyExist': 'rejected', // the specified client id already exist\n            'clientOrderIdTooLong': 'rejected', // the client id is longer than the permissible limit\n            'outsidePriceCollar': 'rejected', // the limit order crosses the spread but is an order of magnitude away from the mark price - fat finger control\n            // Should the next two be 'expired' ?\n            'postWouldExecute': 'rejected', // the post-only order would be filled upon placement, thus is cancelled\n            'iocWouldNotExecute': 'rejected', // the immediate-or-cancel order would not execute.\n            'wouldNotReducePosition': 'rejected', // the reduce only order would not reduce position.\n            'edited': 'open', // the order was edited successfully\n            'orderForEditNotFound': 'rejected', // the requested order for edit has not been found\n            'orderForEditNotAStop': 'rejected', // the supplied stopPrice cannot be applied because order is not a stop order\n            'filled': 'closed', // the order was found completely filled and could not be cancelled\n            'notFound': 'rejected', // the order was not found, either because it had already been cancelled or it never existed\n            'untouched': 'open', // the entire size of the order is unfilled\n            'partiallyFilled': 'open', // the size of the order is partially but not entirely filled\n            'ENTERED_BOOK': 'open',\n            'FULLY_EXECUTED': 'closed',\n            'CANCELLED': 'canceled',\n            'TRIGGER_PLACED': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'UNTOUCHED': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (orderType)",
        "line_start": 1625,
        "line_end": 1633,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (orderType) {\n        const typesMap: Dict = {\n            'lmt': 'limit',\n            'mkt': 'market',\n            'post': 'limit',\n            'ioc': 'market',\n        };\n        return this.safeString (typesMap, orderType, orderType);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2612,
        "line_end": 2666,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'price')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'size')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "marginType",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (position, 'side')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"side\": \"long\",\n        \"symbol\": \"pi_xrpusd\",\n        \"price\": \"0.7533\",\n        \"fillTime\": \"2022-03-03T22:51:16.566Z\",\n        \"size\": \"230\",\n        \"unrealizedFunding\": \"-0.001878596918214635\"\n    }",
          "{\n        \"side\":\"long\",\n        \"symbol\":\"pf_ftmusd\",\n        \"price\":\"0.4921\",\n        \"fillTime\":\"2023-02-22T11:37:16.685Z\",\n        \"size\":\"1\",\n        \"unrealizedFunding\":\"-8.155240068885155E-8\",\n        \"pnlCurrency\":\"USD\",\n        \"maxFixedLeverage\":\"1.0\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        // cross\n        //    {\n        //        \"side\": \"long\",\n        //        \"symbol\": \"pi_xrpusd\",\n        //        \"price\": \"0.7533\",\n        //        \"fillTime\": \"2022-03-03T22:51:16.566Z\",\n        //        \"size\": \"230\",\n        //        \"unrealizedFunding\": \"-0.001878596918214635\"\n        //    }\n        //\n        // isolated\n        //    {\n        //        \"side\":\"long\",\n        //        \"symbol\":\"pf_ftmusd\",\n        //        \"price\":\"0.4921\",\n        //        \"fillTime\":\"2023-02-22T11:37:16.685Z\",\n        //        \"size\":\"1\",\n        //        \"unrealizedFunding\":\"-8.155240068885155E-8\",\n        //        \"pnlCurrency\":\"USD\",\n        //        \"maxFixedLeverage\":\"1.0\"\n        //    }\n        //\n        const leverage = this.safeNumber (position, 'maxFixedLeverage');\n        let marginType = 'cross';\n        if (leverage !== undefined) {\n            marginType = 'isolated';\n        }\n        const datetime = this.safeString (position, 'fillTime');\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': position,\n            'symbol': market['symbol'],\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': this.safeNumber (position, 'price'),\n            'notional': undefined,\n            'leverage': leverage,\n            'unrealizedPnl': undefined,\n            'contracts': this.safeNumber (position, 'size'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'marginRatio': undefined,\n            'liquidationPrice': undefined,\n            'markPrice': undefined,\n            'collateral': undefined,\n            'marginType': marginType,\n            'side': this.safeString (position, 'side'),\n            'percentage': undefined,\n        };\n    }"
      },
      {
        "name": "parsePositions",
        "signature": "parsePositions (response, symbols: Strings = undefined, params = {})",
        "line_start": 2602,
        "line_end": 2610,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parsePositions (response, symbols: Strings = undefined, params = {}) {\n        const result = [];\n        const positions = this.safeValue (response, 'openPositions');\n        for (let i = 0; i < positions.length; i++) {\n            const position = this.parsePosition (positions[i]);\n            result.push (position);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 640,
        "line_end": 711,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSize')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSize')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPrice')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"tag\": 'semiannual',  // 'month', 'quarter', \"perpetual\", \"semiannual\",\n        \"pair\": \"ETH:USD\",\n        \"symbol\": \"fi_ethusd_220624\",\n        \"markPrice\": \"2925.72\",\n        \"bid\": \"2923.8\",\n        \"bidSize\": \"16804\",\n        \"ask\": \"2928.65\",\n        \"askSize\": \"1339\",\n        \"vol24h\": \"860493\",\n        \"openInterest\": \"3023363.00000000\",\n        \"open24h\": \"3021.25\",\n        \"indexPrice\": \"2893.71\",\n        \"last\": \"2942.25\",\n        \"lastTime\": \"2022-02-18T14:08:15.578Z\",\n        \"lastSize\": \"151\",\n        \"suspended\": false\n    }",
          "{\n        \"symbol\": \"in_xbtusd\", // \"rr_xbtusd\",\n        \"last\": \"40411\",\n        \"lastTime\": \"2022-02-18T14:16:28.000Z\"\n    }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //    {\n        //        \"tag\": 'semiannual',  // 'month', 'quarter', \"perpetual\", \"semiannual\",\n        //        \"pair\": \"ETH:USD\",\n        //        \"symbol\": \"fi_ethusd_220624\",\n        //        \"markPrice\": \"2925.72\",\n        //        \"bid\": \"2923.8\",\n        //        \"bidSize\": \"16804\",\n        //        \"ask\": \"2928.65\",\n        //        \"askSize\": \"1339\",\n        //        \"vol24h\": \"860493\",\n        //        \"openInterest\": \"3023363.00000000\",\n        //        \"open24h\": \"3021.25\",\n        //        \"indexPrice\": \"2893.71\",\n        //        \"last\": \"2942.25\",\n        //        \"lastTime\": \"2022-02-18T14:08:15.578Z\",\n        //        \"lastSize\": \"151\",\n        //        \"suspended\": false\n        //    }\n        //\n        //    {\n        //        \"symbol\": \"in_xbtusd\", // \"rr_xbtusd\",\n        //        \"last\": \"40411\",\n        //        \"lastTime\": \"2022-02-18T14:16:28.000Z\"\n        //    }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.parse8601 (this.safeString (ticker, 'lastTime'));\n        const open = this.safeString (ticker, 'open24h');\n        const last = this.safeString (ticker, 'last');\n        const change = Precise.stringSub (last, open);\n        const percentage = Precise.stringMul (Precise.stringDiv (change, open), '100');\n        const average = Precise.stringDiv (Precise.stringAdd (open, last), '2');\n        const volume = this.safeString (ticker, 'vol24h');\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        const isIndex = this.safeBool (market, 'index', false);\n        if (!isIndex) {\n            if (market['linear']) {\n                baseVolume = volume;\n            } else if (market['inverse']) {\n                quoteVolume = volume;\n            }\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': undefined,\n            'low': undefined,\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': this.safeString (ticker, 'bidSize'),\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': this.safeString (ticker, 'askSize'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': average,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        });\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 924,
        "line_end": 1062,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "linear ? amount : undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"time\": \"2019-02-14T09:25:33.920Z\",\n        \"trade_id\": 100,\n        \"price\": 3574,\n        \"size\": 100,\n        \"side\": \"buy\",\n        \"type\": \"fill\" // fill, liquidation, assignment, termination\n        \"uid\": \"11c3d82c-9e70-4fe9-8115-f643f1b162d4\"\n    }",
          "{\n        \"timestamp\": \"1710152516830\",\n        \"price\": \"71927.0\",\n        \"quantity\": \"0.0695\",\n        \"markPrice\": \"71936.38701675525\",\n        \"limitFilled\": true,\n        \"usdValue\": \"4998.93\",\n        \"uid\": \"116ae634-253f-470b-bd20-fa9d429fb8b1\",\n        \"makerOrder\": { \"uid\": \"17bfe4de-c01e-4938-926c-617d2a2d0597\", \"tradeable\": \"PF_XBTUSD\", \"direction\": \"Buy\", \"quantity\": \"0.0695\", \"timestamp\": \"1710152515836\", \"limitPrice\": \"71927.0\", \"orderType\": \"Post\", \"reduceOnly\": false, \"lastUpdateTimestamp\": \"1710152515836\" },\n        \"takerOrder\": { \"uid\": \"d3e437b4-aa70-4108-b5cf-b1eecb9845b5\", \"tradeable\": \"PF_XBTUSD\", \"direction\": \"Sell\", \"quantity\": \"0.940100\", \"timestamp\": \"1710152516830\", \"limitPrice\": \"71915\", \"orderType\": \"IoC\", \"reduceOnly\": false, \"lastUpdateTimestamp\": \"1710152516830\" }\n    }",
          "{\n        \"fillTime\": \"2016-02-25T09:47:01.000Z\",\n        \"order_id\": \"c18f0c17-9971-40e6-8e5b-10df05d422f0\",\n        \"fill_id\": \"522d4e08-96e7-4b44-9694-bfaea8fe215e\",\n        \"cliOrdId\": \"d427f920-ec55-4c18-ba95-5fe241513b30\",     // OPTIONAL\n        \"symbol\": \"fi_xbtusd_180615\",\n        \"side\": \"buy\",\n        \"size\": 2000,\n        \"price\": 4255,\n        \"fillType\": \"maker\"                                     // taker, takerAfterEdit, maker, liquidation, assignee\n    }",
          "{\n        \"executionId\": \"e1ec9f63-2338-4c44-b40a-43486c6732d7\",\n        \"price\": 7244.5,\n        \"amount\": 10,\n        \"orderPriorEdit\": null,\n        \"orderPriorExecution\": {\n            \"orderId\": \"61ca5732-3478-42fe-8362-abbfd9465294\",\n            \"cliOrdId\": null,\n            \"type\": \"lmt\",\n            \"symbol\": \"pi_xbtusd\",\n            \"side\": \"buy\",\n            \"quantity\": 10,\n            \"filled\": 0,\n            \"limitPrice\": 7500,\n            \"reduceOnly\": false,\n            \"timestamp\": \"2019-12-11T17:17:33.888Z\",\n            \"lastUpdateTimestamp\": \"2019-12-11T17:17:33.888Z\"\n        },\n        \"takerReducedQuantity\": null,\n        \"type\": \"EXECUTION\"\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (recent trades)\n        //\n        //    {\n        //        \"time\": \"2019-02-14T09:25:33.920Z\",\n        //        \"trade_id\": 100,\n        //        \"price\": 3574,\n        //        \"size\": 100,\n        //        \"side\": \"buy\",\n        //        \"type\": \"fill\" // fill, liquidation, assignment, termination\n        //        \"uid\": \"11c3d82c-9e70-4fe9-8115-f643f1b162d4\"\n        //    }\n        //\n        // fetchTrades (executions history)\n        //\n        //    {\n        //        \"timestamp\": \"1710152516830\",\n        //        \"price\": \"71927.0\",\n        //        \"quantity\": \"0.0695\",\n        //        \"markPrice\": \"71936.38701675525\",\n        //        \"limitFilled\": true,\n        //        \"usdValue\": \"4998.93\",\n        //        \"uid\": \"116ae634-253f-470b-bd20-fa9d429fb8b1\",\n        //        \"makerOrder\": { \"uid\": \"17bfe4de-c01e-4938-926c-617d2a2d0597\", \"tradeable\": \"PF_XBTUSD\", \"direction\": \"Buy\", \"quantity\": \"0.0695\", \"timestamp\": \"1710152515836\", \"limitPrice\": \"71927.0\", \"orderType\": \"Post\", \"reduceOnly\": false, \"lastUpdateTimestamp\": \"1710152515836\" },\n        //        \"takerOrder\": { \"uid\": \"d3e437b4-aa70-4108-b5cf-b1eecb9845b5\", \"tradeable\": \"PF_XBTUSD\", \"direction\": \"Sell\", \"quantity\": \"0.940100\", \"timestamp\": \"1710152516830\", \"limitPrice\": \"71915\", \"orderType\": \"IoC\", \"reduceOnly\": false, \"lastUpdateTimestamp\": \"1710152516830\" }\n        //    }\n        //\n        // fetchMyTrades (private)\n        //\n        //    {\n        //        \"fillTime\": \"2016-02-25T09:47:01.000Z\",\n        //        \"order_id\": \"c18f0c17-9971-40e6-8e5b-10df05d422f0\",\n        //        \"fill_id\": \"522d4e08-96e7-4b44-9694-bfaea8fe215e\",\n        //        \"cliOrdId\": \"d427f920-ec55-4c18-ba95-5fe241513b30\",     // OPTIONAL\n        //        \"symbol\": \"fi_xbtusd_180615\",\n        //        \"side\": \"buy\",\n        //        \"size\": 2000,\n        //        \"price\": 4255,\n        //        \"fillType\": \"maker\"                                     // taker, takerAfterEdit, maker, liquidation, assignee\n        //    }\n        //\n        // execution report (createOrder, editOrder)\n        //\n        //    {\n        //        \"executionId\": \"e1ec9f63-2338-4c44-b40a-43486c6732d7\",\n        //        \"price\": 7244.5,\n        //        \"amount\": 10,\n        //        \"orderPriorEdit\": null,\n        //        \"orderPriorExecution\": {\n        //            \"orderId\": \"61ca5732-3478-42fe-8362-abbfd9465294\",\n        //            \"cliOrdId\": null,\n        //            \"type\": \"lmt\",\n        //            \"symbol\": \"pi_xbtusd\",\n        //            \"side\": \"buy\",\n        //            \"quantity\": 10,\n        //            \"filled\": 0,\n        //            \"limitPrice\": 7500,\n        //            \"reduceOnly\": false,\n        //            \"timestamp\": \"2019-12-11T17:17:33.888Z\",\n        //            \"lastUpdateTimestamp\": \"2019-12-11T17:17:33.888Z\"\n        //        },\n        //        \"takerReducedQuantity\": null,\n        //        \"type\": \"EXECUTION\"\n        //    }\n        //\n        let timestamp = this.parse8601 (this.safeString2 (trade, 'time', 'fillTime'));\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeStringN (trade, [ 'size', 'amount', 'quantity' ], '0.0');\n        let id = this.safeString2 (trade, 'uid', 'fill_id');\n        if (id === undefined) {\n            id = this.safeString (trade, 'executionId');\n        }\n        let order = this.safeString (trade, 'order_id');\n        let marketId = this.safeString (trade, 'symbol');\n        let side = this.safeString (trade, 'side');\n        let type = undefined;\n        const priorEdit = this.safeValue (trade, 'orderPriorEdit');\n        const priorExecution = this.safeValue (trade, 'orderPriorExecution');\n        if (priorExecution !== undefined) {\n            order = this.safeString (priorExecution, 'orderId');\n            marketId = this.safeString (priorExecution, 'symbol');\n            side = this.safeString (priorExecution, 'side');\n            type = this.safeString (priorExecution, 'type');\n        } else if (priorEdit !== undefined) {\n            order = this.safeString (priorEdit, 'orderId');\n            marketId = this.safeString (priorEdit, 'symbol');\n            side = this.safeString (priorEdit, 'type');\n            type = this.safeString (priorEdit, 'type');\n        }\n        if (type !== undefined) {\n            type = this.parseOrderType (type);\n        }\n        market = this.safeMarket (marketId, market);\n        let cost = undefined;\n        const linear = this.safeBool (market, 'linear');\n        if ((amount !== undefined) && (price !== undefined) && (market !== undefined)) {\n            if (linear) {\n                cost = Precise.stringMul (amount, price); // in quote\n            } else {\n                cost = Precise.stringDiv (amount, price); // in base\n            }\n            const contractSize = this.safeString (market, 'contractSize');\n            cost = Precise.stringMul (cost, contractSize);\n        }\n        let takerOrMaker = undefined;\n        const fillType = this.safeString (trade, 'fillType');\n        if (fillType !== undefined) {\n            if (fillType.indexOf ('taker') >= 0) {\n                takerOrMaker = 'taker';\n            } else if (fillType.indexOf ('maker') >= 0) {\n                takerOrMaker = 'maker';\n            }\n        }\n        const isHistoricalExecution = ('takerOrder' in trade);\n        if (isHistoricalExecution) {\n            timestamp = this.safeInteger (trade, 'timestamp');\n            const taker = this.safeDict (trade, 'takerOrder', {});\n            if (taker !== undefined) {\n                side = this.safeStringLower (taker, 'direction');\n                takerOrMaker = 'taker';\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': order,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': linear ? amount : undefined,\n            'cost': cost,\n            'fee': undefined,\n        });\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2798,
        "line_end": 2819,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.safeString (transfer, 'result')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"result\": \"success\",\n        \"serverTime\": \"2022-04-12T01:22:53.420Z\"\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //    {\n        //        \"result\": \"success\",\n        //        \"serverTime\": \"2022-04-12T01:22:53.420Z\"\n        //    }\n        //\n        const datetime = this.safeString (transfer, 'serverTime');\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'currency': this.safeString (currency, 'code'),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.safeString (transfer, 'result'),\n        };\n    }"
      }
    ],
    "kucoin": [
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 4422,
        "line_end": 4431,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString2 (entry, 'holdBalance', 'hold');\n        account['free'] = this.safeString2 (entry, 'availableBalance', 'available');\n        account['total'] = this.safeString2 (entry, 'totalBalance', 'total');\n        const debt = this.safeString (entry, 'liability');\n        const interest = this.safeString (entry, 'interest');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 5181,
        "line_end": 5255,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "interest",
            "value": "interest",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'dailyIntRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "amountBorrowed",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"1INCH\",\n         \"total\": \"0\",\n         \"available\": \"0\",\n         \"hold\": \"0\",\n         \"liability\": \"0\",\n         \"maxBorrowSize\": \"0\",\n         \"borrowEnabled\": true,\n         \"transferInEnabled\": true\n     }",
          "{\n         \"symbol\": \"MANA-USDT\",\n         \"debtRatio\": \"0\",\n         \"status\": \"BORROW\",\n         \"baseAsset\": {\n             \"currency\": \"MANA\",\n             \"borrowEnabled\": true,\n             \"repayEnabled\": true,\n             \"transferEnabled\": true,\n             \"borrowed\": \"0\",\n             \"totalAsset\": \"0\",\n             \"available\": \"0\",\n             \"hold\": \"0\",\n             \"maxBorrowSize\": \"1000\"\n         },\n         \"quoteAsset\": {\n             \"currency\": \"USDT\",\n             \"borrowEnabled\": true,\n             \"repayEnabled\": true,\n             \"transferEnabled\": true,\n             \"borrowed\": \"0\",\n             \"totalAsset\": \"0\",\n             \"available\": \"0\",\n             \"hold\": \"0\",\n             \"maxBorrowSize\": \"50000\"\n         }\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        // Cross\n        //\n        //     {\n        //         \"currency\": \"1INCH\",\n        //         \"total\": \"0\",\n        //         \"available\": \"0\",\n        //         \"hold\": \"0\",\n        //         \"liability\": \"0\",\n        //         \"maxBorrowSize\": \"0\",\n        //         \"borrowEnabled\": true,\n        //         \"transferInEnabled\": true\n        //     }\n        //\n        // Isolated\n        //\n        //     {\n        //         \"symbol\": \"MANA-USDT\",\n        //         \"debtRatio\": \"0\",\n        //         \"status\": \"BORROW\",\n        //         \"baseAsset\": {\n        //             \"currency\": \"MANA\",\n        //             \"borrowEnabled\": true,\n        //             \"repayEnabled\": true,\n        //             \"transferEnabled\": true,\n        //             \"borrowed\": \"0\",\n        //             \"totalAsset\": \"0\",\n        //             \"available\": \"0\",\n        //             \"hold\": \"0\",\n        //             \"maxBorrowSize\": \"1000\"\n        //         },\n        //         \"quoteAsset\": {\n        //             \"currency\": \"USDT\",\n        //             \"borrowEnabled\": true,\n        //             \"repayEnabled\": true,\n        //             \"transferEnabled\": true,\n        //             \"borrowed\": \"0\",\n        //             \"totalAsset\": \"0\",\n        //             \"available\": \"0\",\n        //             \"hold\": \"0\",\n        //             \"maxBorrowSize\": \"50000\"\n        //         }\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const marginMode = (marketId === undefined) ? 'cross' : 'isolated';\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeString (market, 'symbol');\n        const timestamp = this.safeInteger (info, 'createdAt');\n        const isolatedBase = this.safeDict (info, 'baseAsset', {});\n        let amountBorrowed = undefined;\n        let interest = undefined;\n        let currencyId = undefined;\n        if (marginMode === 'isolated') {\n            amountBorrowed = this.safeNumber (isolatedBase, 'liability');\n            interest = this.safeNumber (isolatedBase, 'interest');\n            currencyId = this.safeString (isolatedBase, 'currency');\n        } else {\n            amountBorrowed = this.safeNumber (info, 'liability');\n            interest = this.safeNumber (info, 'accruedInterest');\n            currencyId = this.safeString (info, 'currency');\n        }\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (currencyId),\n            'interest': interest,\n            'interestRate': this.safeNumber (info, 'dailyIntRate'),\n            'amountBorrowed': amountBorrowed,\n            'marginMode': marginMode,\n            'timestamp': timestamp,  // create time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 5041,
        "line_end": 5070,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber2 (info, 'dailyIntRate', 'dayRatio')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tradeId\": \"62db2dcaff219600012b56cd\",\n         \"currency\": \"USDT\",\n         \"size\": \"10\",\n         \"dailyIntRate\": \"0.00003\",\n         \"term\": 7,\n         \"timestamp\": 1658531274508488480\n     },",
          "{\n         \"createdAt\": 1697783812257,\n         \"currency\": \"XMR\",\n         \"interestAmount\": \"0.1\",\n         \"dayRatio\": \"0.001\"\n     }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"tradeId\": \"62db2dcaff219600012b56cd\",\n        //         \"currency\": \"USDT\",\n        //         \"size\": \"10\",\n        //         \"dailyIntRate\": \"0.00003\",\n        //         \"term\": 7,\n        //         \"timestamp\": 1658531274508488480\n        //     },\n        //\n        //     {\n        //         \"createdAt\": 1697783812257,\n        //         \"currency\": \"XMR\",\n        //         \"interestAmount\": \"0.1\",\n        //         \"dayRatio\": \"0.001\"\n        //     }\n        //\n        const timestampId = this.safeString2 (info, 'createdAt', 'timestamp');\n        const timestamp = this.parseToInt (timestampId.slice (0, 13));\n        const currencyId = this.safeString (info, 'currency');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber2 (info, 'dailyIntRate', 'dayRatio'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseBorrowRateHistories",
        "signature": "parseBorrowRateHistories (response, codes, since, limit)",
        "line_start": 5367,
        "line_end": 5397,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"createdAt\": 1697783812257,\n             \"currency\": \"XMR\",\n             \"interestAmount\": \"0.1\",\n             \"dayRatio\": \"0.001\"\n         }\n     ]"
        ],
        "source": "parseBorrowRateHistories (response, codes, since, limit) {\n        //\n        //     [\n        //         {\n        //             \"createdAt\": 1697783812257,\n        //             \"currency\": \"XMR\",\n        //             \"interestAmount\": \"0.1\",\n        //             \"dayRatio\": \"0.001\"\n        //         }\n        //     ]\n        //\n        const borrowRateHistories: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const item = response[i];\n            const code = this.safeCurrencyCode (this.safeString (item, 'currency'));\n            if (codes === undefined || this.inArray (code, codes)) {\n                if (!(code in borrowRateHistories)) {\n                    borrowRateHistories[code] = [];\n                }\n                const borrowRateStructure = this.parseBorrowRate (item);\n                const borrowRateHistoriesCode = borrowRateHistories[code];\n                borrowRateHistoriesCode.push (borrowRateStructure);\n            }\n        }\n        const keys = Object.keys (borrowRateHistories);\n        for (let i = 0; i < keys.length; i++) {\n            const code = keys[i];\n            borrowRateHistories[code] = this.filterByCurrencySinceLimit (borrowRateHistories[code], code, since, limit);\n        }\n        return borrowRateHistories;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2533,
        "line_end": 2554,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (depositAddress, 'chainId'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        let address = this.safeString (depositAddress, 'address');\n        // BCH/BSV is returned with a \"bitcoincash:\" prefix, which we cut off here and only keep the address\n        if (address !== undefined) {\n            address = address.replace ('bitcoincash:', '');\n        }\n        let code = undefined;\n        if (currency !== undefined) {\n            code = this.safeCurrencyCode (currency['id']);\n            if (code !== 'NIM') {\n                // contains spaces\n                this.checkAddress (address);\n            }\n        }\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': this.networkIdToCode (this.safeString (depositAddress, 'chainId')),\n            'address': address,\n            'tag': this.safeString (depositAddress, 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 1901,
        "line_end": 1971,
        "comment": null,
        "mappings": [
          {
            "key": "withdraw",
            "value": "{\n                        'fee': this.safeNumber2 (chain, 'withdrawalMinFee', 'withdrawMinFee'),\n                        'percentage': false,\n                    }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'fee': undefined,\n                        'percentage': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': minWithdrawFee,\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "minWithdrawFee",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\": \"USDT\",\n        \"limitBTCAmount\": \"1.00000000\",\n        \"usedBTCAmount\": \"0.00000000\",\n        \"remainAmount\": \"16548.072149\",\n        \"availableAmount\": \"0\",\n        \"withdrawMinFee\": \"25\",\n        \"innerWithdrawMinFee\": \"0\",\n        \"withdrawMinSize\": \"50\",\n        \"isWithdrawEnabled\": true,\n        \"precision\": 6,\n        \"chain\": \"ERC20\"\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"currency\": \"USDT\",\n        //        \"limitBTCAmount\": \"1.00000000\",\n        //        \"usedBTCAmount\": \"0.00000000\",\n        //        \"remainAmount\": \"16548.072149\",\n        //        \"availableAmount\": \"0\",\n        //        \"withdrawMinFee\": \"25\",\n        //        \"innerWithdrawMinFee\": \"0\",\n        //        \"withdrawMinSize\": \"50\",\n        //        \"isWithdrawEnabled\": true,\n        //        \"precision\": 6,\n        //        \"chain\": \"ERC20\"\n        //    }\n        //\n        if ('chains' in fee) {\n            // if data obtained through `currencies` endpoint\n            const resultNew: Dict = {\n                'info': fee,\n                'withdraw': {\n                    'fee': undefined,\n                    'percentage': false,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n                'networks': {},\n            };\n            const chains = this.safeList (fee, 'chains', []);\n            for (let i = 0; i < chains.length; i++) {\n                const chain = chains[i];\n                const networkCodeNew = this.networkIdToCode (this.safeString (chain, 'chainId'), this.safeString (currency, 'code'));\n                resultNew['networks'][networkCodeNew] = {\n                    'withdraw': {\n                        'fee': this.safeNumber2 (chain, 'withdrawalMinFee', 'withdrawMinFee'),\n                        'percentage': false,\n                    },\n                    'deposit': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                };\n            }\n            return resultNew;\n        }\n        const minWithdrawFee = this.safeNumber (fee, 'withdrawMinFee');\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': minWithdrawFee,\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        const networkId = this.safeString (fee, 'chain');\n        const networkCode = this.networkIdToCode (networkId, this.safeString (currency, 'code'));\n        result['networks'][networkCode] = {\n            'withdraw': minWithdrawFee,\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n        };\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (data, market: Market = undefined): FundingRate",
        "line_start": 5671,
        "line_end": 5703,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (data, 'nextFundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \".XBTUSDTMFPI8H\",\n         \"nextFundingRate\": 7.4E-5,\n         \"fundingTime\": 1762444800000,\n         \"fundingRateCap\": 0.003,\n         \"fundingRateFloor\": -0.003\n     }"
        ],
        "source": "parseFundingRate (data, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \".XBTUSDTMFPI8H\",\n        //         \"nextFundingRate\": 7.4E-5,\n        //         \"fundingTime\": 1762444800000,\n        //         \"fundingRateCap\": 0.003,\n        //         \"fundingRateFloor\": -0.003\n        //     }\n        //\n        const fundingTimestamp = this.safeInteger (data, 'fundingTime');\n        const marketId = this.safeString (data, 'symbol');\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (data, 'nextFundingRate'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (info, market: Market = undefined)",
        "line_start": 5760,
        "line_end": 5775,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (info, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fundingRate\": 7.6E-5,\n         \"ts\": 1706097600000\n     }"
        ],
        "source": "parseFundingRateHistory (info, market: Market = undefined) {\n        //\n        //     {\n        //         \"fundingRate\": 7.6E-5,\n        //         \"ts\": 1706097600000\n        //     }\n        //\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (undefined, market),\n            'fundingRate': this.safeNumber (info, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 4840,
        "line_end": 4922,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "account",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "balanceAfter",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"611a1e7c6a053300067a88d9\", //unique key for each ledger entry\n         \"currency\": \"USDT\", //Currency\n         \"amount\": \"10.00059547\", //The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution.\n         \"fee\": \"0\", //Deposit or withdrawal fee\n         \"balance\": \"0\", //Total assets of a currency remaining funds after transaction\n         \"accountType\": \"MAIN\", //Account Type\n         \"bizType\": \"Loans Repaid\", //business type\n         \"direction\": \"in\", //side, in or out\n         \"createdAt\": 1629101692950, //Creation time\n         \"context\": \"{\\\"borrowerUserId\\\":\\\"601ad03e50dc810006d242ea\\\",\\\"loanRepayDetailNo\\\":\\\"611a1e7cc913d000066cf7ec\\\"}\" //Business core parameters\n     }",
          "\"{\\\"orderId\\\":\\\"617bb2d09e7b3b000196dac8\\\",\\\"txId\\\":\\\"0x79bb9855f86b351a45cab4dc69d78ca09586a94c45dde49475722b98f401b054\\\"}\"",
          "\"{\\\"orderId\\\":\\\"617ab9949e7b3b0001948081\\\",\\\"txId\\\":\\\"0x7a06b16bbd6b03dbc3d96df5683b15229fc35e7184fd7179a5f3a310bd67d1fa@default@0\\\"}\"",
          "\"{\\\"symbol\\\":\\\"ETH-USDT\\\",\\\"orderId\\\":\\\"617adcd1eb3fa20001dd29a1\\\",\\\"tradeId\\\":\\\"617adcd12e113d2b91222ff9\\\"}\""
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"id\": \"611a1e7c6a053300067a88d9\", //unique key for each ledger entry\n        //         \"currency\": \"USDT\", //Currency\n        //         \"amount\": \"10.00059547\", //The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution.\n        //         \"fee\": \"0\", //Deposit or withdrawal fee\n        //         \"balance\": \"0\", //Total assets of a currency remaining funds after transaction\n        //         \"accountType\": \"MAIN\", //Account Type\n        //         \"bizType\": \"Loans Repaid\", //business type\n        //         \"direction\": \"in\", //side, in or out\n        //         \"createdAt\": 1629101692950, //Creation time\n        //         \"context\": \"{\\\"borrowerUserId\\\":\\\"601ad03e50dc810006d242ea\\\",\\\"loanRepayDetailNo\\\":\\\"611a1e7cc913d000066cf7ec\\\"}\" //Business core parameters\n        //     }\n        //\n        const id = this.safeString (item, 'id');\n        const currencyId = this.safeString (item, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amount = this.safeNumber (item, 'amount');\n        const balanceAfter = undefined;\n        // const balanceAfter = this.safeNumber (item, 'balance'); only returns zero string\n        const bizType = this.safeString (item, 'bizType');\n        const type = this.parseLedgerEntryType (bizType);\n        const direction = this.safeString (item, 'direction');\n        const timestamp = this.safeInteger (item, 'createdAt');\n        const datetime = this.iso8601 (timestamp);\n        const account = this.safeString (item, 'accountType'); // MAIN, TRADE, MARGIN, or CONTRACT\n        const context = this.safeString (item, 'context'); // contains other information about the ledger entry\n        //\n        // withdrawal transaction\n        //\n        //     \"{\\\"orderId\\\":\\\"617bb2d09e7b3b000196dac8\\\",\\\"txId\\\":\\\"0x79bb9855f86b351a45cab4dc69d78ca09586a94c45dde49475722b98f401b054\\\"}\"\n        //\n        // deposit to MAIN, trade via MAIN\n        //\n        //     \"{\\\"orderId\\\":\\\"617ab9949e7b3b0001948081\\\",\\\"txId\\\":\\\"0x7a06b16bbd6b03dbc3d96df5683b15229fc35e7184fd7179a5f3a310bd67d1fa@default@0\\\"}\"\n        //\n        // sell trade\n        //\n        //     \"{\\\"symbol\\\":\\\"ETH-USDT\\\",\\\"orderId\\\":\\\"617adcd1eb3fa20001dd29a1\\\",\\\"tradeId\\\":\\\"617adcd12e113d2b91222ff9\\\"}\"\n        //\n        let referenceId = undefined;\n        if (context !== undefined && context !== '') {\n            try {\n                const parsed = JSON.parse (context);\n                const orderId = this.safeString (parsed, 'orderId');\n                const tradeId = this.safeString (parsed, 'tradeId');\n                // transactions only have an orderId but for trades we wish to use tradeId\n                if (tradeId !== undefined) {\n                    referenceId = tradeId;\n                } else {\n                    referenceId = orderId;\n                }\n            } catch (exc) {\n                referenceId = context;\n            }\n        }\n        let fee = undefined;\n        const feeCost = this.safeString (item, 'fee');\n        let feeCurrency = undefined;\n        if (feeCost !== '0') {\n            feeCurrency = code;\n            fee = { 'cost': this.parseNumber (feeCost), 'currency': feeCurrency };\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': direction,\n            'account': account,\n            'referenceId': referenceId,\n            'referenceAccount': account,\n            'type': type,\n            'currency': code,\n            'amount': amount,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'before': undefined,\n            'after': balanceAfter, // undefined\n            'status': undefined,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 4795,
        "line_end": 4838,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'Assets Transferred in After Upgrading': 'transfer', // Assets Transferred in After V1 to V2 Upgrading\n            'Deposit': 'transaction', // Deposit\n            'Withdrawal': 'transaction', // Withdrawal\n            'Transfer': 'transfer', // Transfer\n            'Trade_Exchange': 'trade', // Trade\n            // 'Vote for Coin': 'Vote for Coin', // Vote for Coin\n            'KuCoin Bonus': 'bonus', // KuCoin Bonus\n            'Referral Bonus': 'referral', // Referral Bonus\n            'Rewards': 'bonus', // Activities Rewards\n            // 'Distribution': 'Distribution', // Distribution, such as get GAS by holding NEO\n            'Airdrop/Fork': 'airdrop', // Airdrop/Fork\n            'Other rewards': 'bonus', // Other rewards, except Vote, Airdrop, Fork\n            'Fee Rebate': 'rebate', // Fee Rebate\n            'Buy Crypto': 'trade', // Use credit card to buy crypto\n            'Sell Crypto': 'sell', // Use credit card to sell crypto\n            'Public Offering Purchase': 'trade', // Public Offering Purchase for Spotlight\n            // 'Send red envelope': 'Send red envelope', // Send red envelope\n            // 'Open red envelope': 'Open red envelope', // Open red envelope\n            // 'Staking': 'Staking', // Staking\n            // 'LockDrop Vesting': 'LockDrop Vesting', // LockDrop Vesting\n            // 'Staking Profits': 'Staking Profits', // Staking Profits\n            // 'Redemption': 'Redemption', // Redemption\n            'Refunded Fees': 'fee', // Refunded Fees\n            'KCS Pay Fees': 'fee', // KCS Pay Fees\n            'Margin Trade': 'trade', // Margin Trade\n            'Loans': 'Loans', // Loans\n            // 'Borrowings': 'Borrowings', // Borrowings\n            // 'Debt Repayment': 'Debt Repayment', // Debt Repayment\n            // 'Loans Repaid': 'Loans Repaid', // Loans Repaid\n            // 'Lendings': 'Lendings', // Lendings\n            // 'Pool transactions': 'Pool transactions', // Pool-X transactions\n            'Instant Exchange': 'trade', // Instant Exchange\n            'Sub-account transfer': 'transfer', // Sub-account transfer\n            'Liquidation Fees': 'fee', // Liquidation Fees\n            // 'Soft Staking Profits': 'Soft Staking Profits', // Soft Staking Profits\n            // 'Voting Earnings': 'Voting Earnings', // Voting Earnings on Pool-X\n            // 'Redemption of Voting': 'Redemption of Voting', // Redemption of Voting on Pool-X\n            // 'Voting': 'Voting', // Voting on Pool-X\n            // 'Convert to KCS': 'Convert to KCS', // Convert to KCS\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 5547,
        "line_end": 5565,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (info, 'orderNo')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'actualSize')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderNo\": \"5da6dba0f943c0c81f5d5db5\",\n         \"actualSize\": 10\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"orderNo\": \"5da6dba0f943c0c81f5d5db5\",\n        //         \"actualSize\": 10\n        //     }\n        //\n        const timestamp = this.milliseconds ();\n        const currencyId = this.safeString (info, 'currency');\n        return {\n            'id': this.safeString (info, 'orderNo'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'actualSize'),\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2341,
        "line_end": 2361,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1545904980\",             // Start time of the candle cycle\n         \"0.058\",                  // opening price\n         \"0.049\",                  // closing price\n         \"0.058\",                  // highest price\n         \"0.049\",                  // lowest price\n         \"0.018\",                  // base volume\n         \"0.000945\",               // quote volume\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1545904980\",             // Start time of the candle cycle\n        //         \"0.058\",                  // opening price\n        //         \"0.049\",                  // closing price\n        //         \"0.058\",                  // highest price\n        //         \"0.049\",                  // lowest price\n        //         \"0.018\",                  // base volume\n        //         \"0.000945\",               // quote volume\n        //     ]\n        //\n        return [\n            this.safeTimestamp (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3496,
        "line_end": 3674,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'id', 'orderId', 'newOrderId', 'cancelledOrderId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOid')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '-')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (order, 'type')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "this.safeBool (order, 'postOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (order, 'side')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'size')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'dealFunds')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'dealSize')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n                'cost': this.safeNumber (order, 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'avgDealPrice')",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (feeCurrencyId)",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"orderId\": \"63c97e47d686c5000159a656\"\n    }",
          "{\n        \"cancelledOrderIds\": [ \"63c97e47d686c5000159a656\" ]\n    }",
          "{\n        \"id\": \"63c97ce8d686c500015793bb\",\n        \"symbol\": \"USDC-USDT\",\n        \"opType\": \"DEAL\",\n        \"type\": \"limit\",\n        \"side\": \"sell\",\n        \"price\": \"1.05\",\n        \"size\": \"1\",\n        \"funds\": \"0\",\n        \"dealFunds\": \"0\",\n        \"dealSize\": \"0\",\n        \"fee\": \"0\",\n        \"feeCurrency\": \"USDT\",\n        \"stp\": \"\",\n        \"stop\": \"\",\n        \"stopTriggered\": false,\n        \"stopPrice\": \"0\",\n        \"timeInForce\": \"GTC\",\n        \"postOnly\": false,\n        \"hidden\": false,\n        \"iceberg\": false,\n        \"visibleSize\": \"0\",\n        \"cancelAfter\": 0,\n        \"channel\": \"API\",\n        \"clientOid\": \"d602d73f-5424-4751-bef0-8debce8f0a82\",\n        \"remark\": null,\n        \"tags\": \"partner:ccxt\",\n        \"isActive\": true,\n        \"cancelExist\": false,\n        \"createdAt\": 1674149096927,\n        \"tradeType\": \"TRADE\"\n    }",
          "{\n        \"id\": \"vs9f6ou9e864rgq8000t4qnm\",\n        \"symbol\": \"USDC-USDT\",\n        \"userId\": \"613a896885d8660006151f01\",\n        \"status\": \"NEW\",\n        \"type\": \"market\",\n        \"side\": \"sell\",\n        \"price\": null,\n        \"size\": \"1.00000000000000000000\",\n        \"funds\": null,\n        \"stp\": null,\n        \"timeInForce\": \"GTC\",\n        \"cancelAfter\": -1,\n        \"postOnly\": false,\n        \"hidden\": false,\n        \"iceberg\": false,\n        \"visibleSize\": null,\n        \"channel\": \"API\",\n        \"clientOid\": \"5d3fd727-6456-438d-9550-40d9d85eee0b\",\n        \"remark\": null,\n        \"tags\": \"partner:ccxt\",\n        \"relatedNo\": null,\n        \"orderTime\": 1674146316994000028,\n        \"domainId\": \"kucoin\",\n        \"tradeSource\": \"USER\",\n        \"tradeType\": \"MARGIN_TRADE\",\n        \"feeCurrency\": \"USDT\",\n        \"takerFeeRate\": \"0.00100000000000000000\",\n        \"makerFeeRate\": \"0.00100000000000000000\",\n        \"createdAt\": 1674146316994,\n        \"stop\": \"loss\",\n        \"stopTriggerTime\": null,\n        \"stopPrice\": \"0.97000000000000000000\"\n    }",
          "{\n        \"id\":\"6478cf1439bdfc0001528a1d\",\n        \"symbol\":\"LTC-USDT\",\n        \"opType\":\"DEAL\",\n        \"type\":\"limit\",\n        \"side\":\"buy\",\n        \"price\":\"50\",\n        \"size\":\"0.1\",\n        \"funds\":\"5\",\n        \"dealSize\":\"0\",\n        \"dealFunds\":\"0\",\n        \"fee\":\"0\",\n        \"feeCurrency\":\"USDT\",\n        \"stp\":null,\n        \"timeInForce\":\"GTC\",\n        \"postOnly\":false,\n        \"hidden\":false,\n        \"iceberg\":false,\n        \"visibleSize\":\"0\",\n        \"cancelAfter\":0,\n        \"channel\":\"API\",\n        \"clientOid\":\"d4d2016b-8e3a-445c-aa5d-dc6df5d1678d\",\n        \"remark\":null,\n        \"tags\":\"partner:ccxt\",\n        \"cancelExist\":false,\n        \"createdAt\":1685638932074,\n        \"lastUpdatedAt\":1685639013735,\n        \"tradeType\":\"TRADE\",\n        \"inOrderBook\":true,\n        \"cancelledSize\":\"0\",\n        \"cancelledFunds\":\"0\",\n        \"remainSize\":\"0.1\",\n        \"remainFunds\":\"5\",\n        \"active\":true\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //    {\n        //        \"orderId\": \"63c97e47d686c5000159a656\"\n        //    }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"cancelledOrderIds\": [ \"63c97e47d686c5000159a656\" ]\n        //    }\n        //\n        // fetchOpenOrders, fetchClosedOrders\n        //\n        //    {\n        //        \"id\": \"63c97ce8d686c500015793bb\",\n        //        \"symbol\": \"USDC-USDT\",\n        //        \"opType\": \"DEAL\",\n        //        \"type\": \"limit\",\n        //        \"side\": \"sell\",\n        //        \"price\": \"1.05\",\n        //        \"size\": \"1\",\n        //        \"funds\": \"0\",\n        //        \"dealFunds\": \"0\",\n        //        \"dealSize\": \"0\",\n        //        \"fee\": \"0\",\n        //        \"feeCurrency\": \"USDT\",\n        //        \"stp\": \"\",\n        //        \"stop\": \"\",\n        //        \"stopTriggered\": false,\n        //        \"stopPrice\": \"0\",\n        //        \"timeInForce\": \"GTC\",\n        //        \"postOnly\": false,\n        //        \"hidden\": false,\n        //        \"iceberg\": false,\n        //        \"visibleSize\": \"0\",\n        //        \"cancelAfter\": 0,\n        //        \"channel\": \"API\",\n        //        \"clientOid\": \"d602d73f-5424-4751-bef0-8debce8f0a82\",\n        //        \"remark\": null,\n        //        \"tags\": \"partner:ccxt\",\n        //        \"isActive\": true,\n        //        \"cancelExist\": false,\n        //        \"createdAt\": 1674149096927,\n        //        \"tradeType\": \"TRADE\"\n        //    }\n        //\n        // stop orders (fetchOpenOrders, fetchClosedOrders)\n        //\n        //    {\n        //        \"id\": \"vs9f6ou9e864rgq8000t4qnm\",\n        //        \"symbol\": \"USDC-USDT\",\n        //        \"userId\": \"613a896885d8660006151f01\",\n        //        \"status\": \"NEW\",\n        //        \"type\": \"market\",\n        //        \"side\": \"sell\",\n        //        \"price\": null,\n        //        \"size\": \"1.00000000000000000000\",\n        //        \"funds\": null,\n        //        \"stp\": null,\n        //        \"timeInForce\": \"GTC\",\n        //        \"cancelAfter\": -1,\n        //        \"postOnly\": false,\n        //        \"hidden\": false,\n        //        \"iceberg\": false,\n        //        \"visibleSize\": null,\n        //        \"channel\": \"API\",\n        //        \"clientOid\": \"5d3fd727-6456-438d-9550-40d9d85eee0b\",\n        //        \"remark\": null,\n        //        \"tags\": \"partner:ccxt\",\n        //        \"relatedNo\": null,\n        //        \"orderTime\": 1674146316994000028,\n        //        \"domainId\": \"kucoin\",\n        //        \"tradeSource\": \"USER\",\n        //        \"tradeType\": \"MARGIN_TRADE\",\n        //        \"feeCurrency\": \"USDT\",\n        //        \"takerFeeRate\": \"0.00100000000000000000\",\n        //        \"makerFeeRate\": \"0.00100000000000000000\",\n        //        \"createdAt\": 1674146316994,\n        //        \"stop\": \"loss\",\n        //        \"stopTriggerTime\": null,\n        //        \"stopPrice\": \"0.97000000000000000000\"\n        //    }\n        // hf order\n        //    {\n        //        \"id\":\"6478cf1439bdfc0001528a1d\",\n        //        \"symbol\":\"LTC-USDT\",\n        //        \"opType\":\"DEAL\",\n        //        \"type\":\"limit\",\n        //        \"side\":\"buy\",\n        //        \"price\":\"50\",\n        //        \"size\":\"0.1\",\n        //        \"funds\":\"5\",\n        //        \"dealSize\":\"0\",\n        //        \"dealFunds\":\"0\",\n        //        \"fee\":\"0\",\n        //        \"feeCurrency\":\"USDT\",\n        //        \"stp\":null,\n        //        \"timeInForce\":\"GTC\",\n        //        \"postOnly\":false,\n        //        \"hidden\":false,\n        //        \"iceberg\":false,\n        //        \"visibleSize\":\"0\",\n        //        \"cancelAfter\":0,\n        //        \"channel\":\"API\",\n        //        \"clientOid\":\"d4d2016b-8e3a-445c-aa5d-dc6df5d1678d\",\n        //        \"remark\":null,\n        //        \"tags\":\"partner:ccxt\",\n        //        \"cancelExist\":false,\n        //        \"createdAt\":1685638932074,\n        //        \"lastUpdatedAt\":1685639013735,\n        //        \"tradeType\":\"TRADE\",\n        //        \"inOrderBook\":true,\n        //        \"cancelledSize\":\"0\",\n        //        \"cancelledFunds\":\"0\",\n        //        \"remainSize\":\"0.1\",\n        //        \"remainFunds\":\"5\",\n        //        \"active\":true\n        //    }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        const timestamp = this.safeInteger (order, 'createdAt');\n        const feeCurrencyId = this.safeString (order, 'feeCurrency');\n        const cancelExist = this.safeBool (order, 'cancelExist', false);\n        const responseStop = this.safeString (order, 'stop');\n        const trigger = responseStop !== undefined;\n        const stopTriggered = this.safeBool (order, 'stopTriggered', false);\n        const isActive = this.safeBool2 (order, 'isActive', 'active');\n        const responseStatus = this.safeString (order, 'status');\n        let status = undefined;\n        if (isActive !== undefined) {\n            if (isActive === true) {\n                status = 'open';\n            } else {\n                status = 'closed';\n            }\n        }\n        if (trigger) {\n            if (responseStatus === 'NEW') {\n                status = 'open';\n            } else if (!isActive && !stopTriggered) {\n                status = 'cancelled';\n            }\n        }\n        if (cancelExist) {\n            status = 'canceled';\n        }\n        if (responseStatus === 'fail') {\n            status = 'rejected';\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeStringN (order, [ 'id', 'orderId', 'newOrderId', 'cancelledOrderId' ]),\n            'clientOrderId': this.safeString (order, 'clientOid'),\n            'symbol': this.safeSymbol (marketId, market, '-'),\n            'type': this.safeString (order, 'type'),\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': this.safeBool (order, 'postOnly'),\n            'side': this.safeString (order, 'side'),\n            'amount': this.safeString (order, 'size'),\n            'price': this.safeString (order, 'price'), // price is zero for market order, omitZero is called in safeOrder2\n            'triggerPrice': this.safeNumber (order, 'stopPrice'),\n            'cost': this.safeString (order, 'dealFunds'),\n            'filled': this.safeString (order, 'dealSize'),\n            'remaining': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': {\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n                'cost': this.safeNumber (order, 'fee'),\n            },\n            'status': status,\n            'lastTradeTimestamp': undefined,\n            'average': this.safeString (order, 'avgDealPrice'),\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1992,
        "line_end": 2101,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeStringN (ticker, [ 'buy', 'bestBid', 'bestBidPrice' ])",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bestBidSize')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeStringN (ticker, [ 'sell', 'bestAsk', 'bestAskPrice' ])",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'bestAskSize')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'changePrice')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'averagePrice')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'value')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USDT\",   // symbol\n         \"symbolName\":\"BTC-USDT\", // Name of trading pairs, it would change after renaming\n         \"buy\": \"11328.9\",   // bestAsk\n         \"sell\": \"11329\",    // bestBid\n         \"changeRate\": \"-0.0055\",    // 24h change rate\n         \"changePrice\": \"-63.6\", // 24h change price\n         \"high\": \"11610\",    // 24h highest price\n         \"low\": \"11200\", // 24h lowest price\n         \"vol\": \"2282.70993217\", // 24h volume，the aggregated trading volume in BTC\n         \"volValue\": \"25984946.157790431\",   // 24h total, the trading volume in quote currency of last 24 hours\n         \"last\": \"11328.9\",  // last price\n         \"averagePrice\": \"11360.66065903\",   // 24h average transaction price yesterday\n         \"takerFeeRate\": \"0.001\",    // Basic Taker Fee\n         \"makerFeeRate\": \"0.001\",    // Basic Maker Fee\n         \"takerCoefficient\": \"1\",    // Taker Fee Coefficient\n         \"makerCoefficient\": \"1\" // Maker Fee Coefficient\n     }",
          "{\n         \"trading\": true,\n         \"symbol\": \"KCS-BTC\",\n         \"buy\": 0.00011,\n         \"sell\": 0.00012,\n         \"sort\": 100,\n         \"volValue\": 3.13851792584,   //total\n         \"baseCurrency\": \"KCS\",\n         \"market\": \"BTC\",\n         \"quoteCurrency\": \"BTC\",\n         \"symbolCode\": \"KCS-BTC\",\n         \"datetime\": 1548388122031,\n         \"high\": 0.00013,\n         \"vol\": 27514.34842,\n         \"low\": 0.0001,\n         \"changePrice\": -1.0e-5,\n         \"changeRate\": -0.0769,\n         \"lastTradedPrice\": 0.00012,\n         \"board\": 0,\n         \"mark\": 0\n     }",
          "{\n         \"bestAsk\": \"62258.9\",\n         \"bestAskSize\": \"0.38579986\",\n         \"bestBid\": \"62258.8\",\n         \"bestBidSize\": \"0.0078381\",\n         \"price\": \"62260.7\",\n         \"sequence\": \"1621383297064\",\n         \"size\": \"0.00002841\",\n         \"time\": 1634641777363\n     }",
          "{\n         \"symbol\": \"BTC-USDT\",\n         \"name\": \"BTC-USDT\",\n         \"bestBidSize\": \"0.69207954\",\n         \"bestBidPrice\": \"110417.5\",\n         \"bestAskSize\": \"0.08836606\",\n         \"bestAskPrice\": \"110417.6\",\n         \"lastPrice\": \"110417.5\",\n         \"size\": \"0.00016\",\n         \"open\": \"110105.1\",\n         \"high\": \"110838.9\",\n         \"low\": \"109705.5\",\n         \"baseVolume\": \"1882.10069442\",\n         \"quoteVolume\": \"207325626.822922498\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USDT\",   // symbol\n        //         \"symbolName\":\"BTC-USDT\", // Name of trading pairs, it would change after renaming\n        //         \"buy\": \"11328.9\",   // bestAsk\n        //         \"sell\": \"11329\",    // bestBid\n        //         \"changeRate\": \"-0.0055\",    // 24h change rate\n        //         \"changePrice\": \"-63.6\", // 24h change price\n        //         \"high\": \"11610\",    // 24h highest price\n        //         \"low\": \"11200\", // 24h lowest price\n        //         \"vol\": \"2282.70993217\", // 24h volume，the aggregated trading volume in BTC\n        //         \"volValue\": \"25984946.157790431\",   // 24h total, the trading volume in quote currency of last 24 hours\n        //         \"last\": \"11328.9\",  // last price\n        //         \"averagePrice\": \"11360.66065903\",   // 24h average transaction price yesterday\n        //         \"takerFeeRate\": \"0.001\",    // Basic Taker Fee\n        //         \"makerFeeRate\": \"0.001\",    // Basic Maker Fee\n        //         \"takerCoefficient\": \"1\",    // Taker Fee Coefficient\n        //         \"makerCoefficient\": \"1\" // Maker Fee Coefficient\n        //     }\n        //\n        //     {\n        //         \"trading\": true,\n        //         \"symbol\": \"KCS-BTC\",\n        //         \"buy\": 0.00011,\n        //         \"sell\": 0.00012,\n        //         \"sort\": 100,\n        //         \"volValue\": 3.13851792584,   //total\n        //         \"baseCurrency\": \"KCS\",\n        //         \"market\": \"BTC\",\n        //         \"quoteCurrency\": \"BTC\",\n        //         \"symbolCode\": \"KCS-BTC\",\n        //         \"datetime\": 1548388122031,\n        //         \"high\": 0.00013,\n        //         \"vol\": 27514.34842,\n        //         \"low\": 0.0001,\n        //         \"changePrice\": -1.0e-5,\n        //         \"changeRate\": -0.0769,\n        //         \"lastTradedPrice\": 0.00012,\n        //         \"board\": 0,\n        //         \"mark\": 0\n        //     }\n        //\n        // market/ticker ws subscription\n        //\n        //     {\n        //         \"bestAsk\": \"62258.9\",\n        //         \"bestAskSize\": \"0.38579986\",\n        //         \"bestBid\": \"62258.8\",\n        //         \"bestBidSize\": \"0.0078381\",\n        //         \"price\": \"62260.7\",\n        //         \"sequence\": \"1621383297064\",\n        //         \"size\": \"0.00002841\",\n        //         \"time\": 1634641777363\n        //     }\n        //\n        // uta\n        //\n        //     {\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"name\": \"BTC-USDT\",\n        //         \"bestBidSize\": \"0.69207954\",\n        //         \"bestBidPrice\": \"110417.5\",\n        //         \"bestAskSize\": \"0.08836606\",\n        //         \"bestAskPrice\": \"110417.6\",\n        //         \"lastPrice\": \"110417.5\",\n        //         \"size\": \"0.00016\",\n        //         \"open\": \"110105.1\",\n        //         \"high\": \"110838.9\",\n        //         \"low\": \"109705.5\",\n        //         \"baseVolume\": \"1882.10069442\",\n        //         \"quoteVolume\": \"207325626.822922498\"\n        //     }\n        //\n        let percentage = this.safeString (ticker, 'changeRate');\n        if (percentage !== undefined) {\n            percentage = Precise.stringMul (percentage, '100');\n        }\n        let last = this.safeStringN (ticker, [ 'last', 'lastTradedPrice', 'lastPrice' ]);\n        last = this.safeString (ticker, 'price', last);\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const baseVolume = this.safeString2 (ticker, 'vol', 'baseVolume');\n        const quoteVolume = this.safeString2 (ticker, 'volValue', 'quoteVolume');\n        const timestamp = this.safeIntegerN (ticker, [ 'time', 'datetime', 'timePoint' ]);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeStringN (ticker, [ 'buy', 'bestBid', 'bestBidPrice' ]),\n            'bidVolume': this.safeString (ticker, 'bestBidSize'),\n            'ask': this.safeStringN (ticker, [ 'sell', 'bestAsk', 'bestAskPrice' ]),\n            'askVolume': this.safeString (ticker, 'bestAskSize'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'changePrice'),\n            'percentage': percentage,\n            'average': this.safeString (ticker, 'averagePrice'),\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'value'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 3889,
        "line_end": 4029,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"sequence\": \"1548764654235\",\n         \"side\": \"sell\",\n         \"size\":\"0.6841354\",\n         \"price\":\"0.03202\",\n         \"time\":1548848575203567174\n     }",
          "{\n         \"sequence\": \"1568787654360\",\n         \"symbol\": \"BTC-USDT\",\n         \"side\": \"buy\",\n         \"size\": \"0.00536577\",\n         \"price\": \"9345\",\n         \"takerOrderId\": \"5e356c4a9f1a790008f8d921\",\n         \"time\": \"1580559434436443257\",\n         \"type\": \"match\",\n         \"makerOrderId\": \"5e356bffedf0010008fa5d7f\",\n         \"tradeId\": \"5e356c4aeefabd62c62a1ece\"\n     }",
          "{\n         \"symbol\":\"BTC-USDT\",\n         \"tradeId\":\"5c35c02709e4f67d5266954e\",\n         \"orderId\":\"5c35c02703aa673ceec2a168\",\n         \"counterOrderId\":\"5c1ab46003aa676e487fa8e3\",\n         \"side\":\"buy\",\n         \"liquidity\":\"taker\",\n         \"forceTaker\":true,\n         \"price\":\"0.083\",\n         \"size\":\"0.8424304\",\n         \"funds\":\"0.0699217232\",\n         \"fee\":\"0\",\n         \"feeRate\":\"0\",\n         \"feeCurrency\":\"USDT\",\n         \"stop\":\"\",\n         \"type\":\"limit\",\n         \"createdAt\":1547026472000\n     }",
          "{\n         \"symbol\": \"OPEN-BTC\",\n         \"forceTaker\":  false,\n         \"orderId\": \"5ce36420054b4663b1fff2c9\",\n         \"fee\": \"0\",\n         \"feeCurrency\": \"\",\n         \"type\": \"\",\n         \"feeRate\": \"0\",\n         \"createdAt\": 1558417615000,\n         \"size\": \"12.8206\",\n         \"stop\": \"\",\n         \"price\": \"0\",\n         \"funds\": \"0\",\n         \"tradeId\": \"5ce390cf6e0db23b861c6e80\"\n     }",
          "{\n         \"symbol\": \"SNOV-ETH\",\n         \"dealPrice\": \"0.0000246\",\n         \"dealValue\": \"0.018942\",\n         \"amount\": \"770\",\n         \"fee\": \"0.00001137\",\n         \"side\": \"sell\",\n         \"createdAt\": 1540080199\n         \"id\":\"5c4d389e4c8c60413f78e2e5\",\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"sequence\": \"1548764654235\",\n        //         \"side\": \"sell\",\n        //         \"size\":\"0.6841354\",\n        //         \"price\":\"0.03202\",\n        //         \"time\":1548848575203567174\n        //     }\n        //\n        //     {\n        //         \"sequence\": \"1568787654360\",\n        //         \"symbol\": \"BTC-USDT\",\n        //         \"side\": \"buy\",\n        //         \"size\": \"0.00536577\",\n        //         \"price\": \"9345\",\n        //         \"takerOrderId\": \"5e356c4a9f1a790008f8d921\",\n        //         \"time\": \"1580559434436443257\",\n        //         \"type\": \"match\",\n        //         \"makerOrderId\": \"5e356bffedf0010008fa5d7f\",\n        //         \"tradeId\": \"5e356c4aeefabd62c62a1ece\"\n        //     }\n        //\n        // fetchMyTrades (private) v2\n        //\n        //     {\n        //         \"symbol\":\"BTC-USDT\",\n        //         \"tradeId\":\"5c35c02709e4f67d5266954e\",\n        //         \"orderId\":\"5c35c02703aa673ceec2a168\",\n        //         \"counterOrderId\":\"5c1ab46003aa676e487fa8e3\",\n        //         \"side\":\"buy\",\n        //         \"liquidity\":\"taker\",\n        //         \"forceTaker\":true,\n        //         \"price\":\"0.083\",\n        //         \"size\":\"0.8424304\",\n        //         \"funds\":\"0.0699217232\",\n        //         \"fee\":\"0\",\n        //         \"feeRate\":\"0\",\n        //         \"feeCurrency\":\"USDT\",\n        //         \"stop\":\"\",\n        //         \"type\":\"limit\",\n        //         \"createdAt\":1547026472000\n        //     }\n        //\n        // fetchMyTrades v2 alternative format since 2019-05-21 https://github.com/ccxt/ccxt/pull/5162\n        //\n        //     {\n        //         \"symbol\": \"OPEN-BTC\",\n        //         \"forceTaker\":  false,\n        //         \"orderId\": \"5ce36420054b4663b1fff2c9\",\n        //         \"fee\": \"0\",\n        //         \"feeCurrency\": \"\",\n        //         \"type\": \"\",\n        //         \"feeRate\": \"0\",\n        //         \"createdAt\": 1558417615000,\n        //         \"size\": \"12.8206\",\n        //         \"stop\": \"\",\n        //         \"price\": \"0\",\n        //         \"funds\": \"0\",\n        //         \"tradeId\": \"5ce390cf6e0db23b861c6e80\"\n        //     }\n        //\n        // fetchMyTrades (private) v1 (historical)\n        //\n        //     {\n        //         \"symbol\": \"SNOV-ETH\",\n        //         \"dealPrice\": \"0.0000246\",\n        //         \"dealValue\": \"0.018942\",\n        //         \"amount\": \"770\",\n        //         \"fee\": \"0.00001137\",\n        //         \"side\": \"sell\",\n        //         \"createdAt\": 1540080199\n        //         \"id\":\"5c4d389e4c8c60413f78e2e5\",\n        //     }\n        //\n        // uta fetchTrades\n        //\n        //     {\n        //         \"sequence\": \"18746044393340932\",\n        //         \"tradeId\": \"18746044393340932\",\n        //         \"price\": \"104355.6\",\n        //         \"size\": \"0.00011886\",\n        //         \"side\": \"sell\",\n        //         \"ts\": 1762242540829000000\n        //     }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market, '-');\n        const id = this.safeString2 (trade, 'tradeId', 'id');\n        const orderId = this.safeString (trade, 'orderId');\n        const takerOrMaker = this.safeString (trade, 'liquidity');\n        let timestamp = this.safeInteger2 (trade, 'time', 'ts');\n        if (timestamp !== undefined) {\n            timestamp = this.parseToInt (timestamp / 1000000);\n        } else {\n            timestamp = this.safeInteger (trade, 'createdAt');\n            // if it's a historical v1 trade, the exchange returns timestamp in seconds\n            if (('dealValue' in trade) && (timestamp !== undefined)) {\n                timestamp = timestamp * 1000;\n            }\n        }\n        const priceString = this.safeString2 (trade, 'price', 'dealPrice');\n        const amountString = this.safeString2 (trade, 'size', 'amount');\n        const side = this.safeString (trade, 'side');\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'feeCurrency');\n            let feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n            if (feeCurrency === undefined) {\n                feeCurrency = (side === 'sell') ? market['quote'] : market['base'];\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrency,\n                'rate': this.safeString (trade, 'feeRate'),\n            };\n        }\n        let type = this.safeString (trade, 'type');\n        if (type === 'match') {\n            type = undefined;\n        }\n        const costString = this.safeString2 (trade, 'funds', 'dealValue');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4137,
        "line_end": 4249,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'withdrawalId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'chain'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'remark')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"0x5f047b29041bcfdbf0e4478cdfa753a336ba6989\",\n         \"memo\": \"5c247c8a03aa677cea2a251d\",\n         \"amount\": 1,\n         \"fee\": 0.0001,\n         \"currency\": \"KCS\",\n         \"chain\": \"\",\n         \"isInner\": false,\n         \"walletTxId\": \"5bbb57386d99522d9f954c5a@test004\",\n         \"status\": \"SUCCESS\",\n         \"createdAt\": 1544178843000,\n         \"updatedAt\": 1544178891000\n         \"remark\":\"foobar\"\n     }",
          "{\n         \"id\": \"5c2dc64e03aa675aa263f1ac\",\n         \"address\": \"0x5bedb060b8eb8d823e2414d82acce78d38be7fe9\",\n         \"memo\": \"\",\n         \"currency\": \"ETH\",\n         \"chain\": \"\",\n         \"amount\": 1.0000000,\n         \"fee\": 0.0100000,\n         \"walletTxId\": \"3e2414d82acce78d38be7fe9\",\n         \"isInner\": false,\n         \"status\": \"FAILURE\",\n         \"createdAt\": 1546503758000,\n         \"updatedAt\": 1546504603000\n         \"remark\":\"foobar\"\n     }",
          "{\n         \"withdrawalId\":  \"5bffb63303aa675e8bbe18f9\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"address\": \"0x5f047b29041bcfdbf0e4478cdfa753a336ba6989\",\n        //         \"memo\": \"5c247c8a03aa677cea2a251d\",\n        //         \"amount\": 1,\n        //         \"fee\": 0.0001,\n        //         \"currency\": \"KCS\",\n        //         \"chain\": \"\",\n        //         \"isInner\": false,\n        //         \"walletTxId\": \"5bbb57386d99522d9f954c5a@test004\",\n        //         \"status\": \"SUCCESS\",\n        //         \"createdAt\": 1544178843000,\n        //         \"updatedAt\": 1544178891000\n        //         \"remark\":\"foobar\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"5c2dc64e03aa675aa263f1ac\",\n        //         \"address\": \"0x5bedb060b8eb8d823e2414d82acce78d38be7fe9\",\n        //         \"memo\": \"\",\n        //         \"currency\": \"ETH\",\n        //         \"chain\": \"\",\n        //         \"amount\": 1.0000000,\n        //         \"fee\": 0.0100000,\n        //         \"walletTxId\": \"3e2414d82acce78d38be7fe9\",\n        //         \"isInner\": false,\n        //         \"status\": \"FAILURE\",\n        //         \"createdAt\": 1546503758000,\n        //         \"updatedAt\": 1546504603000\n        //         \"remark\":\"foobar\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"withdrawalId\":  \"5bffb63303aa675e8bbe18f9\"\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let address = this.safeString (transaction, 'address');\n        const amount = this.safeString (transaction, 'amount');\n        let txid = this.safeString (transaction, 'walletTxId');\n        if (txid !== undefined) {\n            const txidParts = txid.split ('@');\n            const numTxidParts = txidParts.length;\n            if (numTxidParts > 1) {\n                if (address === undefined) {\n                    if (txidParts[1].length > 1) {\n                        address = txidParts[1];\n                    }\n                }\n            }\n            txid = txidParts[0];\n        }\n        let type = (txid === undefined) ? 'withdrawal' : 'deposit';\n        const rawStatus = this.safeString (transaction, 'status');\n        let fee = undefined;\n        const feeCost = this.safeString (transaction, 'fee');\n        if (feeCost !== undefined) {\n            let rate = undefined;\n            if (amount !== undefined) {\n                rate = Precise.stringDiv (feeCost, amount);\n            }\n            fee = {\n                'cost': this.parseNumber (feeCost),\n                'rate': this.parseNumber (rate),\n                'currency': code,\n            };\n        }\n        let timestamp = this.safeInteger2 (transaction, 'createdAt', 'createAt');\n        let updated = this.safeInteger (transaction, 'updatedAt');\n        const isV1 = !('createdAt' in transaction);\n        // if it's a v1 structure\n        if (isV1) {\n            type = ('address' in transaction) ? 'withdrawal' : 'deposit';\n            if (timestamp !== undefined) {\n                timestamp = timestamp * 1000;\n            }\n            if (updated !== undefined) {\n                updated = updated * 1000;\n            }\n        }\n        const internal = this.safeBool (transaction, 'isInner');\n        const tag = this.safeString (transaction, 'memo');\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'withdrawalId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (this.safeString (transaction, 'chain')),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'txid': txid,\n            'type': type,\n            'status': this.parseTransactionStatus (rawStatus),\n            'comment': this.safeString (transaction, 'remark'),\n            'internal': internal,\n            'fee': fee,\n            'updated': updated,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 4127,
        "line_end": 4135,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'SUCCESS': 'ok',\n            'PROCESSING': 'pending',\n            'WALLET_PROCESSING': 'pending',\n            'FAILURE': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 4701,
        "line_end": 4786,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeStringN (transfer, [ 'id', 'applyId', 'orderId' ])",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "accountFrom",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "accountTo",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"orderId\": \"605a6211e657f00006ad0ad6\"\n    }",
          "{\n        \"code\": \"200000\",\n        \"msg\": \"Failed to transfer out. The amount exceeds the upper limit\"\n    }",
          "{\n         \"applyId\": \"605a87217dff1500063d485d\",\n         \"bizNo\": \"bcd6e5e1291f4905af84dc\",\n         \"payAccountType\": \"CONTRACT\",\n         \"payTag\": \"DEFAULT\",\n         \"remark\": '',\n         \"recAccountType\": \"MAIN\",\n         \"recTag\": \"DEFAULT\",\n         \"recRemark\": '',\n         \"recSystem\": \"KUCOIN\",\n         \"status\": \"PROCESSING\",\n         \"currency\": \"XBT\",\n         \"amount\": \"0.00001\",\n         \"fee\": \"0\",\n         \"sn\": \"573688685663948\",\n         \"reason\": '',\n         \"createdAt\": 1616545569000,\n         \"updatedAt\": 1616545569000\n     }",
          "{\n     \"id\": \"611a1e7c6a053300067a88d9\",\n     \"currency\": \"USDT\",\n     \"amount\": \"10.00059547\",\n     \"fee\": \"0\",\n     \"balance\": \"0\",\n     \"accountType\": \"MAIN\",\n     \"bizType\": \"Transfer\",\n     \"direction\": \"in\",\n     \"createdAt\": 1629101692950,\n     \"context\": \"{\\\"orderId\\\":\\\"611a1e7c6a053300067a88d9\\\"}\"\n }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer (spot)\n        //\n        //    {\n        //        \"orderId\": \"605a6211e657f00006ad0ad6\"\n        //    }\n        //\n        //    {\n        //        \"code\": \"200000\",\n        //        \"msg\": \"Failed to transfer out. The amount exceeds the upper limit\"\n        //    }\n        //\n        // transfer (futures)\n        //\n        //     {\n        //         \"applyId\": \"605a87217dff1500063d485d\",\n        //         \"bizNo\": \"bcd6e5e1291f4905af84dc\",\n        //         \"payAccountType\": \"CONTRACT\",\n        //         \"payTag\": \"DEFAULT\",\n        //         \"remark\": '',\n        //         \"recAccountType\": \"MAIN\",\n        //         \"recTag\": \"DEFAULT\",\n        //         \"recRemark\": '',\n        //         \"recSystem\": \"KUCOIN\",\n        //         \"status\": \"PROCESSING\",\n        //         \"currency\": \"XBT\",\n        //         \"amount\": \"0.00001\",\n        //         \"fee\": \"0\",\n        //         \"sn\": \"573688685663948\",\n        //         \"reason\": '',\n        //         \"createdAt\": 1616545569000,\n        //         \"updatedAt\": 1616545569000\n        //     }\n        //\n        // ledger entry - from account ledgers API (for fetchTransfers)\n        //\n        // {\n        //     \"id\": \"611a1e7c6a053300067a88d9\",\n        //     \"currency\": \"USDT\",\n        //     \"amount\": \"10.00059547\",\n        //     \"fee\": \"0\",\n        //     \"balance\": \"0\",\n        //     \"accountType\": \"MAIN\",\n        //     \"bizType\": \"Transfer\",\n        //     \"direction\": \"in\",\n        //     \"createdAt\": 1629101692950,\n        //     \"context\": \"{\\\"orderId\\\":\\\"611a1e7c6a053300067a88d9\\\"}\"\n        // }\n        //\n        const timestamp = this.safeInteger (transfer, 'createdAt');\n        const currencyId = this.safeString (transfer, 'currency');\n        const rawStatus = this.safeString (transfer, 'status');\n        const bizType = this.safeString (transfer, 'bizType');\n        const isLedgerEntry = (bizType !== undefined);\n        let accountFromRaw = undefined;\n        let accountToRaw = undefined;\n        if (isLedgerEntry) {\n            // Ledger entry format: uses accountType + direction\n            const accountType = this.safeStringLower (transfer, 'accountType');\n            const direction = this.safeString (transfer, 'direction');\n            if (direction === 'out') {\n                accountFromRaw = accountType;\n            } else if (direction === 'in') {\n                accountToRaw = accountType;\n            }\n        } else {\n            // Transfer API format: uses payAccountType/recAccountType\n            accountFromRaw = this.safeStringLower (transfer, 'payAccountType');\n            accountToRaw = this.safeStringLower (transfer, 'recAccountType');\n        }\n        const accountsByType = this.safeDict (this.options, 'accountsByType');\n        const accountFrom = this.safeString (accountsByType, accountFromRaw, accountFromRaw);\n        const accountTo = this.safeString (accountsByType, accountToRaw, accountToRaw);\n        return {\n            'id': this.safeStringN (transfer, [ 'id', 'applyId', 'orderId' ]),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': accountFrom,\n            'toAccount': accountTo,\n            'status': this.parseTransferStatus (rawStatus),\n            'info': transfer,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 4788,
        "line_end": 4793,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'PROCESSING': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "kucoinfutures": [
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 3528,
        "line_end": 3584,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.parseNumber (Precise.stringMul (percentage, '100'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"600000000001260912\",\n         \"symbol\": \"XBTUSDTM\",\n         \"crossMode\": true,\n         \"maintMarginReq\": 0.0040000133,\n         \"delevPercentage\": 0.0,\n         \"openingTimestamp\": 1768481882915,\n         \"currentTimestamp\": 1768481897988,\n         \"currentQty\": 1,\n         \"currentCost\": 96.9768,\n         \"currentComm\": 0.05818608,\n         \"unrealisedCost\": 96.9768,\n         \"realisedGrossCost\": 0.0,\n         \"realisedCost\": 0.05818608,\n         \"isOpen\": true,\n         \"markPrice\": 96985.6,\n         \"markValue\": 96.9856,\n         \"posCost\": 96.9768,\n         \"posInit\": 4.84884,\n         \"posMargin\": 4.84928,\n         \"posMaint\": 0.38794369,\n         \"realisedGrossPnl\": 0.0,\n         \"realisedPnl\": -0.05818608,\n         \"unrealisedPnl\": 0.0088,\n         \"unrealisedPnlPcnt\": 1.0E-4,\n         \"unrealisedRoePcnt\": 0.0018,\n         \"avgEntryPrice\": 96976.8,\n         \"liquidationPrice\": 52351.69,\n         \"bankruptPrice\": 52110.87,\n         \"settleCurrency\": \"USDT\",\n         \"isInverse\": false,\n         \"maintainMargin\": 0.0040000133,\n         \"marginMode\": \"CROSS\",\n         \"positionSide\": \"LONG\",\n         \"leverage\": 20,\n         \"dealComm\": -0.05818608,\n         \"fundingFee\": 0,\n         \"tax\": 0\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionsADLRank\n        //\n        //     {\n        //         \"id\": \"600000000001260912\",\n        //         \"symbol\": \"XBTUSDTM\",\n        //         \"crossMode\": true,\n        //         \"maintMarginReq\": 0.0040000133,\n        //         \"delevPercentage\": 0.0,\n        //         \"openingTimestamp\": 1768481882915,\n        //         \"currentTimestamp\": 1768481897988,\n        //         \"currentQty\": 1,\n        //         \"currentCost\": 96.9768,\n        //         \"currentComm\": 0.05818608,\n        //         \"unrealisedCost\": 96.9768,\n        //         \"realisedGrossCost\": 0.0,\n        //         \"realisedCost\": 0.05818608,\n        //         \"isOpen\": true,\n        //         \"markPrice\": 96985.6,\n        //         \"markValue\": 96.9856,\n        //         \"posCost\": 96.9768,\n        //         \"posInit\": 4.84884,\n        //         \"posMargin\": 4.84928,\n        //         \"posMaint\": 0.38794369,\n        //         \"realisedGrossPnl\": 0.0,\n        //         \"realisedPnl\": -0.05818608,\n        //         \"unrealisedPnl\": 0.0088,\n        //         \"unrealisedPnlPcnt\": 1.0E-4,\n        //         \"unrealisedRoePcnt\": 0.0018,\n        //         \"avgEntryPrice\": 96976.8,\n        //         \"liquidationPrice\": 52351.69,\n        //         \"bankruptPrice\": 52110.87,\n        //         \"settleCurrency\": \"USDT\",\n        //         \"isInverse\": false,\n        //         \"maintainMargin\": 0.0040000133,\n        //         \"marginMode\": \"CROSS\",\n        //         \"positionSide\": \"LONG\",\n        //         \"leverage\": 20,\n        //         \"dealComm\": -0.05818608,\n        //         \"fundingFee\": 0,\n        //         \"tax\": 0\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger (info, 'openingTimestamp');\n        const percentage = this.safeString (info, 'delevPercentage');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': undefined,\n            'rating': undefined,\n            'percentage': this.parseNumber (Precise.stringMul (percentage, '100')),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2513,
        "line_end": 2527,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const data = this.safeValue (response, 'data');\n        const currencyId = this.safeString (data, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const account = this.account ();\n        account['free'] = this.safeString (data, 'availableBalance');\n        account['total'] = this.safeString (data, 'accountEquity');\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 4422,
        "line_end": 4431,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString2 (entry, 'holdBalance', 'hold');\n        account['free'] = this.safeString2 (entry, 'availableBalance', 'available');\n        account['total'] = this.safeString2 (entry, 'totalBalance', 'total');\n        const debt = this.safeString (entry, 'liability');\n        const interest = this.safeString (entry, 'interest');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 5181,
        "line_end": 5255,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "interest",
            "value": "interest",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'dailyIntRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "amountBorrowed",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"1INCH\",\n         \"total\": \"0\",\n         \"available\": \"0\",\n         \"hold\": \"0\",\n         \"liability\": \"0\",\n         \"maxBorrowSize\": \"0\",\n         \"borrowEnabled\": true,\n         \"transferInEnabled\": true\n     }",
          "{\n         \"symbol\": \"MANA-USDT\",\n         \"debtRatio\": \"0\",\n         \"status\": \"BORROW\",\n         \"baseAsset\": {\n             \"currency\": \"MANA\",\n             \"borrowEnabled\": true,\n             \"repayEnabled\": true,\n             \"transferEnabled\": true,\n             \"borrowed\": \"0\",\n             \"totalAsset\": \"0\",\n             \"available\": \"0\",\n             \"hold\": \"0\",\n             \"maxBorrowSize\": \"1000\"\n         },\n         \"quoteAsset\": {\n             \"currency\": \"USDT\",\n             \"borrowEnabled\": true,\n             \"repayEnabled\": true,\n             \"transferEnabled\": true,\n             \"borrowed\": \"0\",\n             \"totalAsset\": \"0\",\n             \"available\": \"0\",\n             \"hold\": \"0\",\n             \"maxBorrowSize\": \"50000\"\n         }\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        // Cross\n        //\n        //     {\n        //         \"currency\": \"1INCH\",\n        //         \"total\": \"0\",\n        //         \"available\": \"0\",\n        //         \"hold\": \"0\",\n        //         \"liability\": \"0\",\n        //         \"maxBorrowSize\": \"0\",\n        //         \"borrowEnabled\": true,\n        //         \"transferInEnabled\": true\n        //     }\n        //\n        // Isolated\n        //\n        //     {\n        //         \"symbol\": \"MANA-USDT\",\n        //         \"debtRatio\": \"0\",\n        //         \"status\": \"BORROW\",\n        //         \"baseAsset\": {\n        //             \"currency\": \"MANA\",\n        //             \"borrowEnabled\": true,\n        //             \"repayEnabled\": true,\n        //             \"transferEnabled\": true,\n        //             \"borrowed\": \"0\",\n        //             \"totalAsset\": \"0\",\n        //             \"available\": \"0\",\n        //             \"hold\": \"0\",\n        //             \"maxBorrowSize\": \"1000\"\n        //         },\n        //         \"quoteAsset\": {\n        //             \"currency\": \"USDT\",\n        //             \"borrowEnabled\": true,\n        //             \"repayEnabled\": true,\n        //             \"transferEnabled\": true,\n        //             \"borrowed\": \"0\",\n        //             \"totalAsset\": \"0\",\n        //             \"available\": \"0\",\n        //             \"hold\": \"0\",\n        //             \"maxBorrowSize\": \"50000\"\n        //         }\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const marginMode = (marketId === undefined) ? 'cross' : 'isolated';\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeString (market, 'symbol');\n        const timestamp = this.safeInteger (info, 'createdAt');\n        const isolatedBase = this.safeDict (info, 'baseAsset', {});\n        let amountBorrowed = undefined;\n        let interest = undefined;\n        let currencyId = undefined;\n        if (marginMode === 'isolated') {\n            amountBorrowed = this.safeNumber (isolatedBase, 'liability');\n            interest = this.safeNumber (isolatedBase, 'interest');\n            currencyId = this.safeString (isolatedBase, 'currency');\n        } else {\n            amountBorrowed = this.safeNumber (info, 'liability');\n            interest = this.safeNumber (info, 'accruedInterest');\n            currencyId = this.safeString (info, 'currency');\n        }\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': this.safeCurrencyCode (currencyId),\n            'interest': interest,\n            'interestRate': this.safeNumber (info, 'dailyIntRate'),\n            'amountBorrowed': amountBorrowed,\n            'marginMode': marginMode,\n            'timestamp': timestamp,  // create time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 5041,
        "line_end": 5070,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber2 (info, 'dailyIntRate', 'dayRatio')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"tradeId\": \"62db2dcaff219600012b56cd\",\n         \"currency\": \"USDT\",\n         \"size\": \"10\",\n         \"dailyIntRate\": \"0.00003\",\n         \"term\": 7,\n         \"timestamp\": 1658531274508488480\n     },",
          "{\n         \"createdAt\": 1697783812257,\n         \"currency\": \"XMR\",\n         \"interestAmount\": \"0.1\",\n         \"dayRatio\": \"0.001\"\n     }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"tradeId\": \"62db2dcaff219600012b56cd\",\n        //         \"currency\": \"USDT\",\n        //         \"size\": \"10\",\n        //         \"dailyIntRate\": \"0.00003\",\n        //         \"term\": 7,\n        //         \"timestamp\": 1658531274508488480\n        //     },\n        //\n        //     {\n        //         \"createdAt\": 1697783812257,\n        //         \"currency\": \"XMR\",\n        //         \"interestAmount\": \"0.1\",\n        //         \"dayRatio\": \"0.001\"\n        //     }\n        //\n        const timestampId = this.safeString2 (info, 'createdAt', 'timestamp');\n        const timestamp = this.parseToInt (timestampId.slice (0, 13));\n        const currencyId = this.safeString (info, 'currency');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.safeNumber2 (info, 'dailyIntRate', 'dayRatio'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseBorrowRateHistories",
        "signature": "parseBorrowRateHistories (response, codes, since, limit)",
        "line_start": 5367,
        "line_end": 5397,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         {\n             \"createdAt\": 1697783812257,\n             \"currency\": \"XMR\",\n             \"interestAmount\": \"0.1\",\n             \"dayRatio\": \"0.001\"\n         }\n     ]"
        ],
        "source": "parseBorrowRateHistories (response, codes, since, limit) {\n        //\n        //     [\n        //         {\n        //             \"createdAt\": 1697783812257,\n        //             \"currency\": \"XMR\",\n        //             \"interestAmount\": \"0.1\",\n        //             \"dayRatio\": \"0.001\"\n        //         }\n        //     ]\n        //\n        const borrowRateHistories: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const item = response[i];\n            const code = this.safeCurrencyCode (this.safeString (item, 'currency'));\n            if (codes === undefined || this.inArray (code, codes)) {\n                if (!(code in borrowRateHistories)) {\n                    borrowRateHistories[code] = [];\n                }\n                const borrowRateStructure = this.parseBorrowRate (item);\n                const borrowRateHistoriesCode = borrowRateHistories[code];\n                borrowRateHistoriesCode.push (borrowRateStructure);\n            }\n        }\n        const keys = Object.keys (borrowRateHistories);\n        for (let i = 0; i < keys.length; i++) {\n            const code = keys[i];\n            borrowRateHistories[code] = this.filterByCurrencySinceLimit (borrowRateHistories[code], code, since, limit);\n        }\n        return borrowRateHistories;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2533,
        "line_end": 2554,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (depositAddress, 'chainId'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        let address = this.safeString (depositAddress, 'address');\n        // BCH/BSV is returned with a \"bitcoincash:\" prefix, which we cut off here and only keep the address\n        if (address !== undefined) {\n            address = address.replace ('bitcoincash:', '');\n        }\n        let code = undefined;\n        if (currency !== undefined) {\n            code = this.safeCurrencyCode (currency['id']);\n            if (code !== 'NIM') {\n                // contains spaces\n                this.checkAddress (address);\n            }\n        }\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': this.networkIdToCode (this.safeString (depositAddress, 'chainId')),\n            'address': address,\n            'tag': this.safeString (depositAddress, 'memo'),\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 1901,
        "line_end": 1971,
        "comment": null,
        "mappings": [
          {
            "key": "withdraw",
            "value": "{\n                        'fee': this.safeNumber2 (chain, 'withdrawalMinFee', 'withdrawMinFee'),\n                        'percentage': false,\n                    }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'fee': undefined,\n                        'percentage': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                'fee': minWithdrawFee,\n                'percentage': false,\n            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                'fee': undefined,\n                'percentage': undefined,\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "minWithdrawFee",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"currency\": \"USDT\",\n        \"limitBTCAmount\": \"1.00000000\",\n        \"usedBTCAmount\": \"0.00000000\",\n        \"remainAmount\": \"16548.072149\",\n        \"availableAmount\": \"0\",\n        \"withdrawMinFee\": \"25\",\n        \"innerWithdrawMinFee\": \"0\",\n        \"withdrawMinSize\": \"50\",\n        \"isWithdrawEnabled\": true,\n        \"precision\": 6,\n        \"chain\": \"ERC20\"\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"currency\": \"USDT\",\n        //        \"limitBTCAmount\": \"1.00000000\",\n        //        \"usedBTCAmount\": \"0.00000000\",\n        //        \"remainAmount\": \"16548.072149\",\n        //        \"availableAmount\": \"0\",\n        //        \"withdrawMinFee\": \"25\",\n        //        \"innerWithdrawMinFee\": \"0\",\n        //        \"withdrawMinSize\": \"50\",\n        //        \"isWithdrawEnabled\": true,\n        //        \"precision\": 6,\n        //        \"chain\": \"ERC20\"\n        //    }\n        //\n        if ('chains' in fee) {\n            // if data obtained through `currencies` endpoint\n            const resultNew: Dict = {\n                'info': fee,\n                'withdraw': {\n                    'fee': undefined,\n                    'percentage': false,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n                'networks': {},\n            };\n            const chains = this.safeList (fee, 'chains', []);\n            for (let i = 0; i < chains.length; i++) {\n                const chain = chains[i];\n                const networkCodeNew = this.networkIdToCode (this.safeString (chain, 'chainId'), this.safeString (currency, 'code'));\n                resultNew['networks'][networkCodeNew] = {\n                    'withdraw': {\n                        'fee': this.safeNumber2 (chain, 'withdrawalMinFee', 'withdrawMinFee'),\n                        'percentage': false,\n                    },\n                    'deposit': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                };\n            }\n            return resultNew;\n        }\n        const minWithdrawFee = this.safeNumber (fee, 'withdrawMinFee');\n        const result: Dict = {\n            'info': fee,\n            'withdraw': {\n                'fee': minWithdrawFee,\n                'percentage': false,\n            },\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n            'networks': {},\n        };\n        const networkId = this.safeString (fee, 'chain');\n        const networkCode = this.networkIdToCode (networkId, this.safeString (currency, 'code'));\n        result['networks'][networkCode] = {\n            'withdraw': minWithdrawFee,\n            'deposit': {\n                'fee': undefined,\n                'percentage': undefined,\n            },\n        };\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 2502,
        "line_end": 2511,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (data, market: Market = undefined): FundingRate",
        "line_start": 2468,
        "line_end": 2500,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (data, 'value')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (data, 'predictedValue')",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (this.safeString (data, 'granularity'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \".ETHUSDTMFPI8H\",\n         \"granularity\": 28800000,\n         \"timePoint\": 1637380800000,\n         \"value\": 0.0001,\n         \"predictedValue\": 0.0001,\n     }"
        ],
        "source": "parseFundingRate (data, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \".ETHUSDTMFPI8H\",\n        //         \"granularity\": 28800000,\n        //         \"timePoint\": 1637380800000,\n        //         \"value\": 0.0001,\n        //         \"predictedValue\": 0.0001,\n        //     }\n        //\n        const fundingTimestamp = this.safeInteger (data, 'timePoint');\n        const marketId = this.safeString (data, 'symbol');\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (data, 'value'),\n            'fundingTimestamp': fundingTimestamp,\n            'fundingDatetime': this.iso8601 (fundingTimestamp),\n            'nextFundingRate': this.safeNumber (data, 'predictedValue'),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (this.safeString (data, 'granularity')),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (info, market: Market = undefined)",
        "line_start": 3195,
        "line_end": 3205,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (info, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRateHistory (info, market: Market = undefined) {\n        const timestamp = this.safeInteger (info, 'timepoint');\n        const marketId = this.safeString (info, 'symbol');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market),\n            'fundingRate': this.safeNumber (info, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 4840,
        "line_end": 4922,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "account",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "balanceAfter",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"611a1e7c6a053300067a88d9\", //unique key for each ledger entry\n         \"currency\": \"USDT\", //Currency\n         \"amount\": \"10.00059547\", //The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution.\n         \"fee\": \"0\", //Deposit or withdrawal fee\n         \"balance\": \"0\", //Total assets of a currency remaining funds after transaction\n         \"accountType\": \"MAIN\", //Account Type\n         \"bizType\": \"Loans Repaid\", //business type\n         \"direction\": \"in\", //side, in or out\n         \"createdAt\": 1629101692950, //Creation time\n         \"context\": \"{\\\"borrowerUserId\\\":\\\"601ad03e50dc810006d242ea\\\",\\\"loanRepayDetailNo\\\":\\\"611a1e7cc913d000066cf7ec\\\"}\" //Business core parameters\n     }",
          "\"{\\\"orderId\\\":\\\"617bb2d09e7b3b000196dac8\\\",\\\"txId\\\":\\\"0x79bb9855f86b351a45cab4dc69d78ca09586a94c45dde49475722b98f401b054\\\"}\"",
          "\"{\\\"orderId\\\":\\\"617ab9949e7b3b0001948081\\\",\\\"txId\\\":\\\"0x7a06b16bbd6b03dbc3d96df5683b15229fc35e7184fd7179a5f3a310bd67d1fa@default@0\\\"}\"",
          "\"{\\\"symbol\\\":\\\"ETH-USDT\\\",\\\"orderId\\\":\\\"617adcd1eb3fa20001dd29a1\\\",\\\"tradeId\\\":\\\"617adcd12e113d2b91222ff9\\\"}\""
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"id\": \"611a1e7c6a053300067a88d9\", //unique key for each ledger entry\n        //         \"currency\": \"USDT\", //Currency\n        //         \"amount\": \"10.00059547\", //The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution.\n        //         \"fee\": \"0\", //Deposit or withdrawal fee\n        //         \"balance\": \"0\", //Total assets of a currency remaining funds after transaction\n        //         \"accountType\": \"MAIN\", //Account Type\n        //         \"bizType\": \"Loans Repaid\", //business type\n        //         \"direction\": \"in\", //side, in or out\n        //         \"createdAt\": 1629101692950, //Creation time\n        //         \"context\": \"{\\\"borrowerUserId\\\":\\\"601ad03e50dc810006d242ea\\\",\\\"loanRepayDetailNo\\\":\\\"611a1e7cc913d000066cf7ec\\\"}\" //Business core parameters\n        //     }\n        //\n        const id = this.safeString (item, 'id');\n        const currencyId = this.safeString (item, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amount = this.safeNumber (item, 'amount');\n        const balanceAfter = undefined;\n        // const balanceAfter = this.safeNumber (item, 'balance'); only returns zero string\n        const bizType = this.safeString (item, 'bizType');\n        const type = this.parseLedgerEntryType (bizType);\n        const direction = this.safeString (item, 'direction');\n        const timestamp = this.safeInteger (item, 'createdAt');\n        const datetime = this.iso8601 (timestamp);\n        const account = this.safeString (item, 'accountType'); // MAIN, TRADE, MARGIN, or CONTRACT\n        const context = this.safeString (item, 'context'); // contains other information about the ledger entry\n        //\n        // withdrawal transaction\n        //\n        //     \"{\\\"orderId\\\":\\\"617bb2d09e7b3b000196dac8\\\",\\\"txId\\\":\\\"0x79bb9855f86b351a45cab4dc69d78ca09586a94c45dde49475722b98f401b054\\\"}\"\n        //\n        // deposit to MAIN, trade via MAIN\n        //\n        //     \"{\\\"orderId\\\":\\\"617ab9949e7b3b0001948081\\\",\\\"txId\\\":\\\"0x7a06b16bbd6b03dbc3d96df5683b15229fc35e7184fd7179a5f3a310bd67d1fa@default@0\\\"}\"\n        //\n        // sell trade\n        //\n        //     \"{\\\"symbol\\\":\\\"ETH-USDT\\\",\\\"orderId\\\":\\\"617adcd1eb3fa20001dd29a1\\\",\\\"tradeId\\\":\\\"617adcd12e113d2b91222ff9\\\"}\"\n        //\n        let referenceId = undefined;\n        if (context !== undefined && context !== '') {\n            try {\n                const parsed = JSON.parse (context);\n                const orderId = this.safeString (parsed, 'orderId');\n                const tradeId = this.safeString (parsed, 'tradeId');\n                // transactions only have an orderId but for trades we wish to use tradeId\n                if (tradeId !== undefined) {\n                    referenceId = tradeId;\n                } else {\n                    referenceId = orderId;\n                }\n            } catch (exc) {\n                referenceId = context;\n            }\n        }\n        let fee = undefined;\n        const feeCost = this.safeString (item, 'fee');\n        let feeCurrency = undefined;\n        if (feeCost !== '0') {\n            feeCurrency = code;\n            fee = { 'cost': this.parseNumber (feeCost), 'currency': feeCurrency };\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': id,\n            'direction': direction,\n            'account': account,\n            'referenceId': referenceId,\n            'referenceAccount': account,\n            'type': type,\n            'currency': code,\n            'amount': amount,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'before': undefined,\n            'after': balanceAfter, // undefined\n            'status': undefined,\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 4795,
        "line_end": 4838,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'Assets Transferred in After Upgrading': 'transfer', // Assets Transferred in After V1 to V2 Upgrading\n            'Deposit': 'transaction', // Deposit\n            'Withdrawal': 'transaction', // Withdrawal\n            'Transfer': 'transfer', // Transfer\n            'Trade_Exchange': 'trade', // Trade\n            // 'Vote for Coin': 'Vote for Coin', // Vote for Coin\n            'KuCoin Bonus': 'bonus', // KuCoin Bonus\n            'Referral Bonus': 'referral', // Referral Bonus\n            'Rewards': 'bonus', // Activities Rewards\n            // 'Distribution': 'Distribution', // Distribution, such as get GAS by holding NEO\n            'Airdrop/Fork': 'airdrop', // Airdrop/Fork\n            'Other rewards': 'bonus', // Other rewards, except Vote, Airdrop, Fork\n            'Fee Rebate': 'rebate', // Fee Rebate\n            'Buy Crypto': 'trade', // Use credit card to buy crypto\n            'Sell Crypto': 'sell', // Use credit card to sell crypto\n            'Public Offering Purchase': 'trade', // Public Offering Purchase for Spotlight\n            // 'Send red envelope': 'Send red envelope', // Send red envelope\n            // 'Open red envelope': 'Open red envelope', // Open red envelope\n            // 'Staking': 'Staking', // Staking\n            // 'LockDrop Vesting': 'LockDrop Vesting', // LockDrop Vesting\n            // 'Staking Profits': 'Staking Profits', // Staking Profits\n            // 'Redemption': 'Redemption', // Redemption\n            'Refunded Fees': 'fee', // Refunded Fees\n            'KCS Pay Fees': 'fee', // KCS Pay Fees\n            'Margin Trade': 'trade', // Margin Trade\n            'Loans': 'Loans', // Loans\n            // 'Borrowings': 'Borrowings', // Borrowings\n            // 'Debt Repayment': 'Debt Repayment', // Debt Repayment\n            // 'Loans Repaid': 'Loans Repaid', // Loans Repaid\n            // 'Lendings': 'Lendings', // Lendings\n            // 'Pool transactions': 'Pool transactions', // Pool-X transactions\n            'Instant Exchange': 'trade', // Instant Exchange\n            'Sub-account transfer': 'transfer', // Sub-account transfer\n            'Liquidation Fees': 'fee', // Liquidation Fees\n            // 'Soft Staking Profits': 'Soft Staking Profits', // Soft Staking Profits\n            // 'Voting Earnings': 'Voting Earnings', // Voting Earnings on Pool-X\n            // 'Redemption of Voting': 'Redemption of Voting', // Redemption of Voting on Pool-X\n            // 'Voting': 'Voting', // Voting on Pool-X\n            // 'Convert to KCS': 'Convert to KCS', // Convert to KCS\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3452,
        "line_end": 3463,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageNum",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageNum",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const leverageNum = this.safeInteger (leverage, 'leverage');\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': undefined,\n            'longLeverage': leverageNum,\n            'shortLeverage': leverageNum,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 5547,
        "line_end": 5565,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (info, 'orderNo')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'actualSize')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderNo\": \"5da6dba0f943c0c81f5d5db5\",\n         \"actualSize\": 10\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"orderNo\": \"5da6dba0f943c0c81f5d5db5\",\n        //         \"actualSize\": 10\n        //     }\n        //\n        const timestamp = this.milliseconds ();\n        const currencyId = this.safeString (info, 'currency');\n        return {\n            'id': this.safeString (info, 'orderNo'),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'actualSize'),\n            'symbol': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode",
        "line_start": 3310,
        "line_end": 3318,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginType",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n        let marginType = this.safeString (marginMode, 'marginMode');\n        marginType = (marginType === 'ISOLATED') ? 'isolated' : 'cross';\n        return {\n            'info': marginMode,\n            'symbol': market['symbol'],\n            'marginMode': marginType,\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (info, market: Market = undefined): MarginModification",
        "line_start": 1983,
        "line_end": 2048,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "mode",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\": \"62311d26064e8f00013f2c6d\",\n        \"symbol\": \"XRPUSDTM\",\n        \"autoDeposit\": false,\n        \"maintMarginReq\": 0.01,\n        \"riskLimit\": 200000,\n        \"realLeverage\": 0.88,\n        \"crossMode\": false,\n        \"delevPercentage\": 0.4,\n        \"openingTimestamp\": 1647385894798,\n        \"currentTimestamp\": 1647414510672,\n        \"currentQty\": -1,\n        \"currentCost\": -7.658,\n        \"currentComm\": 0.0053561,\n        \"unrealisedCost\": -7.658,\n        \"realisedGrossCost\": 0,\n        \"realisedCost\": 0.0053561,\n        \"isOpen\": true,\n        \"markPrice\": 0.7635,\n        \"markValue\": -7.635,\n        \"posCost\": -7.658,\n        \"posCross\": 1.00016084,\n        \"posInit\": 7.658,\n        \"posComm\": 0.00979006,\n        \"posLoss\": 0,\n        \"posMargin\": 8.6679509,\n        \"posMaint\": 0.08637006,\n        \"maintMargin\": 8.6909509,\n        \"realisedGrossPnl\": 0,\n        \"realisedPnl\": -0.0038335,\n        \"unrealisedPnl\": 0.023,\n        \"unrealisedPnlPcnt\": 0.003,\n        \"unrealisedRoePcnt\": 0.003,\n        \"avgEntryPrice\": 0.7658,\n        \"liquidationPrice\": 1.6239,\n        \"bankruptPrice\": 1.6317,\n        \"settleCurrency\": \"USDT\"\n    }",
          "{\n        \"code\":\"200000\",\n        \"msg\":\"Position does not exist\"\n    }"
        ],
        "source": "parseMarginModification (info, market: Market = undefined): MarginModification {\n        //\n        //    {\n        //        \"id\": \"62311d26064e8f00013f2c6d\",\n        //        \"symbol\": \"XRPUSDTM\",\n        //        \"autoDeposit\": false,\n        //        \"maintMarginReq\": 0.01,\n        //        \"riskLimit\": 200000,\n        //        \"realLeverage\": 0.88,\n        //        \"crossMode\": false,\n        //        \"delevPercentage\": 0.4,\n        //        \"openingTimestamp\": 1647385894798,\n        //        \"currentTimestamp\": 1647414510672,\n        //        \"currentQty\": -1,\n        //        \"currentCost\": -7.658,\n        //        \"currentComm\": 0.0053561,\n        //        \"unrealisedCost\": -7.658,\n        //        \"realisedGrossCost\": 0,\n        //        \"realisedCost\": 0.0053561,\n        //        \"isOpen\": true,\n        //        \"markPrice\": 0.7635,\n        //        \"markValue\": -7.635,\n        //        \"posCost\": -7.658,\n        //        \"posCross\": 1.00016084,\n        //        \"posInit\": 7.658,\n        //        \"posComm\": 0.00979006,\n        //        \"posLoss\": 0,\n        //        \"posMargin\": 8.6679509,\n        //        \"posMaint\": 0.08637006,\n        //        \"maintMargin\": 8.6909509,\n        //        \"realisedGrossPnl\": 0,\n        //        \"realisedPnl\": -0.0038335,\n        //        \"unrealisedPnl\": 0.023,\n        //        \"unrealisedPnlPcnt\": 0.003,\n        //        \"unrealisedRoePcnt\": 0.003,\n        //        \"avgEntryPrice\": 0.7658,\n        //        \"liquidationPrice\": 1.6239,\n        //        \"bankruptPrice\": 1.6317,\n        //        \"settleCurrency\": \"USDT\"\n        //    }\n        //\n        //    {\n        //        \"code\":\"200000\",\n        //        \"msg\":\"Position does not exist\"\n        //    }\n        //\n        const id = this.safeString (info, 'id');\n        market = this.safeMarket (id, market);\n        const currencyId = this.safeString (info, 'settleCurrency');\n        const crossMode = this.safeValue (info, 'crossMode');\n        const mode = crossMode ? 'cross' : 'isolated';\n        const marketId = this.safeString (market, 'symbol');\n        const timestamp = this.safeInteger (info, 'currentTimestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market),\n            'type': undefined,\n            'marginMode': mode,\n            'amount': undefined,\n            'total': undefined,\n            'code': this.safeCurrencyCode (currencyId),\n            'status': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 3104,
        "line_end": 3139,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeNumber (tier, 'level')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['base']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (tier, 'minRiskLimit')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'maxRiskLimit')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintainMargin')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'maxLeverage')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "@param {object} info Exchange market response for 1 market",
          "@param {object} market CCXT market",
          "{\n        \"symbol\": \"ETHUSDTM\",\n        \"level\": 1,\n        \"maxRiskLimit\": 300000,\n        \"minRiskLimit\": 0,\n        \"maxLeverage\": 100,\n        \"initialMargin\": 0.0100000000,\n        \"maintainMargin\": 0.0050000000\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @name kucoinfutures#parseMarketLeverageTiers\n         * @param {object} info Exchange market response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    {\n        //        \"symbol\": \"ETHUSDTM\",\n        //        \"level\": 1,\n        //        \"maxRiskLimit\": 300000,\n        //        \"minRiskLimit\": 0,\n        //        \"maxLeverage\": 100,\n        //        \"initialMargin\": 0.0100000000,\n        //        \"maintainMargin\": 0.0050000000\n        //    }\n        //\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const tier = info[i];\n            const marketId = this.safeString (tier, 'symbol');\n            tiers.push ({\n                'tier': this.safeNumber (tier, 'level'),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n                'currency': market['base'],\n                'minNotional': this.safeNumber (tier, 'minRiskLimit'),\n                'maxNotional': this.safeNumber (tier, 'maxRiskLimit'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintainMargin'),\n                'maxLeverage': this.safeNumber (tier, 'maxLeverage'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 733,
        "line_end": 753,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        \"1545904980000\",          // Start time of the candle cycle\n        \"0.058\",                  // opening price\n        \"0.049\",                  // closing price\n        \"0.058\",                  // highest price\n        \"0.049\",                  // lowest price\n        \"0.018\",                  // base volume\n        \"0.000945\",               // quote volume\n    ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //    [\n        //        \"1545904980000\",          // Start time of the candle cycle\n        //        \"0.058\",                  // opening price\n        //        \"0.049\",                  // closing price\n        //        \"0.058\",                  // highest price\n        //        \"0.049\",                  // lowest price\n        //        \"0.018\",                  // base volume\n        //        \"0.000945\",               // quote volume\n        //    ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2288,
        "line_end": 2420,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"64507d02921f1c0001ff6892\",\n         \"symbol\": \"XBTUSDTM\",\n         \"type\": \"market\",\n         \"side\": \"buy\",\n         \"price\": null,\n         \"size\": 1,\n         \"value\": \"27.992\",\n         \"dealValue\": \"27.992\",\n         \"dealSize\": 1,\n         \"stp\": \"\",\n         \"stop\": \"\",\n         \"stopPriceType\": \"\",\n         \"stopTriggered\": false,\n         \"stopPrice\": null,\n         \"timeInForce\": \"GTC\",\n         \"postOnly\": false,\n         \"hidden\": false,\n         \"iceberg\": false,\n         \"leverage\": \"17\",\n         \"forceHold\": false,\n         \"closeOrder\": false,\n         \"visibleSize\": null,\n         \"clientOid\": null,\n         \"remark\": null,\n         \"tags\": null,\n         \"isActive\": false,\n         \"cancelExist\": false,\n         \"createdAt\": 1682996482000,\n         \"updatedAt\": 1682996483062,\n         \"endAt\": 1682996483062,\n         \"orderTime\": 1682996482953900677,\n         \"settleCurrency\": \"USDT\",\n         \"status\": \"done\",\n         \"filledValue\": \"27.992\",\n         \"filledSize\": 1,\n         \"reduceOnly\": false\n     }",
          "{\n         \"orderId\": \"619717484f1d010001510cde\"\n     }",
          "{\n         \"orderId\": \"80465574458560512\",\n         \"clientOid\": \"5c52e11203aa677f33e491\",\n         \"symbol\": \"ETHUSDTM\",\n         \"code\": \"200000\",\n         \"msg\": \"success\"\n     }",
          "const average = Precise.stringDiv (cost, Precise.stringMul (filled, market['contractSize']));"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrder, fetchOrdersByStatus\n        //\n        //     {\n        //         \"id\": \"64507d02921f1c0001ff6892\",\n        //         \"symbol\": \"XBTUSDTM\",\n        //         \"type\": \"market\",\n        //         \"side\": \"buy\",\n        //         \"price\": null,\n        //         \"size\": 1,\n        //         \"value\": \"27.992\",\n        //         \"dealValue\": \"27.992\",\n        //         \"dealSize\": 1,\n        //         \"stp\": \"\",\n        //         \"stop\": \"\",\n        //         \"stopPriceType\": \"\",\n        //         \"stopTriggered\": false,\n        //         \"stopPrice\": null,\n        //         \"timeInForce\": \"GTC\",\n        //         \"postOnly\": false,\n        //         \"hidden\": false,\n        //         \"iceberg\": false,\n        //         \"leverage\": \"17\",\n        //         \"forceHold\": false,\n        //         \"closeOrder\": false,\n        //         \"visibleSize\": null,\n        //         \"clientOid\": null,\n        //         \"remark\": null,\n        //         \"tags\": null,\n        //         \"isActive\": false,\n        //         \"cancelExist\": false,\n        //         \"createdAt\": 1682996482000,\n        //         \"updatedAt\": 1682996483062,\n        //         \"endAt\": 1682996483062,\n        //         \"orderTime\": 1682996482953900677,\n        //         \"settleCurrency\": \"USDT\",\n        //         \"status\": \"done\",\n        //         \"filledValue\": \"27.992\",\n        //         \"filledSize\": 1,\n        //         \"reduceOnly\": false\n        //     }\n        //\n        // createOrder\n        //\n        //     {\n        //         \"orderId\": \"619717484f1d010001510cde\"\n        //     }\n        //\n        // createOrders\n        //\n        //     {\n        //         \"orderId\": \"80465574458560512\",\n        //         \"clientOid\": \"5c52e11203aa677f33e491\",\n        //         \"symbol\": \"ETHUSDTM\",\n        //         \"code\": \"200000\",\n        //         \"msg\": \"success\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const orderId = this.safeString2 (order, 'id', 'orderId');\n        const type = this.safeString (order, 'type');\n        const timestamp = this.safeInteger (order, 'createdAt');\n        const datetime = this.iso8601 (timestamp);\n        const price = this.safeString (order, 'price');\n        // price is zero for market order\n        // omitZero is called in safeOrder2\n        const side = this.safeString (order, 'side');\n        const feeCurrencyId = this.safeString (order, 'feeCurrency');\n        const feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n        const feeCost = this.safeNumber (order, 'fee');\n        const amount = this.safeString (order, 'size');\n        const filled = this.safeString (order, 'filledSize');\n        const cost = this.safeString (order, 'filledValue');\n        let average = this.safeString (order, 'avgDealPrice');\n        if ((average === undefined) && Precise.stringGt (filled, '0')) {\n            const contractSize = this.safeString (market, 'contractSize');\n            if (market['linear']) {\n                average = Precise.stringDiv (cost, Precise.stringMul (contractSize, filled));\n            } else {\n                average = Precise.stringDiv (Precise.stringMul (contractSize, filled), cost);\n            }\n        }\n        // precision reported by their api is 8 d.p.\n        // const average = Precise.stringDiv (cost, Precise.stringMul (filled, market['contractSize']));\n        // bool\n        const isActive = this.safeValue (order, 'isActive');\n        const cancelExist = this.safeBool (order, 'cancelExist', false);\n        let status = undefined;\n        if (isActive !== undefined) {\n            status = isActive ? 'open' : 'closed';\n        }\n        status = cancelExist ? 'canceled' : status;\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': feeCurrency,\n                'cost': feeCost,\n            };\n        }\n        const clientOrderId = this.safeString (order, 'clientOid');\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const postOnly = this.safeValue (order, 'postOnly');\n        const reduceOnly = this.safeValue (order, 'reduceOnly');\n        const lastUpdateTimestamp = this.safeInteger (order, 'updatedAt');\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': reduceOnly,\n            'side': side,\n            'amount': amount,\n            'price': price,\n            'triggerPrice': this.safeNumber (order, 'stopPrice'),\n            'cost': cost,\n            'filled': filled,\n            'remaining': undefined,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'fee': fee,\n            'status': status,\n            'info': order,\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'average': average,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1400,
        "line_end": 1529,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (position, 'id', 'positionId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'closeTime')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentage)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (position, 'posMaint')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.safeNumber (position, 'maintMarginReq')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber2 (position, 'avgEntryPrice', 'openPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber2 (position, 'realLeverage', 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (Precise.stringAbs (size))",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeValue (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber2 (position, 'realisedPnl', 'pnl')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidationPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'maintMargin')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"code\": \"200000\",\n        \"data\": [\n            {\n                \"id\": \"615ba79f83a3410001cde321\",         // Position ID\n                \"symbol\": \"ETHUSDTM\",                     // Symbol\n                \"autoDeposit\": false,                     // Auto deposit margin or not\n                \"maintMarginReq\": 0.005,                  // Maintenance margin requirement\n                \"riskLimit\": 1000000,                     // Risk limit\n                \"realLeverage\": 25.92,                    // Leverage of the order\n                \"crossMode\": false,                       // Cross mode or not\n                \"delevPercentage\": 0.76,                  // ADL ranking percentile\n                \"openingTimestamp\": 1638578546031,        // Open time\n                \"currentTimestamp\": 1638578563580,        // Current timestamp\n                \"currentQty\": 2,                          // Current postion quantity\n                \"currentCost\": 83.787,                    // Current postion value\n                \"currentComm\": 0.0167574,                 // Current commission\n                \"unrealisedCost\": 83.787,                 // Unrealised value\n                \"realisedGrossCost\": 0.0,                 // Accumulated realised gross profit value\n                \"realisedCost\": 0.0167574,                // Current realised position value\n                \"isOpen\": true,                           // Opened position or not\n                \"markPrice\": 4183.38,                     // Mark price\n                \"markValue\": 83.6676,                     // Mark value\n                \"posCost\": 83.787,                        // Position value\n                \"posCross\": 0.0,                          // added margin\n                \"posInit\": 3.35148,                       // Leverage margin\n                \"posComm\": 0.05228309,                    // Bankruptcy cost\n                \"posLoss\": 0.0,                           // Funding fees paid out\n                \"posMargin\": 3.40376309,                  // Position margin\n                \"posMaint\": 0.50707892,                   // Maintenance margin\n                \"maintMargin\": 3.28436309,                // Position margin\n                \"realisedGrossPnl\": 0.0,                  // Accumulated realised gross profit value\n                \"realisedPnl\": -0.0167574,                // Realised profit and loss\n                \"unrealisedPnl\": -0.1194,                 // Unrealised profit and loss\n                \"unrealisedPnlPcnt\": -0.0014,             // Profit-loss ratio of the position\n                \"unrealisedRoePcnt\": -0.0356,             // Rate of return on investment\n                \"avgEntryPrice\": 4189.35,                 // Average entry price\n                \"liquidationPrice\": 4044.55,              // Liquidation price\n                \"bankruptPrice\": 4021.75,                 // Bankruptcy price\n                \"settleCurrency\": \"USDT\",                 // Currency used to clear and settle the trades\n                \"isInverse\": false\n            }\n        ]\n    }",
          "{\n                 \"closeId\": \"300000000000000030\",\n                 \"positionId\": \"300000000000000009\",\n                 \"uid\": 99996908309485,\n                 \"userId\": \"6527d4fc8c7f3d0001f40f5f\",\n                 \"symbol\": \"XBTUSDM\",\n                 \"settleCurrency\": \"XBT\",\n                 \"leverage\": \"0.0\",\n                 \"type\": \"LIQUID_LONG\",\n                 \"side\": null,\n                 \"closeSize\": null,\n                 \"pnl\": \"-1.0000003793999999\",\n                 \"realisedGrossCost\": \"0.9993849748999999\",\n                 \"withdrawPnl\": \"0.0\",\n                 \"roe\": null,\n                 \"tradeFee\": \"0.0006154045\",\n                 \"fundingFee\": \"0.0\",\n                 \"openTime\": 1713785751181,\n                 \"closeTime\": 1713785752784,\n                 \"openPrice\": null,\n                 \"closePrice\": null\n             }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //    {\n        //        \"code\": \"200000\",\n        //        \"data\": [\n        //            {\n        //                \"id\": \"615ba79f83a3410001cde321\",         // Position ID\n        //                \"symbol\": \"ETHUSDTM\",                     // Symbol\n        //                \"autoDeposit\": false,                     // Auto deposit margin or not\n        //                \"maintMarginReq\": 0.005,                  // Maintenance margin requirement\n        //                \"riskLimit\": 1000000,                     // Risk limit\n        //                \"realLeverage\": 25.92,                    // Leverage of the order\n        //                \"crossMode\": false,                       // Cross mode or not\n        //                \"delevPercentage\": 0.76,                  // ADL ranking percentile\n        //                \"openingTimestamp\": 1638578546031,        // Open time\n        //                \"currentTimestamp\": 1638578563580,        // Current timestamp\n        //                \"currentQty\": 2,                          // Current postion quantity\n        //                \"currentCost\": 83.787,                    // Current postion value\n        //                \"currentComm\": 0.0167574,                 // Current commission\n        //                \"unrealisedCost\": 83.787,                 // Unrealised value\n        //                \"realisedGrossCost\": 0.0,                 // Accumulated realised gross profit value\n        //                \"realisedCost\": 0.0167574,                // Current realised position value\n        //                \"isOpen\": true,                           // Opened position or not\n        //                \"markPrice\": 4183.38,                     // Mark price\n        //                \"markValue\": 83.6676,                     // Mark value\n        //                \"posCost\": 83.787,                        // Position value\n        //                \"posCross\": 0.0,                          // added margin\n        //                \"posInit\": 3.35148,                       // Leverage margin\n        //                \"posComm\": 0.05228309,                    // Bankruptcy cost\n        //                \"posLoss\": 0.0,                           // Funding fees paid out\n        //                \"posMargin\": 3.40376309,                  // Position margin\n        //                \"posMaint\": 0.50707892,                   // Maintenance margin\n        //                \"maintMargin\": 3.28436309,                // Position margin\n        //                \"realisedGrossPnl\": 0.0,                  // Accumulated realised gross profit value\n        //                \"realisedPnl\": -0.0167574,                // Realised profit and loss\n        //                \"unrealisedPnl\": -0.1194,                 // Unrealised profit and loss\n        //                \"unrealisedPnlPcnt\": -0.0014,             // Profit-loss ratio of the position\n        //                \"unrealisedRoePcnt\": -0.0356,             // Rate of return on investment\n        //                \"avgEntryPrice\": 4189.35,                 // Average entry price\n        //                \"liquidationPrice\": 4044.55,              // Liquidation price\n        //                \"bankruptPrice\": 4021.75,                 // Bankruptcy price\n        //                \"settleCurrency\": \"USDT\",                 // Currency used to clear and settle the trades\n        //                \"isInverse\": false\n        //            }\n        //        ]\n        //    }\n        // position history\n        //             {\n        //                 \"closeId\": \"300000000000000030\",\n        //                 \"positionId\": \"300000000000000009\",\n        //                 \"uid\": 99996908309485,\n        //                 \"userId\": \"6527d4fc8c7f3d0001f40f5f\",\n        //                 \"symbol\": \"XBTUSDM\",\n        //                 \"settleCurrency\": \"XBT\",\n        //                 \"leverage\": \"0.0\",\n        //                 \"type\": \"LIQUID_LONG\",\n        //                 \"side\": null,\n        //                 \"closeSize\": null,\n        //                 \"pnl\": \"-1.0000003793999999\",\n        //                 \"realisedGrossCost\": \"0.9993849748999999\",\n        //                 \"withdrawPnl\": \"0.0\",\n        //                 \"roe\": null,\n        //                 \"tradeFee\": \"0.0006154045\",\n        //                 \"fundingFee\": \"0.0\",\n        //                 \"openTime\": 1713785751181,\n        //                 \"closeTime\": 1713785752784,\n        //                 \"openPrice\": null,\n        //                 \"closePrice\": null\n        //             }\n        //\n        const symbol = this.safeString (position, 'symbol');\n        market = this.safeMarket (symbol, market);\n        const timestamp = this.safeInteger (position, 'currentTimestamp');\n        const size = this.safeString (position, 'currentQty');\n        let side = undefined;\n        const type = this.safeStringLower (position, 'type');\n        if (size !== undefined) {\n            if (Precise.stringGt (size, '0')) {\n                side = 'long';\n            } else if (Precise.stringLt (size, '0')) {\n                side = 'short';\n            }\n        } else if (type !== undefined) {\n            if (type.indexOf ('long') > -1) {\n                side = 'long';\n            } else {\n                side = 'short';\n            }\n        }\n        const notional = Precise.stringAbs (this.safeString (position, 'posCost'));\n        const initialMargin = this.safeString (position, 'posInit');\n        const initialMarginPercentage = Precise.stringDiv (initialMargin, notional);\n        // const marginRatio = Precise.stringDiv (maintenanceRate, collateral);\n        const unrealisedPnl = this.safeString (position, 'unrealisedPnl');\n        const crossMode = this.safeValue (position, 'crossMode');\n        // currently crossMode is always set to false and only isolated positions are supported\n        let marginMode = undefined;\n        if (crossMode !== undefined) {\n            marginMode = crossMode ? 'cross' : 'isolated';\n        }\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString2 (position, 'id', 'positionId'),\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'closeTime'),\n            'initialMargin': this.parseNumber (initialMargin),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentage),\n            'maintenanceMargin': this.safeNumber (position, 'posMaint'),\n            'maintenanceMarginPercentage': this.safeNumber (position, 'maintMarginReq'),\n            'entryPrice': this.safeNumber2 (position, 'avgEntryPrice', 'openPrice'),\n            'notional': this.parseNumber (notional),\n            'leverage': this.safeNumber2 (position, 'realLeverage', 'leverage'),\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'contracts': this.parseNumber (Precise.stringAbs (size)),\n            'contractSize': this.safeValue (market, 'contractSize'),\n            'realizedPnl': this.safeNumber2 (position, 'realisedPnl', 'pnl'),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'lastPrice': undefined,\n            'collateral': this.safeNumber (position, 'maintMargin'),\n            'marginMode': marginMode,\n            'side': side,\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 996,
        "line_end": 1111,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'highPrice')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'lowPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bestBidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bestBidSize')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'bestAskPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'bestAskSize')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'priceChg')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChgPct')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volumeOf24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'turnoverOf24h')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString2 (ticker, 'markPrice', 'value')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'indexPrice')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCUSDTM\",\n         \"granularity\": 1000,\n         \"timePoint\": 1727967339000,\n         \"value\": 62.37, mark price\n         \"indexPrice\": 62.37\n      }",
          "{\n         \"code\": \"200000\",\n         \"data\": {\n             \"sequence\":  1629930362547,\n             \"symbol\": \"ETHUSDTM\",\n             \"side\": \"buy\",\n             \"size\":  130,\n             \"price\": \"4724.7\",\n             \"bestBidSize\":  5,\n             \"bestBidPrice\": \"4724.6\",\n             \"bestAskPrice\": \"4724.65\",\n             \"tradeId\": \"618d2a5a77a0c4431d2335f4\",\n             \"ts\":  1636641371963227600,\n             \"bestAskSize\":  1789\n          }\n     }",
          "{\n     symbol: \"XBTUSDTM\",\n     rootSymbol: \"USDT\",\n     type: \"FFWCSX\",\n     firstOpenDate: 1585555200000,\n     expireDate: null,\n     settleDate: null,\n     baseCurrency: \"XBT\",\n     quoteCurrency: \"USDT\",\n     settleCurrency: \"USDT\",\n     maxOrderQty: 1000000,\n     maxPrice: 1000000,\n     lotSize: 1,\n     tickSize: 0.1,\n     indexPriceTickSize: 0.01,\n     multiplier: 0.001,\n     initialMargin: 0.008,\n     maintainMargin: 0.004,\n     maxRiskLimit: 100000,\n     minRiskLimit: 100000,\n     riskStep: 50000,\n     makerFeeRate: 0.0002,\n     takerFeeRate: 0.0006,\n     takerFixFee: 0,\n     makerFixFee: 0,\n     settlementFee: null,\n     isDeleverage: true,\n     isQuanto: true,\n     isInverse: false,\n     markMethod: \"FairPrice\",\n     fairMethod: \"FundingRate\",\n     fundingBaseSymbol: \".XBTINT8H\",\n     fundingQuoteSymbol: \".USDTINT8H\",\n     fundingRateSymbol: \".XBTUSDTMFPI8H\",\n     indexSymbol: \".KXBTUSDT\",\n     settlementSymbol: \"\",\n     status: \"Open\",\n     fundingFeeRate: 0.000297,\n     predictedFundingFeeRate: 0.000327,\n     fundingRateGranularity: 28800000,\n     openInterest: \"8033200\",\n     turnoverOf24h: 659795309.2524643,\n     volumeOf24h: 9998.54,\n     markPrice: 67193.51,\n     indexPrice: 67184.81,\n     lastTradePrice: 67191.8,\n     nextFundingRateTime: 20022985,\n     maxLeverage: 125,\n     premiumsSymbol1M: \".XBTUSDTMPI\",\n     premiumsSymbol8H: \".XBTUSDTMPI8H\",\n     fundingBaseSymbol1M: \".XBTINT\",\n     fundingQuoteSymbol1M: \".USDTINT\",\n     lowPrice: 64041.6,\n     highPrice: 67737.3,\n     priceChgPct: 0.0447,\n     priceChg: 2878.7\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"symbol\": \"LTCUSDTM\",\n        //         \"granularity\": 1000,\n        //         \"timePoint\": 1727967339000,\n        //         \"value\": 62.37, mark price\n        //         \"indexPrice\": 62.37\n        //      }\n        //\n        //     {\n        //         \"code\": \"200000\",\n        //         \"data\": {\n        //             \"sequence\":  1629930362547,\n        //             \"symbol\": \"ETHUSDTM\",\n        //             \"side\": \"buy\",\n        //             \"size\":  130,\n        //             \"price\": \"4724.7\",\n        //             \"bestBidSize\":  5,\n        //             \"bestBidPrice\": \"4724.6\",\n        //             \"bestAskPrice\": \"4724.65\",\n        //             \"tradeId\": \"618d2a5a77a0c4431d2335f4\",\n        //             \"ts\":  1636641371963227600,\n        //             \"bestAskSize\":  1789\n        //          }\n        //     }\n        //\n        // from fetchTickers\n        //\n        // {\n        //     symbol: \"XBTUSDTM\",\n        //     rootSymbol: \"USDT\",\n        //     type: \"FFWCSX\",\n        //     firstOpenDate: 1585555200000,\n        //     expireDate: null,\n        //     settleDate: null,\n        //     baseCurrency: \"XBT\",\n        //     quoteCurrency: \"USDT\",\n        //     settleCurrency: \"USDT\",\n        //     maxOrderQty: 1000000,\n        //     maxPrice: 1000000,\n        //     lotSize: 1,\n        //     tickSize: 0.1,\n        //     indexPriceTickSize: 0.01,\n        //     multiplier: 0.001,\n        //     initialMargin: 0.008,\n        //     maintainMargin: 0.004,\n        //     maxRiskLimit: 100000,\n        //     minRiskLimit: 100000,\n        //     riskStep: 50000,\n        //     makerFeeRate: 0.0002,\n        //     takerFeeRate: 0.0006,\n        //     takerFixFee: 0,\n        //     makerFixFee: 0,\n        //     settlementFee: null,\n        //     isDeleverage: true,\n        //     isQuanto: true,\n        //     isInverse: false,\n        //     markMethod: \"FairPrice\",\n        //     fairMethod: \"FundingRate\",\n        //     fundingBaseSymbol: \".XBTINT8H\",\n        //     fundingQuoteSymbol: \".USDTINT8H\",\n        //     fundingRateSymbol: \".XBTUSDTMFPI8H\",\n        //     indexSymbol: \".KXBTUSDT\",\n        //     settlementSymbol: \"\",\n        //     status: \"Open\",\n        //     fundingFeeRate: 0.000297,\n        //     predictedFundingFeeRate: 0.000327,\n        //     fundingRateGranularity: 28800000,\n        //     openInterest: \"8033200\",\n        //     turnoverOf24h: 659795309.2524643,\n        //     volumeOf24h: 9998.54,\n        //     markPrice: 67193.51,\n        //     indexPrice: 67184.81,\n        //     lastTradePrice: 67191.8,\n        //     nextFundingRateTime: 20022985,\n        //     maxLeverage: 125,\n        //     premiumsSymbol1M: \".XBTUSDTMPI\",\n        //     premiumsSymbol8H: \".XBTUSDTMPI8H\",\n        //     fundingBaseSymbol1M: \".XBTINT\",\n        //     fundingQuoteSymbol1M: \".USDTINT\",\n        //     lowPrice: 64041.6,\n        //     highPrice: 67737.3,\n        //     priceChgPct: 0.0447,\n        //     priceChg: 2878.7\n        // }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market, '-');\n        const last = this.safeString2 (ticker, 'price', 'lastTradePrice');\n        const timestamp = this.safeIntegerProduct (ticker, 'ts', 0.000001);\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'highPrice'),\n            'low': this.safeString (ticker, 'lowPrice'),\n            'bid': this.safeString (ticker, 'bestBidPrice'),\n            'bidVolume': this.safeString (ticker, 'bestBidSize'),\n            'ask': this.safeString (ticker, 'bestAskPrice'),\n            'askVolume': this.safeString (ticker, 'bestAskSize'),\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'priceChg'),\n            'percentage': this.safeString (ticker, 'priceChgPct'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volumeOf24h'),\n            'quoteVolume': this.safeString (ticker, 'turnoverOf24h'),\n            'markPrice': this.safeString2 (ticker, 'markPrice', 'value'),\n            'indexPrice': this.safeString (ticker, 'indexPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2817,
        "line_end": 2950,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"sequence\": 32114961,\n         \"side\": \"buy\",\n         \"size\": 39,\n         \"price\": \"4001.6500000000\",\n         \"takerOrderId\": \"61c20742f172110001e0ebe4\",\n         \"makerOrderId\": \"61c2073fcfc88100010fcb5d\",\n         \"tradeId\": \"61c2074277a0c473e69029b8\",\n         \"ts\": 1640105794099993896   // filled time\n     }",
          "{\n         \"symbol\":\"BTC-USDT\",\n         \"tradeId\":\"5c35c02709e4f67d5266954e\",\n         \"orderId\":\"5c35c02703aa673ceec2a168\",\n         \"counterOrderId\":\"5c1ab46003aa676e487fa8e3\",\n         \"side\":\"buy\",\n         \"liquidity\":\"taker\",\n         \"forceTaker\":true,\n         \"price\":\"0.083\",\n         \"size\":\"0.8424304\",\n         \"funds\":\"0.0699217232\",\n         \"fee\":\"0\",\n         \"feeRate\":\"0\",\n         \"feeCurrency\":\"USDT\",\n         \"stop\":\"\",\n         \"type\":\"limit\",\n         \"createdAt\":1547026472000\n     }",
          "{\n        \"symbol\":\"DOGEUSDTM\",\n        \"tradeId\":\"620ec41a96bab27b5f4ced56\",\n        \"orderId\":\"620ec41a0d1d8a0001560bd0\",\n        \"side\":\"sell\",\n        \"liquidity\":\"taker\",\n        \"forceTaker\":true,\n        \"price\":\"0.13969\",\n        \"size\":1,\n        \"value\":\"13.969\",\n        \"feeRate\":\"0.0006\",\n        \"fixFee\":\"0\",\n        \"feeCurrency\":\"USDT\",\n        \"stop\":\"\",\n        \"tradeTime\":1645134874858018058,\n        \"fee\":\"0.0083814\",\n        \"settleCurrency\":\"USDT\",\n        \"orderType\":\"market\",\n        \"tradeType\":\"trade\",\n        \"createdAt\":1645134874858\n    }",
          "{\n        \"makerUserId\": \"62286a4d720edf0001e81961\",\n        \"symbol\": \"ADAUSDTM\",\n        \"sequence\": 41320766,\n        \"side\": \"sell\",\n        \"size\": 2,\n        \"price\": 0.35904,\n        \"takerOrderId\": \"636dd9da9857ba00010cfa44\",\n        \"makerOrderId\": \"636dd9c8df149d0001e62bc8\",\n        \"takerUserId\": \"6180be22b6ab210001fa3371\",\n        \"tradeId\": \"636dd9da0000d400d477eca7\",\n        \"ts\": 1668143578987357700\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"sequence\": 32114961,\n        //         \"side\": \"buy\",\n        //         \"size\": 39,\n        //         \"price\": \"4001.6500000000\",\n        //         \"takerOrderId\": \"61c20742f172110001e0ebe4\",\n        //         \"makerOrderId\": \"61c2073fcfc88100010fcb5d\",\n        //         \"tradeId\": \"61c2074277a0c473e69029b8\",\n        //         \"ts\": 1640105794099993896   // filled time\n        //     }\n        //\n        // fetchMyTrades (private) v2\n        //\n        //     {\n        //         \"symbol\":\"BTC-USDT\",\n        //         \"tradeId\":\"5c35c02709e4f67d5266954e\",\n        //         \"orderId\":\"5c35c02703aa673ceec2a168\",\n        //         \"counterOrderId\":\"5c1ab46003aa676e487fa8e3\",\n        //         \"side\":\"buy\",\n        //         \"liquidity\":\"taker\",\n        //         \"forceTaker\":true,\n        //         \"price\":\"0.083\",\n        //         \"size\":\"0.8424304\",\n        //         \"funds\":\"0.0699217232\",\n        //         \"fee\":\"0\",\n        //         \"feeRate\":\"0\",\n        //         \"feeCurrency\":\"USDT\",\n        //         \"stop\":\"\",\n        //         \"type\":\"limit\",\n        //         \"createdAt\":1547026472000\n        //     }\n        //\n        // fetchMyTrades (private) v1\n        //\n        //    {\n        //        \"symbol\":\"DOGEUSDTM\",\n        //        \"tradeId\":\"620ec41a96bab27b5f4ced56\",\n        //        \"orderId\":\"620ec41a0d1d8a0001560bd0\",\n        //        \"side\":\"sell\",\n        //        \"liquidity\":\"taker\",\n        //        \"forceTaker\":true,\n        //        \"price\":\"0.13969\",\n        //        \"size\":1,\n        //        \"value\":\"13.969\",\n        //        \"feeRate\":\"0.0006\",\n        //        \"fixFee\":\"0\",\n        //        \"feeCurrency\":\"USDT\",\n        //        \"stop\":\"\",\n        //        \"tradeTime\":1645134874858018058,\n        //        \"fee\":\"0.0083814\",\n        //        \"settleCurrency\":\"USDT\",\n        //        \"orderType\":\"market\",\n        //        \"tradeType\":\"trade\",\n        //        \"createdAt\":1645134874858\n        //    }\n        //\n        // watchTrades\n        //\n        //    {\n        //        \"makerUserId\": \"62286a4d720edf0001e81961\",\n        //        \"symbol\": \"ADAUSDTM\",\n        //        \"sequence\": 41320766,\n        //        \"side\": \"sell\",\n        //        \"size\": 2,\n        //        \"price\": 0.35904,\n        //        \"takerOrderId\": \"636dd9da9857ba00010cfa44\",\n        //        \"makerOrderId\": \"636dd9c8df149d0001e62bc8\",\n        //        \"takerUserId\": \"6180be22b6ab210001fa3371\",\n        //        \"tradeId\": \"636dd9da0000d400d477eca7\",\n        //        \"ts\": 1668143578987357700\n        //    }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market, '-');\n        const id = this.safeString2 (trade, 'tradeId', 'id');\n        const orderId = this.safeString (trade, 'orderId');\n        const takerOrMaker = this.safeString (trade, 'liquidity');\n        let timestamp = this.safeInteger (trade, 'ts');\n        if (timestamp !== undefined) {\n            timestamp = this.parseToInt (timestamp / 1000000);\n        } else {\n            timestamp = this.safeInteger (trade, 'createdAt');\n            // if it's a historical v1 trade, the exchange returns timestamp in seconds\n            if (('dealValue' in trade) && (timestamp !== undefined)) {\n                timestamp = timestamp * 1000;\n            }\n        }\n        const priceString = this.safeString2 (trade, 'price', 'dealPrice');\n        const amountString = this.safeString2 (trade, 'size', 'amount');\n        const side = this.safeString (trade, 'side');\n        let fee = undefined;\n        const feeCostString = this.safeString (trade, 'fee');\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'feeCurrency');\n            let feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n            if (feeCurrency === undefined) {\n                feeCurrency = (side === 'sell') ? market['quote'] : market['base'];\n            }\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrency,\n                'rate': this.safeString (trade, 'feeRate'),\n            };\n        }\n        let type = this.safeString2 (trade, 'type', 'orderType');\n        if (type === 'match') {\n            type = undefined;\n        }\n        let costString = this.safeString2 (trade, 'funds', 'value');\n        if (costString === undefined) {\n            const contractSize = this.safeString (market, 'contractSize');\n            const contractCost = Precise.stringMul (priceString, amountString);\n            costString = Precise.stringMul (contractCost, contractSize);\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4137,
        "line_end": 4249,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'withdrawalId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'chain'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'remark')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"0x5f047b29041bcfdbf0e4478cdfa753a336ba6989\",\n         \"memo\": \"5c247c8a03aa677cea2a251d\",\n         \"amount\": 1,\n         \"fee\": 0.0001,\n         \"currency\": \"KCS\",\n         \"chain\": \"\",\n         \"isInner\": false,\n         \"walletTxId\": \"5bbb57386d99522d9f954c5a@test004\",\n         \"status\": \"SUCCESS\",\n         \"createdAt\": 1544178843000,\n         \"updatedAt\": 1544178891000\n         \"remark\":\"foobar\"\n     }",
          "{\n         \"id\": \"5c2dc64e03aa675aa263f1ac\",\n         \"address\": \"0x5bedb060b8eb8d823e2414d82acce78d38be7fe9\",\n         \"memo\": \"\",\n         \"currency\": \"ETH\",\n         \"chain\": \"\",\n         \"amount\": 1.0000000,\n         \"fee\": 0.0100000,\n         \"walletTxId\": \"3e2414d82acce78d38be7fe9\",\n         \"isInner\": false,\n         \"status\": \"FAILURE\",\n         \"createdAt\": 1546503758000,\n         \"updatedAt\": 1546504603000\n         \"remark\":\"foobar\"\n     }",
          "{\n         \"withdrawalId\":  \"5bffb63303aa675e8bbe18f9\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"address\": \"0x5f047b29041bcfdbf0e4478cdfa753a336ba6989\",\n        //         \"memo\": \"5c247c8a03aa677cea2a251d\",\n        //         \"amount\": 1,\n        //         \"fee\": 0.0001,\n        //         \"currency\": \"KCS\",\n        //         \"chain\": \"\",\n        //         \"isInner\": false,\n        //         \"walletTxId\": \"5bbb57386d99522d9f954c5a@test004\",\n        //         \"status\": \"SUCCESS\",\n        //         \"createdAt\": 1544178843000,\n        //         \"updatedAt\": 1544178891000\n        //         \"remark\":\"foobar\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"5c2dc64e03aa675aa263f1ac\",\n        //         \"address\": \"0x5bedb060b8eb8d823e2414d82acce78d38be7fe9\",\n        //         \"memo\": \"\",\n        //         \"currency\": \"ETH\",\n        //         \"chain\": \"\",\n        //         \"amount\": 1.0000000,\n        //         \"fee\": 0.0100000,\n        //         \"walletTxId\": \"3e2414d82acce78d38be7fe9\",\n        //         \"isInner\": false,\n        //         \"status\": \"FAILURE\",\n        //         \"createdAt\": 1546503758000,\n        //         \"updatedAt\": 1546504603000\n        //         \"remark\":\"foobar\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"withdrawalId\":  \"5bffb63303aa675e8bbe18f9\"\n        //     }\n        //\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let address = this.safeString (transaction, 'address');\n        const amount = this.safeString (transaction, 'amount');\n        let txid = this.safeString (transaction, 'walletTxId');\n        if (txid !== undefined) {\n            const txidParts = txid.split ('@');\n            const numTxidParts = txidParts.length;\n            if (numTxidParts > 1) {\n                if (address === undefined) {\n                    if (txidParts[1].length > 1) {\n                        address = txidParts[1];\n                    }\n                }\n            }\n            txid = txidParts[0];\n        }\n        let type = (txid === undefined) ? 'withdrawal' : 'deposit';\n        const rawStatus = this.safeString (transaction, 'status');\n        let fee = undefined;\n        const feeCost = this.safeString (transaction, 'fee');\n        if (feeCost !== undefined) {\n            let rate = undefined;\n            if (amount !== undefined) {\n                rate = Precise.stringDiv (feeCost, amount);\n            }\n            fee = {\n                'cost': this.parseNumber (feeCost),\n                'rate': this.parseNumber (rate),\n                'currency': code,\n            };\n        }\n        let timestamp = this.safeInteger2 (transaction, 'createdAt', 'createAt');\n        let updated = this.safeInteger (transaction, 'updatedAt');\n        const isV1 = !('createdAt' in transaction);\n        // if it's a v1 structure\n        if (isV1) {\n            type = ('address' in transaction) ? 'withdrawal' : 'deposit';\n            if (timestamp !== undefined) {\n                timestamp = timestamp * 1000;\n            }\n            if (updated !== undefined) {\n                updated = updated * 1000;\n            }\n        }\n        const internal = this.safeBool (transaction, 'isInner');\n        const tag = this.safeString (transaction, 'memo');\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'withdrawalId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (this.safeString (transaction, 'chain')),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'currency': code,\n            'amount': this.parseNumber (amount),\n            'txid': txid,\n            'type': type,\n            'status': this.parseTransactionStatus (rawStatus),\n            'comment': this.safeString (transaction, 'remark'),\n            'internal': internal,\n            'fee': fee,\n            'updated': updated,\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 4127,
        "line_end": 4135,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'SUCCESS': 'ok',\n            'PROCESSING': 'pending',\n            'WALLET_PROCESSING': 'pending',\n            'FAILURE': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "kucoin"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2640,
        "line_end": 2682,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'applyId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.safeString (transfer, 'status')",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n            \"applyId\": \"5bffb63303aa675e8bbe18f9\" // Transfer-out request ID\n     }",
          "{\n         \"applyId\": \"6738754373ceee00011ec3f8\",\n         \"bizNo\": \"6738754373ceee00011ec3f7\",\n         \"payAccountType\": \"CONTRACT\",\n         \"payTag\": \"DEFAULT\",\n         \"remark\": \"\",\n         \"recAccountType\": \"MAIN\",\n         \"recTag\": \"DEFAULT\",\n         \"recRemark\": \"\",\n         \"recSystem\": \"KUCOIN\",\n         \"status\": \"PROCESSING\",\n         \"currency\": \"USDT\",\n         \"amount\": \"5\",\n         \"fee\": \"0\",\n         \"sn\": 1519769124846692,\n         \"reason\": \"\",\n         \"createdAt\": 1731753283000,\n         \"updatedAt\": 1731753283000\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer to spot or funding account\n        //\n        //     {\n        //            \"applyId\": \"5bffb63303aa675e8bbe18f9\" // Transfer-out request ID\n        //     }\n        //\n        // transfer to future account\n        //\n        //     {\n        //         \"applyId\": \"6738754373ceee00011ec3f8\",\n        //         \"bizNo\": \"6738754373ceee00011ec3f7\",\n        //         \"payAccountType\": \"CONTRACT\",\n        //         \"payTag\": \"DEFAULT\",\n        //         \"remark\": \"\",\n        //         \"recAccountType\": \"MAIN\",\n        //         \"recTag\": \"DEFAULT\",\n        //         \"recRemark\": \"\",\n        //         \"recSystem\": \"KUCOIN\",\n        //         \"status\": \"PROCESSING\",\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"5\",\n        //         \"fee\": \"0\",\n        //         \"sn\": 1519769124846692,\n        //         \"reason\": \"\",\n        //         \"createdAt\": 1731753283000,\n        //         \"updatedAt\": 1731753283000\n        //     }\n        //\n        const timestamp = this.safeInteger (transfer, 'updatedAt');\n        return {\n            'id': this.safeString (transfer, 'applyId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': this.safeString (transfer, 'status'),\n            'info': transfer,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 2684,
        "line_end": 2689,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'PROCESSING': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransferType",
        "signature": "parseTransferType (transferType: Str): Str",
        "line_start": 2691,
        "line_end": 2697,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferType (transferType: Str): Str {\n        const transferTypes: Dict = {\n            'spot': 'TRADE',\n            'funding': 'MAIN',\n        };\n        return this.safeStringUpper (transferTypes, transferType, transferType);\n    }"
      }
    ],
    "latoken": [
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1066,
        "line_end": 1169,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"baseCurrency\": \"f7dac554-8139-4ff6-841f-0e586a5984a0\",\n        \"quoteCurrency\": \"a5a7a7a9-e2a3-43f9-8754-29a02f6b709b\",\n        \"side\": \"BID\",\n        \"clientOrderId\": \"my-wonderful-order-number-71566\",\n        \"price\": \"10103.19\",\n        \"stopPrice\": \"10103.19\",\n        \"quantity\": \"3.21\",\n        \"timestamp\": 1568185507\n    }",
          "{\n         \"id\":\"a76bd262-3560-4bfb-98ac-1cedd394f4fc\",\n         \"status\":\"ORDER_STATUS_PLACED\",\n         \"side\":\"ORDER_SIDE_BUY\",\n         \"condition\":\"ORDER_CONDITION_GOOD_TILL_CANCELLED\",\n         \"type\":\"ORDER_TYPE_LIMIT\",\n         \"baseCurrency\":\"620f2019-33c0-423b-8a9d-cde4d7f8ef7f\",\n         \"quoteCurrency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n         \"clientOrderId\":\"web-macos_chrome_1a6a6659-6f7c-4fac-be0b-d1d7ac06d\",\n         \"price\":\"4000.00\",\n         \"quantity\":\"0.01\",\n         \"cost\":\"40.000000000000000000\",\n         \"filled\":\"0\",\n         \"trader\":\"7244bb3a-b6b2-446a-ac78-fa4bce5b59a9\",\n         \"creator\":\"ORDER_CREATOR_USER\",\n         \"creatorId\":\"\",\n         \"timestamp\":1635920767648\n     }",
          "{\n         \"message\":\"cancellation request successfully submitted\",\n         \"status\":\"SUCCESS\",\n         \"id\":\"a631426d-3543-45ba-941e-75f7825afb0f\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //    {\n        //        \"baseCurrency\": \"f7dac554-8139-4ff6-841f-0e586a5984a0\",\n        //        \"quoteCurrency\": \"a5a7a7a9-e2a3-43f9-8754-29a02f6b709b\",\n        //        \"side\": \"BID\",\n        //        \"clientOrderId\": \"my-wonderful-order-number-71566\",\n        //        \"price\": \"10103.19\",\n        //        \"stopPrice\": \"10103.19\",\n        //        \"quantity\": \"3.21\",\n        //        \"timestamp\": 1568185507\n        //    }\n        //\n        // fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"id\":\"a76bd262-3560-4bfb-98ac-1cedd394f4fc\",\n        //         \"status\":\"ORDER_STATUS_PLACED\",\n        //         \"side\":\"ORDER_SIDE_BUY\",\n        //         \"condition\":\"ORDER_CONDITION_GOOD_TILL_CANCELLED\",\n        //         \"type\":\"ORDER_TYPE_LIMIT\",\n        //         \"baseCurrency\":\"620f2019-33c0-423b-8a9d-cde4d7f8ef7f\",\n        //         \"quoteCurrency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        //         \"clientOrderId\":\"web-macos_chrome_1a6a6659-6f7c-4fac-be0b-d1d7ac06d\",\n        //         \"price\":\"4000.00\",\n        //         \"quantity\":\"0.01\",\n        //         \"cost\":\"40.000000000000000000\",\n        //         \"filled\":\"0\",\n        //         \"trader\":\"7244bb3a-b6b2-446a-ac78-fa4bce5b59a9\",\n        //         \"creator\":\"ORDER_CREATOR_USER\",\n        //         \"creatorId\":\"\",\n        //         \"timestamp\":1635920767648\n        //     }\n        //\n        // cancelOrder\n        //\n        //     {\n        //         \"message\":\"cancellation request successfully submitted\",\n        //         \"status\":\"SUCCESS\",\n        //         \"id\":\"a631426d-3543-45ba-941e-75f7825afb0f\"\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const timestamp = this.safeInteger (order, 'timestamp');\n        const baseId = this.safeString (order, 'baseCurrency');\n        const quoteId = this.safeString (order, 'quoteCurrency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = undefined;\n        if ((base !== undefined) && (quote !== undefined)) {\n            symbol = base + '/' + quote;\n            if (symbol in this.markets) {\n                market = this.market (symbol);\n            }\n        }\n        const orderSide = this.safeString (order, 'side');\n        let side = undefined;\n        if (orderSide !== undefined) {\n            const parts = orderSide.split ('_');\n            const partsLength = parts.length;\n            side = this.safeStringLower (parts, partsLength - 1);\n        }\n        const type = this.parseOrderType (this.safeString (order, 'type'));\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'quantity');\n        const filled = this.safeString (order, 'filled');\n        const cost = this.safeString (order, 'cost');\n        let status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const message = this.safeString (order, 'message');\n        if (message !== undefined) {\n            if (message.indexOf ('cancel') >= 0) {\n                status = 'canceled';\n            } else if (message.indexOf ('accept') >= 0) {\n                status = 'open';\n            }\n        }\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        const timeInForce = this.parseTimeInForce (this.safeString (order, 'condition'));\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString (order, 'stopPrice'),\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'average': undefined,\n            'remaining': undefined,\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1040,
        "line_end": 1047,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'ORDER_STATUS_PLACED': 'open',\n            'ORDER_STATUS_CLOSED': 'closed',\n            'ORDER_STATUS_CANCELLED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1049,
        "line_end": 1055,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'ORDER_TYPE_MARKET': 'market',\n            'ORDER_TYPE_LIMIT': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 665,
        "line_end": 711,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bestBidQuantity')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'bestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'bestAskQuantity')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'change24h')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'amount24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'volume24h')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        \"baseCurrency\": \"92151d82-df98-4d88-9a4d-284fa9eca49f\",\n        \"quoteCurrency\": \"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        \"volume24h\": \"165723597.189022176000000000\",\n        \"volume7d\": \"934505768.625109571000000000\",\n        \"change24h\": \"0.0200\",\n        \"change7d\": \"-6.4200\",\n        \"amount24h\": \"6438.457663100000000000\",\n        \"amount7d\": \"35657.785013800000000000\",\n        \"lastPrice\": \"25779.16\",\n        \"lastQuantity\": \"0.248403300000000000\",\n        \"bestBid\": \"25778.74\",\n        \"bestBidQuantity\": \"0.6520232\",\n        \"bestAsk\": \"25779.17\",\n        \"bestAskQuantity\": \"0.4956043\",\n        \"updateTimestamp\": \"1693965231406\"\n    }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //    {\n        //        \"symbol\": \"92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        //        \"baseCurrency\": \"92151d82-df98-4d88-9a4d-284fa9eca49f\",\n        //        \"quoteCurrency\": \"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        //        \"volume24h\": \"165723597.189022176000000000\",\n        //        \"volume7d\": \"934505768.625109571000000000\",\n        //        \"change24h\": \"0.0200\",\n        //        \"change7d\": \"-6.4200\",\n        //        \"amount24h\": \"6438.457663100000000000\",\n        //        \"amount7d\": \"35657.785013800000000000\",\n        //        \"lastPrice\": \"25779.16\",\n        //        \"lastQuantity\": \"0.248403300000000000\",\n        //        \"bestBid\": \"25778.74\",\n        //        \"bestBidQuantity\": \"0.6520232\",\n        //        \"bestAsk\": \"25779.17\",\n        //        \"bestAskQuantity\": \"0.4956043\",\n        //        \"updateTimestamp\": \"1693965231406\"\n        //    }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        const last = this.safeString (ticker, 'lastPrice');\n        const timestamp = this.safeIntegerOmitZero (ticker, 'updateTimestamp'); // sometimes latoken provided '0' ts from /ticker endpoint\n        return this.safeTicker ({\n            'symbol': this.safeSymbol (marketId, market),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'low': undefined,\n            'high': undefined,\n            'bid': this.safeString (ticker, 'bestBid'),\n            'bidVolume': this.safeString (ticker, 'bestBidQuantity'),\n            'ask': this.safeString (ticker, 'bestAsk'),\n            'askVolume': this.safeString (ticker, 'bestAskQuantity'),\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (ticker, 'change24h'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'amount24h'),\n            'quoteVolume': this.safeString (ticker, 'volume24h'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1057,
        "line_end": 1064,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'ORDER_CONDITION_GOOD_TILL_CANCELLED': 'GTC',\n            'ORDER_CONDITION_IMMEDIATE_OR_CANCEL': 'IOC',\n            'ORDER_CONDITION_FILL_OR_KILL': 'FOK',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 790,
        "line_end": 874,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":\"c152f814-8eeb-44f0-8f3f-e5c568f2ffcf\",\n         \"isMakerBuyer\":false,\n         \"baseCurrency\":\"620f2019-33c0-423b-8a9d-cde4d7f8ef7f\",\n         \"quoteCurrency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n         \"price\":\"4435.56\",\n         \"quantity\":\"0.32534\",\n         \"cost\":\"1443.0650904\",\n         \"timestamp\":1635854642725,\n         \"makerBuyer\":false\n     }",
          "{\n         \"id\":\"02e02533-b4bf-4ba9-9271-24e2108dfbf7\",\n         \"isMakerBuyer\":false,\n         \"direction\":\"TRADE_DIRECTION_BUY\",\n         \"baseCurrency\":\"620f2019-33c0-423b-8a9d-cde4d7f8ef7f\",\n         \"quoteCurrency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n         \"price\":\"4564.32\",\n         \"quantity\":\"0.01000\",\n         \"cost\":\"45.6432\",\n         \"fee\":\"0.223651680000000000\",\n         \"order\":\"c9cac6a0-484c-4892-88e7-ad51b39f2ce1\",\n         \"timestamp\":1635921580399,\n         \"makerBuyer\":false\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"id\":\"c152f814-8eeb-44f0-8f3f-e5c568f2ffcf\",\n        //         \"isMakerBuyer\":false,\n        //         \"baseCurrency\":\"620f2019-33c0-423b-8a9d-cde4d7f8ef7f\",\n        //         \"quoteCurrency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        //         \"price\":\"4435.56\",\n        //         \"quantity\":\"0.32534\",\n        //         \"cost\":\"1443.0650904\",\n        //         \"timestamp\":1635854642725,\n        //         \"makerBuyer\":false\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"id\":\"02e02533-b4bf-4ba9-9271-24e2108dfbf7\",\n        //         \"isMakerBuyer\":false,\n        //         \"direction\":\"TRADE_DIRECTION_BUY\",\n        //         \"baseCurrency\":\"620f2019-33c0-423b-8a9d-cde4d7f8ef7f\",\n        //         \"quoteCurrency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        //         \"price\":\"4564.32\",\n        //         \"quantity\":\"0.01000\",\n        //         \"cost\":\"45.6432\",\n        //         \"fee\":\"0.223651680000000000\",\n        //         \"order\":\"c9cac6a0-484c-4892-88e7-ad51b39f2ce1\",\n        //         \"timestamp\":1635921580399,\n        //         \"makerBuyer\":false\n        //     }\n        //\n        const type = undefined;\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'quantity');\n        const costString = this.safeString (trade, 'cost');\n        const makerBuyer = this.safeValue (trade, 'makerBuyer');\n        let side = this.safeString (trade, 'direction');\n        if (side === undefined) {\n            side = makerBuyer ? 'sell' : 'buy';\n        } else {\n            if (side === 'TRADE_DIRECTION_BUY') {\n                side = 'buy';\n            } else if (side === 'TRADE_DIRECTION_SELL') {\n                side = 'sell';\n            }\n        }\n        const isBuy = (side === 'buy');\n        const takerOrMaker = (makerBuyer && isBuy) ? 'maker' : 'taker';\n        const baseId = this.safeString (trade, 'baseCurrency');\n        const quoteId = this.safeString (trade, 'quoteCurrency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote;\n        if (symbol in this.markets) {\n            market = this.market (symbol);\n        }\n        const id = this.safeString (trade, 'id');\n        const orderId = this.safeString (trade, 'order');\n        const feeCost = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': quote,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1549,
        "line_end": 1611,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "address",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":\"fbf7d0d1-2629-4ad8-9def-7a1dba423362\",\n         \"status\":\"TRANSACTION_STATUS_CONFIRMED\",\n         \"type\":\"TRANSACTION_TYPE_DEPOSIT\",\n         \"senderAddress\":\"\",\n         \"recipientAddress\":\"0x3c46fa2e3f9023bc4897828ed173f8ecb3a554bc\",\n         \"amount\":\"200.000000000000000000\",\n         \"transactionFee\":\"0.000000000000000000\",\n         \"timestamp\":1635893208404,\n         \"transactionHash\":\"0x28bad3b74a042df13d64ddfbca855566a51bf7f190b8cd565c236a18d5cd493f#42\",\n         \"blockHeight\":13540262,\n         \"currency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n         \"memo\":null,\n         \"paymentProvider\":\"a8d6d1cb-f84a-4e9d-aa82-c6a08b356ee1\",\n         \"requiresCode\":false\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"id\":\"fbf7d0d1-2629-4ad8-9def-7a1dba423362\",\n        //         \"status\":\"TRANSACTION_STATUS_CONFIRMED\",\n        //         \"type\":\"TRANSACTION_TYPE_DEPOSIT\",\n        //         \"senderAddress\":\"\",\n        //         \"recipientAddress\":\"0x3c46fa2e3f9023bc4897828ed173f8ecb3a554bc\",\n        //         \"amount\":\"200.000000000000000000\",\n        //         \"transactionFee\":\"0.000000000000000000\",\n        //         \"timestamp\":1635893208404,\n        //         \"transactionHash\":\"0x28bad3b74a042df13d64ddfbca855566a51bf7f190b8cd565c236a18d5cd493f#42\",\n        //         \"blockHeight\":13540262,\n        //         \"currency\":\"0c3a106d-bde3-4c13-a26e-3fd2394529e5\",\n        //         \"memo\":null,\n        //         \"paymentProvider\":\"a8d6d1cb-f84a-4e9d-aa82-c6a08b356ee1\",\n        //         \"requiresCode\":false\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const amount = this.safeNumber (transaction, 'amount');\n        const addressFrom = this.safeString (transaction, 'senderAddress');\n        const addressTo = this.safeString (transaction, 'recipientAddress');\n        const txid = this.safeString (transaction, 'transactionHash');\n        const tagTo = this.safeString (transaction, 'memo');\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        const feeCost = this.safeNumber (transaction, 'transactionFee');\n        if (feeCost !== undefined) {\n            fee['cost'] = feeCost;\n            fee['currency'] = code;\n        }\n        const type = this.parseTransactionType (this.safeString (transaction, 'type'));\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'address': addressTo,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'tag': tagTo,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1613,
        "line_end": 1623,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'TRANSACTION_STATUS_CONFIRMED': 'ok',\n            'TRANSACTION_STATUS_EXECUTED': 'ok',\n            'TRANSACTION_STATUS_CHECKING': 'pending',\n            'TRANSACTION_STATUS_CANCELLED': 'canceled',\n            'TRANSACTION_STATUS_FAILED': 'failed',\n            'TRANSACTION_STATUS_REJECTED': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransactionType",
        "signature": "parseTransactionType (type)",
        "line_start": 1625,
        "line_end": 1631,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionType (type) {\n        const types: Dict = {\n            'TRANSACTION_TYPE_DEPOSIT': 'deposit',\n            'TRANSACTION_TYPE_WITHDRAWAL': 'withdrawal',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1738,
        "line_end": 1775,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.safeInteger (transfer, 'timestamp')",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'transferringFunds')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (transfer, 'fromAccount')",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (transfer, 'toAccount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"e6fc4ace-7750-44e4-b7e9-6af038ac7107\",\n         \"status\": \"TRANSFER_STATUS_COMPLETED\",\n         \"type\": \"TRANSFER_TYPE_DEPOSIT_SPOT\",\n         \"fromAccount\": \"3bf61015-bf32-47a6-b237-c9f70df772ad\",\n         \"toAccount\": \"355eb279-7c7e-4515-814a-575a49dc0325\",\n         \"transferringFunds\": \"500000.000000000000000000\",\n         \"usdValue\": \"0.000000000000000000\",\n         \"rejectReason\": \"\",\n         \"timestamp\": 1576844438402,\n         \"direction\": \"INTERNAL\",\n         \"method\": \"TRANSFER_METHOD_UNKNOWN\",\n         \"recipient\": \"\",\n         \"sender\": \"\",\n         \"currency\": \"40af7879-a8cc-4576-a42d-7d2749821b58\",\n         \"codeRequired\": false,\n         \"fromUser\": \"cd555555-666d-46fb-9ae6-487f66738073\",\n         \"toUser\": \"cd555555-666d-46fb-9ae6-487f66738073\",\n         \"fee\": 0\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //     {\n        //         \"id\": \"e6fc4ace-7750-44e4-b7e9-6af038ac7107\",\n        //         \"status\": \"TRANSFER_STATUS_COMPLETED\",\n        //         \"type\": \"TRANSFER_TYPE_DEPOSIT_SPOT\",\n        //         \"fromAccount\": \"3bf61015-bf32-47a6-b237-c9f70df772ad\",\n        //         \"toAccount\": \"355eb279-7c7e-4515-814a-575a49dc0325\",\n        //         \"transferringFunds\": \"500000.000000000000000000\",\n        //         \"usdValue\": \"0.000000000000000000\",\n        //         \"rejectReason\": \"\",\n        //         \"timestamp\": 1576844438402,\n        //         \"direction\": \"INTERNAL\",\n        //         \"method\": \"TRANSFER_METHOD_UNKNOWN\",\n        //         \"recipient\": \"\",\n        //         \"sender\": \"\",\n        //         \"currency\": \"40af7879-a8cc-4576-a42d-7d2749821b58\",\n        //         \"codeRequired\": false,\n        //         \"fromUser\": \"cd555555-666d-46fb-9ae6-487f66738073\",\n        //         \"toUser\": \"cd555555-666d-46fb-9ae6-487f66738073\",\n        //         \"fee\": 0\n        //     }\n        //\n        const timestamp = this.safeTimestamp (transfer, 'timestamp');\n        const currencyId = this.safeString (transfer, 'currency');\n        const status = this.safeString (transfer, 'status');\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'id'),\n            'timestamp': this.safeInteger (transfer, 'timestamp'),\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'transferringFunds'),\n            'fromAccount': this.safeString (transfer, 'fromAccount'),\n            'toAccount': this.safeString (transfer, 'toAccount'),\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 1777,
        "line_end": 1786,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'TRANSFER_STATUS_COMPLETED': 'ok',\n            'TRANSFER_STATUS_PENDING': 'pending',\n            'TRANSFER_STATUS_REJECTED': 'failed',\n            'TRANSFER_STATUS_UNVERIFIED': 'pending',\n            'TRANSFER_STATUS_CANCELLED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "lbank": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1226,
        "line_end": 1356,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"toBtc\": {\n              \"egc:\": \"0\",\n              \"iog\": \"0\",\n              \"ksm\": \"0\",\n              },\n          \"freeze\": {\n              \"egc\": \"0\",\n              \"iog\": \"0\",\n              \"ksm\": \"0\" ,\n              },\n          \"asset\": {\n              \"egc\": \"0\",\n              \"iog\": \"0\",\n              \"ksm\": \"0\",\n              },\n          \"free\": {\n              \"egc\": \"0\",\n              \"iog\": \"0\",\n              \"ksm\": \"0\",\n              }\n      }",
          "{\n          \"balances\":[\n              {\n                  \"asset\":\"lbk\",\n                  \"free\":\"0\",\n                  \"locked\":\"0\"\n              }, ...\n          ]\n      }",
          "[\n          {\n              \"usableAmt\":\"31.45130723\",\n              \"assetAmt\":\"31.45130723\",\n              \"networkList\":[\n                  {\n                      \"isDefault\":true,\n                      \"withdrawFeeRate\":\"\",\n                      \"name\":\"bep20(bsc)\",\n                      \"withdrawMin\":30,\n                      \"minLimit\":0.0001,\n                      \"minDeposit\":0.0001,\n                      \"feeAssetCode\":\"doge\",\n                      \"withdrawFee\":\"30\",\n                      \"type\":1,\n                      \"coin\":\"doge\",\n                      \"network\":\"bsc\"\n                  },\n                  {\n                      \"isDefault\":false,\n                      \"withdrawFeeRate\":\"\",\n                      \"name\":\"dogecoin\",\n                      \"withdrawMin\":10,\n                      \"minLimit\":0.0001,\n                      \"minDeposit\":10,\n                      \"feeAssetCode\":\"doge\",\n                      \"withdrawFee\":\"10\",\n                      \"type\":1,\n                      \"coin\":\"doge\",\n                      \"network\":\"dogecoin\"\n                  }\n              ],\n              \"freezeAmt\":\"0\",\n              \"coin\":\"doge\"\n          }, ...\n      ]"
        ],
        "source": "parseBalance (response): Balances {\n        //\n        // spotPrivatePostUserInfo\n        //\n        //      {\n        //          \"toBtc\": {\n        //              \"egc:\": \"0\",\n        //              \"iog\": \"0\",\n        //              \"ksm\": \"0\",\n        //              },\n        //          \"freeze\": {\n        //              \"egc\": \"0\",\n        //              \"iog\": \"0\",\n        //              \"ksm\": \"0\" ,\n        //              },\n        //          \"asset\": {\n        //              \"egc\": \"0\",\n        //              \"iog\": \"0\",\n        //              \"ksm\": \"0\",\n        //              },\n        //          \"free\": {\n        //              \"egc\": \"0\",\n        //              \"iog\": \"0\",\n        //              \"ksm\": \"0\",\n        //              }\n        //      }\n        //\n        // spotPrivatePostSupplementUserInfoAccount\n        //\n        //      {\n        //          \"balances\":[\n        //              {\n        //                  \"asset\":\"lbk\",\n        //                  \"free\":\"0\",\n        //                  \"locked\":\"0\"\n        //              }, ...\n        //          ]\n        //      }\n        //\n        // spotPrivatePostSupplementUserInfo\n        //\n        //      [\n        //          {\n        //              \"usableAmt\":\"31.45130723\",\n        //              \"assetAmt\":\"31.45130723\",\n        //              \"networkList\":[\n        //                  {\n        //                      \"isDefault\":true,\n        //                      \"withdrawFeeRate\":\"\",\n        //                      \"name\":\"bep20(bsc)\",\n        //                      \"withdrawMin\":30,\n        //                      \"minLimit\":0.0001,\n        //                      \"minDeposit\":0.0001,\n        //                      \"feeAssetCode\":\"doge\",\n        //                      \"withdrawFee\":\"30\",\n        //                      \"type\":1,\n        //                      \"coin\":\"doge\",\n        //                      \"network\":\"bsc\"\n        //                  },\n        //                  {\n        //                      \"isDefault\":false,\n        //                      \"withdrawFeeRate\":\"\",\n        //                      \"name\":\"dogecoin\",\n        //                      \"withdrawMin\":10,\n        //                      \"minLimit\":0.0001,\n        //                      \"minDeposit\":10,\n        //                      \"feeAssetCode\":\"doge\",\n        //                      \"withdrawFee\":\"10\",\n        //                      \"type\":1,\n        //                      \"coin\":\"doge\",\n        //                      \"network\":\"dogecoin\"\n        //                  }\n        //              ],\n        //              \"freezeAmt\":\"0\",\n        //              \"coin\":\"doge\"\n        //          }, ...\n        //      ]\n        //\n        const timestamp = this.safeInteger (response, 'ts');\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const data = this.safeValue (response, 'data');\n        // from spotPrivatePostUserInfo\n        const toBtc = this.safeValue (data, 'toBtc');\n        if (toBtc !== undefined) {\n            const used = this.safeValue (data, 'freeze', {});\n            const free = this.safeValue (data, 'free', {});\n            const currencies = Object.keys (free);\n            for (let i = 0; i < currencies.length; i++) {\n                const currencyId = currencies[i];\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['used'] = this.safeString (used, currencyId);\n                account['free'] = this.safeString (free, currencyId);\n                result[code] = account;\n            }\n            return this.safeBalance (result);\n        }\n        // from spotPrivatePostSupplementUserInfoAccount\n        const balances = this.safeValue (data, 'balances');\n        if (balances !== undefined) {\n            for (let i = 0; i < balances.length; i++) {\n                const item = balances[i];\n                const currencyId = this.safeString (item, 'asset');\n                const codeInner = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (item, 'free');\n                account['used'] = this.safeString (item, 'locked');\n                result[codeInner] = account;\n            }\n            return this.safeBalance (result);\n        }\n        // from spotPrivatePostSupplementUserInfo\n        const isArray = Array.isArray (data);\n        if (isArray === true) {\n            for (let i = 0; i < data.length; i++) {\n                const item = data[i];\n                const currencyId = this.safeString (item, 'coin');\n                const codeInner = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['free'] = this.safeString (item, 'usableAmt');\n                account['used'] = this.safeString (item, 'freezeAmt');\n                result[codeInner] = account;\n            }\n            return this.safeBalance (result);\n        }\n        return undefined;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 2920,
        "line_end": 2974,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"usableAmt\": \"14.36\",\n        \"assetAmt\": \"14.36\",\n        \"networkList\": [\n            {\n                \"isDefault\": false,\n                \"withdrawFeeRate\": \"\",\n                \"name\": \"erc20\",\n                \"withdrawMin\": 30,\n                \"minLimit\": 0.0001,\n                \"minDeposit\": 20,\n                \"feeAssetCode\": \"usdt\",\n                \"withdrawFee\": \"30\",\n                \"type\": 1,\n                \"coin\": \"usdt\",\n                \"network\": \"eth\"\n            },\n            ...\n        ],\n        \"freezeAmt\": \"0\",\n        \"coin\": \"ada\"\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        // * only used for fetchPrivateDepositWithdrawFees\n        //\n        //    {\n        //        \"usableAmt\": \"14.36\",\n        //        \"assetAmt\": \"14.36\",\n        //        \"networkList\": [\n        //            {\n        //                \"isDefault\": false,\n        //                \"withdrawFeeRate\": \"\",\n        //                \"name\": \"erc20\",\n        //                \"withdrawMin\": 30,\n        //                \"minLimit\": 0.0001,\n        //                \"minDeposit\": 20,\n        //                \"feeAssetCode\": \"usdt\",\n        //                \"withdrawFee\": \"30\",\n        //                \"type\": 1,\n        //                \"coin\": \"usdt\",\n        //                \"network\": \"eth\"\n        //            },\n        //            ...\n        //        ],\n        //        \"freezeAmt\": \"0\",\n        //        \"coin\": \"ada\"\n        //    }\n        //\n        const result = this.depositWithdrawFee (fee);\n        const networkList = this.safeValue (fee, 'networkList', []);\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkCode = this.networkIdToCode (this.safeString (networkEntry, 'name'));\n            const withdrawFee = this.safeNumber (networkEntry, 'withdrawFee');\n            const isDefault = this.safeValue (networkEntry, 'isDefault');\n            if (withdrawFee !== undefined) {\n                if (isDefault) {\n                    result['withdraw'] = {\n                        'fee': withdrawFee,\n                        'percentage': undefined,\n                    };\n                }\n                result['networks'][networkCode] = {\n                    'withdraw': {\n                        'fee': withdrawFee,\n                        'percentage': undefined,\n                    },\n                    'deposit': {\n                        'fee': undefined,\n                        'percentage': undefined,\n                    },\n                };\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (ticker, market: Market = undefined): FundingRate",
        "line_start": 1358,
        "line_end": 1404,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"BTCUSDT\",\n     \"highestPrice\": \"69495.5\",\n     \"underlyingPrice\": \"68455.904\",\n     \"lowestPrice\": \"68182.1\",\n     \"openPrice\": \"68762.4\",\n     \"positionFeeRate\": \"0.0001\",\n     \"volume\": \"33534.2858\",\n     \"markedPrice\": \"68434.1\",\n     \"turnover\": \"1200636218.210558\",\n     \"positionFeeTime\": \"28800\",\n     \"lastPrice\": \"68427.3\",\n     \"nextFeeTime\": \"1730736000000\",\n     \"fundingRate\": \"0.0001\",\n }"
        ],
        "source": "parseFundingRate (ticker, market: Market = undefined): FundingRate {\n        // {\n        //     \"symbol\": \"BTCUSDT\",\n        //     \"highestPrice\": \"69495.5\",\n        //     \"underlyingPrice\": \"68455.904\",\n        //     \"lowestPrice\": \"68182.1\",\n        //     \"openPrice\": \"68762.4\",\n        //     \"positionFeeRate\": \"0.0001\",\n        //     \"volume\": \"33534.2858\",\n        //     \"markedPrice\": \"68434.1\",\n        //     \"turnover\": \"1200636218.210558\",\n        //     \"positionFeeTime\": \"28800\",\n        //     \"lastPrice\": \"68427.3\",\n        //     \"nextFeeTime\": \"1730736000000\",\n        //     \"fundingRate\": \"0.0001\",\n        // }\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const markPrice = this.safeNumber (ticker, 'markedPrice');\n        const indexPrice = this.safeNumber (ticker, 'underlyingPrice');\n        const fundingRate = this.safeNumber (ticker, 'fundingRate');\n        const fundingTime = this.safeInteger (ticker, 'nextFeeTime');\n        const positionFeeTime = this.safeInteger (ticker, 'positionFeeTime');\n        let intervalString = undefined;\n        if (positionFeeTime !== undefined) {\n            const interval = this.parseToInt (positionFeeTime / 60 / 60);\n            intervalString = interval.toString () + 'h';\n        }\n        return {\n            'info': ticker,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1148,
        "line_end": 1167,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n     1482311500, // timestamp\n     5423.23,    // open\n     5472.80,    // high\n     5516.09,    // low\n     5462,       // close\n     234.3250    // volume\n   ],"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //   [\n        //     1482311500, // timestamp\n        //     5423.23,    // open\n        //     5472.80,    // high\n        //     5516.09,    // low\n        //     5462,       // close\n        //     234.3250    // volume\n        //   ],\n        //\n        return [\n            this.safeTimestamp (ohlcv, 0), // timestamp\n            this.safeNumber (ohlcv, 1), // open\n            this.safeNumber (ohlcv, 2), // high\n            this.safeNumber (ohlcv, 3), // low\n            this.safeNumber (ohlcv, 4), // close\n            this.safeNumber (ohlcv, 5), // volume\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1712,
        "line_end": 1856,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (rawStatus)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filledString",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"cummulativeQuoteQty\":0,\n          \"symbol\":\"doge_usdt\",\n          \"executedQty\":0,\n          \"orderId\":\"53d2d53e-70fb-4398-b722-f48571a5f61e\",\n          \"origQty\":1E+2,\n          \"price\":0.05,\n          \"clientOrderId\":null,\n          \"origQuoteOrderQty\":5,\n          \"updateTime\":1648163406000,\n          \"time\":1648163139387,\n          \"type\":\"buy_maker\",\n          \"status\":-1\n      }",
          "{\n          \"symbol\":\"shib_usdt\",\n          \"amount\":1,\n          \"create_time\":1649367863356,\n          \"price\":0.0000246103,\n          \"avg_price\":0.00002466180000000104,\n          \"type\":\"buy_market\",\n          \"order_id\":\"abe8b92d-86d9-4d6d-b71e-d14f5fb53ddf\",\n          \"custom_id\": \"007\",                                 // field only present if user creates it at order time\n          \"deal_amount\":40548.54065802,\n          \"status\":2\n      }",
          "{\n          \"cummulativeQuoteQty\":0,\n          \"symbol\":\"doge_usdt\",\n          \"executedQty\":0,\n          \"orderId\":\"73878edf-008d-4e4c-8041-df1f1b2cd8bb\",\n          \"origQty\":100,\n          \"price\":0.05,\n          \"origQuoteOrderQty\":5,\n          \"updateTime\":1648501762000,\n          \"time\":1648501762353,\n          \"type\":\"buy\",\n          \"status\":0\n      }",
          "{\n          \"cummulativeQuoteQty\":0,\n          \"symbol\":\"doge_usdt\",\n          \"executedQty\":0,\n          \"orderId\":\"2cadc7cc-b5f6-486b-a5b4-d6ac49a9c186\",\n          \"origQty\":100,\n          \"price\":0.05,\n          \"origQuoteOrderQty\":5,\n          \"updateTime\":1648501384000,\n          \"time\":1648501363889,\n          \"type\":\"buy\",\n          \"status\":-1\n      }",
          "{\n        \"executedQty\":0.0,\n        \"price\":0.05,\n        \"origQty\":100.0,\n        \"tradeType\":\"buy\",\n        \"status\":0\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrderSupplement (private)\n        //\n        //      {\n        //          \"cummulativeQuoteQty\":0,\n        //          \"symbol\":\"doge_usdt\",\n        //          \"executedQty\":0,\n        //          \"orderId\":\"53d2d53e-70fb-4398-b722-f48571a5f61e\",\n        //          \"origQty\":1E+2,\n        //          \"price\":0.05,\n        //          \"clientOrderId\":null,\n        //          \"origQuoteOrderQty\":5,\n        //          \"updateTime\":1648163406000,\n        //          \"time\":1648163139387,\n        //          \"type\":\"buy_maker\",\n        //          \"status\":-1\n        //      }\n        //\n        //\n        // fetchOrderDefault (private)\n        //\n        //      {\n        //          \"symbol\":\"shib_usdt\",\n        //          \"amount\":1,\n        //          \"create_time\":1649367863356,\n        //          \"price\":0.0000246103,\n        //          \"avg_price\":0.00002466180000000104,\n        //          \"type\":\"buy_market\",\n        //          \"order_id\":\"abe8b92d-86d9-4d6d-b71e-d14f5fb53ddf\",\n        //          \"custom_id\": \"007\",                                 // field only present if user creates it at order time\n        //          \"deal_amount\":40548.54065802,\n        //          \"status\":2\n        //      }\n        //\n        // fetchOpenOrders (private)\n        //\n        //      {\n        //          \"cummulativeQuoteQty\":0,\n        //          \"symbol\":\"doge_usdt\",\n        //          \"executedQty\":0,\n        //          \"orderId\":\"73878edf-008d-4e4c-8041-df1f1b2cd8bb\",\n        //          \"origQty\":100,\n        //          \"price\":0.05,\n        //          \"origQuoteOrderQty\":5,\n        //          \"updateTime\":1648501762000,\n        //          \"time\":1648501762353,\n        //          \"type\":\"buy\",\n        //          \"status\":0\n        //      }\n        //\n        // fetchOrders (private)\n        //\n        //      {\n        //          \"cummulativeQuoteQty\":0,\n        //          \"symbol\":\"doge_usdt\",\n        //          \"executedQty\":0,\n        //          \"orderId\":\"2cadc7cc-b5f6-486b-a5b4-d6ac49a9c186\",\n        //          \"origQty\":100,\n        //          \"price\":0.05,\n        //          \"origQuoteOrderQty\":5,\n        //          \"updateTime\":1648501384000,\n        //          \"time\":1648501363889,\n        //          \"type\":\"buy\",\n        //          \"status\":-1\n        //      }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"executedQty\":0.0,\n        //        \"price\":0.05,\n        //        \"origQty\":100.0,\n        //        \"tradeType\":\"buy\",\n        //        \"status\":0\n        //    }\n        //\n        // cancelAllOrders\n        //\n        //    {\n        //        \"executedQty\":0.00000000000000000000,\n        //        \"orderId\":\"293ef71b-3e67-4962-af93-aa06990a045f\",\n        //        \"price\":0.05000000000000000000,\n        //        \"origQty\":100.00000000000000000000,\n        //        \"tradeType\":\"buy\",\n        //        \"status\":0\n        //    }\n        //\n        const id = this.safeString2 (order, 'orderId', 'order_id');\n        const clientOrderId = this.safeString2 (order, 'clientOrderId', 'custom_id');\n        const timestamp = this.safeInteger2 (order, 'time', 'create_time');\n        const rawStatus = this.safeString (order, 'status');\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        let timeInForce = undefined;\n        let postOnly = false;\n        let type = 'limit';\n        const rawType = this.safeString2 (order, 'type', 'tradeType'); // buy, sell, buy_market, sell_market, buy_maker,sell_maker,buy_ioc,sell_ioc, buy_fok, sell_fok\n        const parts = rawType.split ('_');\n        const side = this.safeString (parts, 0);\n        const typePart = this.safeString (parts, 1); // market, maker, ioc, fok or undefined (limit)\n        if (typePart === 'market') {\n            type = 'market';\n        }\n        if (typePart === 'maker') {\n            postOnly = true;\n            timeInForce = 'PO';\n        }\n        if (typePart === 'ioc') {\n            timeInForce = 'IOC';\n        }\n        if (typePart === 'fok') {\n            timeInForce = 'FOK';\n        }\n        const price = this.safeString (order, 'price');\n        const costString = this.safeString (order, 'cummulativeQuoteQty');\n        let amountString = undefined;\n        if (rawType !== 'buy_market') {\n            amountString = this.safeString2 (order, 'origQty', 'amount');\n        }\n        const filledString = this.safeString2 (order, 'executedQty', 'deal_amount');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'status': this.parseOrderStatus (rawStatus),\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': costString,\n            'amount': amountString,\n            'filled': filledString,\n            'remaining': undefined,\n            'trades': undefined,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1700,
        "line_end": 1710,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '-1': 'canceled', // canceled\n            '0': 'open', // not traded\n            '1': 'open', // partial deal\n            '2': 'closed', // complete deal\n            '3': 'canceled', // filled partially and cancelled\n            '4': 'closed', // disposal processing\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePublicDepositWithdrawFees",
        "signature": "parsePublicDepositWithdrawFees (response, codes = undefined)",
        "line_start": 2861,
        "line_end": 2918,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        {\n            \"amountScale\": \"4\",\n            \"chain\": \"heco\",\n            \"assetCode\": \"lbk\",\n            \"min\": \"200\",\n            \"transferAmtScale\": \"4\",\n            \"canWithDraw\": true,\n            \"fee\": \"100\",\n            \"minTransfer\": \"0.0001\",\n            \"type\": \"1\"\n        },\n        ...\n    ]"
        ],
        "source": "parsePublicDepositWithdrawFees (response, codes = undefined) {\n        //\n        //    [\n        //        {\n        //            \"amountScale\": \"4\",\n        //            \"chain\": \"heco\",\n        //            \"assetCode\": \"lbk\",\n        //            \"min\": \"200\",\n        //            \"transferAmtScale\": \"4\",\n        //            \"canWithDraw\": true,\n        //            \"fee\": \"100\",\n        //            \"minTransfer\": \"0.0001\",\n        //            \"type\": \"1\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const result: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const fee = response[i];\n            const canWithdraw = this.safeValue (fee, 'canWithDraw');\n            if (canWithdraw === true) {\n                const currencyId = this.safeString (fee, 'assetCode');\n                const code = this.safeCurrencyCode (currencyId);\n                if (codes === undefined || this.inArray (code, codes)) {\n                    const withdrawFee = this.safeNumber (fee, 'fee');\n                    if (withdrawFee !== undefined) {\n                        const resultValue = this.safeValue (result, code);\n                        if (resultValue === undefined) {\n                            result[code] = this.depositWithdrawFee ([ fee ]);\n                        } else {\n                            const resultCodeInfo = result[code]['info'];\n                            resultCodeInfo.push (fee);\n                        }\n                        const networkCode = this.networkIdToCode (this.safeString (fee, 'chain'));\n                        if (networkCode !== undefined) {\n                            result[code]['networks'][networkCode] = {\n                                'withdraw': {\n                                    'fee': withdrawFee,\n                                    'percentage': undefined,\n                                },\n                                'deposit': {\n                                    'fee': undefined,\n                                    'percentage': undefined,\n                                },\n                            };\n                        } else {\n                            result[code]['withdraw'] = {\n                                'fee': withdrawFee,\n                                'percentage': undefined,\n                            };\n                        }\n                    }\n                }\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 716,
        "line_end": 775,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (data, 'high', 'highestPrice')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (data, 'low', 'lowestPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (data, 'openPrice')",
            "comment": null
          },
          {
            "key": "close",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeString2 (data, 'latest', 'lastPrice')",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (data, 'change')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (data, 'vol', 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (data, 'turnover')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"btc_usdt\",\n         \"ticker\": {\n             \"high\": \"29695.57\",\n             \"vol\": \"6890.2789\",\n             \"low\": \"29110\",\n             \"change\": \"0.58\",\n             \"turnover\": \"202769821.06\",\n             \"latest\": \"29405.98\"\n         },\n         \"timestamp\": :1692064274908\n     }",
          "{\n         \"prePositionFeeRate\": \"0.000053\",\n         \"volume\": \"2435.459\",\n         \"symbol\": \"BTCUSDT\",\n         \"highestPrice\": \"29446.5\",\n         \"lowestPrice\": \"29362.9\",\n         \"openPrice\": \"29419.5\",\n         \"markedPrice\": \"29385.1\",\n         \"turnover\": \"36345526.2438402\",\n         \"lastPrice\": \"29387.0\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"symbol\": \"btc_usdt\",\n        //         \"ticker\": {\n        //             \"high\": \"29695.57\",\n        //             \"vol\": \"6890.2789\",\n        //             \"low\": \"29110\",\n        //             \"change\": \"0.58\",\n        //             \"turnover\": \"202769821.06\",\n        //             \"latest\": \"29405.98\"\n        //         },\n        //         \"timestamp\": :1692064274908\n        //     }\n        //\n        // swap: fetchTickers\n        //\n        //     {\n        //         \"prePositionFeeRate\": \"0.000053\",\n        //         \"volume\": \"2435.459\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"highestPrice\": \"29446.5\",\n        //         \"lowestPrice\": \"29362.9\",\n        //         \"openPrice\": \"29419.5\",\n        //         \"markedPrice\": \"29385.1\",\n        //         \"turnover\": \"36345526.2438402\",\n        //         \"lastPrice\": \"29387.0\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const tickerData = this.safeValue (ticker, 'ticker', {});\n        market = this.safeMarket (marketId, market);\n        const data = (market['contract']) ? ticker : tickerData;\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (data, 'high', 'highestPrice'),\n            'low': this.safeString2 (data, 'low', 'lowestPrice'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (data, 'openPrice'),\n            'close': undefined,\n            'last': this.safeString2 (data, 'latest', 'lastPrice'),\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (data, 'change'),\n            'average': undefined,\n            'baseVolume': this.safeString2 (data, 'vol', 'volume'),\n            'quoteVolume': this.safeString (data, 'turnover'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 989,
        "line_end": 1090,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"date_ms\":1647021989789,\n          \"amount\":0.0028,\n          \"price\":38804.2,\n          \"type\":\"buy\",\n          \"tid\":\"52d5616ee35c43019edddebe59b3e094\"\n      }",
          "{\n          \"quoteQty\":1675.048485,\n          \"price\":0.127545,\n          \"qty\":13133,\n          \"id\":\"3589541dc22e4357b227283650f714e2\",\n          \"time\":1648058297110,\n          \"isBuyerMaker\":false\n      }",
          "{\n          \"orderUuid\":\"38b4e7a4-14f6-45fd-aba1-1a37024124a0\",\n          \"tradeFeeRate\":0.0010000000,\n          \"dealTime\":1648500944496,\n          \"dealQuantity\":30.00000000000000000000,\n          \"tradeFee\":0.00453300000000000000,\n          \"txUuid\":\"11f3850cc6214ea3b495adad3a032794\",\n          \"dealPrice\":0.15111300000000000000,\n          \"dealVolumePrice\":4.53339000000000000000,\n          \"tradeType\":\"sell_market\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (old) spotPublicGetTrades\n        //\n        //      {\n        //          \"date_ms\":1647021989789,\n        //          \"amount\":0.0028,\n        //          \"price\":38804.2,\n        //          \"type\":\"buy\",\n        //          \"tid\":\"52d5616ee35c43019edddebe59b3e094\"\n        //      }\n        //\n        //\n        // fetchTrades (new) spotPublicGetTradesSupplement\n        //\n        //      {\n        //          \"quoteQty\":1675.048485,\n        //          \"price\":0.127545,\n        //          \"qty\":13133,\n        //          \"id\":\"3589541dc22e4357b227283650f714e2\",\n        //          \"time\":1648058297110,\n        //          \"isBuyerMaker\":false\n        //      }\n        //\n        // fetchMyTrades (private)\n        //\n        //      {\n        //          \"orderUuid\":\"38b4e7a4-14f6-45fd-aba1-1a37024124a0\",\n        //          \"tradeFeeRate\":0.0010000000,\n        //          \"dealTime\":1648500944496,\n        //          \"dealQuantity\":30.00000000000000000000,\n        //          \"tradeFee\":0.00453300000000000000,\n        //          \"txUuid\":\"11f3850cc6214ea3b495adad3a032794\",\n        //          \"dealPrice\":0.15111300000000000000,\n        //          \"dealVolumePrice\":4.53339000000000000000,\n        //          \"tradeType\":\"sell_market\"\n        //      }\n        //\n        let timestamp = this.safeInteger2 (trade, 'date_ms', 'time');\n        if (timestamp === undefined) {\n            timestamp = this.safeInteger (trade, 'dealTime');\n        }\n        let amountString = this.safeString2 (trade, 'amount', 'qty');\n        if (amountString === undefined) {\n            amountString = this.safeString (trade, 'dealQuantity');\n        }\n        let priceString = this.safeString (trade, 'price');\n        if (priceString === undefined) {\n            priceString = this.safeString (trade, 'dealPrice');\n        }\n        let costString = this.safeString (trade, 'quoteQty');\n        if (costString === undefined) {\n            costString = this.safeString (trade, 'dealVolumePrice');\n        }\n        let side = this.safeString2 (trade, 'tradeType', 'type');\n        let type = undefined;\n        let takerOrMaker = undefined;\n        if (side !== undefined) {\n            const parts = side.split ('_');\n            side = this.safeString (parts, 0);\n            const typePart = this.safeString (parts, 1);\n            type = 'limit';\n            takerOrMaker = 'taker';\n            if (typePart !== undefined) {\n                if (typePart === 'market') {\n                    type = 'market';\n                } else if (typePart === 'maker') {\n                    takerOrMaker = 'maker';\n                }\n            }\n        }\n        let id = this.safeString2 (trade, 'tid', 'id');\n        if (id === undefined) {\n            id = this.safeString (trade, 'txUuid');\n        }\n        const order = this.safeString (trade, 'orderUuid');\n        const symbol = this.safeSymbol (undefined, market);\n        let fee = undefined;\n        const feeCost = this.safeString (trade, 'tradeFee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': (side === 'buy') ? market['base'] : market['quote'],\n                'rate': this.safeString (trade, 'tradeFeeRate'),\n            };\n        }\n        return this.safeTrade ({\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': order,\n            'type': type,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1521,
        "line_end": 1539,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fee, 'makerCommission')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fee, 'takerCommission')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"symbol\":\"skt_usdt\",\n          \"makerCommission\":\"0.10\",\n          \"takerCommission\":\"0.10\"\n      }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //      {\n        //          \"symbol\":\"skt_usdt\",\n        //          \"makerCommission\":\"0.10\",\n        //          \"takerCommission\":\"0.10\"\n        //      }\n        //\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber (fee, 'makerCommission'),\n            'taker': this.safeNumber (fee, 'takerCommission'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2418,
        "line_end": 2499,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'networkName'))",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "(status === 'transfer')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"insertTime\":1649012310000,\n          \"amount\":9.00000000000000000000,\n          \"address\":\"TYASr5UV6HEcXatwdFQfmLVUqQQQMUxHLS\",\n          \"networkName\":\"trc20\",\n          \"txId\":\"081e4e9351dd0274922168da5f2d14ea6c495b1c3b440244f4a6dd9fe196bf2b\",\n          \"coin\":\"usdt\",\n          \"status\":\"2\"\n      }",
          "{\n          \"amount\":2.00000000000000000000,\n          \"address\":\"TBjrW5JHDyPZjFc5nrRMhRWUDaJmhGhmD6\",\n          \"fee\":1.00000000000000000000,\n          \"networkName\":\"trc20\",\n          \"coid\":\"usdt\",\n          \"transferType\":\"数字资产提现\",\n          \"txId\":\"47eeee2763ad49b8817524dacfa7d092fb58f8b0ab7e5d25473314df1a793c3d\",\n          \"id\":1902194,\n          \"applyTime\":1649014002000,\n          \"status\":\"4\"\n      }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits (private)\n        //\n        //      {\n        //          \"insertTime\":1649012310000,\n        //          \"amount\":9.00000000000000000000,\n        //          \"address\":\"TYASr5UV6HEcXatwdFQfmLVUqQQQMUxHLS\",\n        //          \"networkName\":\"trc20\",\n        //          \"txId\":\"081e4e9351dd0274922168da5f2d14ea6c495b1c3b440244f4a6dd9fe196bf2b\",\n        //          \"coin\":\"usdt\",\n        //          \"status\":\"2\"\n        //      }\n        //\n        //\n        // fetchWithdrawals (private)\n        //\n        //      {\n        //          \"amount\":2.00000000000000000000,\n        //          \"address\":\"TBjrW5JHDyPZjFc5nrRMhRWUDaJmhGhmD6\",\n        //          \"fee\":1.00000000000000000000,\n        //          \"networkName\":\"trc20\",\n        //          \"coid\":\"usdt\",\n        //          \"transferType\":\"数字资产提现\",\n        //          \"txId\":\"47eeee2763ad49b8817524dacfa7d092fb58f8b0ab7e5d25473314df1a793c3d\",\n        //          \"id\":1902194,\n        //          \"applyTime\":1649014002000,\n        //          \"status\":\"4\"\n        //      }\n        //\n        const id = this.safeString (transaction, 'id');\n        let type = undefined;\n        if (id === undefined) {\n            type = 'deposit';\n        } else {\n            type = 'withdrawal';\n        }\n        const txid = this.safeString (transaction, 'txId');\n        const timestamp = this.safeInteger2 (transaction, 'insertTime', 'applyTime');\n        const address = this.safeString (transaction, 'address');\n        let addressFrom = undefined;\n        let addressTo = undefined;\n        if (type === 'deposit') {\n            addressFrom = address;\n        } else {\n            addressTo = address;\n        }\n        const amount = this.safeNumber (transaction, 'amount');\n        const currencyId = this.safeString2 (transaction, 'coin', 'coid');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'), type);\n        let fee = undefined;\n        const feeCost = this.safeNumber (transaction, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (this.safeString (transaction, 'networkName')),\n            'address': address,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': (status === 'transfer'),\n            'fee': fee,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status, type)",
        "line_start": 2399,
        "line_end": 2416,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status, type) {\n        const statuses: Dict = {\n            'deposit': {\n                '1': 'pending',\n                '2': 'ok',\n                '3': 'failed',\n                '4': 'canceled',\n                '5': 'transfer',\n            },\n            'withdrawal': {\n                '1': 'pending',\n                '2': 'canceled',\n                '3': 'failed',\n                '4': 'ok',\n            },\n        };\n        return this.safeString (this.safeValue (statuses, type, {}), status, status);\n    }"
      }
    ],
    "luno": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 519,
        "line_end": 546,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const wallets = this.safeValue (response, 'balance', []);\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < wallets.length; i++) {\n            const wallet = wallets[i];\n            const currencyId = this.safeString (wallet, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const reserved = this.safeString (wallet, 'reserved');\n            const unconfirmed = this.safeString (wallet, 'unconfirmed');\n            const balance = this.safeString (wallet, 'balance');\n            const reservedUnconfirmed = Precise.stringAdd (reserved, unconfirmed);\n            const balanceUnconfirmed = Precise.stringAdd (balance, unconfirmed);\n            if (code in result) {\n                result[code]['used'] = Precise.stringAdd (result[code]['used'], reservedUnconfirmed);\n                result[code]['total'] = Precise.stringAdd (result[code]['total'], balanceUnconfirmed);\n            } else {\n                const account = this.account ();\n                account['used'] = reservedUnconfirmed;\n                account['total'] = balanceUnconfirmed;\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1439,
        "line_end": 1469,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'name')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"account_id\": \"string\",\n         \"address\": \"string\",\n         \"address_meta\": [\n             {\n                 \"label\": \"string\",\n                 \"value\": \"string\"\n             }\n         ],\n         \"asset\": \"string\",\n         \"assigned_at\": 0,\n         \"name\": \"string\",\n         \"network\": 0,\n         \"qr_code_uri\": \"string\",\n         \"receive_fee\": \"string\",\n         \"total_received\": \"string\",\n         \"total_unconfirmed\": \"string\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"account_id\": \"string\",\n        //         \"address\": \"string\",\n        //         \"address_meta\": [\n        //             {\n        //                 \"label\": \"string\",\n        //                 \"value\": \"string\"\n        //             }\n        //         ],\n        //         \"asset\": \"string\",\n        //         \"assigned_at\": 0,\n        //         \"name\": \"string\",\n        //         \"network\": 0,\n        //         \"qr_code_uri\": \"string\",\n        //         \"receive_fee\": \"string\",\n        //         \"total_received\": \"string\",\n        //         \"total_unconfirmed\": \"string\"\n        //     }\n        //\n        const currencyId = this.safeStringUpper (depositAddress, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': undefined,\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': this.safeString (depositAddress, 'name'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseLedgerComment",
        "signature": "parseLedgerComment (comment)",
        "line_start": 1272,
        "line_end": 1302,
        "comment": null,
        "mappings": [
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerComment (comment) {\n        const words = comment.split (' ');\n        const types: Dict = {\n            'Withdrawal': 'fee',\n            'Trading': 'fee',\n            'Payment': 'transaction',\n            'Sent': 'transaction',\n            'Deposit': 'transaction',\n            'Received': 'transaction',\n            'Released': 'released',\n            'Reserved': 'reserved',\n            'Sold': 'trade',\n            'Bought': 'trade',\n            'Failure': 'failed',\n        };\n        let referenceId = undefined;\n        const firstWord = this.safeString (words, 0);\n        const thirdWord = this.safeString (words, 2);\n        const fourthWord = this.safeString (words, 3);\n        let type = this.safeString (types, firstWord, undefined);\n        if ((type === undefined) && (thirdWord === 'fee')) {\n            type = 'fee';\n        }\n        if ((type === 'reserved') && (fourthWord === 'order')) {\n            referenceId = this.safeString (words, 4);\n        }\n        return {\n            'type': type,\n            'referenceId': referenceId,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (entry, currency: Currency = undefined): LedgerEntry",
        "line_start": 1304,
        "line_end": 1356,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "entry",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "account_id",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "referenceId",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseToNumeric (amount)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "this.parseToNumeric (before)",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.parseToNumeric (after)",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "const details = this.safeValue (entry, 'details', {});"
        ],
        "source": "parseLedgerEntry (entry, currency: Currency = undefined): LedgerEntry {\n        // const details = this.safeValue (entry, 'details', {});\n        const id = this.safeString (entry, 'row_index');\n        const account_id = this.safeString (entry, 'account_id');\n        const timestamp = this.safeInteger (entry, 'timestamp');\n        const currencyId = this.safeString (entry, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const available_delta = this.safeString (entry, 'available_delta');\n        const balance_delta = this.safeString (entry, 'balance_delta');\n        const after = this.safeString (entry, 'balance');\n        const comment = this.safeString (entry, 'description');\n        let before = after;\n        let amount = '0.0';\n        const result = this.parseLedgerComment (comment);\n        const type = result['type'];\n        const referenceId = result['referenceId'];\n        let direction = undefined;\n        let status = undefined;\n        if (!Precise.stringEquals (balance_delta, '0.0')) {\n            before = Precise.stringSub (after, balance_delta);\n            status = 'ok';\n            amount = Precise.stringAbs (balance_delta);\n        } else if (Precise.stringLt (available_delta, '0.0')) {\n            status = 'pending';\n            amount = Precise.stringAbs (available_delta);\n        } else if (Precise.stringGt (available_delta, '0.0')) {\n            status = 'canceled';\n            amount = Precise.stringAbs (available_delta);\n        }\n        if (Precise.stringGt (balance_delta, '0') || Precise.stringGt (available_delta, '0')) {\n            direction = 'in';\n        } else if (Precise.stringLt (balance_delta, '0') || Precise.stringLt (available_delta, '0')) {\n            direction = 'out';\n        }\n        return this.safeLedgerEntry ({\n            'info': entry,\n            'id': id,\n            'direction': direction,\n            'account': account_id,\n            'referenceId': referenceId,\n            'referenceAccount': undefined,\n            'type': type,\n            'currency': code,\n            'amount': this.parseToNumeric (amount),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': this.parseToNumeric (before),\n            'after': this.parseToNumeric (after),\n            'status': status,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1028,
        "line_end": 1045,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n     \"timestamp\": 1664055240000,\n     \"open\": \"19612.65\",\n     \"close\": \"19612.65\",\n     \"high\": \"19612.65\",\n     \"low\": \"19612.65\",\n     \"volume\": \"0.00\"\n }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // {\n        //     \"timestamp\": 1664055240000,\n        //     \"open\": \"19612.65\",\n        //     \"close\": \"19612.65\",\n        //     \"high\": \"19612.65\",\n        //     \"low\": \"19612.65\",\n        //     \"volume\": \"0.00\"\n        // }\n        return [\n            this.safeInteger (ohlcv, 'timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 607,
        "line_end": 679,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"base\": \"string\",\n         \"completed_timestamp\": \"string\",\n         \"counter\": \"string\",\n         \"creation_timestamp\": \"string\",\n         \"expiration_timestamp\": \"string\",\n         \"fee_base\": \"string\",\n         \"fee_counter\": \"string\",\n         \"limit_price\": \"string\",\n         \"limit_volume\": \"string\",\n         \"order_id\": \"string\",\n         \"pair\": \"string\",\n         \"state\": \"PENDING\",\n         \"type\": \"BID\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"base\": \"string\",\n        //         \"completed_timestamp\": \"string\",\n        //         \"counter\": \"string\",\n        //         \"creation_timestamp\": \"string\",\n        //         \"expiration_timestamp\": \"string\",\n        //         \"fee_base\": \"string\",\n        //         \"fee_counter\": \"string\",\n        //         \"limit_price\": \"string\",\n        //         \"limit_volume\": \"string\",\n        //         \"order_id\": \"string\",\n        //         \"pair\": \"string\",\n        //         \"state\": \"PENDING\",\n        //         \"type\": \"BID\"\n        //     }\n        //\n        const timestamp = this.safeInteger (order, 'creation_timestamp');\n        let status = this.parseOrderStatus (this.safeString (order, 'state'));\n        status = (status === 'open') ? status : status;\n        let side = undefined;\n        const orderType = this.safeString (order, 'type');\n        if ((orderType === 'ASK') || (orderType === 'SELL')) {\n            side = 'sell';\n        } else if ((orderType === 'BID') || (orderType === 'BUY')) {\n            side = 'buy';\n        }\n        const marketId = this.safeString (order, 'pair');\n        market = this.safeMarket (marketId, market);\n        const price = this.safeString (order, 'limit_price');\n        const amount = this.safeString (order, 'limit_volume');\n        const quoteFee = this.safeNumber (order, 'fee_counter');\n        const baseFee = this.safeNumber (order, 'fee_base');\n        const filled = this.safeString (order, 'base');\n        const cost = this.safeString (order, 'counter');\n        let fee = undefined;\n        if (quoteFee !== undefined) {\n            fee = {\n                'cost': quoteFee,\n                'currency': market['quote'],\n            };\n        } else if (baseFee !== undefined) {\n            fee = {\n                'cost': baseFee,\n                'currency': market['base'],\n            };\n        }\n        const id = this.safeString (order, 'order_id');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': undefined,\n            'status': status,\n            'symbol': market['symbol'],\n            'type': undefined,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'filled': filled,\n            'cost': cost,\n            'remaining': undefined,\n            'trades': undefined,\n            'fee': fee,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 599,
        "line_end": 605,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            // todo add other statuses\n            'PENDING': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 761,
        "line_end": 797,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'rolling_24_hour_volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"pair\":\"XBTAUD\",\n     \"timestamp\":1642201439301,\n     \"bid\":\"59972.30000000\",\n     \"ask\":\"59997.99000000\",\n     \"last_trade\":\"59997.99000000\",\n     \"rolling_24_hour_volume\":\"1.89510000\",\n     \"status\":\"ACTIVE\"\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        // {\n        //     \"pair\":\"XBTAUD\",\n        //     \"timestamp\":1642201439301,\n        //     \"bid\":\"59972.30000000\",\n        //     \"ask\":\"59997.99000000\",\n        //     \"last_trade\":\"59997.99000000\",\n        //     \"rolling_24_hour_volume\":\"1.89510000\",\n        //     \"status\":\"ACTIVE\"\n        // }\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const marketId = this.safeString (ticker, 'pair');\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString (ticker, 'last_trade');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': undefined,\n            'low': undefined,\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'rolling_24_hour_volume'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 853,
        "line_end": 942,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString2 (trade, 'volume', 'base')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': feeCost,\n                'currency': feeCurrency,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"sequence\":276989,\n          \"timestamp\":1648651276949,\n          \"price\":\"35773.20000000\",\n          \"volume\":\"0.00300000\",\n          \"is_buy\":false\n      }",
          "{\n          \"pair\":\"LTCXBT\",\n          \"sequence\":3256813,\n          \"order_id\":\"BXEX6XHHDT5EGW2\",\n          \"type\":\"ASK\",\n          \"timestamp\":1648652135235,\n          \"price\":\"0.002786\",\n          \"volume\":\"0.10\",\n          \"base\":\"0.10\",\n          \"counter\":\"0.0002786\",\n          \"fee_base\":\"0.0001\",\n          \"fee_counter\":\"0.00\",\n          \"is_buy\":false,\n          \"client_order_id\":\"\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"sequence\":276989,\n        //          \"timestamp\":1648651276949,\n        //          \"price\":\"35773.20000000\",\n        //          \"volume\":\"0.00300000\",\n        //          \"is_buy\":false\n        //      }\n        //\n        // fetchMyTrades (private)\n        //\n        //      {\n        //          \"pair\":\"LTCXBT\",\n        //          \"sequence\":3256813,\n        //          \"order_id\":\"BXEX6XHHDT5EGW2\",\n        //          \"type\":\"ASK\",\n        //          \"timestamp\":1648652135235,\n        //          \"price\":\"0.002786\",\n        //          \"volume\":\"0.10\",\n        //          \"base\":\"0.10\",\n        //          \"counter\":\"0.0002786\",\n        //          \"fee_base\":\"0.0001\",\n        //          \"fee_counter\":\"0.00\",\n        //          \"is_buy\":false,\n        //          \"client_order_id\":\"\"\n        //      }\n        //\n        // For public trade data (is_buy === True) indicates 'buy' side but for private trade data\n        // is_buy indicates maker or taker. The value of \"type\" (ASK/BID) indicate sell/buy side.\n        // Private trade data includes ID field which public trade data does not.\n        const orderId = this.safeString (trade, 'order_id');\n        const id = this.safeString (trade, 'sequence');\n        let takerOrMaker = undefined;\n        let side = undefined;\n        if (orderId !== undefined) {\n            const type = this.safeString (trade, 'type');\n            if ((type === 'ASK') || (type === 'SELL')) {\n                side = 'sell';\n            } else if ((type === 'BID') || (type === 'BUY')) {\n                side = 'buy';\n            }\n            if (side === 'sell' && trade['is_buy']) {\n                takerOrMaker = 'maker';\n            } else if (side === 'buy' && !trade['is_buy']) {\n                takerOrMaker = 'maker';\n            } else {\n                takerOrMaker = 'taker';\n            }\n        } else {\n            side = trade['is_buy'] ? 'buy' : 'sell';\n        }\n        const feeBaseString = this.safeString (trade, 'fee_base');\n        const feeCounterString = this.safeString (trade, 'fee_counter');\n        let feeCurrency = undefined;\n        let feeCost = undefined;\n        if (feeBaseString !== undefined) {\n            if (!Precise.stringEquals (feeBaseString, '0.0')) {\n                feeCurrency = market['base'];\n                feeCost = feeBaseString;\n            }\n        } else if (feeCounterString !== undefined) {\n            if (!Precise.stringEquals (feeCounterString, '0.0')) {\n                feeCurrency = market['quote'];\n                feeCost = feeCounterString;\n            }\n        }\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString2 (trade, 'volume', 'base'),\n            // Does not include potential fee costs\n            'cost': this.safeString (trade, 'counter'),\n            'fee': {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            },\n        }, market);\n    }"
      }
    ],
    "mercado": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 517,
        "line_end": 534,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const data = this.safeValue (response, 'response_data', {});\n        const balances = this.safeValue (data, 'balance', {});\n        const result: Dict = { 'info': response };\n        const currencyIds = Object.keys (balances);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            if (currencyId in balances) {\n                const balance = this.safeValue (balances, currencyId, {});\n                const account = this.account ();\n                account['free'] = this.safeString (balance, 'available');\n                account['total'] = this.safeString (balance, 'total');\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 853,
        "line_end": 862,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 651,
        "line_end": 721,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "this.safeString (order, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": 4,\n         \"coin_pair\": \"BRLBTC\",\n         \"order_type\": 1,\n         \"status\": 2,\n         \"has_fills\": true,\n         \"quantity\": \"2.00000000\",\n         \"limit_price\": \"900.00000\",\n         \"executed_quantity\": \"1.00000000\",\n         \"executed_price_avg\": \"900.00000\",\n         \"fee\": \"0.00300000\",\n         \"created_timestamp\": \"1453838494\",\n         \"updated_timestamp\": \"1453838494\",\n         \"operations\": [\n             {\n                 \"operation_id\": 1,\n                 \"quantity\": \"1.00000000\",\n                 \"price\": \"900.00000\",\n                 \"fee_rate\": \"0.30\",\n                 \"executed_timestamp\": \"1453838494\",\n             },\n         ],\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"order_id\": 4,\n        //         \"coin_pair\": \"BRLBTC\",\n        //         \"order_type\": 1,\n        //         \"status\": 2,\n        //         \"has_fills\": true,\n        //         \"quantity\": \"2.00000000\",\n        //         \"limit_price\": \"900.00000\",\n        //         \"executed_quantity\": \"1.00000000\",\n        //         \"executed_price_avg\": \"900.00000\",\n        //         \"fee\": \"0.00300000\",\n        //         \"created_timestamp\": \"1453838494\",\n        //         \"updated_timestamp\": \"1453838494\",\n        //         \"operations\": [\n        //             {\n        //                 \"operation_id\": 1,\n        //                 \"quantity\": \"1.00000000\",\n        //                 \"price\": \"900.00000\",\n        //                 \"fee_rate\": \"0.30\",\n        //                 \"executed_timestamp\": \"1453838494\",\n        //             },\n        //         ],\n        //     }\n        //\n        const id = this.safeString (order, 'order_id');\n        const order_type = this.safeString (order, 'order_type');\n        let side = undefined;\n        if ('order_type' in order) {\n            side = (order_type === '1') ? 'buy' : 'sell';\n        }\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'coin_pair');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeTimestamp (order, 'created_timestamp');\n        const fee = {\n            'cost': this.safeString (order, 'fee'),\n            'currency': market['quote'],\n        };\n        const price = this.safeString (order, 'limit_price');\n        // price = this.safeNumber (order, 'executed_price_avg', price);\n        const average = this.safeString (order, 'executed_price_avg');\n        const amount = this.safeString (order, 'quantity');\n        const filled = this.safeString (order, 'executed_quantity');\n        const lastTradeTimestamp = this.safeTimestamp (order, 'updated_timestamp');\n        const rawTrades = this.safeValue (order, 'operations', []);\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': market['symbol'],\n            'type': 'limit',\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': rawTrades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 642,
        "line_end": 649,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '2': 'open',\n            '3': 'canceled',\n            '4': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 382,
        "line_end": 420,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'vol')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"high\":\"103.96000000\",\n         \"low\":\"95.00000000\",\n         \"vol\":\"2227.67806598\",\n         \"last\":\"97.91591000\",\n         \"buy\":\"95.52760000\",\n         \"sell\":\"97.91475000\",\n         \"open\":\"99.79955000\",\n         \"date\":1643382606\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"high\":\"103.96000000\",\n        //         \"low\":\"95.00000000\",\n        //         \"vol\":\"2227.67806598\",\n        //         \"last\":\"97.91591000\",\n        //         \"buy\":\"95.52760000\",\n        //         \"sell\":\"97.91475000\",\n        //         \"open\":\"99.79955000\",\n        //         \"date\":1643382606\n        //     }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeTimestamp (ticker, 'date');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'vol'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 455,
        "line_end": 486,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        const timestamp = this.safeTimestamp2 (trade, 'date', 'executed_timestamp');\n        market = this.safeMarket (undefined, market);\n        const id = this.safeString2 (trade, 'tid', 'operation_id');\n        const type = undefined;\n        const side = this.safeString (trade, 'type');\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString2 (trade, 'amount', 'quantity');\n        const feeCost = this.safeString (trade, 'fee_rate');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': undefined,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': undefined,\n            'type': type,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 814,
        "line_end": 851,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 1,\n         \"coin\": \"BRL\",\n         \"quantity\": \"300.56\",\n         \"net_quantity\": \"291.68\",\n         \"fee\": \"8.88\",\n         \"account\": \"bco: 341, ag: 1111, cta: 23456-X\",\n         \"status\": 1,\n         \"created_timestamp\": \"1453912088\",\n         \"updated_timestamp\": \"1453912088\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"id\": 1,\n        //         \"coin\": \"BRL\",\n        //         \"quantity\": \"300.56\",\n        //         \"net_quantity\": \"291.68\",\n        //         \"fee\": \"8.88\",\n        //         \"account\": \"bco: 341, ag: 1111, cta: 23456-X\",\n        //         \"status\": 1,\n        //         \"created_timestamp\": \"1453912088\",\n        //         \"updated_timestamp\": \"1453912088\"\n        //     }\n        //\n        currency = this.safeCurrency (undefined, currency);\n        return {\n            'id': this.safeString (transaction, 'id'),\n            'txid': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'amount': undefined,\n            'type': undefined,\n            'currency': currency['code'],\n            'status': undefined,\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'info': transaction,\n        } as Transaction;\n    }"
      }
    ],
    "mexc": [
      {
        "name": "parseAccountId",
        "signature": "parseAccountId (status)",
        "line_start": 5562,
        "line_end": 5570,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseAccountId (status) {\n        const statuses: Dict = {\n            'SPOT': 'spot',\n            'FUTURES': 'swap',\n            'MAIN': 'spot',\n            'CONTRACT': 'swap',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseBalanceHelper",
        "signature": "parseBalanceHelper (entry)",
        "line_start": 3901,
        "line_end": 3910,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceHelper (entry) {\n        const account = this.account ();\n        account['used'] = this.safeString (entry, 'locked');\n        account['free'] = this.safeString (entry, 'free');\n        account['total'] = this.safeString (entry, 'totalAsset');\n        const debt = this.safeString (entry, 'borrowed');\n        const interest = this.safeString (entry, 'interest');\n        account['debt'] = Precise.stringAdd (debt, interest);\n        return account;\n    }"
      },
      {
        "name": "parseBidAsk",
        "signature": "parseBidAsk (bidask, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2)",
        "line_start": 1501,
        "line_end": 1510,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBidAsk (bidask, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2) {\n        const countKey = 2;\n        const price = this.safeNumber (bidask, priceKey);\n        const amount = this.safeNumber (bidask, amountKey);\n        const count = this.safeNumber (bidask, countKey);\n        if (count !== undefined) {\n            return [ price, amount, count ];\n        }\n        return [ price, amount ];\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 4697,
        "line_end": 4717,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId, currencyId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        coin: \"USDT\",\n        network: \"BNB Smart Chain(BEP20)\",\n        address: \"0x0d48003e0c27c5de62b97c9b4cdb31fdd29da619\",\n        memo:  null\n    }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        coin: \"USDT\",\n        //        network: \"BNB Smart Chain(BEP20)\",\n        //        address: \"0x0d48003e0c27c5de62b97c9b4cdb31fdd29da619\",\n        //        memo:  null\n        //    }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const currencyId = this.safeString (depositAddress, 'coin');\n        const networkId = this.safeString (depositAddress, 'netWork');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'network': this.networkIdToCode (networkId, currencyId),\n            'address': address,\n            'tag': this.safeString (depositAddress, 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 5840,
        "line_end": 5885,
        "comment": null,
        "mappings": [
          {
            "key": "withdraw",
            "value": "{\n                    'fee': this.safeNumber (networkEntry, 'withdrawFee'),\n                    'percentage': undefined,\n                }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                    'fee': undefined,\n                    'percentage': undefined,\n                }",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"coin\": \"AGLD\",\n        \"name\": \"Adventure Gold\",\n        \"networkList\": [\n            {\n                \"coin\": \"AGLD\",\n                \"depositDesc\": null,\n                \"depositEnable\": true,\n                \"minConfirm\": \"0\",\n                \"name\": \"Adventure Gold\",\n                \"network\": \"ERC20\",\n                \"withdrawEnable\": true,\n                \"withdrawFee\": \"10.000000000000000000\",\n                \"withdrawIntegerMultiple\": null,\n                \"withdrawMax\": \"1200000.000000000000000000\",\n                \"withdrawMin\": \"20.000000000000000000\",\n                \"sameAddress\": false,\n                \"contract\": \"0x32353a6c91143bfd6c7d363b546e62a9a2489a20\",\n                \"withdrawTips\": null,\n                \"depositTips\": null\n            }\n            ...\n        ]\n    }"
        ],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"coin\": \"AGLD\",\n        //        \"name\": \"Adventure Gold\",\n        //        \"networkList\": [\n        //            {\n        //                \"coin\": \"AGLD\",\n        //                \"depositDesc\": null,\n        //                \"depositEnable\": true,\n        //                \"minConfirm\": \"0\",\n        //                \"name\": \"Adventure Gold\",\n        //                \"network\": \"ERC20\",\n        //                \"withdrawEnable\": true,\n        //                \"withdrawFee\": \"10.000000000000000000\",\n        //                \"withdrawIntegerMultiple\": null,\n        //                \"withdrawMax\": \"1200000.000000000000000000\",\n        //                \"withdrawMin\": \"20.000000000000000000\",\n        //                \"sameAddress\": false,\n        //                \"contract\": \"0x32353a6c91143bfd6c7d363b546e62a9a2489a20\",\n        //                \"withdrawTips\": null,\n        //                \"depositTips\": null\n        //            }\n        //            ...\n        //        ]\n        //    }\n        //\n        const networkList = this.safeValue (fee, 'networkList', []);\n        const result = this.depositWithdrawFee (fee);\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.networkIdToCode (networkId, this.safeString (currency, 'code'));\n            result['networks'][networkCode] = {\n                'withdraw': {\n                    'fee': this.safeNumber (networkEntry, 'withdrawFee'),\n                    'percentage': undefined,\n                },\n                'deposit': {\n                    'fee': undefined,\n                    'percentage': undefined,\n                },\n            };\n        }\n        return this.assignDefaultDepositWithdrawFees (result);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 4383,
        "line_end": 4433,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "intervalString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC_USDT\",\n         \"fundingRate\": 0.000014,\n         \"maxFundingRate\": 0.003,\n         \"minFundingRate\": -0.003,\n         \"collectCycle\": 8,\n         \"nextSettleTime\": 1643241600000,\n         \"timestamp\": 1643240373359\n     }",
          "{\n         \"symbol\": \"BTC_USDT\",\n         \"rate\": -0.000021,\n         \"nextSettleTime\": 1771084800000\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"fundingRate\": 0.000014,\n        //         \"maxFundingRate\": 0.003,\n        //         \"minFundingRate\": -0.003,\n        //         \"collectCycle\": 8,\n        //         \"nextSettleTime\": 1643241600000,\n        //         \"timestamp\": 1643240373359\n        //     }\n        //\n        // watchFundingRate\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT\",\n        //         \"rate\": -0.000021,\n        //         \"nextSettleTime\": 1771084800000\n        //     }\n        //\n        const nextFundingRate = this.safeNumber2 (contract, 'fundingRate', 'rate');\n        const nextFundingTimestamp = this.safeInteger (contract, 'nextSettleTime');\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const timestamp = this.safeInteger (contract, 'timestamp');\n        const interval = this.safeString (contract, 'collectCycle');\n        let intervalString = undefined;\n        if (interval !== undefined) {\n            intervalString = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': nextFundingRate,\n            'fundingTimestamp': nextFundingTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': intervalString,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 5937,
        "line_end": 5959,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        let marginMode = undefined;\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        for (let i = 0; i < leverage.length; i++) {\n            const entry = leverage[i];\n            const openType = this.safeInteger (entry, 'openType');\n            const positionType = this.safeInteger (entry, 'positionType');\n            if (positionType === 1) {\n                longLeverage = this.safeInteger (entry, 'leverage');\n            } else if (positionType === 2) {\n                shortLeverage = this.safeInteger (entry, 'leverage');\n            }\n            marginMode = (openType === 1) ? 'isolated' : 'cross';\n        }\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 4615,
        "line_end": 4695,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"symbol\": \"BTC_USDT\",\n        \"displayName\": \"BTC_USDT永续\",\n        \"displayNameEn\": \"BTC_USDT SWAP\",\n        \"positionOpenType\": 3,\n        \"baseCoin\": \"BTC\",\n        \"quoteCoin\": \"USDT\",\n        \"settleCoin\": \"USDT\",\n        \"contractSize\": 0.0001,\n        \"minLeverage\": 1,\n        \"maxLeverage\": 125,\n        \"priceScale\": 2,\n        \"volScale\": 0,\n        \"amountScale\": 4,\n        \"priceUnit\": 0.5,\n        \"volUnit\": 1,\n        \"minVol\": 1,\n        \"maxVol\": 1000000,\n        \"bidLimitPriceRate\": 0.1,\n        \"askLimitPriceRate\": 0.1,\n        \"takerFeeRate\": 0.0006,\n        \"makerFeeRate\": 0.0002,\n        \"maintenanceMarginRate\": 0.004,\n        \"initialMarginRate\": 0.008,\n        \"riskBaseVol\": 10000,\n        \"riskIncrVol\": 200000,\n        \"riskIncrMmr\": 0.004,\n        \"riskIncrImr\": 0.004,\n        \"riskLevelLimit\": 5,\n        \"priceCoefficientVariation\": 0.1,\n        \"indexOrigin\": [\"BINANCE\",\"GATEIO\",\"HUOBI\",\"MXC\"],\n        \"state\": 0, // 0 enabled, 1 delivery, 2 completed, 3 offline, 4 pause\n        \"isNew\": false,\n        \"isHot\": true,\n        \"isHidden\": false\n    }"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //    {\n        //        \"symbol\": \"BTC_USDT\",\n        //        \"displayName\": \"BTC_USDT永续\",\n        //        \"displayNameEn\": \"BTC_USDT SWAP\",\n        //        \"positionOpenType\": 3,\n        //        \"baseCoin\": \"BTC\",\n        //        \"quoteCoin\": \"USDT\",\n        //        \"settleCoin\": \"USDT\",\n        //        \"contractSize\": 0.0001,\n        //        \"minLeverage\": 1,\n        //        \"maxLeverage\": 125,\n        //        \"priceScale\": 2,\n        //        \"volScale\": 0,\n        //        \"amountScale\": 4,\n        //        \"priceUnit\": 0.5,\n        //        \"volUnit\": 1,\n        //        \"minVol\": 1,\n        //        \"maxVol\": 1000000,\n        //        \"bidLimitPriceRate\": 0.1,\n        //        \"askLimitPriceRate\": 0.1,\n        //        \"takerFeeRate\": 0.0006,\n        //        \"makerFeeRate\": 0.0002,\n        //        \"maintenanceMarginRate\": 0.004,\n        //        \"initialMarginRate\": 0.008,\n        //        \"riskBaseVol\": 10000,\n        //        \"riskIncrVol\": 200000,\n        //        \"riskIncrMmr\": 0.004,\n        //        \"riskIncrImr\": 0.004,\n        //        \"riskLevelLimit\": 5,\n        //        \"priceCoefficientVariation\": 0.1,\n        //        \"indexOrigin\": [\"BINANCE\",\"GATEIO\",\"HUOBI\",\"MXC\"],\n        //        \"state\": 0, // 0 enabled, 1 delivery, 2 completed, 3 offline, 4 pause\n        //        \"isNew\": false,\n        //        \"isHot\": true,\n        //        \"isHidden\": false\n        //    }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        let maintenanceMarginRate = this.safeString (info, 'maintenanceMarginRate');\n        let initialMarginRate = this.safeString (info, 'initialMarginRate');\n        const maxVol = this.safeString (info, 'maxVol');\n        const riskIncrVol = this.safeString (info, 'riskIncrVol');\n        const riskIncrMmr = this.safeString (info, 'riskIncrMmr');\n        const riskIncrImr = this.safeString (info, 'riskIncrImr');\n        let floor = '0';\n        const tiers = [];\n        const quoteId = this.safeString (info, 'quoteCoin');\n        if (riskIncrVol === '0') {\n            return [\n                {\n                    'tier': 0,\n                    'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n                    'currency': this.safeCurrencyCode (quoteId),\n                    'minNotional': undefined,\n                    'maxNotional': undefined,\n                    'maintenanceMarginRate': undefined,\n                    'maxLeverage': this.safeNumber (info, 'maxLeverage'),\n                    'info': info,\n                },\n            ];\n        }\n        while (Precise.stringLt (floor, maxVol)) {\n            const cap = Precise.stringAdd (floor, riskIncrVol);\n            tiers.push ({\n                'tier': this.parseNumber (Precise.stringDiv (cap, riskIncrVol)),\n                'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n                'currency': this.safeCurrencyCode (quoteId),\n                'minNotional': this.parseNumber (floor),\n                'maxNotional': this.parseNumber (cap),\n                'maintenanceMarginRate': this.parseNumber (maintenanceMarginRate),\n                'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMarginRate)),\n                'info': info,\n            });\n            initialMarginRate = Precise.stringAdd (initialMarginRate, riskIncrImr);\n            maintenanceMarginRate = Precise.stringAdd (maintenanceMarginRate, riskIncrMmr);\n            floor = cap;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1876,
        "line_end": 1885,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3374,
        "line_end": 3602,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'newClientOrderId')",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'updateTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString2 (order, 'status', 'state'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (typeRaw)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.parseOrderSide (this.safeString (order, 'side'))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber2 (order, 'stopPrice', 'triggerPrice')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber (order, 'dealAvgPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber2 (order, 'origQty', 'vol')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'cummulativeQuoteQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeSum)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"symbol\": \"FARTCOINUSDT\",\n        \"orderId\": \"C02__342252993005723644225\",\n        \"orderListId\": \"-1\",\n        \"price\": \"1.1\",\n        \"origQty\": \"6.3\",\n        \"type\": \"IMMEDIATE_OR_CANCEL\",\n        \"side\": \"SELL\",\n        \"transactTime\": \"1745852205223\"\n    }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"123738410679123456\",\n         \"orderListId\": -1\n    }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"762634301354414080\",\n         \"clientOrderId\": null,\n         \"isIsolated\": true,\n         \"transactTime\": 1661992652132\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"133926441921286144\",\n         \"price\": \"30000\",\n         \"origQty\": \"0.0002\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\"\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"orderId\": \"762640232574226432\",\n         \"orderListId\": \"-1\",\n         \"clientOrderId\": null,\n         \"price\": \"18000\",\n         \"origQty\": \"0.00147\",\n         \"executedQty\": \"0\",\n         \"cummulativeQuoteQty\": \"0\",\n         \"status\": \"NEW\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"isIsolated\": true,\n         \"isWorking\": true,\n         \"time\": 1661994066000,\n         \"updateTime\": 1661994066000\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //    createOrder\n        //\n        //    {\n        //        \"symbol\": \"FARTCOINUSDT\",\n        //        \"orderId\": \"C02__342252993005723644225\",\n        //        \"orderListId\": \"-1\",\n        //        \"price\": \"1.1\",\n        //        \"origQty\": \"6.3\",\n        //        \"type\": \"IMMEDIATE_OR_CANCEL\",\n        //        \"side\": \"SELL\",\n        //        \"transactTime\": \"1745852205223\"\n        //    }\n        //\n        //    unknown endpoint on spot\n        //\n        //    {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"123738410679123456\",\n        //         \"orderListId\": -1\n        //    }\n        //\n        // margin: createOrder\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"762634301354414080\",\n        //         \"clientOrderId\": null,\n        //         \"isIsolated\": true,\n        //         \"transactTime\": 1661992652132\n        //     }\n        //\n        // spot: cancelOrder, cancelAllOrders\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"133926441921286144\",\n        //         \"price\": \"30000\",\n        //         \"origQty\": \"0.0002\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\"\n        //     }\n        //\n        // margin: cancelOrder, cancelAllOrders\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"762640232574226432\",\n        //         \"orderListId\": \"-1\",\n        //         \"clientOrderId\": null,\n        //         \"price\": \"18000\",\n        //         \"origQty\": \"0.00147\",\n        //         \"executedQty\": \"0\",\n        //         \"cummulativeQuoteQty\": \"0\",\n        //         \"status\": \"NEW\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"isIsolated\": true,\n        //         \"isWorking\": true,\n        //         \"time\": 1661994066000,\n        //         \"updateTime\": 1661994066000\n        //     }\n        //\n        // spot: fetchOrder, fetchOpenOrders, fetchOrders\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"133734823834147272\",\n        //         \"orderListId\": \"-1\",\n        //         \"clientOrderId\": null,\n        //         \"price\": \"30000\",\n        //         \"origQty\": \"0.0002\",\n        //         \"executedQty\": \"0\",\n        //         \"cummulativeQuoteQty\": \"0\",\n        //         \"status\": \"CANCELED\",\n        //         \"timeInForce\": null,\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": null,\n        //         \"icebergQty\": null,\n        //         \"time\": \"1647667102000\",\n        //         \"updateTime\": \"1647708567000\",\n        //         \"isWorking\": true,\n        //         \"origQuoteOrderQty\": \"6\"\n        //     }\n        //\n        // margin: fetchOrder, fetchOrders\n        //\n        //     {\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"orderId\": \"763307297891028992\",\n        //         \"orderListId\": \"-1\",\n        //         \"clientOrderId\": null,\n        //         \"price\": \"18000\",\n        //         \"origQty\": \"0.0014\",\n        //         \"executedQty\": \"0\",\n        //         \"cummulativeQuoteQty\": \"0\",\n        //         \"status\": \"NEW\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"isIsolated\": true,\n        //         \"isWorking\": true,\n        //         \"time\": 1662153107000,\n        //         \"updateTime\": 1662153107000\n        //     }\n        //\n        // swap: createOrder\n        //\n        //     2ff3163e8617443cb9c6fc19d42b1ca4\n        //\n        // swap: fetchOrder, fetchOrders\n        //\n        //     regular\n        //     {\n        //         \"orderId\": \"264995729269765120\",\n        //         \"symbol\": \"STEPN_USDT\",\n        //         \"positionId\": \"0\",\n        //         \"price\": \"2.2\",\n        //         \"vol\": \"15\",\n        //         \"leverage\": \"20\",\n        //         \"side\": \"1\", // TODO: not unified\n        //         \"category\": \"1\",\n        //         \"orderType\": \"1\", // TODO: not unified\n        //         \"dealAvgPrice\": \"0\",\n        //         \"dealVol\": \"0\",\n        //         \"orderMargin\": \"2.2528\",\n        //         \"takerFee\": \"0\",\n        //         \"makerFee\": \"0\",\n        //         \"profit\": \"0\",\n        //         \"feeCurrency\": \"USDT\",\n        //         \"openType\": \"1\",\n        //         \"state\": \"2\", // TODO\n        //         \"externalOid\": \"_m_0e9520c256744d64b942985189026d20\",\n        //         \"errorCode\": \"0\",\n        //         \"usedMargin\": \"0\",\n        //         \"createTime\": \"1648850305236\",\n        //         \"updateTime\": \"1648850305245\",\n        //         \"positionMode\": \"1\"\n        //     }\n        //\n        //     stop\n        //     {\n        //         \"id\": \"265557643326564352\",\n        //         \"triggerType\": \"1\",\n        //         \"triggerPrice\": \"3\",\n        //         \"price\": \"2.9\", // not present in stop-market, but in stop-limit order\n        //         \"executeCycle\": \"87600\",\n        //         \"trend\": \"1\",\n        //          // below keys are same as in regular order structure\n        //         \"symbol\": \"STEPN_USDT\",\n        //         \"leverage\": \"20\",\n        //         \"side\": \"1\",\n        //         \"vol\": \"13\",\n        //         \"openType\": \"1\",\n        //         \"state\": \"1\",\n        //         \"orderType\": \"1\",\n        //         \"errorCode\": \"0\",\n        //         \"createTime\": \"1648984276000\",\n        //         \"updateTime\": \"1648984276000\",\n        //     }\n        //\n        // createOrders error\n        //\n        //     {\n        //         \"newClientOrderId\": \"123456\",\n        //         \"msg\": \"The minimum transaction volume cannot be less than:0.5USDT\",\n        //         \"code\": 30002\n        //     }\n        //\n        const code = this.safeInteger (order, 'code');\n        if (code !== undefined) {\n            // error upon placing multiple orders\n            return this.safeOrder ({\n                'info': order,\n                'status': 'rejected',\n                'clientOrderId': this.safeString (order, 'newClientOrderId'),\n            });\n        }\n        let id = undefined;\n        if (typeof order === 'string') {\n            id = order;\n        } else {\n            id = this.safeString2 (order, 'orderId', 'id');\n        }\n        let timeInForce = this.parseOrderTimeInForce (this.safeString (order, 'timeInForce'));\n        const typeRaw = this.safeString (order, 'type');\n        if (timeInForce === undefined) {\n            timeInForce = this.getTifFromRawOrderType (typeRaw);\n        }\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeIntegerN (order, [ 'time', 'createTime', 'transactTime' ]);\n        let fee = undefined;\n        const feeCurrency = this.safeString (order, 'feeCurrency');\n        if (feeCurrency !== undefined) {\n            const takerFee = this.safeString (order, 'takerFee');\n            const makerFee = this.safeString (order, 'makerFee');\n            const feeSum = Precise.stringAdd (takerFee, makerFee);\n            fee = {\n                'currency': feeCurrency,\n                'cost': this.parseNumber (feeSum),\n            };\n        }\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (order, 'updateTime'),\n            'status': this.parseOrderStatus (this.safeString2 (order, 'status', 'state')),\n            'symbol': market['symbol'],\n            'type': this.parseOrderType (typeRaw),\n            'timeInForce': timeInForce,\n            'side': this.parseOrderSide (this.safeString (order, 'side')),\n            'price': this.safeNumber (order, 'price'),\n            'triggerPrice': this.safeNumber2 (order, 'stopPrice', 'triggerPrice'),\n            'average': this.safeNumber (order, 'dealAvgPrice'),\n            'amount': this.safeNumber2 (order, 'origQty', 'vol'),\n            'cost': this.safeNumber (order, 'cummulativeQuoteQty'),  // 'cummulativeQuoteQty' vs 'origQuoteOrderQty'\n            'filled': this.safeNumber2 (order, 'executedQty', 'dealVol'),\n            'remaining': undefined,\n            'fee': fee,\n            'trades': undefined,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (status)",
        "line_start": 3604,
        "line_end": 3613,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSide (status) {\n        const statuses: Dict = {\n            'BUY': 'buy',\n            'SELL': 'sell',\n            '1': 'buy',\n            '2': 'sell',\n            // contracts v1 : TODO\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3627,
        "line_end": 3642,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'PARTIALLY_FILLED': 'open',\n            'PARTIALLY_CANCELED': 'canceled',\n            // contracts v1\n            // '1': 'uninformed', // TODO: wt?\n            '2': 'open',\n            '3': 'closed',\n            '4': 'canceled',\n            // '5': 'invalid', //  TODO: wt?\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (status)",
        "line_start": 3644,
        "line_end": 3651,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderTimeInForce (status) {\n        const statuses: Dict = {\n            'GTC': 'GTC',\n            'FOK': 'FOK',\n            'IOC': 'IOC',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 3615,
        "line_end": 3625,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'LIMIT_MAKER': 'limit',\n            // on spot, during submission below types are used only accepted as limit order\n            'IMMEDIATE_OR_CANCEL': 'limit',\n            'FILL_OR_KILL': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 5173,
        "line_end": 5275,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contracts)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "entryPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverage)",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginType",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMargin)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"positionId\": 1394650,\n         \"symbol\": \"ETH_USDT\",\n         \"positionType\": 1,\n         \"openType\": 1,\n         \"state\": 1,\n         \"holdVol\": 1,\n         \"frozenVol\": 0,\n         \"closeVol\": 0,\n         \"holdAvgPrice\": 1217.3,\n         \"openAvgPrice\": 1217.3,\n         \"closeAvgPrice\": 0,\n         \"liquidatePrice\": 1211.2,\n         \"oim\": 0.1290338,\n         \"im\": 0.1290338,\n         \"holdFee\": 0,\n         \"realised\": -0.0073,\n         \"leverage\": 100,\n         \"createTime\": 1609991676000,\n         \"updateTime\": 1609991676000,\n         \"autoAddIm\": false\n     }",
          "{\n        positionId: '390281084',\n        symbol: 'RVN_USDT',\n        positionType: '1',\n        openType: '2',\n        state: '3',\n        holdVol: '0',\n        frozenVol: '0',\n        closeVol: '1141',\n        holdAvgPrice: '0.03491',\n        holdAvgPriceFullyScale: '0.03491',\n        openAvgPrice: '0.03491',\n        openAvgPriceFullyScale: '0.03491',\n        closeAvgPrice: '0.03494',\n        liquidatePrice: '0.03433',\n        oim: '0',\n        im: '0',\n        holdFee: '0',\n        realised: '0.1829',\n        leverage: '50',\n        createTime: '1711512408000',\n        updateTime: '1711512553000',\n        autoAddIm: false,\n        version: '4',\n        profitRatio: '0.0227',\n        newOpenAvgPrice: '0.03491',\n        newCloseAvgPrice: '0.03494',\n        closeProfitLoss: '0.3423',\n        fee: '0.1593977',\n        positionShowStatus: 'CLOSED'\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // fetchPositions\n        //\n        //     {\n        //         \"positionId\": 1394650,\n        //         \"symbol\": \"ETH_USDT\",\n        //         \"positionType\": 1,\n        //         \"openType\": 1,\n        //         \"state\": 1,\n        //         \"holdVol\": 1,\n        //         \"frozenVol\": 0,\n        //         \"closeVol\": 0,\n        //         \"holdAvgPrice\": 1217.3,\n        //         \"openAvgPrice\": 1217.3,\n        //         \"closeAvgPrice\": 0,\n        //         \"liquidatePrice\": 1211.2,\n        //         \"oim\": 0.1290338,\n        //         \"im\": 0.1290338,\n        //         \"holdFee\": 0,\n        //         \"realised\": -0.0073,\n        //         \"leverage\": 100,\n        //         \"createTime\": 1609991676000,\n        //         \"updateTime\": 1609991676000,\n        //         \"autoAddIm\": false\n        //     }\n        //\n        // fetchPositionsHistory\n        //\n        //    {\n        //        positionId: '390281084',\n        //        symbol: 'RVN_USDT',\n        //        positionType: '1',\n        //        openType: '2',\n        //        state: '3',\n        //        holdVol: '0',\n        //        frozenVol: '0',\n        //        closeVol: '1141',\n        //        holdAvgPrice: '0.03491',\n        //        holdAvgPriceFullyScale: '0.03491',\n        //        openAvgPrice: '0.03491',\n        //        openAvgPriceFullyScale: '0.03491',\n        //        closeAvgPrice: '0.03494',\n        //        liquidatePrice: '0.03433',\n        //        oim: '0',\n        //        im: '0',\n        //        holdFee: '0',\n        //        realised: '0.1829',\n        //        leverage: '50',\n        //        createTime: '1711512408000',\n        //        updateTime: '1711512553000',\n        //        autoAddIm: false,\n        //        version: '4',\n        //        profitRatio: '0.0227',\n        //        newOpenAvgPrice: '0.03491',\n        //        newCloseAvgPrice: '0.03494',\n        //        closeProfitLoss: '0.3423',\n        //        fee: '0.1593977',\n        //        positionShowStatus: 'CLOSED'\n        //    }\n        //\n        market = this.safeMarket (this.safeString (position, 'symbol'), market, undefined, 'swap');\n        const symbol = market['symbol'];\n        const contracts = this.safeString (position, 'holdVol');\n        const entryPrice = this.safeNumber (position, 'openAvgPrice');\n        const initialMargin = this.safeString (position, 'im');\n        const rawSide = this.safeString (position, 'positionType');\n        const side = (rawSide === '1') ? 'long' : 'short';\n        const openType = this.safeString (position, 'margin_mode');\n        const marginType = (openType === '1') ? 'isolated' : 'cross';\n        const leverage = this.safeNumber (position, 'leverage');\n        const liquidationPrice = this.safeNumber (position, 'liquidatePrice');\n        const timestamp = this.safeInteger (position, 'updateTime');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'contracts': this.parseNumber (contracts),\n            'contractSize': undefined,\n            'entryPrice': entryPrice,\n            'collateral': undefined,\n            'side': side,\n            'unrealizedPnl': undefined,\n            'leverage': this.parseNumber (leverage),\n            'percentage': undefined,\n            'marginMode': marginType,\n            'notional': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'liquidationPrice': liquidationPrice,\n            'initialMargin': this.parseNumber (initialMargin),\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'marginRatio': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n            'lastUpdateTimestamp': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2052,
        "line_end": 2167,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString (ticker, 'lastPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "bid",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "ask",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "prevClose",
            "comment": null
          },
          {
            "key": "change",
            "value": "changeValue",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "changePcnt",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETH_USDT\",\n         \"lastPrice\": 3581.3,\n         \"bid1\": 3581.25,\n         \"ask1\": 3581.5,\n         \"volume24\": 4045530,\n         \"amount24\": 141331823.5755,\n         \"holdVol\": 5832946,\n         \"lower24Price\": 3413.4,\n         \"high24Price\": 3588.7,\n         \"riseFallRate\": 0.0275,\n         \"riseFallValue\": 95.95,\n         \"indexPrice\": 3580.7852,\n         \"fairPrice\": 3581.08,\n         \"fundingRate\": 0.000063,\n         \"maxBidPrice\": 3938.85,\n         \"minAskPrice\": 3222.7,\n         \"timestamp\": 1634162885016\n     }",
          "{\n         \"symbol\": \"BTCUSDT\",\n         \"priceChange\": \"184.34\",\n         \"priceChangePercent\": \"0.00400048\",\n         \"prevClosePrice\": \"46079.37\",\n         \"lastPrice\": \"46263.71\",\n         \"lastQty\": \"\",\n         \"bidPrice\": \"46260.38\",\n         \"bidQty\": \"\",\n         \"askPrice\": \"46260.41\",\n         \"askQty\": \"\",\n         \"openPrice\": \"46079.37\",\n         \"highPrice\": \"47550.01\",\n         \"lowPrice\": \"45555.5\",\n         \"volume\": \"1732.461487\",\n         \"quoteVolume\": null,\n         \"openTime\": 1641349500000,\n         \"closeTime\": 1641349582808,\n         \"count\": null\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        let timestamp = undefined;\n        let bid = undefined;\n        let ask = undefined;\n        let bidVolume = undefined;\n        let askVolume = undefined;\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        let open = undefined;\n        let high = undefined;\n        let low = undefined;\n        let changePcnt = undefined;\n        let changeValue = undefined;\n        let prevClose = undefined;\n        const isSwap = this.safeValue (market, 'swap');\n        // if swap\n        if (isSwap || ('timestamp' in ticker)) {\n            //\n            //     {\n            //         \"symbol\": \"ETH_USDT\",\n            //         \"lastPrice\": 3581.3,\n            //         \"bid1\": 3581.25,\n            //         \"ask1\": 3581.5,\n            //         \"volume24\": 4045530,\n            //         \"amount24\": 141331823.5755,\n            //         \"holdVol\": 5832946,\n            //         \"lower24Price\": 3413.4,\n            //         \"high24Price\": 3588.7,\n            //         \"riseFallRate\": 0.0275,\n            //         \"riseFallValue\": 95.95,\n            //         \"indexPrice\": 3580.7852,\n            //         \"fairPrice\": 3581.08,\n            //         \"fundingRate\": 0.000063,\n            //         \"maxBidPrice\": 3938.85,\n            //         \"minAskPrice\": 3222.7,\n            //         \"timestamp\": 1634162885016\n            //     }\n            //\n            timestamp = this.safeInteger (ticker, 'timestamp');\n            bid = this.safeString (ticker, 'bid1');\n            ask = this.safeString (ticker, 'ask1');\n            baseVolume = this.safeString (ticker, 'volume24');\n            quoteVolume = this.safeString (ticker, 'amount24');\n            high = this.safeString (ticker, 'high24Price');\n            low = this.safeString (ticker, 'lower24Price');\n            changeValue = this.safeString (ticker, 'riseFallValue');\n            changePcnt = this.safeString (ticker, 'riseFallRate');\n            changePcnt = Precise.stringMul (changePcnt, '100');\n        } else {\n            //\n            //     {\n            //         \"symbol\": \"BTCUSDT\",\n            //         \"priceChange\": \"184.34\",\n            //         \"priceChangePercent\": \"0.00400048\",\n            //         \"prevClosePrice\": \"46079.37\",\n            //         \"lastPrice\": \"46263.71\",\n            //         \"lastQty\": \"\",\n            //         \"bidPrice\": \"46260.38\",\n            //         \"bidQty\": \"\",\n            //         \"askPrice\": \"46260.41\",\n            //         \"askQty\": \"\",\n            //         \"openPrice\": \"46079.37\",\n            //         \"highPrice\": \"47550.01\",\n            //         \"lowPrice\": \"45555.5\",\n            //         \"volume\": \"1732.461487\",\n            //         \"quoteVolume\": null,\n            //         \"openTime\": 1641349500000,\n            //         \"closeTime\": 1641349582808,\n            //         \"count\": null\n            //     }\n            //\n            timestamp = this.safeInteger (ticker, 'closeTime');\n            bid = this.safeString (ticker, 'bidPrice');\n            ask = this.safeString (ticker, 'askPrice');\n            bidVolume = this.safeString (ticker, 'bidQty');\n            askVolume = this.safeString (ticker, 'askQty');\n            if (Precise.stringEq (bidVolume, '0')) {\n                bidVolume = undefined;\n            }\n            if (Precise.stringEq (askVolume, '0')) {\n                askVolume = undefined;\n            }\n            baseVolume = this.safeString (ticker, 'volume');\n            quoteVolume = this.safeString (ticker, 'quoteVolume');\n            open = this.safeString (ticker, 'openPrice');\n            high = this.safeString (ticker, 'highPrice');\n            low = this.safeString (ticker, 'lowPrice');\n            prevClose = this.safeString (ticker, 'prevClosePrice');\n            changeValue = this.safeString (ticker, 'priceChange');\n            changePcnt = this.safeString (ticker, 'priceChangePercent');\n            changePcnt = Precise.stringMul (changePcnt, '100');\n        }\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'open': open,\n            'high': high,\n            'low': low,\n            'close': this.safeString (ticker, 'lastPrice'),\n            'bid': bid,\n            'bidVolume': bidVolume,\n            'ask': ask,\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'previousClose': prevClose,\n            'change': changeValue,\n            'percentage': changePcnt,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1615,
        "line_end": 1759,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (trade, 'feeCurrency'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"p\": 31199,\n         \"v\": 18,\n         \"T\": 1,\n         \"O\": 3,\n         \"M\": 2,\n         \"t\": 1609831235985\n     }",
          "{\n             \"a\": null,\n             \"f\": null,\n             \"l\": null,\n             \"p\": \"40679\",\n             \"q\": \"0.001309\",\n             \"T\": 1647551328000,\n             \"m\": true,\n             \"M\": true\n         }",
          "{\n             \"symbol\": \"BTCUSDT\",\n             \"id\": \"133948532984922113\",\n             \"orderId\": \"133948532531949568\",\n             \"orderListId\": \"-1\",\n             \"price\": \"41995.51\",\n             \"qty\": \"0.0002\",\n             \"quoteQty\": \"8.399102\",\n             \"commission\": \"0.016798204\",\n             \"commissionAsset\": \"USDT\",\n             \"time\": \"1647718055000\",\n             \"isBuyer\": true,\n             \"isMaker\": false,\n             \"isBestMatch\": true\n         }",
          "{\n             \"id\": \"299444585\",\n             \"symbol\": \"STEPN_USDT\",\n             \"side\": \"1\",\n             \"vol\": \"1\",\n             \"price\": \"2.45455\",\n             \"feeCurrency\": \"USDT\",\n             \"fee\": \"0.00147273\",\n             \"timestamp\": \"1648924557000\",\n             \"profit\": \"0\",\n             \"category\": \"1\",\n             \"orderId\": \"265307163526610432\",\n             \"positionMode\": \"1\",\n             \"taker\": true\n         }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        let id = undefined;\n        let timestamp = undefined;\n        let orderId = undefined;\n        let symbol = undefined;\n        let fee = undefined;\n        const type = undefined;\n        let side = undefined;\n        let takerOrMaker = undefined;\n        let priceString = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        // if swap\n        if ('v' in trade) {\n            //\n            // swap: fetchTrades\n            //\n            //     {\n            //         \"p\": 31199,\n            //         \"v\": 18,\n            //         \"T\": 1,\n            //         \"O\": 3,\n            //         \"M\": 2,\n            //         \"t\": 1609831235985\n            //     }\n            //\n            timestamp = this.safeInteger (trade, 't');\n            market = this.safeMarket (undefined, market);\n            symbol = market['symbol'];\n            priceString = this.safeString (trade, 'p');\n            amountString = this.safeString (trade, 'v');\n            side = this.parseOrderSide (this.safeString (trade, 'T'));\n            takerOrMaker = 'taker';\n        } else {\n            //\n            // spot: fetchTrades (for aggTrades)\n            //\n            //         {\n            //             \"a\": null,\n            //             \"f\": null,\n            //             \"l\": null,\n            //             \"p\": \"40679\",\n            //             \"q\": \"0.001309\",\n            //             \"T\": 1647551328000,\n            //             \"m\": true,\n            //             \"M\": true\n            //         }\n            //\n            // spot: fetchMyTrades, fetchOrderTrades\n            //\n            //         {\n            //             \"symbol\": \"BTCUSDT\",\n            //             \"id\": \"133948532984922113\",\n            //             \"orderId\": \"133948532531949568\",\n            //             \"orderListId\": \"-1\",\n            //             \"price\": \"41995.51\",\n            //             \"qty\": \"0.0002\",\n            //             \"quoteQty\": \"8.399102\",\n            //             \"commission\": \"0.016798204\",\n            //             \"commissionAsset\": \"USDT\",\n            //             \"time\": \"1647718055000\",\n            //             \"isBuyer\": true,\n            //             \"isMaker\": false,\n            //             \"isBestMatch\": true\n            //         }\n            //\n            // swap: fetchMyTrades, fetchOrderTrades\n            //\n            //         {\n            //             \"id\": \"299444585\",\n            //             \"symbol\": \"STEPN_USDT\",\n            //             \"side\": \"1\",\n            //             \"vol\": \"1\",\n            //             \"price\": \"2.45455\",\n            //             \"feeCurrency\": \"USDT\",\n            //             \"fee\": \"0.00147273\",\n            //             \"timestamp\": \"1648924557000\",\n            //             \"profit\": \"0\",\n            //             \"category\": \"1\",\n            //             \"orderId\": \"265307163526610432\",\n            //             \"positionMode\": \"1\",\n            //             \"taker\": true\n            //         }\n            //\n            const marketId = this.safeString (trade, 'symbol');\n            market = this.safeMarket (marketId, market);\n            symbol = market['symbol'];\n            id = this.safeString2 (trade, 'id', 'a');\n            priceString = this.safeString2 (trade, 'price', 'p');\n            orderId = this.safeString (trade, 'orderId');\n            // if swap\n            if ('positionMode' in trade) {\n                timestamp = this.safeInteger (trade, 'timestamp');\n                amountString = this.safeString (trade, 'vol');\n                side = this.parseOrderSide (this.safeString (trade, 'side'));\n                fee = {\n                    'cost': this.safeString (trade, 'fee'),\n                    'currency': this.safeCurrencyCode (this.safeString (trade, 'feeCurrency')),\n                };\n                takerOrMaker = this.safeValue (trade, 'taker') ? 'taker' : 'maker';\n            } else {\n                timestamp = this.safeInteger2 (trade, 'time', 'T');\n                amountString = this.safeString2 (trade, 'qty', 'q');\n                costString = this.safeString (trade, 'quoteQty');\n                const isBuyer = this.safeValue (trade, 'isBuyer');\n                const isMaker = this.safeValue (trade, 'isMaker');\n                const buyerMaker = this.safeValue2 (trade, 'isBuyerMaker', 'm');\n                if (isMaker !== undefined) {\n                    takerOrMaker = isMaker ? 'maker' : 'taker';\n                }\n                if (isBuyer !== undefined) {\n                    side = isBuyer ? 'buy' : 'sell';\n                }\n                if (buyerMaker !== undefined) {\n                    side = buyerMaker ? 'sell' : 'buy';\n                    takerOrMaker = 'taker';\n                }\n                const feeAsset = this.safeString (trade, 'commissionAsset');\n                if (feeAsset !== undefined) {\n                    fee = {\n                        'cost': this.safeString (trade, 'commission'),\n                        'currency': this.safeCurrencyCode (feeAsset),\n                    };\n                }\n            }\n        }\n        if (id === undefined && this.safeBool (this.options, 'useCcxtTradeId', true)) {\n            id = this.createCcxtTradeId (timestamp, side, amountString, priceString, takerOrMaker);\n        }\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 4971,
        "line_end": 5078,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'memo')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'remark')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"amount\": \"10\",\n     \"coin\": \"USDC-TRX\",\n     \"network\": \"TRX\",\n     \"status\": \"5\",\n     \"address\": \"TSMcEDDvkqY9dz8RkFnrS86U59GwEZjfvh\",\n     \"txId\": \"51a8f49e6f03f2c056e71fe3291aa65e1032880be855b65cecd0595a1b8af95b:0\",\n     \"insertTime\": \"1664805021000\",\n     \"unlockConfirm\": \"200\",\n     \"confirmTimes\": \"203\",\n     \"memo\": \"xxyy1122\",\n     \"transHash\": \"51a8f49e6f03f2c056e71fe3291aa65e1032880be855b65cecd0595a1b8af95b\",\n     \"updateTime\": \"1664805621000\",\n     \"netWork: \"TRX\"\n }",
          "{\n     \"id\": \"adcd1c8322154de691b815eedcd10c42\",\n     \"txId\": \"0xc8c918cd69b2246db493ef6225a72ffdc664f15b08da3e25c6879b271d05e9d0:0\",\n     \"coin\": \"USDC-MATIC\",\n     \"network\": \"MATIC\",\n     \"address\": \"0xeE6C7a415995312ED52c53a0f8f03e165e0A5D62\",\n     \"amount\": \"2\",\n     \"transferType\": \"0\",\n     \"status\": \"7\",\n     \"transactionFee\": \"1\",\n     \"confirmNo\": null,\n     \"applyTime\": \"1664882739000\",\n     \"remark\": \"\",\n     \"memo\": null,\n     \"explorerUrl\": \"https://etherscan.io/tx/0xc8c918cd69b2246db493ef6225a72ffdc664f15b08da3e25c6879b271d05e9d0\",\n     \"transHash\": \"0xc8c918cd69b2246db493ef6225a72ffdc664f15b08da3e25c6879b271d05e9d0\",\n     \"updateTime\": \"1664882799000\",\n     \"netWork: \"MATIC\"\n   }",
          "{\n         \"id\":\"25fb2831fb6d4fc7aa4094612a26c81d\"\n     }",
          "{\n         \"tranId\":\"ad36f0e9c9a24ae794b36fa4f152e471\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        // {\n        //     \"amount\": \"10\",\n        //     \"coin\": \"USDC-TRX\",\n        //     \"network\": \"TRX\",\n        //     \"status\": \"5\",\n        //     \"address\": \"TSMcEDDvkqY9dz8RkFnrS86U59GwEZjfvh\",\n        //     \"txId\": \"51a8f49e6f03f2c056e71fe3291aa65e1032880be855b65cecd0595a1b8af95b:0\",\n        //     \"insertTime\": \"1664805021000\",\n        //     \"unlockConfirm\": \"200\",\n        //     \"confirmTimes\": \"203\",\n        //     \"memo\": \"xxyy1122\",\n        //     \"transHash\": \"51a8f49e6f03f2c056e71fe3291aa65e1032880be855b65cecd0595a1b8af95b\",\n        //     \"updateTime\": \"1664805621000\",\n        //     \"netWork: \"TRX\"\n        // }\n        //\n        // fetchWithdrawals\n        //\n        // {\n        //     \"id\": \"adcd1c8322154de691b815eedcd10c42\",\n        //     \"txId\": \"0xc8c918cd69b2246db493ef6225a72ffdc664f15b08da3e25c6879b271d05e9d0:0\",\n        //     \"coin\": \"USDC-MATIC\",\n        //     \"network\": \"MATIC\",\n        //     \"address\": \"0xeE6C7a415995312ED52c53a0f8f03e165e0A5D62\",\n        //     \"amount\": \"2\",\n        //     \"transferType\": \"0\",\n        //     \"status\": \"7\",\n        //     \"transactionFee\": \"1\",\n        //     \"confirmNo\": null,\n        //     \"applyTime\": \"1664882739000\",\n        //     \"remark\": \"\",\n        //     \"memo\": null,\n        //     \"explorerUrl\": \"https://etherscan.io/tx/0xc8c918cd69b2246db493ef6225a72ffdc664f15b08da3e25c6879b271d05e9d0\",\n        //     \"transHash\": \"0xc8c918cd69b2246db493ef6225a72ffdc664f15b08da3e25c6879b271d05e9d0\",\n        //     \"updateTime\": \"1664882799000\",\n        //     \"netWork: \"MATIC\"\n        //   }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\":\"25fb2831fb6d4fc7aa4094612a26c81d\"\n        //     }\n        //\n        // internal withdraw (aka internal-transfer)\n        //\n        //     {\n        //         \"tranId\":\"ad36f0e9c9a24ae794b36fa4f152e471\"\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'id', 'tranId');\n        const type = (id === undefined) ? 'deposit' : 'withdrawal';\n        const timestamp = this.safeInteger2 (transaction, 'insertTime', 'applyTime');\n        const updated = this.safeInteger (transaction, 'updateTime');\n        let currencyId = undefined;\n        const currencyWithNetwork = this.safeString (transaction, 'coin');\n        if (currencyWithNetwork !== undefined) {\n            currencyId = currencyWithNetwork.split ('-')[0];\n        }\n        let network = undefined;\n        const rawNetwork = this.safeString (transaction, 'network');\n        if (rawNetwork !== undefined) {\n            network = this.networkIdToCode (rawNetwork);\n        }\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n        let amountString = this.safeString (transaction, 'amount');\n        const address = this.safeString (transaction, 'address');\n        const txid = this.safeString2 (transaction, 'transHash', 'txId');\n        let fee = undefined;\n        const feeCostString = this.safeString (transaction, 'transactionFee');\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': this.parseNumber (feeCostString),\n                'currency': code,\n            };\n        }\n        if (type === 'withdrawal') {\n            // mexc withdrawal amount includes the fee\n            amountString = Precise.stringSub (amountString, feeCostString);\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': this.safeString (transaction, 'memo'),\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.parseNumber (amountString),\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'comment': this.safeString (transaction, 'remark'),\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionFee",
        "signature": "parseTransactionFee (transaction, currency: Currency = undefined)",
        "line_start": 5757,
        "line_end": 5794,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n        \"coin\": \"AGLD\",\n        \"name\": \"Adventure Gold\",\n        \"networkList\": [\n            {\n                \"coin\": \"AGLD\",\n                \"depositDesc\": null,\n                \"depositEnable\": true,\n                \"minConfirm\": \"0\",\n                \"name\": \"Adventure Gold\",\n                \"network\": \"ERC20\",\n                \"withdrawEnable\": true,\n                \"withdrawFee\": \"10.000000000000000000\",\n                \"withdrawIntegerMultiple\": null,\n                \"withdrawMax\": \"1200000.000000000000000000\",\n                \"withdrawMin\": \"20.000000000000000000\",\n                \"sameAddress\": false,\n                \"contract\": \"0x32353a6c91143bfd6c7d363b546e62a9a2489a20\",\n                \"withdrawTips\": null,\n                \"depositTips\": null\n            }\n            ...\n        ]\n    }"
        ],
        "source": "parseTransactionFee (transaction, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"coin\": \"AGLD\",\n        //        \"name\": \"Adventure Gold\",\n        //        \"networkList\": [\n        //            {\n        //                \"coin\": \"AGLD\",\n        //                \"depositDesc\": null,\n        //                \"depositEnable\": true,\n        //                \"minConfirm\": \"0\",\n        //                \"name\": \"Adventure Gold\",\n        //                \"network\": \"ERC20\",\n        //                \"withdrawEnable\": true,\n        //                \"withdrawFee\": \"10.000000000000000000\",\n        //                \"withdrawIntegerMultiple\": null,\n        //                \"withdrawMax\": \"1200000.000000000000000000\",\n        //                \"withdrawMin\": \"20.000000000000000000\",\n        //                \"sameAddress\": false,\n        //                \"contract\": \"0x32353a6c91143bfd6c7d363b546e62a9a2489a20\",\n        //                \"withdrawTips\": null,\n        //                \"depositTips\": null\n        //            }\n        //            ...\n        //        ]\n        //    }\n        //\n        const networkList = this.safeValue (transaction, 'networkList', []);\n        const result: Dict = {};\n        for (let j = 0; j < networkList.length; j++) {\n            const networkEntry = networkList[j];\n            const networkId = this.safeString (networkEntry, 'network');\n            const networkCode = this.safeString (this.options['networks'], networkId, networkId);\n            const fee = this.safeNumber (networkEntry, 'withdrawFee');\n            result[networkCode] = fee;\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTransactionFees",
        "signature": "parseTransactionFees (response, codes = undefined)",
        "line_start": 5739,
        "line_end": 5755,
        "comment": null,
        "mappings": [
          {
            "key": "withdraw",
            "value": "withdrawFees",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{}",
            "comment": null
          },
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransactionFees (response, codes = undefined) {\n        const withdrawFees: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const currencyId = this.safeString (entry, 'coin');\n            const currency = this.safeCurrency (currencyId);\n            const code = this.safeString (currency, 'code');\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                withdrawFees[code] = this.parseTransactionFee (entry, currency);\n            }\n        }\n        return {\n            'withdraw': withdrawFees,\n            'deposit': {},\n            'info': response,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 5080,
        "line_end": 5106,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        const statusesByType: Dict = {\n            'deposit': {\n                '1': 'failed', // SMALL\n                '2': 'pending', // TIME_DELAY\n                '3': 'pending', // LARGE_DELAY\n                '4': 'pending', // PENDING\n                '5': 'ok', // SUCCESS\n                '6': 'pending', // AUDITING\n                '7': 'failed', // REJECTED\n            },\n            'withdrawal': {\n                '1': 'pending', // APPLY\n                '2': 'pending', // AUDITING\n                '3': 'pending', // WAIT\n                '4': 'pending', // PROCESSING\n                '5': 'pending', // WAIT_PACKAGING\n                '6': 'pending', // WAIT_CONFIRM\n                '7': 'ok', // SUCCESS\n                '8': 'failed', // FAILED\n                '9': 'canceled', // CANCEL\n                '10': 'pending', // MANUAL\n            },\n        };\n        const statuses = this.safeValue (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 5487,
        "line_end": 5560,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.parseAccountId (accountFrom)",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.parseAccountId (accountTo)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeStringN (transfer, [ 'transact_state', 'state', 'status' ]))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"USDT\",\n         \"amount\": \"1\",\n         \"transact_id\": \"b60c1df8e7b24b268858003f374ecb75\",\n         \"from\": \"MAIN\",\n         \"to\": \"CONTRACT\",\n         \"transact_state\": \"WAIT\"\n     }",
          "{\n         \"currency\": \"USDT\",\n         \"amount\": \"22.90213135\",\n         \"txid\": \"fa8a1e7bf05940a3b7025856dc48d025\",\n         \"id\": \"2980812\",\n         \"type\": \"IN\",\n         \"state\": \"SUCCESS\",\n         \"createTime\": \"1648849076000\",\n         \"updateTime\": \"1648849076000\"\n     }",
          "{\n         \"tranId\": \"cdf0d2a618b5458c965baefe6b1d0859\",\n         \"clientTranId\": null,\n         \"asset\": \"USDT\",\n         \"amount\": \"1\",\n         \"fromAccountType\": \"FUTURES\",\n         \"toAccountType\": \"SPOT\",\n         \"symbol\": null,\n         \"status\": \"SUCCESS\",\n         \"timestamp\": 1759328309000\n         }",
          "{\n         \"tranId\": \"ebb06123e6a64f4ab234b396c548d57e\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // spot: fetchTransfer\n        //\n        //     {\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"1\",\n        //         \"transact_id\": \"b60c1df8e7b24b268858003f374ecb75\",\n        //         \"from\": \"MAIN\",\n        //         \"to\": \"CONTRACT\",\n        //         \"transact_state\": \"WAIT\"\n        //     }\n        //\n        // swap: fetchTransfer\n        //\n        //     {\n        //         \"currency\": \"USDT\",\n        //         \"amount\": \"22.90213135\",\n        //         \"txid\": \"fa8a1e7bf05940a3b7025856dc48d025\",\n        //         \"id\": \"2980812\",\n        //         \"type\": \"IN\",\n        //         \"state\": \"SUCCESS\",\n        //         \"createTime\": \"1648849076000\",\n        //         \"updateTime\": \"1648849076000\"\n        //     }\n        //         {\n        //         \"tranId\": \"cdf0d2a618b5458c965baefe6b1d0859\",\n        //         \"clientTranId\": null,\n        //         \"asset\": \"USDT\",\n        //         \"amount\": \"1\",\n        //         \"fromAccountType\": \"FUTURES\",\n        //         \"toAccountType\": \"SPOT\",\n        //         \"symbol\": null,\n        //         \"status\": \"SUCCESS\",\n        //         \"timestamp\": 1759328309000\n        //         }\n        //\n        // transfer\n        //\n        //     {\n        //         \"tranId\": \"ebb06123e6a64f4ab234b396c548d57e\"\n        //     }\n        //\n        const currencyId = this.safeString2 (transfer, 'currency', 'asset');\n        const id = this.safeStringN (transfer, [ 'transact_id', 'txid', 'tranId' ]);\n        const timestamp = this.safeInteger2 (transfer, 'createTime', 'timestamp');\n        const datetime = (timestamp !== undefined) ? this.iso8601 (timestamp) : undefined;\n        const direction = this.safeString (transfer, 'type');\n        let accountFrom = undefined;\n        let accountTo = undefined;\n        const fromAccountType = this.safeString (transfer, 'fromAccountType');\n        const toAccountType = this.safeString (transfer, 'toAccountType');\n        if ((fromAccountType !== undefined) && (toAccountType !== undefined)) {\n            accountFrom = fromAccountType;\n            accountTo = toAccountType;\n        } else if (direction !== undefined) {\n            accountFrom = (direction === 'IN') ? 'MAIN' : 'CONTRACT';\n            accountTo = (direction === 'IN') ? 'CONTRACT' : 'MAIN';\n        } else {\n            accountFrom = this.safeString (transfer, 'from');\n            accountTo = this.safeString (transfer, 'to');\n        }\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': this.parseAccountId (accountFrom),\n            'toAccount': this.parseAccountId (accountTo),\n            'status': this.parseTransferStatus (this.safeStringN (transfer, [ 'transact_state', 'state', 'status' ])),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 5572,
        "line_end": 5579,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'SUCCESS': 'ok',\n            'FAILED': 'failed',\n            'WAIT': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "modetrade": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2259,
        "line_end": 2273,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        const balances = this.safeList (response, 'holding', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'token'));\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'holding');\n            account['used'] = this.safeString (balance, 'frozen');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 889,
        "line_end": 898,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate",
        "line_start": 847,
        "line_end": 887,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "estFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (estFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (fundingRate, 'est_funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "this.safeNumber (fundingRate, 'last_funding_rate')",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "lastFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "this.iso8601 (lastFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"symbol\":\"PERP_AAVE_USDT\",\n             \"est_funding_rate\":-0.00003447,\n             \"est_funding_rate_timestamp\":1653633959001,\n             \"last_funding_rate\":-0.00002094,\n             \"last_funding_rate_timestamp\":1653631200000,\n             \"next_funding_time\":1653634800000,\n            \"sum_unitary_funding\": 521.367\n         }"
        ],
        "source": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n        //\n        //         {\n        //             \"symbol\":\"PERP_AAVE_USDT\",\n        //             \"est_funding_rate\":-0.00003447,\n        //             \"est_funding_rate_timestamp\":1653633959001,\n        //             \"last_funding_rate\":-0.00002094,\n        //             \"last_funding_rate_timestamp\":1653631200000,\n        //             \"next_funding_time\":1653634800000,\n        //            \"sum_unitary_funding\": 521.367\n        //         }\n        //\n        const symbol = this.safeString (fundingRate, 'symbol');\n        market = this.market (symbol);\n        const nextFundingTimestamp = this.safeInteger (fundingRate, 'next_funding_time');\n        const estFundingRateTimestamp = this.safeInteger (fundingRate, 'est_funding_rate_timestamp');\n        const lastFundingRateTimestamp = this.safeInteger (fundingRate, 'last_funding_rate_timestamp');\n        const fundingTimeString = this.safeString (fundingRate, 'last_funding_rate_timestamp');\n        const nextFundingTimeString = this.safeString (fundingRate, 'next_funding_time');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        return {\n            'info': fundingRate,\n            'symbol': market['symbol'],\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': estFundingRateTimestamp,\n            'datetime': this.iso8601 (estFundingRateTimestamp),\n            'fundingRate': this.safeNumber (fundingRate, 'est_funding_rate'),\n            'fundingTimestamp': nextFundingTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': this.safeNumber (fundingRate, 'last_funding_rate'),\n            'previousFundingTimestamp': lastFundingRateTimestamp,\n            'previousFundingDatetime': this.iso8601 (lastFundingRateTimestamp),\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 1052,
        "line_end": 1083,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PERP_ETH_USDC\",\n         \"funding_rate\": 0.00046875,\n         \"mark_price\": 2100,\n         \"funding_fee\": 0.000016,\n         \"payment_type\": \"Pay\",\n         \"status\": \"Accrued\",\n         \"created_time\": 1682235722003,\n         \"updated_time\": 1682235722003\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        // {\n        //         \"symbol\": \"PERP_ETH_USDC\",\n        //         \"funding_rate\": 0.00046875,\n        //         \"mark_price\": 2100,\n        //         \"funding_fee\": 0.000016,\n        //         \"payment_type\": \"Pay\",\n        //         \"status\": \"Accrued\",\n        //         \"created_time\": 1682235722003,\n        //         \"updated_time\": 1682235722003\n        // }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        let amount = this.safeString (income, 'funding_fee');\n        const code = this.safeCurrencyCode ('USDC');\n        const timestamp = this.safeInteger (income, 'updated_time');\n        const rate = this.safeNumber (income, 'funding_rate');\n        const paymentType = this.safeString (income, 'payment_type');\n        amount = (paymentType === 'Pay') ? Precise.stringNeg (amount) : amount;\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.parseNumber (amount),\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2354,
        "line_end": 2380,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'account')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tx_id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (item, 'status'))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        const currencyId = this.safeString (item, 'token');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amount = this.safeNumber (item, 'amount');\n        const side = this.safeString (item, 'token_side');\n        const direction = (side === 'DEPOSIT') ? 'in' : 'out';\n        const timestamp = this.safeInteger (item, 'created_time');\n        const fee = this.parseTokenAndFeeTemp (item, 'fee_token', 'fee_amount');\n        return this.safeLedgerEntry ({\n            'id': this.safeString (item, 'id'),\n            'currency': code,\n            'account': this.safeString (item, 'account'),\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tx_id'),\n            'status': this.parseTransactionStatus (this.safeString (item, 'status')),\n            'amount': amount,\n            'before': undefined,\n            'after': undefined,\n            'fee': fee,\n            'direction': direction,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'info': item,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2382,
        "line_end": 2388,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'BALANCE': 'transaction', // Funds moved in/out wallet\n            'COLLATERAL': 'transfer', // Funds moved between portfolios\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage, market = undefined): Leverage",
        "line_start": 2632,
        "line_end": 2641,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage, market = undefined): Leverage {\n        const leverageValue = this.safeInteger (leverage, 'max_leverage');\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': undefined,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 490,
        "line_end": 577,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_tick'),\n                'price': this.safeNumber (market, 'quote_tick'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min'),\n                    'max': this.safeNumber (market, 'base_max'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'quote_min'),\n                    'max': this.safeNumber (market, 'quote_max'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'created_time')",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'base_min'),\n                    'max': this.safeNumber (market, 'base_max'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'quote_min'),\n                    'max': this.safeNumber (market, 'quote_max'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'quote_min')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'quote_max')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'min_notional')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"PERP_BTC_USDC\",\n     \"quote_min\": 123,\n     \"quote_max\": 100000,\n     \"quote_tick\": 0.1,\n     \"base_min\": 0.00001,\n     \"base_max\": 20,\n     \"base_tick\": 0.00001,\n     \"min_notional\": 1,\n     \"price_range\": 0.02,\n     \"price_scope\": 0.4,\n     \"std_liquidation_fee\": 0.03,\n     \"liquidator_fee\": 0.015,\n     \"claim_insurance_fund_discount\": 0.0075,\n     \"funding_period\": 8,\n     \"cap_funding\": 0.000375,\n     \"floor_funding\": -0.000375,\n     \"interest_rate\": 0.0001,\n     \"created_time\": 1684140107326,\n     \"updated_time\": 1685345968053,\n     \"base_mmr\": 0.05,\n     \"base_imr\": 0.1,\n     \"imr_factor\": 0.0002512,\n     \"liquidation_tier\": \"1\"\n   }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //   {\n        //     \"symbol\": \"PERP_BTC_USDC\",\n        //     \"quote_min\": 123,\n        //     \"quote_max\": 100000,\n        //     \"quote_tick\": 0.1,\n        //     \"base_min\": 0.00001,\n        //     \"base_max\": 20,\n        //     \"base_tick\": 0.00001,\n        //     \"min_notional\": 1,\n        //     \"price_range\": 0.02,\n        //     \"price_scope\": 0.4,\n        //     \"std_liquidation_fee\": 0.03,\n        //     \"liquidator_fee\": 0.015,\n        //     \"claim_insurance_fund_discount\": 0.0075,\n        //     \"funding_period\": 8,\n        //     \"cap_funding\": 0.000375,\n        //     \"floor_funding\": -0.000375,\n        //     \"interest_rate\": 0.0001,\n        //     \"created_time\": 1684140107326,\n        //     \"updated_time\": 1685345968053,\n        //     \"base_mmr\": 0.05,\n        //     \"base_imr\": 0.1,\n        //     \"imr_factor\": 0.0002512,\n        //     \"liquidation_tier\": \"1\"\n        //   }\n        //\n        const marketId = this.safeString (market, 'symbol');\n        const parts = marketId.split ('_');\n        const marketType = 'swap';\n        const baseId = this.safeString (parts, 1);\n        const quoteId = this.safeString (parts, 2);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settleId: Str = this.safeString (parts, 2);\n        const settle: Str = this.safeCurrencyCode (settleId);\n        const symbol = base + '/' + quote + ':' + settle;\n        return {\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': false,\n            'margin': false,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': undefined,\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'contractSize': this.parseNumber ('1'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_tick'),\n                'price': this.safeNumber (market, 'quote_tick'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min'),\n                    'max': this.safeNumber (market, 'base_max'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'quote_min'),\n                    'max': this.safeNumber (market, 'quote_max'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                },\n            },\n            'created': this.safeInteger (market, 'created_time'),\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1249,
        "line_end": 1258,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'start_timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1308,
        "line_end": 1422,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (orderType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (orderType)",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "trades",
            "value": "transactions",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': fee,\n                'currency': feeCurrency,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"orderId\": \"1578938\",\n     \"clientOrderId\": \"0\",\n     \"algoType\": \"STOP_LOSS\",\n     \"quantity\": \"0.1\"\n   }",
          "{\n       \"algoOrderId\": \"1578958\",\n       \"clientOrderId\": \"0\",\n       \"rootAlgoOrderId\": \"1578958\",\n       \"parentAlgoOrderId\": \"0\",\n       \"symbol\": \"SPOT_LTC_USDT\",\n       \"orderTag\": \"default\",\n       \"algoType\": \"STOP_LOSS\",\n       \"side\": \"BUY\",\n       \"quantity\": \"0.1\",\n       \"isTriggered\": false,\n       \"triggerPrice\": \"100\",\n       \"triggerStatus\": \"USELESS\",\n       \"type\": \"LIMIT\",\n       \"rootAlgoStatus\": \"CANCELLED\",\n       \"algoStatus\": \"CANCELLED\",\n       \"triggerPriceType\": \"MARKET_PRICE\",\n       \"price\": \"75\",\n       \"triggerTime\": \"0\",\n       \"totalExecutedQuantity\": \"0\",\n       \"averageExecutedPrice\": \"0\",\n       \"totalFee\": \"0\",\n       \"feeAsset\": '',\n       \"reduceOnly\": false,\n       \"createdTime\": \"1686149609.744\",\n       \"updatedTime\": \"1686149903.362\"\n   }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // Possible input functions:\n        // * createOrder\n        // * createOrders\n        // * cancelOrder\n        // * fetchOrder\n        // * fetchOrders\n        // const isFromFetchOrder = ('order_tag' in order); TO_DO\n        //\n        // stop order after creating it:\n        //   {\n        //     \"orderId\": \"1578938\",\n        //     \"clientOrderId\": \"0\",\n        //     \"algoType\": \"STOP_LOSS\",\n        //     \"quantity\": \"0.1\"\n        //   }\n        // stop order after fetching it:\n        //   {\n        //       \"algoOrderId\": \"1578958\",\n        //       \"clientOrderId\": \"0\",\n        //       \"rootAlgoOrderId\": \"1578958\",\n        //       \"parentAlgoOrderId\": \"0\",\n        //       \"symbol\": \"SPOT_LTC_USDT\",\n        //       \"orderTag\": \"default\",\n        //       \"algoType\": \"STOP_LOSS\",\n        //       \"side\": \"BUY\",\n        //       \"quantity\": \"0.1\",\n        //       \"isTriggered\": false,\n        //       \"triggerPrice\": \"100\",\n        //       \"triggerStatus\": \"USELESS\",\n        //       \"type\": \"LIMIT\",\n        //       \"rootAlgoStatus\": \"CANCELLED\",\n        //       \"algoStatus\": \"CANCELLED\",\n        //       \"triggerPriceType\": \"MARKET_PRICE\",\n        //       \"price\": \"75\",\n        //       \"triggerTime\": \"0\",\n        //       \"totalExecutedQuantity\": \"0\",\n        //       \"averageExecutedPrice\": \"0\",\n        //       \"totalFee\": \"0\",\n        //       \"feeAsset\": '',\n        //       \"reduceOnly\": false,\n        //       \"createdTime\": \"1686149609.744\",\n        //       \"updatedTime\": \"1686149903.362\"\n        //   }\n        //\n        const timestamp = this.safeIntegerN (order, [ 'timestamp', 'created_time', 'createdTime' ]);\n        const orderId = this.safeStringN (order, [ 'order_id', 'orderId', 'algoOrderId' ]);\n        const clientOrderId = this.omitZero (this.safeString2 (order, 'client_order_id', 'clientOrderId')); // Somehow, this always returns 0 for limit order\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString2 (order, 'order_price', 'price');\n        const amount = this.safeString2 (order, 'order_quantity', 'quantity'); // This is base amount\n        const cost = this.safeString2 (order, 'order_amount', 'amount'); // This is quote amount\n        const orderType = this.safeStringLower2 (order, 'order_type', 'type');\n        let status = this.safeValue2 (order, 'status', 'algoStatus');\n        const success = this.safeBool (order, 'success');\n        if (success !== undefined) {\n            status = (success) ? 'NEW' : 'REJECTED';\n        }\n        const side = this.safeStringLower (order, 'side');\n        const filled = this.omitZero (this.safeValue2 (order, 'executed', 'totalExecutedQuantity'));\n        const average = this.omitZero (this.safeString2 (order, 'average_executed_price', 'averageExecutedPrice'));\n        const remaining = Precise.stringSub (cost, filled);\n        const fee = this.safeValue2 (order, 'total_fee', 'totalFee');\n        const feeCurrency = this.safeString2 (order, 'fee_asset', 'feeAsset');\n        const transactions = this.safeValue (order, 'Transactions');\n        const triggerPrice = this.safeNumber (order, 'triggerPrice');\n        let takeProfitPrice: Num = undefined;\n        let stopLossPrice: Num = undefined;\n        const childOrders = this.safeValue (order, 'childOrders');\n        if (childOrders !== undefined) {\n            const first = this.safeValue (childOrders, 0);\n            const innerChildOrders = this.safeValue (first, 'childOrders', []);\n            const innerChildOrdersLength = innerChildOrders.length;\n            if (innerChildOrdersLength > 0) {\n                const takeProfitOrder = this.safeValue (innerChildOrders, 0);\n                const stopLossOrder = this.safeValue (innerChildOrders, 1);\n                takeProfitPrice = this.safeNumber (takeProfitOrder, 'triggerPrice');\n                stopLossPrice = this.safeNumber (stopLossOrder, 'triggerPrice');\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger2 (order, 'updatedTime', 'updated_time');\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': this.parseOrderType (orderType),\n            'timeInForce': this.parseTimeInForce (orderType),\n            'postOnly': undefined, // TO_DO\n            'reduceOnly': this.safeBool (order, 'reduce_only'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining, // TO_DO\n            'cost': cost,\n            'trades': transactions,\n            'fee': {\n                'cost': fee,\n                'currency': feeCurrency,\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1433,
        "line_end": 1449,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'NEW': 'open',\n                'FILLED': 'closed',\n                'CANCEL_SENT': 'canceled',\n                'CANCEL_ALL_SENT': 'canceled',\n                'CANCELLED': 'canceled',\n                'PARTIAL_FILLED': 'open',\n                'REJECTED': 'rejected',\n                'INCOMPLETE': 'open',\n                'COMPLETED': 'closed',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1451,
        "line_end": 1458,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n            'POST_ONLY': 'limit',\n        };\n        return this.safeStringLower (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2710,
        "line_end": 2779,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPrice)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'est_liq_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPrice)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'cross'",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"IMR_withdraw_orders\": 0.1,\n     \"MMR_with_orders\": 0.05,\n     \"average_open_price\": 27908.14386047,\n     \"cost_position\": -139329.358492,\n     \"est_liq_price\": 117335.92899428,\n     \"fee_24_h\": 123,\n     \"imr\": 0.1,\n     \"last_sum_unitary_funding\": 70.38,\n     \"mark_price\": 27794.9,\n     \"mmr\": 0.05,\n     \"pending_long_qty\": 123,\n     \"pending_short_qty\": 123,\n     \"pnl_24_h\": 123,\n     \"position_qty\": -5,\n     \"settle_price\": 27865.8716984,\n     \"symbol\": \"PERP_BTC_USDC\",\n     \"timestamp\": 1685429350571,\n     \"unsettled_pnl\": 354.858492\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"IMR_withdraw_orders\": 0.1,\n        //     \"MMR_with_orders\": 0.05,\n        //     \"average_open_price\": 27908.14386047,\n        //     \"cost_position\": -139329.358492,\n        //     \"est_liq_price\": 117335.92899428,\n        //     \"fee_24_h\": 123,\n        //     \"imr\": 0.1,\n        //     \"last_sum_unitary_funding\": 70.38,\n        //     \"mark_price\": 27794.9,\n        //     \"mmr\": 0.05,\n        //     \"pending_long_qty\": 123,\n        //     \"pending_short_qty\": 123,\n        //     \"pnl_24_h\": 123,\n        //     \"position_qty\": -5,\n        //     \"settle_price\": 27865.8716984,\n        //     \"symbol\": \"PERP_BTC_USDC\",\n        //     \"timestamp\": 1685429350571,\n        //     \"unsettled_pnl\": 354.858492\n        // }\n        //\n        const contract = this.safeString (position, 'symbol');\n        market = this.safeMarket (contract, market);\n        let size = this.safeString (position, 'position_qty');\n        let side: Str = undefined;\n        if (Precise.stringGt (size, '0')) {\n            side = 'long';\n        } else {\n            side = 'short';\n        }\n        const contractSize = this.safeString (market, 'contractSize');\n        const markPrice = this.safeString (position, 'mark_price');\n        const timestamp = this.safeInteger (position, 'timestamp');\n        const entryPrice = this.safeString (position, 'average_open_price');\n        const unrealisedPnl = this.safeString (position, 'unsettled_pnl');\n        size = Precise.stringAbs (size);\n        const notional = Precise.stringMul (size, markPrice);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': this.parseNumber (entryPrice),\n            'notional': this.parseNumber (notional),\n            'leverage': undefined,\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'contracts': this.parseNumber (size),\n            'contractSize': this.parseNumber (contractSize),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'est_liq_price'),\n            'markPrice': this.parseNumber (markPrice),\n            'lastPrice': undefined,\n            'collateral': undefined,\n            'marginMode': 'cross',\n            'marginType': undefined,\n            'side': side,\n            'percentage': undefined,\n            'hedged': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1424,
        "line_end": 1431,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'ioc': 'IOC',\n            'fok': 'FOK',\n            'post_only': 'PO',\n        };\n        return this.safeString (timeInForces, timeInForce, undefined);\n    }"
      },
      {
        "name": "parseTokenAndFeeTemp",
        "signature": "parseTokenAndFeeTemp (item, feeTokenKey, feeAmountKey)",
        "line_start": 726,
        "line_end": 738,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTokenAndFeeTemp (item, feeTokenKey, feeAmountKey) {\n        const feeCost = this.safeString (item, feeAmountKey);\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (item, feeTokenKey);\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return fee;\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 740,
        "line_end": 804,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "order",
            "value": "order_id",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PERP_ETH_USDC\",\n         \"side\": \"SELL\",\n         \"executed_price\": 46222.35,\n         \"executed_quantity\": 0.0012,\n         \"executed_timestamp\": \"1683878609166\"\n     }",
          "{\n         \"id\": \"99119876\",\n         \"symbol\": \"PERP_BTC_USDC\",\n         \"fee\": \"0.0024\",\n         \"side\": \"BUY\",\n         \"executed_timestamp\": \"1641481113084\",\n         \"order_id\": \"87001234\",\n         \"order_tag\": \"default\", <-- this param only in \"fetchOrderTrades\"\n         \"executed_price\": \"1\",\n         \"executed_quantity\": \"12\",\n         \"fee_asset\": \"BTC\",\n         \"is_maker\": \"1\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public/market_trades\n        //\n        //     {\n        //         \"symbol\": \"PERP_ETH_USDC\",\n        //         \"side\": \"SELL\",\n        //         \"executed_price\": 46222.35,\n        //         \"executed_quantity\": 0.0012,\n        //         \"executed_timestamp\": \"1683878609166\"\n        //     }\n        //\n        // fetchOrderTrades, fetchOrder\n        //\n        //     {\n        //         \"id\": \"99119876\",\n        //         \"symbol\": \"PERP_BTC_USDC\",\n        //         \"fee\": \"0.0024\",\n        //         \"side\": \"BUY\",\n        //         \"executed_timestamp\": \"1641481113084\",\n        //         \"order_id\": \"87001234\",\n        //         \"order_tag\": \"default\", <-- this param only in \"fetchOrderTrades\"\n        //         \"executed_price\": \"1\",\n        //         \"executed_quantity\": \"12\",\n        //         \"fee_asset\": \"BTC\",\n        //         \"is_maker\": \"1\"\n        //     }\n        //\n        const isFromFetchOrder = ('id' in trade);\n        const timestamp = this.safeInteger (trade, 'executed_timestamp');\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (trade, 'executed_price');\n        const amount = this.safeString (trade, 'executed_quantity');\n        const order_id = this.safeString (trade, 'order_id');\n        const fee = this.parseTokenAndFeeTemp (trade, 'fee_asset', 'fee');\n        const feeCost = this.safeString (fee, 'cost');\n        if (feeCost !== undefined) {\n            fee['cost'] = feeCost;\n        }\n        const cost = Precise.stringMul (price, amount);\n        const side = this.safeStringLower (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        let takerOrMaker: Str = undefined;\n        if (isFromFetchOrder) {\n            const isMaker = this.safeString (trade, 'is_maker') === '1';\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'order': order_id,\n            'takerOrMaker': takerOrMaker,\n            'type': undefined,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2408,
        "line_end": 2441,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'withdraw_id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'tx_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'extra')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "movementDirection",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'updated_time')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        // example in fetchLedger\n        const code = this.safeString (transaction, 'token');\n        let movementDirection = this.safeStringLower (transaction, 'token_side');\n        if (movementDirection === 'withdraw') {\n            movementDirection = 'withdrawal';\n        }\n        const fee = this.parseTokenAndFeeTemp (transaction, 'fee_token', 'fee_amount');\n        const addressTo = this.safeString (transaction, 'target_address');\n        const addressFrom = this.safeString (transaction, 'source_address');\n        const timestamp = this.safeInteger (transaction, 'created_time');\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'withdraw_id'),\n            'txid': this.safeString (transaction, 'tx_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': this.safeString (transaction, 'extra'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'type': movementDirection,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': this.safeInteger (transaction, 'updated_time'),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n            'network': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2443,
        "line_end": 2452,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'pending',\n            'CONFIRMING': 'pending',\n            'PROCESSING': 'pending',\n            'COMPLETED': 'ok',\n            'CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "myokx": [
      {
        "name": "parseBalanceByType",
        "signature": "parseBalanceByType (type, response)",
        "line_start": 2722,
        "line_end": 2728,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceByType (type, response) {\n        if (type === 'funding') {\n            return this.parseFundingBalance (response);\n        } else {\n            return this.parseTradingBalance (response);\n        }\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 7520,
        "line_end": 7537,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'ccy'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'liab')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (info, 'mgnMode')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const instId = this.safeString (info, 'instId');\n        if (instId !== undefined) {\n            market = this.safeMarket (instId, market);\n        }\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'ccy')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'liab'),\n            'marginMode': this.safeString (info, 'mgnMode'),\n            'timestamp': timestamp,  // Interest accrued time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 7074,
        "line_end": 7093,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (ccy)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber2 (info, 'interestRate', 'rate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amt\": \"992.10341195\",\n        \"ccy\": \"BTC\",\n        \"rate\": \"0.01\",\n        \"ts\": \"1643954400000\"\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"amt\": \"992.10341195\",\n        //        \"ccy\": \"BTC\",\n        //        \"rate\": \"0.01\",\n        //        \"ts\": \"1643954400000\"\n        //    }\n        //\n        const ccy = this.safeString (info, 'ccy');\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'currency': this.safeCurrencyCode (ccy),\n            'rate': this.safeNumber2 (info, 'interestRate', 'rate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseBorrowRateHistories",
        "signature": "parseBorrowRateHistories (response, codes, since, limit)",
        "line_start": 7095,
        "line_end": 7126,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        {\n            \"amt\": \"992.10341195\",\n            \"ccy\": \"BTC\",\n            \"rate\": \"0.01\",\n            \"ts\": \"1643954400000\"\n        },\n        ...\n    ]"
        ],
        "source": "parseBorrowRateHistories (response, codes, since, limit) {\n        //\n        //    [\n        //        {\n        //            \"amt\": \"992.10341195\",\n        //            \"ccy\": \"BTC\",\n        //            \"rate\": \"0.01\",\n        //            \"ts\": \"1643954400000\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const borrowRateHistories: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const item = response[i];\n            const code = this.safeCurrencyCode (this.safeString (item, 'ccy'));\n            if (codes === undefined || this.inArray (code, codes)) {\n                if (!(code in borrowRateHistories)) {\n                    borrowRateHistories[code] = [];\n                }\n                const borrowRateStructure = this.parseBorrowRate (item);\n                const borrrowRateCode = borrowRateHistories[code];\n                borrrowRateCode.push (borrowRateStructure);\n            }\n        }\n        const keys = Object.keys (borrowRateHistories);\n        for (let i = 0; i < keys.length; i++) {\n            const code = keys[i];\n            borrowRateHistories[code] = this.filterByCurrencySinceLimit (borrowRateHistories[code], code, since, limit);\n        }\n        return borrowRateHistories;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 8758,
        "line_end": 8828,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'clQReqId', 'tradeId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'baseSz', 'fillBaseSz')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'quoteSz', 'fillQuoteSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (conversion, 'cnvtPx', 'fillPx')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"baseCcy\": \"ETH\",\n         \"baseSz\": \"0.01023052\",\n         \"clQReqId\": \"\",\n         \"cnvtPx\": \"2932.40104429\",\n         \"origRfqSz\": \"30\",\n         \"quoteCcy\": \"USDT\",\n         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n         \"quoteSz\": \"30\",\n         \"quoteTime\": \"1646188510461\",\n         \"rfqSz\": \"30\",\n         \"rfqSzCcy\": \"USDT\",\n         \"side\": \"buy\",\n         \"ttlMs\": \"10000\"\n     }",
          "{\n         \"baseCcy\": \"ETH\",\n         \"clTReqId\": \"\",\n         \"fillBaseSz\": \"0.01023052\",\n         \"fillPx\": \"2932.40104429\",\n         \"fillQuoteSz\": \"30\",\n         \"instId\": \"ETH-USDT\",\n         \"quoteCcy\": \"USDT\",\n         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n         \"side\": \"buy\",\n         \"state\": \"fullyFilled\",\n         \"tradeId\": \"trader16461885203381437\",\n         \"ts\": \"1646188520338\"\n     }",
          "{\n         \"clTReqId\": \"\",\n         \"instId\": \"ETH-USDT\",\n         \"side\": \"buy\",\n         \"fillPx\": \"2932.401044\",\n         \"baseCcy\": \"ETH\",\n         \"quoteCcy\": \"USDT\",\n         \"fillBaseSz\": \"0.01023052\",\n         \"state\": \"fullyFilled\",\n         \"tradeId\": \"trader16461885203381437\",\n         \"fillQuoteSz\": \"30\",\n         \"ts\": \"1646188520000\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"baseCcy\": \"ETH\",\n        //         \"baseSz\": \"0.01023052\",\n        //         \"clQReqId\": \"\",\n        //         \"cnvtPx\": \"2932.40104429\",\n        //         \"origRfqSz\": \"30\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n        //         \"quoteSz\": \"30\",\n        //         \"quoteTime\": \"1646188510461\",\n        //         \"rfqSz\": \"30\",\n        //         \"rfqSzCcy\": \"USDT\",\n        //         \"side\": \"buy\",\n        //         \"ttlMs\": \"10000\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"baseCcy\": \"ETH\",\n        //         \"clTReqId\": \"\",\n        //         \"fillBaseSz\": \"0.01023052\",\n        //         \"fillPx\": \"2932.40104429\",\n        //         \"fillQuoteSz\": \"30\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n        //         \"side\": \"buy\",\n        //         \"state\": \"fullyFilled\",\n        //         \"tradeId\": \"trader16461885203381437\",\n        //         \"ts\": \"1646188520338\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory\n        //\n        //     {\n        //         \"clTReqId\": \"\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"side\": \"buy\",\n        //         \"fillPx\": \"2932.401044\",\n        //         \"baseCcy\": \"ETH\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"fillBaseSz\": \"0.01023052\",\n        //         \"state\": \"fullyFilled\",\n        //         \"tradeId\": \"trader16461885203381437\",\n        //         \"fillQuoteSz\": \"30\",\n        //         \"ts\": \"1646188520000\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (conversion, 'quoteTime', 'ts');\n        const fromCoin = this.safeString (conversion, 'baseCcy');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'quoteCcy');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'clQReqId', 'tradeId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'baseSz', 'fillBaseSz'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'quoteSz', 'fillQuoteSz'),\n            'price': this.safeNumber2 (conversion, 'cnvtPx', 'fillPx'),\n            'fee': undefined,\n        } as Conversion;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 5171,
        "line_end": 5267,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"addr\": \"okbtothemoon\",\n         \"memo\": \"971668\", // may be missing\n         \"tag\":\"52055\", // may be missing\n         \"pmtId\": \"\", // may be missing\n         \"ccy\": \"BTC\",\n         \"to\": \"6\", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account\n         \"selected\": true\n     }",
          "{\n         \"ccy\":\"usdt-erc20\",\n         \"to\":\"6\",\n         \"addr\":\"0x696abb81974a8793352cbd33aadcf78eda3cfdfa\",\n         \"selected\":true\n     }",
          "{\n        \"chain\": \"ETH-OKExChain\",\n        \"addrEx\": { \"comment\": \"6040348\" }, // some currencies like TON may have this field,\n        \"ctAddr\": \"72315c\",\n        \"ccy\": \"ETH\",\n        \"to\": \"6\",\n        \"addr\": \"0x1c9f2244d1ccaa060bd536827c18925db10db102\",\n        \"selected\": true\n     }",
          "{\n          \"chain\": \"USDT-Polygon\",\n          \"ctAddr\": \"\",\n          \"ccy\": \"USDT\",\n          \"to\":\"6\" ,\n          \"addr\": \"0x1903441e386cc49d937f6302955b5feb4286dcfa\",\n          \"selected\": true\n      }",
          "network information from currency['networks'] field:"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"addr\": \"okbtothemoon\",\n        //         \"memo\": \"971668\", // may be missing\n        //         \"tag\":\"52055\", // may be missing\n        //         \"pmtId\": \"\", // may be missing\n        //         \"ccy\": \"BTC\",\n        //         \"to\": \"6\", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account\n        //         \"selected\": true\n        //     }\n        //\n        //     {\n        //         \"ccy\":\"usdt-erc20\",\n        //         \"to\":\"6\",\n        //         \"addr\":\"0x696abb81974a8793352cbd33aadcf78eda3cfdfa\",\n        //         \"selected\":true\n        //     }\n        //\n        //     {\n        //        \"chain\": \"ETH-OKExChain\",\n        //        \"addrEx\": { \"comment\": \"6040348\" }, // some currencies like TON may have this field,\n        //        \"ctAddr\": \"72315c\",\n        //        \"ccy\": \"ETH\",\n        //        \"to\": \"6\",\n        //        \"addr\": \"0x1c9f2244d1ccaa060bd536827c18925db10db102\",\n        //        \"selected\": true\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'addr');\n        let tag = this.safeStringN (depositAddress, [ 'tag', 'pmtId', 'memo' ]);\n        if (tag === undefined) {\n            const addrEx = this.safeValue (depositAddress, 'addrEx', {});\n            tag = this.safeString (addrEx, 'comment');\n        }\n        const currencyId = this.safeString (depositAddress, 'ccy');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = currency['code'];\n        const chain = this.safeString (depositAddress, 'chain');\n        const networks = this.safeValue (currency, 'networks', {});\n        const networksById = this.indexBy (networks, 'id');\n        let networkData = this.safeValue (networksById, chain);\n        // inconsistent naming responses from exchange\n        // with respect to network naming provided in currency info vs address chain-names and ids\n        //\n        // response from address endpoint:\n        //      {\n        //          \"chain\": \"USDT-Polygon\",\n        //          \"ctAddr\": \"\",\n        //          \"ccy\": \"USDT\",\n        //          \"to\":\"6\" ,\n        //          \"addr\": \"0x1903441e386cc49d937f6302955b5feb4286dcfa\",\n        //          \"selected\": true\n        //      }\n        // network information from currency['networks'] field:\n        // Polygon: {\n        //        info: {\n        //            canDep: false,\n        //            canInternal: false,\n        //            canWd: false,\n        //            ccy: 'USDT',\n        //            chain: 'USDT-Polygon-Bridge',\n        //            mainNet: false,\n        //            maxFee: '26.879528',\n        //            minFee: '13.439764',\n        //            minWd: '0.001',\n        //            name: ''\n        //        },\n        //        id: 'USDT-Polygon-Bridge',\n        //        network: 'Polygon',\n        //        active: false,\n        //        deposit: false,\n        //        withdraw: false,\n        //        fee: 13.439764,\n        //        precision: undefined,\n        //        limits: {\n        //            withdraw: {\n        //                min: 0.001,\n        //                max: undefined\n        //            }\n        //        }\n        //     },\n        //\n        if (chain === 'USDT-Polygon') {\n            networkData = this.safeValue2 (networksById, 'USDT-Polygon-Bridge', 'USDT-Polygon');\n        }\n        const network = this.safeString (networkData, 'network');\n        const networkCode = this.networkIdToCode (network, code);\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 7948,
        "line_end": 8011,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n   {\n       \"canDep\": true,\n       \"canInternal\": false,\n       \"canWd\": true,\n       \"ccy\": \"USDT\",\n       \"chain\": \"USDT-TRC20\",\n       \"logoLink\": \"https://static.coinall.ltd/cdn/assets/imgs/221/5F74EB20302D7761.png\",\n       \"mainNet\": false,\n       \"maxFee\": \"1.6\",\n       \"maxWd\": \"8852150\",\n       \"minFee\": \"0.8\",\n       \"minWd\": \"2\",\n       \"name\": \"Tether\",\n       \"usedWdQuota\": \"0\",\n       \"wdQuota\": \"500\",\n       \"wdTickSz\": \"3\"\n   }\n ]"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        // [\n        //   {\n        //       \"canDep\": true,\n        //       \"canInternal\": false,\n        //       \"canWd\": true,\n        //       \"ccy\": \"USDT\",\n        //       \"chain\": \"USDT-TRC20\",\n        //       \"logoLink\": \"https://static.coinall.ltd/cdn/assets/imgs/221/5F74EB20302D7761.png\",\n        //       \"mainNet\": false,\n        //       \"maxFee\": \"1.6\",\n        //       \"maxWd\": \"8852150\",\n        //       \"minFee\": \"0.8\",\n        //       \"minWd\": \"2\",\n        //       \"name\": \"Tether\",\n        //       \"usedWdQuota\": \"0\",\n        //       \"wdQuota\": \"500\",\n        //       \"wdTickSz\": \"3\"\n        //   }\n        // ]\n        //\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        for (let i = 0; i < response.length; i++) {\n            const feeInfo = response[i];\n            const currencyId = this.safeString (feeInfo, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                const depositWithdrawFee = this.safeValue (depositWithdrawFees, code);\n                if (depositWithdrawFee === undefined) {\n                    depositWithdrawFees[code] = this.depositWithdrawFee ({});\n                }\n                depositWithdrawFees[code]['info'][currencyId] = feeInfo;\n                const chain = this.safeString (feeInfo, 'chain');\n                if (chain === undefined) {\n                    continue;\n                }\n                const chainSplit = chain.split ('-');\n                const networkId = this.safeValue (chainSplit, 1);\n                const withdrawFee = this.safeNumber (feeInfo, 'fee');\n                const withdrawResult: Dict = {\n                    'fee': withdrawFee,\n                    'percentage': (withdrawFee !== undefined) ? false : undefined,\n                };\n                const depositResult: Dict = {\n                    'fee': undefined,\n                    'percentage': undefined,\n                };\n                const networkCode = this.networkIdToCode (networkId, code);\n                depositWithdrawFees[code]['networks'][networkCode] = {\n                    'withdraw': withdrawResult,\n                    'deposit': depositResult,\n                };\n            }\n        }\n        const depositWithdrawCodes = Object.keys (depositWithdrawFees);\n        for (let i = 0; i < depositWithdrawCodes.length; i++) {\n            const code = depositWithdrawCodes[i];\n            const currency = this.currency (code);\n            depositWithdrawFees[code] = this.assignDefaultDepositWithdrawFees (depositWithdrawFees[code], currency);\n        }\n        return depositWithdrawFees;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseFundingBalance",
        "signature": "parseFundingBalance (response)",
        "line_start": 2758,
        "line_end": 2773,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingBalance (response) {\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        for (let i = 0; i < data.length; i++) {\n            const balance = data[i];\n            const currencyId = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            account['total'] = this.safeString (balance, 'bal');\n            account['free'] = this.safeString (balance, 'availBal');\n            account['used'] = this.safeString (balance, 'frozenBal');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 6570,
        "line_end": 6579,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 6509,
        "line_end": 6568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"fundingRate\": \"0.00027815\",\n        \"fundingTime\": \"1634256000000\",\n        \"instId\": \"BTC-USD-SWAP\",\n        \"instType\": \"SWAP\",\n        \"nextFundingRate\": \"0.00017\",\n        \"nextFundingTime\": \"1634284800000\"\n    }",
          "{\n        \"fundingRate\":\"0.0001875391284828\",\n        \"fundingTime\":\"1700726400000\",\n        \"instId\":\"BTC-USD-SWAP\",\n        \"instType\":\"SWAP\",\n        \"method\": \"next_period\",\n        \"maxFundingRate\":\"0.00375\",\n        \"minFundingRate\":\"-0.00375\",\n        \"nextFundingRate\":\"0.0002608059239328\",\n        \"nextFundingTime\":\"1700755200000\",\n        \"premium\": \"0.0001233824646391\",\n        \"settFundingRate\":\"0.0001699799259033\",\n        \"settState\":\"settled\",\n        \"ts\":\"1700724675402\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"fundingRate\": \"0.00027815\",\n        //        \"fundingTime\": \"1634256000000\",\n        //        \"instId\": \"BTC-USD-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"nextFundingRate\": \"0.00017\",\n        //        \"nextFundingTime\": \"1634284800000\"\n        //    }\n        // ws\n        //     {\n        //        \"fundingRate\":\"0.0001875391284828\",\n        //        \"fundingTime\":\"1700726400000\",\n        //        \"instId\":\"BTC-USD-SWAP\",\n        //        \"instType\":\"SWAP\",\n        //        \"method\": \"next_period\",\n        //        \"maxFundingRate\":\"0.00375\",\n        //        \"minFundingRate\":\"-0.00375\",\n        //        \"nextFundingRate\":\"0.0002608059239328\",\n        //        \"nextFundingTime\":\"1700755200000\",\n        //        \"premium\": \"0.0001233824646391\",\n        //        \"settFundingRate\":\"0.0001699799259033\",\n        //        \"settState\":\"settled\",\n        //        \"ts\":\"1700724675402\"\n        //     }\n        //\n        // in the response above nextFundingRate is actually two funding rates from now\n        //\n        const nextFundingRateTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        const marketId = this.safeString (contract, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        const nextFundingRate = this.safeNumber (contract, 'nextFundingRate');\n        const fundingTime = this.safeInteger (contract, 'fundingTime');\n        const fundingTimeString = this.safeString (contract, 'fundingTime');\n        const nextFundingTimeString = this.safeString (contract, 'nextFundingTime');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        // https://www.okx.com/support/hc/en-us/articles/360053909272-Ⅸ-Introduction-to-perpetual-swap-funding-fee\n        // > The current interest is 0.\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': nextFundingRate,\n            'nextFundingTimestamp': nextFundingRateTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 8294,
        "line_end": 8342,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidVol')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askVol')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markVol')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"askVol\": \"0\",\n         \"bidVol\": \"0\",\n         \"delta\": \"0.5105464486882039\",\n         \"deltaBS\": \"0.7325502184143025\",\n         \"fwdPx\": \"37675.80158694987186\",\n         \"gamma\": \"-0.13183515090501083\",\n         \"gammaBS\": \"0.000024139685826358558\",\n         \"instId\": \"BTC-USD-240329-32000-C\",\n         \"instType\": \"OPTION\",\n         \"lever\": \"4.504428015946619\",\n         \"markVol\": \"0.5916253554539876\",\n         \"realVol\": \"0\",\n         \"theta\": \"-0.0004202992014012855\",\n         \"thetaBS\": \"-18.52354631567909\",\n         \"ts\": \"1699586421976\",\n         \"uly\": \"BTC-USD\",\n         \"vega\": \"0.0020207455080045846\",\n         \"vegaBS\": \"74.44022302387287\",\n         \"volLv\": \"0.5948549730405797\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"askVol\": \"0\",\n        //         \"bidVol\": \"0\",\n        //         \"delta\": \"0.5105464486882039\",\n        //         \"deltaBS\": \"0.7325502184143025\",\n        //         \"fwdPx\": \"37675.80158694987186\",\n        //         \"gamma\": \"-0.13183515090501083\",\n        //         \"gammaBS\": \"0.000024139685826358558\",\n        //         \"instId\": \"BTC-USD-240329-32000-C\",\n        //         \"instType\": \"OPTION\",\n        //         \"lever\": \"4.504428015946619\",\n        //         \"markVol\": \"0.5916253554539876\",\n        //         \"realVol\": \"0\",\n        //         \"theta\": \"-0.0004202992014012855\",\n        //         \"thetaBS\": \"-18.52354631567909\",\n        //         \"ts\": \"1699586421976\",\n        //         \"uly\": \"BTC-USD\",\n        //         \"vega\": \"0.0020207455080045846\",\n        //         \"vegaBS\": \"74.44022302387287\",\n        //         \"volLv\": \"0.5948549730405797\"\n        //     }\n        //\n        const timestamp = this.safeInteger (greeks, 'ts');\n        const marketId = this.safeString (greeks, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidVol'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askVol'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markVol'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseIds",
        "signature": "parseIds (ids)",
        "line_start": 3647,
        "line_end": 3660,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {string[]|string} ids order ids",
          "@returns {string[]} list of order ids"
        ],
        "source": "parseIds (ids) {\n        /**\n         * @ignore\n         * @method\n         * @name okx#parseIds\n         * @param {string[]|string} ids order ids\n         * @returns {string[]} list of order ids\n         */\n        if ((ids !== undefined) && typeof ids === 'string') {\n            return ids.split (',');\n        } else {\n            return ids;\n        }\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 5101,
        "line_end": 5169,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'billId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'ordId')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'balChg')",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'bal')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"bal\": \"0.0000819307998198\",\n         \"balChg\": \"-664.2679586599999802\",\n         \"billId\": \"310394313544966151\",\n         \"ccy\": \"USDT\",\n         \"fee\": \"0\",\n         \"from\": \"\",\n         \"instId\": \"LTC-USDT\",\n         \"instType\": \"SPOT\",\n         \"mgnMode\": \"cross\",\n         \"notes\": \"\",\n         \"ordId\": \"310394313519800320\",\n         \"pnl\": \"0\",\n         \"posBal\": \"0\",\n         \"posBalChg\": \"0\",\n         \"subType\": \"2\",\n         \"sz\": \"664.26795866\",\n         \"to\": \"\",\n         \"ts\": \"1620275771196\",\n         \"type\": \"2\"\n     }",
          "{\n         \"billId\": \"12344\",\n         \"ccy\": \"BTC\",\n         \"balChg\": \"2\",\n         \"bal\": \"12\",\n         \"type\": \"1\",\n         \"ts\": \"1597026383085\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // privateGetAccountBills, privateGetAccountBillsArchive\n        //\n        //     {\n        //         \"bal\": \"0.0000819307998198\",\n        //         \"balChg\": \"-664.2679586599999802\",\n        //         \"billId\": \"310394313544966151\",\n        //         \"ccy\": \"USDT\",\n        //         \"fee\": \"0\",\n        //         \"from\": \"\",\n        //         \"instId\": \"LTC-USDT\",\n        //         \"instType\": \"SPOT\",\n        //         \"mgnMode\": \"cross\",\n        //         \"notes\": \"\",\n        //         \"ordId\": \"310394313519800320\",\n        //         \"pnl\": \"0\",\n        //         \"posBal\": \"0\",\n        //         \"posBalChg\": \"0\",\n        //         \"subType\": \"2\",\n        //         \"sz\": \"664.26795866\",\n        //         \"to\": \"\",\n        //         \"ts\": \"1620275771196\",\n        //         \"type\": \"2\"\n        //     }\n        //\n        // privateGetAssetBills\n        //\n        //     {\n        //         \"billId\": \"12344\",\n        //         \"ccy\": \"BTC\",\n        //         \"balChg\": \"2\",\n        //         \"bal\": \"12\",\n        //         \"type\": \"1\",\n        //         \"ts\": \"1597026383085\"\n        //     }\n        //\n        const currencyId = this.safeString (item, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'ts');\n        const feeCostString = this.safeString (item, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n                'currency': code,\n            };\n        }\n        const marketId = this.safeString (item, 'instId');\n        const symbol = this.safeSymbol (marketId, undefined, '-');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'billId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'account': undefined,\n            'referenceId': this.safeString (item, 'ordId'),\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': code,\n            'symbol': symbol,\n            'amount': this.safeNumber (item, 'balChg'),\n            'before': undefined,\n            'after': this.safeNumber (item, 'bal'),\n            'status': 'ok',\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 5084,
        "line_end": 5099,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            '1': 'transfer', // transfer\n            '2': 'trade', // trade\n            '3': 'trade', // delivery\n            '4': 'rebate', // auto token conversion\n            '5': 'trade', // liquidation\n            '6': 'transfer', // margin transfer\n            '7': 'trade', // interest deduction\n            '8': 'fee', // funding rate\n            '9': 'trade', // adl\n            '10': 'trade', // clawback\n            '11': 'trade', // system token conversion\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 5825,
        "line_end": 5851,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        let marketId = undefined;\n        let marginMode = undefined;\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        for (let i = 0; i < leverage.length; i++) {\n            const entry = leverage[i];\n            marginMode = this.safeStringLower (entry, 'mgnMode');\n            marketId = this.safeString (entry, 'instId');\n            const positionSide = this.safeStringLower (entry, 'posSide');\n            if (positionSide === 'long') {\n                longLeverage = this.safeInteger (entry, 'lever');\n            } else if (positionSide === 'short') {\n                shortLeverage = this.safeInteger (entry, 'lever');\n            } else {\n                longLeverage = this.safeInteger (entry, 'lever');\n                shortLeverage = this.safeInteger (entry, 'lever');\n            }\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 9174,
        "line_end": 9188,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        const timestamp = this.safeInteger (info, 'timestamp');\n        let symbol = undefined;\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        return {\n            'info': info,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 7624,
        "line_end": 7646,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amt')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amt\": \"102\",\n         \"availLoan\": \"97\",\n         \"ccy\": \"USDT\",\n         \"loanQuota\": \"6000000\",\n         \"posLoan\": \"0\",\n         \"side\": \"repay\",\n         \"usedLoan\": \"97\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"amt\": \"102\",\n        //         \"availLoan\": \"97\",\n        //         \"ccy\": \"USDT\",\n        //         \"loanQuota\": \"6000000\",\n        //         \"posLoan\": \"0\",\n        //         \"side\": \"repay\",\n        //         \"usedLoan\": \"97\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'ccy');\n        return {\n            'id': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amt'),\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 7251,
        "line_end": 7324,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "responseMarket['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amt\": \"0.01\",\n        \"instId\": \"ETH-USD-SWAP\",\n        \"posSide\": \"net\",\n        \"type\": \"reduce\"\n    }",
          "{\n        bal: '67621.4325135010619812',\n        balChg: '-10.0000000000000000',\n        billId: '691293628710342659',\n        ccy: 'USDT',\n        clOrdId: '',\n        execType: '',\n        fee: '0',\n        fillFwdPx: '',\n        fillIdxPx: '',\n        fillMarkPx: '',\n        fillMarkVol: '',\n        fillPxUsd: '',\n        fillPxVol: '',\n        fillTime: '1711089244850',\n        from: '',\n        instId: 'XRP-USDT-SWAP',\n        instType: 'SWAP',\n        interest: '0',\n        mgnMode: 'isolated',\n        notes: '',\n        ordId: '',\n        pnl: '0',\n        posBal: '73.12',\n        posBalChg: '10.00',\n        px: '',\n        subType: '160',\n        sz: '10',\n        tag: '',\n        to: '',\n        tradeId: '0',\n        ts: '1711089244699',\n        type: '6'\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //    {\n        //        \"amt\": \"0.01\",\n        //        \"instId\": \"ETH-USD-SWAP\",\n        //        \"posSide\": \"net\",\n        //        \"type\": \"reduce\"\n        //    }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        bal: '67621.4325135010619812',\n        //        balChg: '-10.0000000000000000',\n        //        billId: '691293628710342659',\n        //        ccy: 'USDT',\n        //        clOrdId: '',\n        //        execType: '',\n        //        fee: '0',\n        //        fillFwdPx: '',\n        //        fillIdxPx: '',\n        //        fillMarkPx: '',\n        //        fillMarkVol: '',\n        //        fillPxUsd: '',\n        //        fillPxVol: '',\n        //        fillTime: '1711089244850',\n        //        from: '',\n        //        instId: 'XRP-USDT-SWAP',\n        //        instType: 'SWAP',\n        //        interest: '0',\n        //        mgnMode: 'isolated',\n        //        notes: '',\n        //        ordId: '',\n        //        pnl: '0',\n        //        posBal: '73.12',\n        //        posBalChg: '10.00',\n        //        px: '',\n        //        subType: '160',\n        //        sz: '10',\n        //        tag: '',\n        //        to: '',\n        //        tradeId: '0',\n        //        ts: '1711089244699',\n        //        type: '6'\n        //    }\n        //\n        const amountRaw = this.safeString2 (data, 'amt', 'posBalChg');\n        const typeRaw = this.safeString (data, 'type');\n        let type = undefined;\n        if (typeRaw === '6') {\n            type = Precise.stringGt (amountRaw, '0') ? 'add' : 'reduce';\n        } else {\n            type = typeRaw;\n        }\n        const amount = Precise.stringAbs (amountRaw);\n        const marketId = this.safeString (data, 'instId');\n        const responseMarket = this.safeMarket (marketId, market);\n        const code = responseMarket['inverse'] ? responseMarket['base'] : responseMarket['quote'];\n        const timestamp = this.safeInteger (data, 'ts');\n        return {\n            'info': data,\n            'symbol': responseMarket['symbol'],\n            'type': type,\n            'marginMode': 'isolated',\n            'amount': this.parseNumber (amount),\n            'code': code,\n            'total': undefined,\n            'status': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1669,
        "line_end": 1839,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "instIdCode",
            "value": "instIdCode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && (Precise.stringGt (maxLeverage, '1'))",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "status === 'live'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "contract ? (quoteId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "contract ? (baseId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contract ? this.safeNumber (market, 'ctVal') : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "this.parseNumber (strikePrice)",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "optionType",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger2 (market, 'contTdSwTime', 'listTime')",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSz')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"alias\": \"\", // this_week, next_week, quarter, next_quarter\n         \"baseCcy\": \"BTC\",\n         \"category\": \"1\",\n         \"ctMult\": \"\",\n         \"ctType\": \"\", // inverse, linear\n         \"ctVal\": \"\",\n         \"ctValCcy\": \"\",\n         \"expTime\": \"\",\n         \"instId\": \"BTC-USDT\", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C\n         \"instType\": \"SPOT\", // SPOT, FUTURES, SWAP, OPTION\n         \"lever\": \"10\",\n         \"listTime\": \"1548133413000\",\n         \"lotSz\": \"0.00000001\",\n         \"minSz\": \"0.00001\",\n         \"optType\": \"\",\n         \"quoteCcy\": \"USDT\",\n         \"settleCcy\": \"\",\n         \"state\": \"live\",\n         \"stk\": \"\",\n         \"tickSz\": \"0.1\",\n         \"uly\": \"\"\n     }",
          "{\n         \"alias\": \"\",\n         \"baseCcy\": \"\",\n         \"category\": \"1\",\n         \"ctMult\": \"0.1\",\n         \"ctType\": \"\",\n         \"ctVal\": \"1\",\n         \"ctValCcy\": \"BTC\",\n         \"expTime\": \"1648195200000\",\n         \"instId\": \"BTC-USD-220325-194000-P\",\n         \"instType\": \"OPTION\",\n         \"lever\": \"\",\n         \"listTime\": \"1631262612280\",\n         \"contTdSwTime\": \"1631262812280\",\n         \"lotSz\": \"1\",\n         \"minSz\": \"1\",\n         \"optType\": \"P\",\n         \"quoteCcy\": \"\",\n         \"settleCcy\": \"BTC\",\n         \"state\": \"live\",\n         \"stk\": \"194000\",\n         \"tickSz\": \"0.0005\",\n         \"uly\": \"BTC-USD\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"alias\": \"\", // this_week, next_week, quarter, next_quarter\n        //         \"baseCcy\": \"BTC\",\n        //         \"category\": \"1\",\n        //         \"ctMult\": \"\",\n        //         \"ctType\": \"\", // inverse, linear\n        //         \"ctVal\": \"\",\n        //         \"ctValCcy\": \"\",\n        //         \"expTime\": \"\",\n        //         \"instId\": \"BTC-USDT\", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C\n        //         \"instType\": \"SPOT\", // SPOT, FUTURES, SWAP, OPTION\n        //         \"lever\": \"10\",\n        //         \"listTime\": \"1548133413000\",\n        //         \"lotSz\": \"0.00000001\",\n        //         \"minSz\": \"0.00001\",\n        //         \"optType\": \"\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"settleCcy\": \"\",\n        //         \"state\": \"live\",\n        //         \"stk\": \"\",\n        //         \"tickSz\": \"0.1\",\n        //         \"uly\": \"\"\n        //     }\n        //\n        //     {\n        //         \"alias\": \"\",\n        //         \"baseCcy\": \"\",\n        //         \"category\": \"1\",\n        //         \"ctMult\": \"0.1\",\n        //         \"ctType\": \"\",\n        //         \"ctVal\": \"1\",\n        //         \"ctValCcy\": \"BTC\",\n        //         \"expTime\": \"1648195200000\",\n        //         \"instId\": \"BTC-USD-220325-194000-P\",\n        //         \"instType\": \"OPTION\",\n        //         \"lever\": \"\",\n        //         \"listTime\": \"1631262612280\",\n        //         \"contTdSwTime\": \"1631262812280\",\n        //         \"lotSz\": \"1\",\n        //         \"minSz\": \"1\",\n        //         \"optType\": \"P\",\n        //         \"quoteCcy\": \"\",\n        //         \"settleCcy\": \"BTC\",\n        //         \"state\": \"live\",\n        //         \"stk\": \"194000\",\n        //         \"tickSz\": \"0.0005\",\n        //         \"uly\": \"BTC-USD\"\n        //     }\n        //\n        // for swap \"preopen\" markets, only `instId` and `instType` are present\n        //\n        //         instId: \"ETH-USD_UM-SWAP\",\n        //         instType: \"SWAP\",\n        //         state: \"preopen\",\n        //\n        const id = this.safeString (market, 'instId');\n        let type = this.safeStringLower (market, 'instType');\n        if (type === 'futures') {\n            type = 'future';\n        }\n        const spot = (type === 'spot');\n        const future = (type === 'future');\n        const swap = (type === 'swap');\n        const option = (type === 'option');\n        const contract = swap || future || option;\n        let baseId = this.safeString (market, 'baseCcy', ''); // defaulting to '' because some weird preopen markets have empty baseId\n        let quoteId = this.safeString (market, 'quoteCcy', '');\n        const settleId = this.safeString (market, 'settleCcy');\n        const settle = this.safeCurrencyCode (settleId);\n        const underlying = this.safeString (market, 'uly');\n        if ((underlying !== undefined) && !spot) {\n            const parts = underlying.split ('-');\n            baseId = this.safeString (parts, 0);\n            quoteId = this.safeString (parts, 1);\n        }\n        if (((baseId === '') || (quoteId === '')) && spot) { // to fix weird preopen markets\n            const instId = this.safeString (market, 'instId', '');\n            const parts = instId.split ('-');\n            baseId = this.safeString (parts, 0);\n            quoteId = this.safeString (parts, 1);\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        // handle preopen empty markets\n        if (base === '' || quote === '') {\n            symbol = id;\n        }\n        let expiry = undefined;\n        let strikePrice = undefined;\n        let optionType = undefined;\n        if (contract) {\n            if (settle !== undefined) {\n                symbol = symbol + ':' + settle;\n            }\n            if (future) {\n                expiry = this.safeInteger (market, 'expTime');\n                if (expiry !== undefined) {\n                    const ymd = this.yymmdd (expiry);\n                    symbol = symbol + '-' + ymd;\n                }\n            } else if (option) {\n                expiry = this.safeInteger (market, 'expTime');\n                strikePrice = this.safeString (market, 'stk');\n                optionType = this.safeString (market, 'optType');\n                if (expiry !== undefined) {\n                    const ymd = this.yymmdd (expiry);\n                    symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;\n                    optionType = (optionType === 'P') ? 'put' : 'call';\n                }\n            }\n        }\n        const fees = this.safeDict2 (this.fees, type, 'trading', {});\n        let maxLeverage = this.safeString (market, 'lever', '1');\n        maxLeverage = Precise.stringMax (maxLeverage, '1');\n        const maxSpotCost = this.safeNumber (market, 'maxMktSz');\n        const status = this.safeString (market, 'state');\n        const instIdCode = this.safeInteger (market, 'instIdCode');\n        return this.extend (fees, {\n            'id': id,\n            'instIdCode': instIdCode,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': spot && (Precise.stringGt (maxLeverage, '1')),\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': status === 'live',\n            'contract': contract,\n            'linear': contract ? (quoteId === settleId) : undefined,\n            'inverse': contract ? (baseId === settleId) : undefined,\n            'contractSize': contract ? this.safeNumber (market, 'ctVal') : undefined,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': this.parseNumber (strikePrice),\n            'optionType': optionType,\n            'created': this.safeInteger2 (market, 'contTdSwTime', 'listTime'), // contTdSwTime is public trading start time, while listTime considers pre-trading too\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tickSz'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                },\n            },\n            'info': market,\n        });\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 7413,
        "line_end": 7454,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (tier, 'tier')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (tier, 'minSz')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'maxSz')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'mmr')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'maxLever')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "[\n        {\n            \"baseMaxLoan\": \"500\",\n            \"imr\": \"0.1\",\n            \"instId\": \"ETH-USDT\",\n            \"maxLever\": \"10\",\n            \"maxSz\": \"500\",\n            \"minSz\": \"0\",\n            \"mmr\": \"0.03\",\n            \"optMgnFactor\": \"0\",\n            \"quoteMaxLoan\": \"200000\",\n            \"tier\": \"1\",\n            \"uly\": \"\"\n        },\n        ...\n    ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    [\n        //        {\n        //            \"baseMaxLoan\": \"500\",\n        //            \"imr\": \"0.1\",\n        //            \"instId\": \"ETH-USDT\",\n        //            \"maxLever\": \"10\",\n        //            \"maxSz\": \"500\",\n        //            \"minSz\": \"0\",\n        //            \"mmr\": \"0.03\",\n        //            \"optMgnFactor\": \"0\",\n        //            \"quoteMaxLoan\": \"200000\",\n        //            \"tier\": \"1\",\n        //            \"uly\": \"\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const tier = info[i];\n            const marketId = this.safeString (tier, 'instId');\n            tiers.push ({\n                'tier': this.safeInteger (tier, 'tier'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber (tier, 'minSz'),\n                'maxNotional': this.safeNumber (tier, 'maxSz'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'mmr'),\n                'maxLeverage': this.safeNumber (tier, 'maxLever'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2507,
        "line_end": 2532,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1678928760000\", // timestamp\n         \"24341.4\", // open\n         \"24344\", // high\n         \"24313.2\", // low\n         \"24323\", // close\n         \"628\", // contract volume\n         \"2.5819\", // base volume\n         \"62800\", // quote volume\n         \"0\" // candlestick state\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1678928760000\", // timestamp\n        //         \"24341.4\", // open\n        //         \"24344\", // high\n        //         \"24313.2\", // low\n        //         \"24323\", // close\n        //         \"628\", // contract volume\n        //         \"2.5819\", // base volume\n        //         \"62800\", // quote volume\n        //         \"0\" // candlestick state\n        //     ]\n        //\n        const res = this.handleMarketTypeAndParams ('fetchOHLCV', market, undefined);\n        const type = res[0];\n        const volumeIndex = (type === 'spot') ? 5 : 6;\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, volumeIndex),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 7819,
        "line_end": 7872,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openInterestValue",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "[\n        \"1648221300000\",  // timestamp\n        \"2183354317.945\",  // open interest (USD) - (coin) for options\n        \"74285877.617\",  // volume (USD) - (coin) for options\n    ]",
          "{\n         \"instId\": \"BTC-USD-230520-25500-P\",\n         \"instType\": \"OPTION\",\n         \"oi\": \"300\",\n         \"oiCcy\": \"3\",\n         \"oiUsd\": \"3\",\n         \"ts\": \"1684551166251\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterestHistory\n        //\n        //    [\n        //        \"1648221300000\",  // timestamp\n        //        \"2183354317.945\",  // open interest (USD) - (coin) for options\n        //        \"74285877.617\",  // volume (USD) - (coin) for options\n        //    ]\n        //\n        // fetchOpenInterest\n        //\n        //     {\n        //         \"instId\": \"BTC-USD-230520-25500-P\",\n        //         \"instType\": \"OPTION\",\n        //         \"oi\": \"300\",\n        //         \"oiCcy\": \"3\",\n        //         \"oiUsd\": \"3\",\n        //         \"ts\": \"1684551166251\"\n        //     }\n        //\n        const id = this.safeString (interest, 'instId');\n        market = this.safeMarket (id, market);\n        const time = this.safeInteger (interest, 'ts');\n        const timestamp = this.safeInteger (interest, 0, time);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        let openInterestAmount = undefined;\n        let openInterestValue = undefined;\n        const type = this.safeString (this.options, 'defaultType');\n        if (Array.isArray (interest)) {\n            if (type === 'option') {\n                openInterestAmount = this.safeNumber (interest, 1);\n                baseVolume = this.safeNumber (interest, 2);\n            } else {\n                openInterestValue = this.safeNumber (interest, 1);\n                quoteVolume = this.safeNumber (interest, 2);\n            }\n        } else {\n            baseVolume = this.safeNumber (interest, 'oiCcy');\n            openInterestAmount = this.safeNumber (interest, 'oi');\n            openInterestValue = this.safeNumber (interest, 'oiUsd');\n        }\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id),\n            'baseVolume': baseVolume,  // deprecated\n            'quoteVolume': quoteVolume,  // deprecated\n            'openInterestAmount': openInterestAmount,\n            'openInterestValue': openInterestValue,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 8506,
        "line_end": 8549,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPx')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPx')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'last')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volCcy24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"OPTION\",\n         \"instId\": \"BTC-USD-241227-60000-P\",\n         \"last\": \"\",\n         \"lastSz\": \"0\",\n         \"askPx\": \"\",\n         \"askSz\": \"0\",\n         \"bidPx\": \"\",\n         \"bidSz\": \"0\",\n         \"open24h\": \"\",\n         \"high24h\": \"\",\n         \"low24h\": \"\",\n         \"volCcy24h\": \"0\",\n         \"vol24h\": \"0\",\n         \"ts\": \"1711176035035\",\n         \"sodUtc0\": \"\",\n         \"sodUtc8\": \"\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"instType\": \"OPTION\",\n        //         \"instId\": \"BTC-USD-241227-60000-P\",\n        //         \"last\": \"\",\n        //         \"lastSz\": \"0\",\n        //         \"askPx\": \"\",\n        //         \"askSz\": \"0\",\n        //         \"bidPx\": \"\",\n        //         \"bidSz\": \"0\",\n        //         \"open24h\": \"\",\n        //         \"high24h\": \"\",\n        //         \"low24h\": \"\",\n        //         \"volCcy24h\": \"0\",\n        //         \"vol24h\": \"0\",\n        //         \"ts\": \"1711176035035\",\n        //         \"sodUtc0\": \"\",\n        //         \"sodUtc8\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'instId');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (chain, 'ts');\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPx'),\n            'askPrice': this.safeNumber (chain, 'askPx'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'last'),\n            'underlyingPrice': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'baseVolume': this.safeNumber (chain, 'volCcy24h'),\n            'quoteVolume': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3897,
        "line_end": 4178,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'ordId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clOrdId')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumberN (order, [ 'triggerPx', 'moveTriggerPx' ])",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostSigned)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clOrdId\": \"oktswap6\",\n         \"ordId\": \"312269865356374016\",\n         \"tag\": \"\",\n         \"sCode\": \"0\",\n         \"sMsg\": \"\"\n     }",
          "{\n         \"clOrdId\": \"e847386590ce4dBCc1a045253497a547\",\n         \"ordId\": \"559176536793178112\",\n         \"reqId\": \"\",\n         \"sCode\": \"0\",\n         \"sMsg\": \"\"\n     }",
          "{\n         \"accFillSz\": \"0\",\n         \"avgPx\": \"\",\n         \"cTime\": \"1621910749815\",\n         \"category\": \"normal\",\n         \"ccy\": \"\",\n         \"clOrdId\": \"\",\n         \"fee\": \"0\",\n         \"feeCcy\": \"ETH\",\n         \"fillPx\": \"\",\n         \"fillSz\": \"0\",\n         \"fillTime\": \"\",\n         \"instId\": \"ETH-USDT\",\n         \"instType\": \"SPOT\",\n         \"lever\": \"\",\n         \"ordId\": \"317251910906576896\",\n         \"ordType\": \"limit\",\n         \"pnl\": \"0\",\n         \"posSide\": \"net\",\n         \"px\": \"2000\",\n         \"rebate\": \"0\",\n         \"rebateCcy\": \"USDT\",\n         \"side\": \"buy\",\n         \"slOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"state\": \"live\",\n         \"sz\": \"0.001\",\n         \"tag\": \"\",\n         \"tdMode\": \"cash\",\n         \"tpOrdPx\": \"\",\n         \"tpTriggerPx\": \"\",\n         \"tradeId\": \"\",\n         \"uTime\": \"1621910749815\"\n     }",
          "{\n        \"algoClOrdId\": \"\",\n        \"algoId\": \"\",\n        \"attachAlgoClOrdId\": \"\",\n        \"attachAlgoOrds\": [],\n        \"cancelSource\": \"\",\n        \"cancelSourceReason\": \"\", // not present in WS, but present in fetchClosedOrders\n        \"category\": \"normal\",\n        \"ccy\": \"\", // empty in WS, but eg. `USDT` in fetchClosedOrders\n        \"clOrdId\": \"\",\n        \"cTime\": \"1751705801423\",\n        \"feeCcy\": \"USDT\",\n        \"instId\": \"LINK-USDT-SWAP\",\n        \"instType\": \"SWAP\",\n        \"isTpLimit\": \"false\",\n        \"lever\": \"3\",\n        \"linkedAlgoOrd\": { \"algoId\": \"\" },\n        \"ordId\": \"2657625147249614848\",\n        \"ordType\": \"limit\",\n        \"posSide\": \"net\",\n        \"px\": \"13.142\",\n        \"pxType\": \"\",\n        \"pxUsd\": \"\",\n        \"pxVol\": \"\",\n        \"quickMgnType\": \"\",\n        \"rebate\": \"0\",\n        \"rebateCcy\": \"USDT\",\n        \"reduceOnly\": \"true\",\n        \"side\": \"sell\",\n        \"slOrdPx\": \"\",\n        \"slTriggerPx\": \"\",\n        \"slTriggerPxType\": \"\",\n        \"source\": \"\",\n        \"stpId\": \"\",\n        \"stpMode\": \"cancel_maker\",\n        \"sz\": \"0.1\",\n        \"tag\": \"\",\n        \"tdMode\": \"isolated\",\n        \"tgtCcy\": \"\",\n        \"tpOrdPx\": \"\",\n        \"tpTriggerPx\": \"\",\n        \"tpTriggerPxType\": \"\",\n        \"uTime\": \"1751705807467\",\n        \"reqId\": \"\",                      // field present only in WS\n        \"msg\": \"\",                        // field present only in WS\n        \"amendResult\": \"\",                // field present only in WS\n        \"amendSource\": \"\",                // field present only in WS\n        \"code\": \"0\",                      // field present only in WS\n        \"fillFwdPx\": \"\",                  // field present only in WS\n        \"fillMarkVol\": \"\",                // field present only in WS\n        \"fillPxUsd\": \"\",                  // field present only in WS\n        \"fillPxVol\": \"\",                  // field present only in WS\n        \"lastPx\": \"13.142\",               // field present only in WS\n        \"notionalUsd\": \"1.314515408\",     // field present only in WS\n\n     #### these below fields are empty on first omit from websocket, because of \"creation\" event. however, if order is executed, it also immediately sends another update with these fields filled  ###\n\n        \"pnl\": \"-0.0001\",\n        \"accFillSz\": \"0.1\",\n        \"avgPx\": \"13.142\",\n        \"state\": \"filled\",\n        \"fee\": \"-0.00026284\",\n        \"fillPx\": \"13.142\",\n        \"tradeId\": \"293429690\",\n        \"fillSz\": \"0.1\",\n        \"fillTime\": \"1751705807467\",\n        \"fillNotionalUsd\": \"1.314515408\", // field present only in WS\n        \"fillPnl\": \"-0.0001\",             // field present only in WS\n        \"fillFee\": \"-0.00026284\",         // field present only in WS\n        \"fillFeeCcy\": \"USDT\",             // field present only in WS\n        \"execType\": \"M\",                  // field present only in WS\n        \"fillMarkPx\": \"13.141\",           // field present only in WS\n        \"fillIdxPx\": \"13.147\"             // field present only in WS\n    }",
          "{\n         \"activePx\": \"\",\n         \"activePxType\": \"\",\n         \"actualPx\": \"\",\n         \"actualSide\": \"buy\",\n         \"actualSz\": \"0\",\n         \"algoId\": \"431375349042380800\",\n         \"cTime\": \"1649119897778\",\n         \"callbackRatio\": \"\",\n         \"callbackSpread\": \"\",\n         \"ccy\": \"\",\n         \"ctVal\": \"0.01\",\n         \"instId\": \"BTC-USDT-SWAP\",\n         \"instType\": \"SWAP\",\n         \"last\": \"46538.9\",\n         \"lever\": \"125\",\n         \"moveTriggerPx\": \"\",\n         \"notionalUsd\": \"467.059\",\n         \"ordId\": \"\",\n         \"ordPx\": \"50000\",\n         \"ordType\": \"trigger\",\n         \"posSide\": \"long\",\n         \"pxLimit\": \"\",\n         \"pxSpread\": \"\",\n         \"pxVar\": \"\",\n         \"side\": \"buy\",\n         \"slOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"slTriggerPxType\": \"\",\n         \"state\": \"live\",\n         \"sz\": \"1\",\n         \"szLimit\": \"\",\n         \"tag\": \"\",\n         \"tdMode\": \"isolated\",\n         \"tgtCcy\": \"\",\n         \"timeInterval\": \"\",\n         \"tpOrdPx\": \"\",\n         \"tpTriggerPx\": \"\",\n         \"tpTriggerPxType\": \"\",\n         \"triggerPx\": \"50000\",\n         \"triggerPxType\": \"last\",\n         \"triggerTime\": \"\",\n         \"uly\": \"BTC-USDT\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"clOrdId\": \"oktswap6\",\n        //         \"ordId\": \"312269865356374016\",\n        //         \"tag\": \"\",\n        //         \"sCode\": \"0\",\n        //         \"sMsg\": \"\"\n        //     }\n        //\n        // editOrder\n        //\n        //     {\n        //         \"clOrdId\": \"e847386590ce4dBCc1a045253497a547\",\n        //         \"ordId\": \"559176536793178112\",\n        //         \"reqId\": \"\",\n        //         \"sCode\": \"0\",\n        //         \"sMsg\": \"\"\n        //     }\n        //\n        // Spot and Swap fetchOrder, fetchOpenOrders\n        //\n        //     {\n        //         \"accFillSz\": \"0\",\n        //         \"avgPx\": \"\",\n        //         \"cTime\": \"1621910749815\",\n        //         \"category\": \"normal\",\n        //         \"ccy\": \"\",\n        //         \"clOrdId\": \"\",\n        //         \"fee\": \"0\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"fillPx\": \"\",\n        //         \"fillSz\": \"0\",\n        //         \"fillTime\": \"\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"instType\": \"SPOT\",\n        //         \"lever\": \"\",\n        //         \"ordId\": \"317251910906576896\",\n        //         \"ordType\": \"limit\",\n        //         \"pnl\": \"0\",\n        //         \"posSide\": \"net\",\n        //         \"px\": \"2000\",\n        //         \"rebate\": \"0\",\n        //         \"rebateCcy\": \"USDT\",\n        //         \"side\": \"buy\",\n        //         \"slOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"state\": \"live\",\n        //         \"sz\": \"0.001\",\n        //         \"tag\": \"\",\n        //         \"tdMode\": \"cash\",\n        //         \"tpOrdPx\": \"\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tradeId\": \"\",\n        //         \"uTime\": \"1621910749815\"\n        //     }\n        //\n        // watchOrders & fetchClosedOrders\n        //\n        //    {\n        //        \"algoClOrdId\": \"\",\n        //        \"algoId\": \"\",\n        //        \"attachAlgoClOrdId\": \"\",\n        //        \"attachAlgoOrds\": [],\n        //        \"cancelSource\": \"\",\n        //        \"cancelSourceReason\": \"\", // not present in WS, but present in fetchClosedOrders\n        //        \"category\": \"normal\",\n        //        \"ccy\": \"\", // empty in WS, but eg. `USDT` in fetchClosedOrders\n        //        \"clOrdId\": \"\",\n        //        \"cTime\": \"1751705801423\",\n        //        \"feeCcy\": \"USDT\",\n        //        \"instId\": \"LINK-USDT-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"isTpLimit\": \"false\",\n        //        \"lever\": \"3\",\n        //        \"linkedAlgoOrd\": { \"algoId\": \"\" },\n        //        \"ordId\": \"2657625147249614848\",\n        //        \"ordType\": \"limit\",\n        //        \"posSide\": \"net\",\n        //        \"px\": \"13.142\",\n        //        \"pxType\": \"\",\n        //        \"pxUsd\": \"\",\n        //        \"pxVol\": \"\",\n        //        \"quickMgnType\": \"\",\n        //        \"rebate\": \"0\",\n        //        \"rebateCcy\": \"USDT\",\n        //        \"reduceOnly\": \"true\",\n        //        \"side\": \"sell\",\n        //        \"slOrdPx\": \"\",\n        //        \"slTriggerPx\": \"\",\n        //        \"slTriggerPxType\": \"\",\n        //        \"source\": \"\",\n        //        \"stpId\": \"\",\n        //        \"stpMode\": \"cancel_maker\",\n        //        \"sz\": \"0.1\",\n        //        \"tag\": \"\",\n        //        \"tdMode\": \"isolated\",\n        //        \"tgtCcy\": \"\",\n        //        \"tpOrdPx\": \"\",\n        //        \"tpTriggerPx\": \"\",\n        //        \"tpTriggerPxType\": \"\",\n        //        \"uTime\": \"1751705807467\",\n        //        \"reqId\": \"\",                      // field present only in WS\n        //        \"msg\": \"\",                        // field present only in WS\n        //        \"amendResult\": \"\",                // field present only in WS\n        //        \"amendSource\": \"\",                // field present only in WS\n        //        \"code\": \"0\",                      // field present only in WS\n        //        \"fillFwdPx\": \"\",                  // field present only in WS\n        //        \"fillMarkVol\": \"\",                // field present only in WS\n        //        \"fillPxUsd\": \"\",                  // field present only in WS\n        //        \"fillPxVol\": \"\",                  // field present only in WS\n        //        \"lastPx\": \"13.142\",               // field present only in WS\n        //        \"notionalUsd\": \"1.314515408\",     // field present only in WS\n        //\n        //     #### these below fields are empty on first omit from websocket, because of \"creation\" event. however, if order is executed, it also immediately sends another update with these fields filled  ###\n        //\n        //        \"pnl\": \"-0.0001\",\n        //        \"accFillSz\": \"0.1\",\n        //        \"avgPx\": \"13.142\",\n        //        \"state\": \"filled\",\n        //        \"fee\": \"-0.00026284\",\n        //        \"fillPx\": \"13.142\",\n        //        \"tradeId\": \"293429690\",\n        //        \"fillSz\": \"0.1\",\n        //        \"fillTime\": \"1751705807467\",\n        //        \"fillNotionalUsd\": \"1.314515408\", // field present only in WS\n        //        \"fillPnl\": \"-0.0001\",             // field present only in WS\n        //        \"fillFee\": \"-0.00026284\",         // field present only in WS\n        //        \"fillFeeCcy\": \"USDT\",             // field present only in WS\n        //        \"execType\": \"M\",                  // field present only in WS\n        //        \"fillMarkPx\": \"13.141\",           // field present only in WS\n        //        \"fillIdxPx\": \"13.147\"             // field present only in WS\n        //    }\n        //\n        //\n        // Algo Order fetchOpenOrders, fetchCanceledOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"activePx\": \"\",\n        //         \"activePxType\": \"\",\n        //         \"actualPx\": \"\",\n        //         \"actualSide\": \"buy\",\n        //         \"actualSz\": \"0\",\n        //         \"algoId\": \"431375349042380800\",\n        //         \"cTime\": \"1649119897778\",\n        //         \"callbackRatio\": \"\",\n        //         \"callbackSpread\": \"\",\n        //         \"ccy\": \"\",\n        //         \"ctVal\": \"0.01\",\n        //         \"instId\": \"BTC-USDT-SWAP\",\n        //         \"instType\": \"SWAP\",\n        //         \"last\": \"46538.9\",\n        //         \"lever\": \"125\",\n        //         \"moveTriggerPx\": \"\",\n        //         \"notionalUsd\": \"467.059\",\n        //         \"ordId\": \"\",\n        //         \"ordPx\": \"50000\",\n        //         \"ordType\": \"trigger\",\n        //         \"posSide\": \"long\",\n        //         \"pxLimit\": \"\",\n        //         \"pxSpread\": \"\",\n        //         \"pxVar\": \"\",\n        //         \"side\": \"buy\",\n        //         \"slOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"slTriggerPxType\": \"\",\n        //         \"state\": \"live\",\n        //         \"sz\": \"1\",\n        //         \"szLimit\": \"\",\n        //         \"tag\": \"\",\n        //         \"tdMode\": \"isolated\",\n        //         \"tgtCcy\": \"\",\n        //         \"timeInterval\": \"\",\n        //         \"tpOrdPx\": \"\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tpTriggerPxType\": \"\",\n        //         \"triggerPx\": \"50000\",\n        //         \"triggerPxType\": \"last\",\n        //         \"triggerTime\": \"\",\n        //         \"uly\": \"BTC-USDT\"\n        //     }\n        //\n        const scode = this.safeString (order, 'sCode');\n        if ((scode !== undefined) && (scode !== '0')) {\n            return this.safeOrder ({\n                'id': this.safeString (order, 'ordId'),\n                'clientOrderId': this.safeString (order, 'clOrdId'),\n                'status': 'rejected',\n                'info': order,\n            });\n        }\n        const id = this.safeString2 (order, 'algoId', 'ordId');\n        const timestamp = this.safeInteger (order, 'cTime');\n        const lastUpdateTimestamp = this.safeInteger (order, 'uTime');\n        const lastTradeTimestamp = this.safeInteger (order, 'fillTime');\n        const side = this.safeString (order, 'side');\n        let type = this.safeString (order, 'ordType');\n        let postOnly = undefined;\n        let timeInForce = undefined;\n        if (type === 'post_only') {\n            postOnly = true;\n            type = 'limit';\n        } else if (type === 'fok') {\n            timeInForce = 'FOK';\n            type = 'limit';\n        } else if (type === 'ioc') {\n            timeInForce = 'IOC';\n            type = 'limit';\n        }\n        const marketId = this.safeString (order, 'instId');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const filled = this.safeString (order, 'accFillSz');\n        const price = this.safeString2 (order, 'px', 'ordPx');\n        const average = this.safeString (order, 'avgPx');\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const feeCostString = this.safeString (order, 'fee');\n        let amount = undefined;\n        let cost = undefined;\n        // spot market buy: \"sz\" can refer either to base currency units or to quote currency units\n        // see documentation: https://www.okx.com/docs-v5/en/#rest-api-trade-place-order\n        const defaultTgtCcy = this.safeString (this.options, 'tgtCcy', 'base_ccy');\n        const tgtCcy = this.safeString (order, 'tgtCcy', defaultTgtCcy);\n        const instType = this.safeString (order, 'instType');\n        if ((side === 'buy') && (type === 'market') && (instType === 'SPOT') && (tgtCcy === 'quote_ccy')) {\n            // \"sz\" refers to the cost\n            cost = this.safeString (order, 'sz');\n        } else {\n            // \"sz\" refers to the trade currency amount\n            amount = this.safeString (order, 'sz');\n        }\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (order, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': this.parseNumber (feeCostSigned),\n                'currency': feeCurrencyCode,\n            };\n        }\n        let clientOrderId = this.safeString (order, 'clOrdId');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined; // fix empty clientOrderId string\n        }\n        const stopLossPrice = this.safeNumber2 (order, 'slTriggerPx', 'slOrdPx');\n        const takeProfitPrice = this.safeNumber2 (order, 'tpTriggerPx', 'tpOrdPx');\n        const reduceOnlyRaw = this.safeString (order, 'reduceOnly');\n        let reduceOnly = false;\n        if (reduceOnly !== undefined) {\n            reduceOnly = (reduceOnlyRaw === 'true');\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'stopLossPrice': stopLossPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'triggerPrice': this.safeNumberN (order, [ 'triggerPx', 'moveTriggerPx' ]),\n            'average': average,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'reduceOnly': reduceOnly,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3885,
        "line_end": 3895,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'canceled': 'canceled',\n            'order_failed': 'canceled',\n            'live': 'open',\n            'partially_filled': 'open',\n            'filled': 'closed',\n            'effective': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 6036,
        "line_end": 6203,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'posId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPriceString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealizedPnlString)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realizedPnl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPriceString)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (position, 'closeAvgPx')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'uTime')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateralString)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentage)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"adl\": \"3\",\n        \"availPos\": \"1\",\n        \"avgPx\": \"34131.1\",\n        \"cTime\": \"1627227626502\",\n        \"ccy\": \"USDT\",\n        \"deltaBS\": \"\",\n        \"deltaPA\": \"\",\n        \"gammaBS\": \"\",\n        \"gammaPA\": \"\",\n        \"imr\": \"170.66093041794787\",\n        \"instId\": \"BTC-USDT-SWAP\",\n        \"instType\": \"SWAP\",\n        \"interest\": \"0\",\n        \"last\": \"34134.4\",\n        \"lever\": \"2\",\n        \"liab\": \"\",\n        \"liabCcy\": \"\",\n        \"liqPx\": \"12608.959083877446\",\n        \"markPx\": \"4786.459271773621\",\n        \"margin\": \"\",\n        \"mgnMode\": \"cross\",\n        \"mgnRatio\": \"140.49930117599155\",\n        \"mmr\": \"1.3652874433435829\",\n        \"notionalUsd\": \"341.5130010779638\",\n        \"optVal\": \"\",\n        \"pos\": \"1\",\n        \"posCcy\": \"\",\n        \"posId\": \"339552508062380036\",\n        \"posSide\": \"long\",\n        \"thetaBS\": \"\",\n        \"thetaPA\": \"\",\n        \"tradeId\": \"98617799\",\n        \"uTime\": \"1627227626502\",\n        \"upl\": \"0.0108608358957281\",\n        \"uplRatio\": \"0.0000636418743944\",\n        \"vegaBS\": \"\",\n        \"vegaPA\": \"\"\n    }",
          "{\n        \"cTime\":\"1708351230102\",\n        \"ccy\":\"USDT\",\n        \"closeAvgPx\":\"1.2567\",\n        \"closeTotalPos\":\"40\",\n        \"direction\":\"short\",\n        \"fee\":\"-0.0351036\",\n        \"fundingFee\":\"0\",\n        \"instId\":\"SUSHI-USDT-SWAP\",\n        \"instType\":\"SWAP\",\n        \"lever\":\"10.0\",\n        \"liqPenalty\":\"0\",\n        \"mgnMode\":\"isolated\",\n        \"openAvgPx\":\"1.2462\",\n        \"openMaxPos\":\"40\",\n        \"pnl\":\"-0.42\",\n        \"pnlRatio\":\"-0.0912982667308618\",\n        \"posId\":\"666159086676836352\",\n        \"realizedPnl\":\"-0.4551036\",\n        \"triggerPx\":\"\",\n        \"type\":\"2\",\n        \"uTime\":\"1708354805699\",\n        \"uly\":\"SUSHI-USDT\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //        \"adl\": \"3\",\n        //        \"availPos\": \"1\",\n        //        \"avgPx\": \"34131.1\",\n        //        \"cTime\": \"1627227626502\",\n        //        \"ccy\": \"USDT\",\n        //        \"deltaBS\": \"\",\n        //        \"deltaPA\": \"\",\n        //        \"gammaBS\": \"\",\n        //        \"gammaPA\": \"\",\n        //        \"imr\": \"170.66093041794787\",\n        //        \"instId\": \"BTC-USDT-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"interest\": \"0\",\n        //        \"last\": \"34134.4\",\n        //        \"lever\": \"2\",\n        //        \"liab\": \"\",\n        //        \"liabCcy\": \"\",\n        //        \"liqPx\": \"12608.959083877446\",\n        //        \"markPx\": \"4786.459271773621\",\n        //        \"margin\": \"\",\n        //        \"mgnMode\": \"cross\",\n        //        \"mgnRatio\": \"140.49930117599155\",\n        //        \"mmr\": \"1.3652874433435829\",\n        //        \"notionalUsd\": \"341.5130010779638\",\n        //        \"optVal\": \"\",\n        //        \"pos\": \"1\",\n        //        \"posCcy\": \"\",\n        //        \"posId\": \"339552508062380036\",\n        //        \"posSide\": \"long\",\n        //        \"thetaBS\": \"\",\n        //        \"thetaPA\": \"\",\n        //        \"tradeId\": \"98617799\",\n        //        \"uTime\": \"1627227626502\",\n        //        \"upl\": \"0.0108608358957281\",\n        //        \"uplRatio\": \"0.0000636418743944\",\n        //        \"vegaBS\": \"\",\n        //        \"vegaPA\": \"\"\n        //    }\n        // history\n        //    {\n        //        \"cTime\":\"1708351230102\",\n        //        \"ccy\":\"USDT\",\n        //        \"closeAvgPx\":\"1.2567\",\n        //        \"closeTotalPos\":\"40\",\n        //        \"direction\":\"short\",\n        //        \"fee\":\"-0.0351036\",\n        //        \"fundingFee\":\"0\",\n        //        \"instId\":\"SUSHI-USDT-SWAP\",\n        //        \"instType\":\"SWAP\",\n        //        \"lever\":\"10.0\",\n        //        \"liqPenalty\":\"0\",\n        //        \"mgnMode\":\"isolated\",\n        //        \"openAvgPx\":\"1.2462\",\n        //        \"openMaxPos\":\"40\",\n        //        \"pnl\":\"-0.42\",\n        //        \"pnlRatio\":\"-0.0912982667308618\",\n        //        \"posId\":\"666159086676836352\",\n        //        \"realizedPnl\":\"-0.4551036\",\n        //        \"triggerPx\":\"\",\n        //        \"type\":\"2\",\n        //        \"uTime\":\"1708354805699\",\n        //        \"uly\":\"SUSHI-USDT\"\n        //    }\n        //\n        const marketId = this.safeString (position, 'instId');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = market['symbol'];\n        const pos = this.safeString (position, 'pos'); // 'pos' field: One way mode: 0 if position is not open, 1 if open | Two way (hedge) mode: -1 if short, 1 if long, 0 if position is not open\n        const contractsAbs = Precise.stringAbs (pos);\n        let side = this.safeString2 (position, 'posSide', 'direction');\n        const hedged = side !== 'net';\n        const contracts = this.parseNumber (contractsAbs);\n        if (market['margin']) {\n            // margin position\n            if (side === 'net') {\n                const posCcy = this.safeString (position, 'posCcy');\n                const parsedCurrency = this.safeCurrencyCode (posCcy);\n                if (parsedCurrency !== undefined) {\n                    side = (market['base'] === parsedCurrency) ? 'long' : 'short';\n                }\n            }\n            if (side === undefined) {\n                side = this.safeString (position, 'direction');\n            }\n        } else {\n            if (pos !== undefined) {\n                if (side === 'net') {\n                    if (Precise.stringGt (pos, '0')) {\n                        side = 'long';\n                    } else if (Precise.stringLt (pos, '0')) {\n                        side = 'short';\n                    } else {\n                        side = undefined;\n                    }\n                }\n            }\n        }\n        const contractSize = this.safeNumber (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const markPriceString = this.safeString (position, 'markPx');\n        let notionalString = this.safeString (position, 'notionalUsd');\n        if (market['inverse']) {\n            notionalString = Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), markPriceString);\n        }\n        const notional = this.parseNumber (notionalString);\n        const marginMode = this.safeString (position, 'mgnMode');\n        let initialMarginString = undefined;\n        const entryPriceString = this.safeString2 (position, 'avgPx', 'openAvgPx');\n        const unrealizedPnlString = this.safeString (position, 'upl');\n        const leverageString = this.safeString (position, 'lever');\n        let initialMarginPercentage = undefined;\n        let collateralString = undefined;\n        if (marginMode === 'cross') {\n            initialMarginString = this.safeString (position, 'imr');\n            collateralString = Precise.stringAdd (initialMarginString, unrealizedPnlString);\n        } else if (marginMode === 'isolated') {\n            initialMarginPercentage = Precise.stringDiv ('1', leverageString);\n            collateralString = this.safeString (position, 'margin');\n        }\n        const maintenanceMarginString = this.safeString (position, 'mmr');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const maintenanceMarginPercentageString = Precise.stringDiv (maintenanceMarginString, notionalString);\n        if (initialMarginPercentage === undefined) {\n            initialMarginPercentage = this.parseNumber (Precise.stringDiv (initialMarginString, notionalString, 4));\n        } else if (initialMarginString === undefined) {\n            initialMarginString = Precise.stringDiv (Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), entryPriceString), leverageString);\n        }\n        const rounder = '0.00005'; // round to closest 0.01%\n        const maintenanceMarginPercentage = this.parseNumber (Precise.stringDiv (Precise.stringAdd (maintenanceMarginPercentageString, rounder), '1', 4));\n        const liquidationPrice = this.safeNumber (position, 'liqPx');\n        const percentageString = this.safeString (position, 'uplRatio');\n        const percentage = this.parseNumber (Precise.stringMul (percentageString, '100'));\n        const timestamp = this.safeInteger (position, 'cTime');\n        const marginRatio = this.parseNumber (Precise.stringDiv (maintenanceMarginString, collateralString, 4));\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'posId'),\n            'symbol': symbol,\n            'notional': notional,\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.parseNumber (entryPriceString),\n            'unrealizedPnl': this.parseNumber (unrealizedPnlString),\n            'realizedPnl': this.safeNumber (position, 'realizedPnl'),\n            'percentage': percentage,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'markPrice': this.parseNumber (markPriceString),\n            'lastPrice': this.safeNumber (position, 'closeAvgPx'),\n            'side': side,\n            'hedged': hedged,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'uTime'),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'collateral': this.parseNumber (collateralString),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentage),\n            'leverage': this.parseNumber (leverageString),\n            'marginRatio': marginRatio,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 8070,
        "line_end": 8086,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'px')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"insId\": \"BTC-USD-230521-28500-P\",\n         \"px\": \"27081.2007345984751516\",\n         \"type\": \"exercised\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        //     {\n        //         \"insId\": \"BTC-USD-230521-28500-P\",\n        //         \"px\": \"27081.2007345984751516\",\n        //         \"type\": \"exercised\"\n        //     }\n        //\n        const marketId = this.safeString (settlement, 'insId');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'px'),\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 8088,
        "line_end": 8115,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"details\": [\n             {\n                 \"insId\": \"BTC-USD-230523-25750-C\",\n                 \"px\": \"27290.1486867000556483\",\n                 \"type\": \"exercised\"\n             },\n         ],\n         \"ts\":\"1684656000000\"\n     }"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        //     {\n        //         \"details\": [\n        //             {\n        //                 \"insId\": \"BTC-USD-230523-25750-C\",\n        //                 \"px\": \"27290.1486867000556483\",\n        //                 \"type\": \"exercised\"\n        //             },\n        //         ],\n        //         \"ts\":\"1684656000000\"\n        //     }\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            const entry = settlements[i];\n            const timestamp = this.safeInteger (entry, 'ts');\n            const details = this.safeList (entry, 'details', []);\n            for (let j = 0; j < details.length; j++) {\n                const settlement = this.parseSettlement (details[j], market);\n                result.push (this.extend (settlement, {\n                    'timestamp': timestamp,\n                    'datetime': this.iso8601 (timestamp),\n                }));\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2090,
        "line_end": 2163,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPx')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSz')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPx')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSz')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPx')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'idxPx')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"instType\":\"SWAP\",\n          \"instId\":\"BTC-USDT-SWAP\",\n          \"markPx\":\"200\",\n          \"ts\":\"1597026383085\"\n      }",
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-BTC\",\n         \"last\": \"0.07319\",\n         \"lastSz\": \"0.044378\",\n         \"askPx\": \"0.07322\",\n         \"askSz\": \"4.2\",\n         \"bidPx\": \"0.0732\",\n         \"bidSz\": \"6.050058\",\n         \"open24h\": \"0.07801\",\n         \"high24h\": \"0.07975\",\n         \"low24h\": \"0.06019\",\n         \"volCcy24h\": \"11788.887619\",\n         \"vol24h\": \"167493.829229\",\n         \"ts\": \"1621440583784\",\n         \"sodUtc0\": \"0.07872\",\n         \"sodUtc8\": \"0.07345\"\n     }",
          "{\n          instId: 'LTC-USDT',\n          idxPx: '65.74',\n          open24h: '65.37',\n          high24h: '66.15',\n          low24h: '64.97',\n          sodUtc0: '65.68',\n          sodUtc8: '65.54',\n          ts: '1728467346900'\n     },"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //      {\n        //          \"instType\":\"SWAP\",\n        //          \"instId\":\"BTC-USDT-SWAP\",\n        //          \"markPx\":\"200\",\n        //          \"ts\":\"1597026383085\"\n        //      }\n        //\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-BTC\",\n        //         \"last\": \"0.07319\",\n        //         \"lastSz\": \"0.044378\",\n        //         \"askPx\": \"0.07322\",\n        //         \"askSz\": \"4.2\",\n        //         \"bidPx\": \"0.0732\",\n        //         \"bidSz\": \"6.050058\",\n        //         \"open24h\": \"0.07801\",\n        //         \"high24h\": \"0.07975\",\n        //         \"low24h\": \"0.06019\",\n        //         \"volCcy24h\": \"11788.887619\",\n        //         \"vol24h\": \"167493.829229\",\n        //         \"ts\": \"1621440583784\",\n        //         \"sodUtc0\": \"0.07872\",\n        //         \"sodUtc8\": \"0.07345\"\n        //     }\n        //     {\n        //          instId: 'LTC-USDT',\n        //          idxPx: '65.74',\n        //          open24h: '65.37',\n        //          high24h: '66.15',\n        //          low24h: '64.97',\n        //          sodUtc0: '65.68',\n        //          sodUtc8: '65.54',\n        //          ts: '1728467346900'\n        //     },\n        //\n        const timestamp = this.safeInteger (ticker, 'ts');\n        const marketId = this.safeString (ticker, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'last');\n        const open = this.safeString (ticker, 'open24h');\n        const spot = this.safeBool (market, 'spot', false);\n        const quoteVolume = spot ? this.safeString (ticker, 'volCcy24h') : undefined;\n        const baseVolume = this.safeString (ticker, 'vol24h');\n        const high = this.safeString (ticker, 'high24h');\n        const low = this.safeString (ticker, 'low24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': this.safeString (ticker, 'bidPx'),\n            'bidVolume': this.safeString (ticker, 'bidSz'),\n            'ask': this.safeString (ticker, 'askPx'),\n            'askVolume': this.safeString (ticker, 'askSz'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPx'),\n            'indexPrice': this.safeString (ticker, 'idxPx'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2336,
        "line_end": 2427,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostSigned",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instId\": \"ETH-BTC\",\n         \"side\": \"sell\",\n         \"sz\": \"0.119501\",\n         \"px\": \"0.07065\",\n         \"tradeId\": \"15826757\",\n         \"ts\": \"1621446178316\"\n     }",
          "{\n         \"fillVol\": \"0.46387625976562497\",\n         \"fwdPx\": \"26299.754935451125\",\n         \"indexPx\": \"26309.7\",\n         \"instFamily\": \"BTC-USD\",\n         \"instId\": \"BTC-USD-230526-26000-C\",\n         \"markPx\": \"0.042386283557554236\",\n         \"optType\": \"C\",\n         \"px\": \"0.0415\",\n         \"side\": \"sell\",\n         \"sz\": \"90\",\n         \"tradeId\": \"112\",\n         \"ts\": \"1683907480154\"\n     }",
          "{\n         \"side\": \"buy\",\n         \"fillSz\": \"0.007533\",\n         \"fillPx\": \"2654.98\",\n         \"fee\": \"-0.000007533\",\n         \"ordId\": \"317321390244397056\",\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-USDT\",\n         \"clOrdId\": \"\",\n         \"posSide\": \"net\",\n         \"billId\": \"317321390265368576\",\n         \"tag\": \"0\",\n         \"execType\": \"T\",\n         \"tradeId\": \"107601752\",\n         \"feeCcy\": \"ETH\",\n         \"ts\": \"1621927314985\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"instId\": \"ETH-BTC\",\n        //         \"side\": \"sell\",\n        //         \"sz\": \"0.119501\",\n        //         \"px\": \"0.07065\",\n        //         \"tradeId\": \"15826757\",\n        //         \"ts\": \"1621446178316\"\n        //     }\n        //\n        // option: fetchTrades\n        //\n        //     {\n        //         \"fillVol\": \"0.46387625976562497\",\n        //         \"fwdPx\": \"26299.754935451125\",\n        //         \"indexPx\": \"26309.7\",\n        //         \"instFamily\": \"BTC-USD\",\n        //         \"instId\": \"BTC-USD-230526-26000-C\",\n        //         \"markPx\": \"0.042386283557554236\",\n        //         \"optType\": \"C\",\n        //         \"px\": \"0.0415\",\n        //         \"side\": \"sell\",\n        //         \"sz\": \"90\",\n        //         \"tradeId\": \"112\",\n        //         \"ts\": \"1683907480154\"\n        //     }\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"side\": \"buy\",\n        //         \"fillSz\": \"0.007533\",\n        //         \"fillPx\": \"2654.98\",\n        //         \"fee\": \"-0.000007533\",\n        //         \"ordId\": \"317321390244397056\",\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"clOrdId\": \"\",\n        //         \"posSide\": \"net\",\n        //         \"billId\": \"317321390265368576\",\n        //         \"tag\": \"0\",\n        //         \"execType\": \"T\",\n        //         \"tradeId\": \"107601752\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"ts\": \"1621927314985\"\n        //     }\n        //\n        const id = this.safeString (trade, 'tradeId');\n        const marketId = this.safeString (trade, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (trade, 'ts');\n        const price = this.safeString2 (trade, 'fillPx', 'px');\n        const amount = this.safeString2 (trade, 'fillSz', 'sz');\n        const side = this.safeString (trade, 'side');\n        const orderId = this.safeString (trade, 'ordId');\n        const feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (trade, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostSigned,\n                'currency': feeCurrencyCode,\n            };\n        }\n        let takerOrMaker = this.safeString (trade, 'execType');\n        if (takerOrMaker === 'T') {\n            takerOrMaker = 'taker';\n        } else if (takerOrMaker === 'M') {\n            takerOrMaker = 'maker';\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTradingBalance",
        "signature": "parseTradingBalance (response)",
        "line_start": 2730,
        "line_end": 2756,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingBalance (response) {\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        const first = this.safeDict (data, 0, {});\n        const timestamp = this.safeInteger (first, 'uTime');\n        const details = this.safeList (first, 'details', []);\n        for (let i = 0; i < details.length; i++) {\n            const balance = details[i];\n            const currencyId = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            const eq = this.safeString (balance, 'eq');\n            const availEq = this.safeString (balance, 'availEq');\n            account['total'] = eq;\n            if (availEq === undefined) {\n                account['free'] = this.safeString (balance, 'availBal');\n                account['used'] = this.safeString (balance, 'frozenBal');\n            } else {\n                account['free'] = availEq;\n            }\n            result[code] = account;\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 2775,
        "line_end": 2798,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU')))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"category\": \"1\",\n         \"delivery\": \"\",\n         \"exercise\": \"\",\n         \"instType\": \"SPOT\",\n         \"level\": \"Lv1\",\n         \"maker\": \"-0.0008\",\n         \"taker\": \"-0.001\",\n         \"ts\": \"1639043138472\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        // https://www.okx.com/docs-v5/en/#rest-api-account-get-fee-rates\n        //\n        //     {\n        //         \"category\": \"1\",\n        //         \"delivery\": \"\",\n        //         \"exercise\": \"\",\n        //         \"instType\": \"SPOT\",\n        //         \"level\": \"Lv1\",\n        //         \"maker\": \"-0.0008\",\n        //         \"taker\": \"-0.001\",\n        //         \"ts\": \"1639043138472\"\n        //     }\n        //\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (undefined, market),\n            // OKX returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped\n            'maker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'maker', 'makerU'))),\n            'taker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU'))),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 5685,
        "line_end": 5779,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': feeCost,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amt\": \"0.1\",\n         \"wdId\": \"67485\",\n         \"ccy\": \"BTC\"\n     }",
          "{\n         \"amt\": \"0.094\",\n         \"wdId\": \"4703879\",\n         \"fee\": \"0.01000000eth\",\n         \"txId\": \"0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85\",\n         \"ccy\": \"ETH\",\n         \"from\": \"13426335357\",\n         \"to\": \"0xA41446125D0B5b6785f6898c9D67874D763A1519\",\n         \"tag\",\n         \"pmtId\",\n         \"memo\",\n         \"ts\": \"1597026383085\",\n         \"state\": \"2\"\n     }",
          "{\n         \"amt\": \"0.01044408\",\n         \"txId\": \"1915737_3_0_0_asset\",\n         \"ccy\": \"BTC\",\n         \"from\": \"13801825426\",\n         \"to\": \"\",\n         \"ts\": \"1597026383085\",\n         \"state\": \"2\",\n         \"depId\": \"4703879\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"amt\": \"0.1\",\n        //         \"wdId\": \"67485\",\n        //         \"ccy\": \"BTC\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"amt\": \"0.094\",\n        //         \"wdId\": \"4703879\",\n        //         \"fee\": \"0.01000000eth\",\n        //         \"txId\": \"0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85\",\n        //         \"ccy\": \"ETH\",\n        //         \"from\": \"13426335357\",\n        //         \"to\": \"0xA41446125D0B5b6785f6898c9D67874D763A1519\",\n        //         \"tag\",\n        //         \"pmtId\",\n        //         \"memo\",\n        //         \"ts\": \"1597026383085\",\n        //         \"state\": \"2\"\n        //     }\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"amt\": \"0.01044408\",\n        //         \"txId\": \"1915737_3_0_0_asset\",\n        //         \"ccy\": \"BTC\",\n        //         \"from\": \"13801825426\",\n        //         \"to\": \"\",\n        //         \"ts\": \"1597026383085\",\n        //         \"state\": \"2\",\n        //         \"depId\": \"4703879\"\n        //     }\n        //\n        let type = undefined;\n        let id = undefined;\n        const withdrawalId = this.safeString (transaction, 'wdId');\n        const addressFrom = this.safeString (transaction, 'from');\n        const addressTo = this.safeString (transaction, 'to');\n        const address = addressTo;\n        let tagTo = this.safeString2 (transaction, 'tag', 'memo');\n        tagTo = this.safeString2 (transaction, 'pmtId', tagTo);\n        if (withdrawalId !== undefined) {\n            type = 'withdrawal';\n            id = withdrawalId;\n        } else {\n            // the payment_id will appear on new deposits but appears to be removed from the response after 2 months\n            id = this.safeString (transaction, 'depId');\n            type = 'deposit';\n        }\n        const currencyId = this.safeString (transaction, 'ccy');\n        const code = this.safeCurrencyCode (currencyId);\n        const amount = this.safeNumber (transaction, 'amt');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const txid = this.safeString (transaction, 'txId');\n        const timestamp = this.safeInteger (transaction, 'ts');\n        let feeCost = undefined;\n        if (type === 'deposit') {\n            feeCost = 0;\n        } else {\n            feeCost = this.safeNumber (transaction, 'fee');\n        }\n        // todo parse tags\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'address': address,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'tag': tagTo,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': feeCost,\n            },\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 5639,
        "line_end": 5683,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"0\": \"waiting for confirmation\",\n         \"1\": \"deposit credited\",\n         \"2\": \"deposit successful\"\n     }",
          "{\n        '-3': \"pending cancel\",\n        \"-2\": \"canceled\",\n        \"-1\": \"failed\",\n         \"0\": \"pending\",\n         \"1\": \"sending\",\n         \"2\": \"sent\",\n         \"3\": \"awaiting email verification\",\n         \"4\": \"awaiting manual verification\",\n         \"5\": \"awaiting identity verification\"\n     }"
        ],
        "source": "parseTransactionStatus (status: Str) {\n        //\n        // deposit statuses\n        //\n        //     {\n        //         \"0\": \"waiting for confirmation\",\n        //         \"1\": \"deposit credited\",\n        //         \"2\": \"deposit successful\"\n        //     }\n        //\n        // withdrawal statuses\n        //\n        //     {\n        //        '-3': \"pending cancel\",\n        //        \"-2\": \"canceled\",\n        //        \"-1\": \"failed\",\n        //         \"0\": \"pending\",\n        //         \"1\": \"sending\",\n        //         \"2\": \"sent\",\n        //         \"3\": \"awaiting email verification\",\n        //         \"4\": \"awaiting manual verification\",\n        //         \"5\": \"awaiting identity verification\"\n        //     }\n        //\n        const statuses: Dict = {\n            '-3': 'pending',\n            '-2': 'canceled',\n            '-1': 'failed',\n            '0': 'pending',\n            '1': 'pending',\n            '2': 'ok',\n            '3': 'pending',\n            '4': 'pending',\n            '5': 'pending',\n            '6': 'pending',\n            '7': 'pending',\n            '8': 'pending',\n            '9': 'pending',\n            '10': 'pending',\n            '12': 'pending',\n            '15': 'pending',\n            '16': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 6266,
        "line_end": 6342,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (accountsById, fromAccountId)",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (accountsById, toAccountId)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'state'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transId\": \"754147\",\n         \"ccy\": \"USDT\",\n         \"from\": \"6\",\n         \"amt\": \"0.1\",\n         \"to\": \"18\"\n     }",
          "{\n         \"amt\": \"5\",\n         \"ccy\": \"USDT\",\n         \"from\": \"18\",\n         \"instId\": \"\",\n         \"state\": \"success\",\n         \"subAcct\": \"\",\n         \"to\": \"6\",\n         \"toInstId\": \"\",\n         \"transId\": \"464424732\",\n         \"type\": \"0\"\n     }",
          "{\n         \"bal\": \"70.6874353780312913\",\n         \"balChg\": \"-4.0000000000000000\", // negative means \"to funding\", positive meand \"from funding\"\n         \"billId\": \"588900695232225299\",\n         \"ccy\": \"USDT\",\n         \"execType\": \"\",\n         \"fee\": \"\",\n         \"from\": \"18\",\n         \"instId\": \"\",\n         \"instType\": \"\",\n         \"mgnMode\": \"\",\n         \"notes\": \"To Funding Account\",\n         \"ordId\": \"\",\n         \"pnl\": \"\",\n         \"posBal\": \"\",\n         \"posBalChg\": \"\",\n         \"price\": \"0\",\n         \"subType\": \"12\",\n         \"sz\": \"-4\",\n         \"to\": \"6\",\n         \"ts\": \"1686676866989\",\n         \"type\": \"1\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"transId\": \"754147\",\n        //         \"ccy\": \"USDT\",\n        //         \"from\": \"6\",\n        //         \"amt\": \"0.1\",\n        //         \"to\": \"18\"\n        //     }\n        //\n        // fetchTransfer\n        //\n        //     {\n        //         \"amt\": \"5\",\n        //         \"ccy\": \"USDT\",\n        //         \"from\": \"18\",\n        //         \"instId\": \"\",\n        //         \"state\": \"success\",\n        //         \"subAcct\": \"\",\n        //         \"to\": \"6\",\n        //         \"toInstId\": \"\",\n        //         \"transId\": \"464424732\",\n        //         \"type\": \"0\"\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"bal\": \"70.6874353780312913\",\n        //         \"balChg\": \"-4.0000000000000000\", // negative means \"to funding\", positive meand \"from funding\"\n        //         \"billId\": \"588900695232225299\",\n        //         \"ccy\": \"USDT\",\n        //         \"execType\": \"\",\n        //         \"fee\": \"\",\n        //         \"from\": \"18\",\n        //         \"instId\": \"\",\n        //         \"instType\": \"\",\n        //         \"mgnMode\": \"\",\n        //         \"notes\": \"To Funding Account\",\n        //         \"ordId\": \"\",\n        //         \"pnl\": \"\",\n        //         \"posBal\": \"\",\n        //         \"posBalChg\": \"\",\n        //         \"price\": \"0\",\n        //         \"subType\": \"12\",\n        //         \"sz\": \"-4\",\n        //         \"to\": \"6\",\n        //         \"ts\": \"1686676866989\",\n        //         \"type\": \"1\"\n        //     }\n        //\n        const id = this.safeString2 (transfer, 'transId', 'billId');\n        const currencyId = this.safeString (transfer, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let amount = this.safeNumber (transfer, 'amt');\n        const fromAccountId = this.safeString (transfer, 'from');\n        const toAccountId = this.safeString (transfer, 'to');\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        const timestamp = this.safeInteger (transfer, 'ts');\n        const balanceChange = this.safeString (transfer, 'sz');\n        if (balanceChange !== undefined) {\n            amount = this.parseNumber (Precise.stringAbs (balanceChange));\n        }\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': this.safeString (accountsById, fromAccountId),\n            'toAccount': this.safeString (accountsById, toAccountId),\n            'status': this.parseTransferStatus (this.safeString (transfer, 'state')),\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 6344,
        "line_end": 6349,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'success': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      }
    ],
    "ndax": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1156,
        "line_end": 1174,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'ProductId');\n            if (currencyId in this.currencies_by_id) {\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['total'] = this.safeString (balance, 'Amount');\n                account['used'] = this.safeString (balance, 'Hold');\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2134,
        "line_end": 2168,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"result\":true,\n         \"errormsg\":null,\n         \"statuscode\":0,\n         \"AssetManagerId\":1,\n         \"AccountId\":449,\n         \"AssetId\":1,\n         \"ProviderId\":1,\n         \"DepositInfo\":\"[\\\"r3e95RwVsLH7yCbnMfyh7SA8FdwUJCB4S2?memo=241452010\\\"]\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        // fetchDepositAddress, createDepositAddress\n        //\n        //     {\n        //         \"result\":true,\n        //         \"errormsg\":null,\n        //         \"statuscode\":0,\n        //         \"AssetManagerId\":1,\n        //         \"AccountId\":449,\n        //         \"AssetId\":1,\n        //         \"ProviderId\":1,\n        //         \"DepositInfo\":\"[\\\"r3e95RwVsLH7yCbnMfyh7SA8FdwUJCB4S2?memo=241452010\\\"]\"\n        //     }\n        //\n        const depositInfoString = this.safeString (depositAddress, 'DepositInfo');\n        const depositInfo = JSON.parse (depositInfoString);\n        const depositInfoLength = depositInfo.length;\n        const lastString = this.safeString (depositInfo, depositInfoLength - 1);\n        const parts = lastString.split ('?memo=');\n        const address = this.safeString (parts, 0);\n        const tag = this.safeString (parts, 1);\n        let code = undefined;\n        if (currency !== undefined) {\n            code = currency['code'];\n        }\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': undefined,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 1252,
        "line_end": 1307,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'TransactionId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'AccountId')",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'ReferenceId')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "this.safeString (item, 'Counterparty')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'ReferenceType'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "this.parseNumber (before)",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.parseNumber (after)",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"TransactionId\": 2663709493,\n         \"ReferenceId\": 68,\n         \"OMSId\": 1,\n         \"AccountId\": 449,\n         \"CR\": 10.000000000000000000000000000,\n         \"DR\": 0.0000000000000000000000000000,\n         \"Counterparty\": 3,\n         \"TransactionType\": \"Other\",\n         \"ReferenceType\": \"Deposit\",\n         \"ProductId\": 1,\n         \"Balance\": 10.000000000000000000000000000,\n         \"TimeStamp\": 1607532331591\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"TransactionId\": 2663709493,\n        //         \"ReferenceId\": 68,\n        //         \"OMSId\": 1,\n        //         \"AccountId\": 449,\n        //         \"CR\": 10.000000000000000000000000000,\n        //         \"DR\": 0.0000000000000000000000000000,\n        //         \"Counterparty\": 3,\n        //         \"TransactionType\": \"Other\",\n        //         \"ReferenceType\": \"Deposit\",\n        //         \"ProductId\": 1,\n        //         \"Balance\": 10.000000000000000000000000000,\n        //         \"TimeStamp\": 1607532331591\n        //     }\n        //\n        const currencyId = this.safeString (item, 'ProductId');\n        currency = this.safeCurrency (currencyId, currency);\n        const credit = this.safeString (item, 'CR');\n        const debit = this.safeString (item, 'DR');\n        let amount = undefined;\n        let direction = undefined;\n        if (Precise.stringLt (credit, '0')) {\n            amount = credit;\n            direction = 'in';\n        } else if (Precise.stringLt (debit, '0')) {\n            amount = debit;\n            direction = 'out';\n        }\n        let before = undefined;\n        const after = this.safeString (item, 'Balance');\n        if (direction === 'out') {\n            before = Precise.stringAdd (after, amount);\n        } else if (direction === 'in') {\n            before = Precise.stringMax ('0', Precise.stringSub (after, amount));\n        }\n        const timestamp = this.safeInteger (item, 'TimeStamp');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'TransactionId'),\n            'direction': direction,\n            'account': this.safeString (item, 'AccountId'),\n            'referenceId': this.safeString (item, 'ReferenceId'),\n            'referenceAccount': this.safeString (item, 'Counterparty'),\n            'type': this.parseLedgerEntryType (this.safeString (item, 'ReferenceType')),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.parseNumber (amount),\n            'before': this.parseNumber (before),\n            'after': this.parseNumber (after),\n            'status': 'ok',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1233,
        "line_end": 1250,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'Trade': 'trade',\n            'Deposit': 'transaction',\n            'Withdraw': 'transaction',\n            'Transfer': 'transfer',\n            'OrderHold': 'trade',\n            'WithdrawHold': 'transaction',\n            'DepositHold': 'transaction',\n            'MarginHold': 'trade',\n            'ManualHold': 'trade',\n            'ManualEntry': 'trade',\n            'MarginAcquisition': 'trade',\n            'MarginRelinquish': 'trade',\n            'MarginQuoteHold': 'trade',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 586,
        "line_end": 645,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(sessionRunning && !isDisable)",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'QuantityIncrement'),\n                'price': this.safeNumber (market, 'PriceIncrement'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'MinimumQuantity'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'MinimumPrice'),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'MinimumQuantity'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'MinimumPrice'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'MinimumPrice')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'InstrumentId');\n        // const lowercaseId = this.safeStringLower (market, 'symbol');\n        const baseId = this.safeString (market, 'Product1');\n        const quoteId = this.safeString (market, 'Product2');\n        const base = this.safeCurrencyCode (this.safeString (market, 'Product1Symbol'));\n        const quote = this.safeCurrencyCode (this.safeString (market, 'Product2Symbol'));\n        const sessionStatus = this.safeString (market, 'SessionStatus');\n        const isDisable = this.safeValue (market, 'IsDisable');\n        const sessionRunning = (sessionStatus === 'Running');\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': (sessionRunning && !isDisable),\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'QuantityIncrement'),\n                'price': this.safeNumber (market, 'PriceIncrement'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'MinimumQuantity'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'MinimumPrice'),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 849,
        "line_end": 871,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1501603632000, // 0 DateTime\n         2700.33,       // 1 High\n         2687.01,       // 2 Low\n         2687.01,       // 3 Open\n         2687.01,       // 4 Close\n         24.86100992,   // 5 Volume\n         0,             // 6 Inside Bid Price\n         2870.95,       // 7 Inside Ask Price\n         1              // 8 InstrumentId\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1501603632000, // 0 DateTime\n        //         2700.33,       // 1 High\n        //         2687.01,       // 2 Low\n        //         2687.01,       // 3 Open\n        //         2687.01,       // 4 Close\n        //         24.86100992,   // 5 Volume\n        //         0,             // 6 Inside Bid Price\n        //         2870.95,       // 7 Inside Ask Price\n        //         1              // 8 InstrumentId\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1372,
        "line_end": 1465,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (order, 'ReplacementOrderId', 'OrderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString2 (order, 'ReplacementClOrdId', 'ClientOrderId')",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'LastUpdatedTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'OrderState'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (order, 'OrderType')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'Side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'Price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.parseNumber (this.omitZero (this.safeString (order, 'StopPrice')))",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'GrossValueExecuted')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'OrigQuantity')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'QuantityExecuted')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'AvgPrice')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"status\":\"Accepted\",\n         \"errormsg\":\"\",\n         \"OrderId\": 2543565231\n     }",
          "{\n         \"ReplacementOrderId\": 1234,\n         \"ReplacementClOrdId\": 1561,\n         \"OrigOrderId\": 5678,\n         \"OrigClOrdId\": 91011,\n     }",
          "{\n         \"Side\":\"Buy\",\n         \"OrderId\":2543565233,\n         \"Price\":19010,\n         \"Quantity\":0.345,\n         \"DisplayQuantity\":0.345,\n         \"Instrument\":8,\n         \"Account\":449,\n         \"AccountName\":\"igor@ccxt.trade\",\n         \"OrderType\":\"Limit\",\n         \"ClientOrderId\":0,\n         \"OrderState\":\"Working\",\n         \"ReceiveTime\":1607579326003,\n         \"ReceiveTimeTicks\":637431761260028981,\n         \"LastUpdatedTime\":1607579326005,\n         \"LastUpdatedTimeTicks\":637431761260054714,\n         \"OrigQuantity\":0.345,\n         \"QuantityExecuted\":0,\n         \"GrossValueExecuted\":0,\n         \"ExecutableValue\":0,\n         \"AvgPrice\":0,\n         \"CounterPartyId\":0,\n         \"ChangeReason\":\"NewInputAccepted\",\n         \"OrigOrderId\":2543565233,\n         \"OrigClOrdId\":0,\n         \"EnteredBy\":446,\n         \"UserName\":\"igor@ccxt.trade\",\n         \"IsQuote\":false,\n         \"InsideAsk\":19069.32,\n         \"InsideAskSize\":0.099736,\n         \"InsideBid\":19068.25,\n         \"InsideBidSize\":1.330001,\n         \"LastTradePrice\":19068.25,\n         \"RejectReason\":\"\",\n         \"IsLockedIn\":false,\n         \"CancelReason\":\"\",\n         \"OrderFlag\":\"AddedToBook\",\n         \"UseMargin\":false,\n         \"StopPrice\":0,\n         \"PegPriceType\":\"Unknown\",\n         \"PegOffset\":0,\n         \"PegLimitOffset\":0,\n         \"IpAddress\":null,\n         \"ClientOrderIdUuid\":null,\n         \"OMSId\":1\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"status\":\"Accepted\",\n        //         \"errormsg\":\"\",\n        //         \"OrderId\": 2543565231\n        //     }\n        //\n        // editOrder\n        //\n        //     {\n        //         \"ReplacementOrderId\": 1234,\n        //         \"ReplacementClOrdId\": 1561,\n        //         \"OrigOrderId\": 5678,\n        //         \"OrigClOrdId\": 91011,\n        //     }\n        //\n        // fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"Side\":\"Buy\",\n        //         \"OrderId\":2543565233,\n        //         \"Price\":19010,\n        //         \"Quantity\":0.345,\n        //         \"DisplayQuantity\":0.345,\n        //         \"Instrument\":8,\n        //         \"Account\":449,\n        //         \"AccountName\":\"igor@ccxt.trade\",\n        //         \"OrderType\":\"Limit\",\n        //         \"ClientOrderId\":0,\n        //         \"OrderState\":\"Working\",\n        //         \"ReceiveTime\":1607579326003,\n        //         \"ReceiveTimeTicks\":637431761260028981,\n        //         \"LastUpdatedTime\":1607579326005,\n        //         \"LastUpdatedTimeTicks\":637431761260054714,\n        //         \"OrigQuantity\":0.345,\n        //         \"QuantityExecuted\":0,\n        //         \"GrossValueExecuted\":0,\n        //         \"ExecutableValue\":0,\n        //         \"AvgPrice\":0,\n        //         \"CounterPartyId\":0,\n        //         \"ChangeReason\":\"NewInputAccepted\",\n        //         \"OrigOrderId\":2543565233,\n        //         \"OrigClOrdId\":0,\n        //         \"EnteredBy\":446,\n        //         \"UserName\":\"igor@ccxt.trade\",\n        //         \"IsQuote\":false,\n        //         \"InsideAsk\":19069.32,\n        //         \"InsideAskSize\":0.099736,\n        //         \"InsideBid\":19068.25,\n        //         \"InsideBidSize\":1.330001,\n        //         \"LastTradePrice\":19068.25,\n        //         \"RejectReason\":\"\",\n        //         \"IsLockedIn\":false,\n        //         \"CancelReason\":\"\",\n        //         \"OrderFlag\":\"AddedToBook\",\n        //         \"UseMargin\":false,\n        //         \"StopPrice\":0,\n        //         \"PegPriceType\":\"Unknown\",\n        //         \"PegOffset\":0,\n        //         \"PegLimitOffset\":0,\n        //         \"IpAddress\":null,\n        //         \"ClientOrderIdUuid\":null,\n        //         \"OMSId\":1\n        //     }\n        //\n        const timestamp = this.safeInteger (order, 'ReceiveTime');\n        const marketId = this.safeString (order, 'Instrument');\n        return this.safeOrder ({\n            'id': this.safeString2 (order, 'ReplacementOrderId', 'OrderId'),\n            'clientOrderId': this.safeString2 (order, 'ReplacementClOrdId', 'ClientOrderId'),\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.safeInteger (order, 'LastUpdatedTime'),\n            'status': this.parseOrderStatus (this.safeString (order, 'OrderState')),\n            'symbol': this.safeSymbol (marketId, market),\n            'type': this.safeStringLower (order, 'OrderType'),\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': this.safeStringLower (order, 'Side'),\n            'price': this.safeString (order, 'Price'),\n            'triggerPrice': this.parseNumber (this.omitZero (this.safeString (order, 'StopPrice'))),\n            'cost': this.safeString (order, 'GrossValueExecuted'),\n            'amount': this.safeString (order, 'OrigQuantity'),\n            'filled': this.safeString (order, 'QuantityExecuted'),\n            'average': this.safeString (order, 'AvgPrice'),\n            'remaining': undefined,\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderBook",
        "signature": "parseOrderBook (orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey:IndexType = 6, amountKey:IndexType = 8, countOrIdKey: IndexType = 2)",
        "line_start": 647,
        "line_end": 683,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderBook (orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey:IndexType = 6, amountKey:IndexType = 8, countOrIdKey: IndexType = 2) {\n        let nonce = undefined;\n        const result: Dict = {\n            'symbol': symbol,\n            'bids': [],\n            'asks': [],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'nonce': undefined,\n        };\n        for (let i = 0; i < orderbook.length; i++) {\n            const level = orderbook[i];\n            if (timestamp === undefined) {\n                timestamp = this.safeInteger (level, 2);\n            } else {\n                const newTimestamp = this.safeInteger (level, 2);\n                timestamp = Math.max (timestamp, newTimestamp);\n            }\n            if (nonce === undefined) {\n                nonce = this.safeInteger (level, 0);\n            } else {\n                const newNonce = this.safeInteger (level, 0);\n                nonce = Math.max (nonce, newNonce);\n            }\n            const bidask = this.parseBidAsk (level, priceKey, amountKey);\n            const levelSide = this.safeInteger (level, 9);\n            const side = levelSide ? asksKey : bidsKey;\n            const resultSide = result[side];\n            resultSide.push (bidask);\n        }\n        result['bids'] = this.sortBy (result['bids'], 0, true);\n        result['asks'] = this.sortBy (result['asks'], 0);\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        result['nonce'] = nonce;\n        return result as OrderBook;\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1360,
        "line_end": 1370,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Accepted': 'open',\n            'Rejected': 'rejected',\n            'Working': 'open',\n            'Canceled': 'canceled',\n            'Expired': 'expired',\n            'FullyExecuted': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 731,
        "line_end": 796,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'SessionHigh')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'SessionLow')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'BestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"OMSId\":1,\n         \"InstrumentId\":8,\n         \"BestBid\":19069.31,\n         \"BestOffer\":19069.32,\n         \"LastTradedPx\":19069.32,\n         \"LastTradedQty\":0.0001,\n         \"LastTradeTime\":1607040406424,\n         \"SessionOpen\":19069.32,\n         \"SessionHigh\":19069.32,\n         \"SessionLow\":19069.32,\n         \"SessionClose\":19069.32,\n         \"Volume\":0.0001,\n         \"CurrentDayVolume\":0.0001,\n         \"CurrentDayNotional\":1.906932,\n         \"CurrentDayNumTrades\":1,\n         \"CurrentDayPxChange\":0.00,\n         \"Rolling24HrVolume\":0.000000000000000000000000000,\n         \"Rolling24HrNotional\":0.00000000000000000000000,\n         \"Rolling24NumTrades\":0,\n         \"Rolling24HrPxChange\":0,\n         \"TimeStamp\":\"1607040406425\",\n         \"BidQty\":0,\n         \"AskQty\":0,\n         \"BidOrderCt\":0,\n         \"AskOrderCt\":0,\n         \"Rolling24HrPxChangePercent\":0,\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker\n        //\n        //     {\n        //         \"OMSId\":1,\n        //         \"InstrumentId\":8,\n        //         \"BestBid\":19069.31,\n        //         \"BestOffer\":19069.32,\n        //         \"LastTradedPx\":19069.32,\n        //         \"LastTradedQty\":0.0001,\n        //         \"LastTradeTime\":1607040406424,\n        //         \"SessionOpen\":19069.32,\n        //         \"SessionHigh\":19069.32,\n        //         \"SessionLow\":19069.32,\n        //         \"SessionClose\":19069.32,\n        //         \"Volume\":0.0001,\n        //         \"CurrentDayVolume\":0.0001,\n        //         \"CurrentDayNotional\":1.906932,\n        //         \"CurrentDayNumTrades\":1,\n        //         \"CurrentDayPxChange\":0.00,\n        //         \"Rolling24HrVolume\":0.000000000000000000000000000,\n        //         \"Rolling24HrNotional\":0.00000000000000000000000,\n        //         \"Rolling24NumTrades\":0,\n        //         \"Rolling24HrPxChange\":0,\n        //         \"TimeStamp\":\"1607040406425\",\n        //         \"BidQty\":0,\n        //         \"AskQty\":0,\n        //         \"BidOrderCt\":0,\n        //         \"AskOrderCt\":0,\n        //         \"Rolling24HrPxChangePercent\":0,\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'TimeStamp');\n        const marketId = this.safeString (ticker, 'InstrumentId');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString (ticker, 'LastTradedPx');\n        const percentage = this.safeString (ticker, 'Rolling24HrPxChangePercent');\n        const change = this.safeString (ticker, 'Rolling24HrPxChange');\n        const open = this.safeString (ticker, 'SessionOpen');\n        const baseVolume = this.safeString (ticker, 'Rolling24HrVolume');\n        const quoteVolume = this.safeString (ticker, 'Rolling24HrNotional');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'SessionHigh'),\n            'low': this.safeString (ticker, 'SessionLow'),\n            'bid': this.safeString (ticker, 'BestBid'),\n            'bidVolume': undefined, // this.safeNumber (ticker, 'BidQty'), always shows 0\n            'ask': this.safeString (ticker, 'BestOffer'),\n            'askVolume': undefined, // this.safeNumber (ticker, 'AskQty'), always shows 0\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 920,
        "line_end": 1086,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "[\n         6913253,       //  0 TradeId\n         8,             //  1 ProductPairCode\n         0.03340802,    //  2 Quantity\n         19116.08,      //  3 Price\n         2543425077,    //  4 Order1\n         2543425482,    //  5 Order2\n         1606935922416, //  6 Tradetime\n         0,             //  7 Direction\n         1,             //  8 TakerSide\n         0,             //  9 BlockTrade\n         0,             // 10 Either Order1ClientId or Order2ClientId\n     ]",
          "{\n         \"OMSId\":1,\n         \"ExecutionId\":16916567,\n         \"TradeId\":14476351,\n         \"OrderId\":2543565231,\n         \"AccountId\":449,\n         \"AccountName\":\"igor@ccxt.trade\",\n         \"SubAccountId\":0,\n         \"ClientOrderId\":0,\n         \"InstrumentId\":8,\n         \"Side\":\"Sell\",\n         \"OrderType\":\"Market\",\n         \"Quantity\":0.1230000000000000000000000000,\n         \"RemainingQuantity\":0.0000000000000000000000000000,\n         \"Price\":19069.310000000000000000000000,\n         \"Value\":2345.5251300000000000000000000,\n         \"CounterParty\":\"7\",\n         \"OrderTradeRevision\":1,\n         \"Direction\":\"NoChange\",\n         \"IsBlockTrade\":false,\n         \"Fee\":1.1727625650000000000000000000,\n         \"FeeProductId\":8,\n         \"OrderOriginator\":446,\n         \"UserName\":\"igor@ccxt.trade\",\n         \"TradeTimeMS\":1607565031569,\n         \"MakerTaker\":\"Taker\",\n         \"AdapterTradeId\":0,\n         \"InsideBid\":19069.310000000000000000000000,\n         \"InsideBidSize\":0.2400950000000000000000000000,\n         \"InsideAsk\":19069.320000000000000000000000,\n         \"InsideAskSize\":0.0997360000000000000000000000,\n         \"IsQuote\":false,\n         \"CounterPartyClientUserId\":1,\n         \"NotionalProductId\":2,\n         \"NotionalRate\":1.0000000000000000000000000000,\n         \"NotionalValue\":2345.5251300000000000000000000,\n         \"NotionalHoldAmount\":0,\n         \"TradeTime\":637431618315686826\n     }",
          "{\n         \"Side\":\"Sell\",\n         \"OrderId\":2543565235,\n         \"Price\":18600.000000000000000000000000,\n         \"Quantity\":0.0000000000000000000000000000,\n         \"DisplayQuantity\":0.0000000000000000000000000000,\n         \"Instrument\":8,\n         \"Account\":449,\n         \"AccountName\":\"igor@ccxt.trade\",\n         \"OrderType\":\"Limit\",\n         \"ClientOrderId\":0,\n         \"OrderState\":\"FullyExecuted\",\n         \"ReceiveTime\":1607585844956,\n         \"ReceiveTimeTicks\":637431826449564182,\n         \"LastUpdatedTime\":1607585844959,\n         \"LastUpdatedTimeTicks\":637431826449593893,\n         \"OrigQuantity\":0.1230000000000000000000000000,\n         \"QuantityExecuted\":0.1230000000000000000000000000,\n         \"GrossValueExecuted\":2345.3947500000000000000000000,\n         \"ExecutableValue\":0.0000000000000000000000000000,\n         \"AvgPrice\":19068.250000000000000000000000,\n         \"CounterPartyId\":0,\n         \"ChangeReason\":\"Trade\",\n         \"OrigOrderId\":2543565235,\n         \"OrigClOrdId\":0,\n         \"EnteredBy\":446,\n         \"UserName\":\"igor@ccxt.trade\",\n         \"IsQuote\":false,\n         \"InsideAsk\":19069.320000000000000000000000,\n         \"InsideAskSize\":0.0997360000000000000000000000,\n         \"InsideBid\":19068.250000000000000000000000,\n         \"InsideBidSize\":1.3300010000000000000000000000,\n         \"LastTradePrice\":19068.250000000000000000000000,\n         \"RejectReason\":\"\",\n         \"IsLockedIn\":false,\n         \"CancelReason\":\"\",\n         \"OrderFlag\":\"0\",\n         \"UseMargin\":false,\n         \"StopPrice\":0.0000000000000000000000000000,\n         \"PegPriceType\":\"Unknown\",\n         \"PegOffset\":0.0000000000000000000000000000,\n         \"PegLimitOffset\":0.0000000000000000000000000000,\n         \"IpAddress\":\"x.x.x.x\",\n         \"ClientOrderIdUuid\":null,\n         \"OMSId\":1\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     [\n        //         6913253,       //  0 TradeId\n        //         8,             //  1 ProductPairCode\n        //         0.03340802,    //  2 Quantity\n        //         19116.08,      //  3 Price\n        //         2543425077,    //  4 Order1\n        //         2543425482,    //  5 Order2\n        //         1606935922416, //  6 Tradetime\n        //         0,             //  7 Direction\n        //         1,             //  8 TakerSide\n        //         0,             //  9 BlockTrade\n        //         0,             // 10 Either Order1ClientId or Order2ClientId\n        //     ]\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"OMSId\":1,\n        //         \"ExecutionId\":16916567,\n        //         \"TradeId\":14476351,\n        //         \"OrderId\":2543565231,\n        //         \"AccountId\":449,\n        //         \"AccountName\":\"igor@ccxt.trade\",\n        //         \"SubAccountId\":0,\n        //         \"ClientOrderId\":0,\n        //         \"InstrumentId\":8,\n        //         \"Side\":\"Sell\",\n        //         \"OrderType\":\"Market\",\n        //         \"Quantity\":0.1230000000000000000000000000,\n        //         \"RemainingQuantity\":0.0000000000000000000000000000,\n        //         \"Price\":19069.310000000000000000000000,\n        //         \"Value\":2345.5251300000000000000000000,\n        //         \"CounterParty\":\"7\",\n        //         \"OrderTradeRevision\":1,\n        //         \"Direction\":\"NoChange\",\n        //         \"IsBlockTrade\":false,\n        //         \"Fee\":1.1727625650000000000000000000,\n        //         \"FeeProductId\":8,\n        //         \"OrderOriginator\":446,\n        //         \"UserName\":\"igor@ccxt.trade\",\n        //         \"TradeTimeMS\":1607565031569,\n        //         \"MakerTaker\":\"Taker\",\n        //         \"AdapterTradeId\":0,\n        //         \"InsideBid\":19069.310000000000000000000000,\n        //         \"InsideBidSize\":0.2400950000000000000000000000,\n        //         \"InsideAsk\":19069.320000000000000000000000,\n        //         \"InsideAskSize\":0.0997360000000000000000000000,\n        //         \"IsQuote\":false,\n        //         \"CounterPartyClientUserId\":1,\n        //         \"NotionalProductId\":2,\n        //         \"NotionalRate\":1.0000000000000000000000000000,\n        //         \"NotionalValue\":2345.5251300000000000000000000,\n        //         \"NotionalHoldAmount\":0,\n        //         \"TradeTime\":637431618315686826\n        //     }\n        //\n        // fetchOrderTrades\n        //\n        //     {\n        //         \"Side\":\"Sell\",\n        //         \"OrderId\":2543565235,\n        //         \"Price\":18600.000000000000000000000000,\n        //         \"Quantity\":0.0000000000000000000000000000,\n        //         \"DisplayQuantity\":0.0000000000000000000000000000,\n        //         \"Instrument\":8,\n        //         \"Account\":449,\n        //         \"AccountName\":\"igor@ccxt.trade\",\n        //         \"OrderType\":\"Limit\",\n        //         \"ClientOrderId\":0,\n        //         \"OrderState\":\"FullyExecuted\",\n        //         \"ReceiveTime\":1607585844956,\n        //         \"ReceiveTimeTicks\":637431826449564182,\n        //         \"LastUpdatedTime\":1607585844959,\n        //         \"LastUpdatedTimeTicks\":637431826449593893,\n        //         \"OrigQuantity\":0.1230000000000000000000000000,\n        //         \"QuantityExecuted\":0.1230000000000000000000000000,\n        //         \"GrossValueExecuted\":2345.3947500000000000000000000,\n        //         \"ExecutableValue\":0.0000000000000000000000000000,\n        //         \"AvgPrice\":19068.250000000000000000000000,\n        //         \"CounterPartyId\":0,\n        //         \"ChangeReason\":\"Trade\",\n        //         \"OrigOrderId\":2543565235,\n        //         \"OrigClOrdId\":0,\n        //         \"EnteredBy\":446,\n        //         \"UserName\":\"igor@ccxt.trade\",\n        //         \"IsQuote\":false,\n        //         \"InsideAsk\":19069.320000000000000000000000,\n        //         \"InsideAskSize\":0.0997360000000000000000000000,\n        //         \"InsideBid\":19068.250000000000000000000000,\n        //         \"InsideBidSize\":1.3300010000000000000000000000,\n        //         \"LastTradePrice\":19068.250000000000000000000000,\n        //         \"RejectReason\":\"\",\n        //         \"IsLockedIn\":false,\n        //         \"CancelReason\":\"\",\n        //         \"OrderFlag\":\"0\",\n        //         \"UseMargin\":false,\n        //         \"StopPrice\":0.0000000000000000000000000000,\n        //         \"PegPriceType\":\"Unknown\",\n        //         \"PegOffset\":0.0000000000000000000000000000,\n        //         \"PegLimitOffset\":0.0000000000000000000000000000,\n        //         \"IpAddress\":\"x.x.x.x\",\n        //         \"ClientOrderIdUuid\":null,\n        //         \"OMSId\":1\n        //     }\n        //\n        let priceString = undefined;\n        let amountString = undefined;\n        let costString = undefined;\n        let timestamp = undefined;\n        let id = undefined;\n        let marketId = undefined;\n        let side = undefined;\n        let orderId = undefined;\n        let takerOrMaker = undefined;\n        let fee = undefined;\n        let type = undefined;\n        if (Array.isArray (trade)) {\n            priceString = this.safeString (trade, 3);\n            amountString = this.safeString (trade, 2);\n            timestamp = this.safeInteger (trade, 6);\n            id = this.safeString (trade, 0);\n            marketId = this.safeString (trade, 1);\n            const takerSide = this.safeValue (trade, 8);\n            side = takerSide ? 'sell' : 'buy';\n            orderId = this.safeString (trade, 4);\n        } else {\n            timestamp = this.safeInteger2 (trade, 'TradeTimeMS', 'ReceiveTime');\n            id = this.safeString (trade, 'TradeId');\n            orderId = this.safeString2 (trade, 'OrderId', 'OrigOrderId');\n            marketId = this.safeString2 (trade, 'InstrumentId', 'Instrument');\n            priceString = this.safeString (trade, 'Price');\n            amountString = this.safeString (trade, 'Quantity');\n            costString = this.safeString2 (trade, 'Value', 'GrossValueExecuted');\n            takerOrMaker = this.safeStringLower (trade, 'MakerTaker');\n            side = this.safeStringLower (trade, 'Side');\n            type = this.safeStringLower (trade, 'OrderType');\n            const feeCostString = this.safeString (trade, 'Fee');\n            if (feeCostString !== undefined) {\n                const feeCurrencyId = this.safeString (trade, 'FeeProductId');\n                const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n                fee = {\n                    'cost': feeCostString,\n                    'currency': feeCurrencyCode,\n                };\n            }\n        }\n        const symbol = this.safeSymbol (marketId, market);\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': orderId,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2349,
        "line_end": 2446,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString2 (templateForm, 'TxId', 'TXId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (templateForm, 'FromAddress')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'Amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatusByType (transactionStatus, type)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"OMSId\": 1,\n        \"DepositId\": 44,\n        \"AccountId\": 449,\n        \"SubAccountId\": 0,\n        \"ProductId\": 4,\n        \"Amount\": 200.00000000000000000000000000,\n        \"LastUpdateTimeStamp\": 637431291261187806,\n        \"ProductType\": \"CryptoCurrency\",\n        \"TicketStatus\": \"FullyProcessed\",\n        \"DepositInfo\": \"{\n            \"AccountProviderId\":42,\n            \"AccountProviderName\":\"USDT_BSC\",\n            \"TXId\":\"0x3879b02632c69482646409e991149290bc9a58e4603be63c7c2c90a843f45d2b\",\n            \"FromAddress\":\"0x8894E0a0c962CB723c1976a4421c95949bE2D4E3\",\n            \"ToAddress\":\"0x5428EcEB1F7Ee058f64158589e27D087149230CB\"\n        }\",\n        \"DepositCode\": \"ab0e23d5-a9ce-4d94-865f-9ab464fb1de3\",\n        \"TicketNumber\": 71,\n        \"NotionalProductId\": 13,\n        \"NotionalValue\": 200.00000000000000000000000000,\n        \"FeeAmount\": 0.0000000000000000000000000000,\n     }",
          "{\n         \"Amount\": 0.0,\n         \"FeeAmount\": 0.0,\n         \"NotionalValue\": 0.0,\n         \"WithdrawId\": 0,\n         \"AssetManagerId\": 0,\n         \"AccountId\": 0,\n         \"AssetId\": 0,\n         \"TemplateForm\": \"{\\\"TemplateType\\\": \\\"TetherRPCWithdraw\\\",\\\"Comment\\\": \\\"TestWithdraw\\\",\\\"ExternalAddress\\\": \\\"ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3\\\"}\",\n         \"TemplateFormType\": \"TetherRPCWithdraw\",\n         \"omsId\": 0,\n         \"TicketStatus\": 0,\n         \"TicketNumber\": 0,\n         \"WithdrawTransactionDetails\": \"\",\n         \"WithdrawType\": \"\",\n         \"WithdrawCode\": \"490b4fa3-53fc-44f4-bd29-7e16be86fba3\",\n         \"AssetType\": 0,\n         \"Reaccepted\": true,\n         \"NotionalProductId\": 0\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //    {\n        //        \"OMSId\": 1,\n        //        \"DepositId\": 44,\n        //        \"AccountId\": 449,\n        //        \"SubAccountId\": 0,\n        //        \"ProductId\": 4,\n        //        \"Amount\": 200.00000000000000000000000000,\n        //        \"LastUpdateTimeStamp\": 637431291261187806,\n        //        \"ProductType\": \"CryptoCurrency\",\n        //        \"TicketStatus\": \"FullyProcessed\",\n        //        \"DepositInfo\": \"{\n        //            \"AccountProviderId\":42,\n        //            \"AccountProviderName\":\"USDT_BSC\",\n        //            \"TXId\":\"0x3879b02632c69482646409e991149290bc9a58e4603be63c7c2c90a843f45d2b\",\n        //            \"FromAddress\":\"0x8894E0a0c962CB723c1976a4421c95949bE2D4E3\",\n        //            \"ToAddress\":\"0x5428EcEB1F7Ee058f64158589e27D087149230CB\"\n        //        }\",\n        //        \"DepositCode\": \"ab0e23d5-a9ce-4d94-865f-9ab464fb1de3\",\n        //        \"TicketNumber\": 71,\n        //        \"NotionalProductId\": 13,\n        //        \"NotionalValue\": 200.00000000000000000000000000,\n        //        \"FeeAmount\": 0.0000000000000000000000000000,\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"Amount\": 0.0,\n        //         \"FeeAmount\": 0.0,\n        //         \"NotionalValue\": 0.0,\n        //         \"WithdrawId\": 0,\n        //         \"AssetManagerId\": 0,\n        //         \"AccountId\": 0,\n        //         \"AssetId\": 0,\n        //         \"TemplateForm\": \"{\\\"TemplateType\\\": \\\"TetherRPCWithdraw\\\",\\\"Comment\\\": \\\"TestWithdraw\\\",\\\"ExternalAddress\\\": \\\"ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3\\\"}\",\n        //         \"TemplateFormType\": \"TetherRPCWithdraw\",\n        //         \"omsId\": 0,\n        //         \"TicketStatus\": 0,\n        //         \"TicketNumber\": 0,\n        //         \"WithdrawTransactionDetails\": \"\",\n        //         \"WithdrawType\": \"\",\n        //         \"WithdrawCode\": \"490b4fa3-53fc-44f4-bd29-7e16be86fba3\",\n        //         \"AssetType\": 0,\n        //         \"Reaccepted\": true,\n        //         \"NotionalProductId\": 0\n        //     }\n        //\n        let id = undefined;\n        const currencyId = this.safeString (transaction, 'ProductId');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let type = undefined;\n        if ('DepositId' in transaction) {\n            id = this.safeString (transaction, 'DepositId');\n            type = 'deposit';\n        } else if ('WithdrawId' in transaction) {\n            id = this.safeString (transaction, 'WithdrawId');\n            type = 'withdrawal';\n        }\n        const templateForm = this.parseJson (this.safeValue2 (transaction, 'TemplateForm', 'DepositInfo'));\n        let updated = this.safeInteger (transaction, 'LastUpdateTimeStamp');\n        if (templateForm !== undefined) {\n            updated = this.safeInteger (templateForm, 'LastUpdated', updated);\n        }\n        const address = this.safeString2 (templateForm, 'ExternalAddress', 'ToAddress');\n        const timestamp = this.safeInteger (templateForm, 'TimeSubmitted');\n        const feeCost = this.safeNumber (transaction, 'FeeAmount');\n        const transactionStatus = this.safeString (transaction, 'TicketStatus');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = { 'currency': code, 'cost': feeCost };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': this.safeString2 (templateForm, 'TxId', 'TXId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': this.safeString (templateForm, 'FromAddress'),\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'Amount'),\n            'currency': code,\n            'status': this.parseTransactionStatusByType (transactionStatus, type),\n            'updated': updated,\n            'fee': fee,\n            'internal': undefined,\n            'comment': undefined,\n            'network': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 2300,
        "line_end": 2347,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        const statusesByType: Dict = {\n            'deposit': {\n                'New': 'pending', // new ticket awaiting operator review\n                'AdminProcessing': 'pending', // an admin is looking at the ticket\n                'Accepted': 'pending', // an admin accepts the ticket\n                'Rejected': 'rejected', // admin rejects the ticket\n                'SystemProcessing': 'pending', // automatic processing; an unlikely status for a deposit\n                'FullyProcessed': 'ok', // the deposit has concluded\n                'Failed': 'failed', // the deposit has failed for some reason\n                'Pending': 'pending', // Account Provider has set status to pending\n                'Confirmed': 'pending', // Account Provider confirms the deposit\n                'AmlProcessing': 'pending', // anti-money-laundering process underway\n                'AmlAccepted': 'pending', // anti-money-laundering process successful\n                'AmlRejected': 'rejected', // deposit did not stand up to anti-money-laundering process\n                'AmlFailed': 'failed', // anti-money-laundering process failed/did not complete\n                'LimitsAccepted': 'pending', // deposit meets limits for fiat or crypto asset\n                'LimitsRejected': 'rejected', // deposit does not meet limits for fiat or crypto asset\n            },\n            'withdrawal': {\n                'New': 'pending', // awaiting operator review\n                'AdminProcessing': 'pending', // An admin is looking at the ticket\n                'Accepted': 'pending', // withdrawal will proceed\n                'Rejected': 'rejected', // admin or automatic rejection\n                'SystemProcessing': 'pending', // automatic processing underway\n                'FullyProcessed': 'ok', // the withdrawal has concluded\n                'Failed': 'failed', // the withdrawal failed for some reason\n                'Pending': 'pending', // the admin has placed the withdrawal in pending status\n                'Pending2Fa': 'pending', // user must click 2-factor authentication confirmation link\n                'AutoAccepted': 'pending', // withdrawal will be automatically processed\n                'Delayed': 'pending', // waiting for funds to be allocated for the withdrawal\n                'UserCanceled': 'canceled', // withdraw canceled by user or Superuser\n                'AdminCanceled': 'canceled', // withdraw canceled by Superuser\n                'AmlProcessing': 'pending', // anti-money-laundering process underway\n                'AmlAccepted': 'pending', // anti-money-laundering process complete\n                'AmlRejected': 'rejected', // withdrawal did not stand up to anti-money-laundering process\n                'AmlFailed': 'failed', // withdrawal did not complete anti-money-laundering process\n                'LimitsAccepted': 'pending', // withdrawal meets limits for fiat or crypto asset\n                'LimitsRejected': 'rejected', // withdrawal does not meet limits for fiat or crypto asset\n                'Submitted': 'pending', // withdrawal sent to Account Provider; awaiting blockchain confirmation\n                'Confirmed': 'pending', // Account Provider confirms that withdrawal is on the blockchain\n                'ManuallyConfirmed': 'pending', // admin has sent withdrawal via wallet or admin function directly; marks ticket as FullyProcessed; debits account\n                'Confirmed2Fa': 'pending', // user has confirmed withdraw via 2-factor authentication.\n            },\n        };\n        const statuses = this.safeValue (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "novadax": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 813,
        "line_end": 831,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const data = this.safeValue (response, 'data', []);\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < data.length; i++) {\n            const balance = data[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'balance');\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'hold');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 384,
        "line_end": 441,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(status === 'ONLINE')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amountPrecision'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision')))",
            "comment": "'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'valuePrecision'))),\n            }"
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minOrderAmount'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minOrderValue'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minOrderAmount'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'minOrderValue'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const baseId = this.safeString (market, 'baseCurrency');\n        const quoteId = this.safeString (market, 'quoteCurrency');\n        const id = this.safeString (market, 'symbol');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const status = this.safeString (market, 'status');\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': (status === 'ONLINE'),\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amountPrecision'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision'))),\n                // 'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'valuePrecision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minOrderAmount'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minOrderValue'),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 787,
        "line_end": 811,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"amount\": 8.25709100,\n         \"closePrice\": 62553.20,\n         \"count\": 29,\n         \"highPrice\": 62592.87,\n         \"lowPrice\": 62553.20,\n         \"openPrice\": 62554.23,\n         \"score\": 1602501480,\n         \"symbol\": \"BTC_BRL\",\n         \"vol\": 516784.2504067500\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"amount\": 8.25709100,\n        //         \"closePrice\": 62553.20,\n        //         \"count\": 29,\n        //         \"highPrice\": 62592.87,\n        //         \"lowPrice\": 62553.20,\n        //         \"openPrice\": 62554.23,\n        //         \"score\": 1602501480,\n        //         \"symbol\": \"BTC_BRL\",\n        //         \"vol\": 516784.2504067500\n        //     }\n        //\n        const options = this.safeValue (this.options, 'fetchOHLCV', {});\n        const volumeField = this.safeString (options, 'volume', 'amount'); // or vol\n        return [\n            this.safeTimestamp (ohlcv, 'score'),\n            this.safeNumber (ohlcv, 'openPrice'),\n            this.safeNumber (ohlcv, 'highPrice'),\n            this.safeNumber (ohlcv, 'lowPrice'),\n            this.safeNumber (ohlcv, 'closePrice'),\n            this.safeNumber (ohlcv, volumeField),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1190,
        "line_end": 1261,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\": \"0.001\",\n         \"averagePrice\": null,\n         \"filledAmount\": \"0\",\n         \"filledFee\": \"0\",\n         \"filledValue\": \"0\",\n         \"id\": \"870613508008464384\",\n         \"operator\": \"GTE\",\n         \"price\": \"210000\",\n         \"side\": \"BUY\",\n         \"status\": \"SUBMITTED\",\n         \"stopPrice\": \"211000\",\n         \"symbol\": \"BTC_BRL\",\n         \"timestamp\": 1627612035528,\n         \"type\": \"STOP_LIMIT\",\n         \"value\": \"210\"\n     }",
          "{\n         \"result\": true\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, fetchOrders, fetchOrder\n        //\n        //     {\n        //         \"amount\": \"0.001\",\n        //         \"averagePrice\": null,\n        //         \"filledAmount\": \"0\",\n        //         \"filledFee\": \"0\",\n        //         \"filledValue\": \"0\",\n        //         \"id\": \"870613508008464384\",\n        //         \"operator\": \"GTE\",\n        //         \"price\": \"210000\",\n        //         \"side\": \"BUY\",\n        //         \"status\": \"SUBMITTED\",\n        //         \"stopPrice\": \"211000\",\n        //         \"symbol\": \"BTC_BRL\",\n        //         \"timestamp\": 1627612035528,\n        //         \"type\": \"STOP_LIMIT\",\n        //         \"value\": \"210\"\n        //     }\n        //\n        // cancelOrder\n        //\n        //     {\n        //         \"result\": true\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const amount = this.safeString (order, 'amount');\n        const price = this.safeString (order, 'price');\n        const cost = this.safeString2 (order, 'filledValue', 'value');\n        const type = this.safeStringLower (order, 'type');\n        const side = this.safeStringLower (order, 'side');\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const timestamp = this.safeInteger (order, 'timestamp');\n        const average = this.safeString (order, 'averagePrice');\n        const filled = this.safeString (order, 'filledAmount');\n        let fee = undefined;\n        const feeCost = this.safeNumber (order, 'filledFee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': undefined,\n            };\n        }\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeNumber (order, 'stopPrice'),\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1177,
        "line_end": 1188,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'SUBMITTED': 'open',\n            'PROCESSING': 'open',\n            'PARTIAL_FILLED': 'open',\n            'CANCELING': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'REJECTED': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 443,
        "line_end": 489,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low24h')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"ask\":\"61946.1\",\n         \"baseVolume24h\":\"164.41930186\",\n         \"bid\":\"61815\",\n         \"high24h\":\"64930.72\",\n         \"lastPrice\":\"61928.41\",\n         \"low24h\":\"61156.32\",\n         \"open24h\":\"64512.46\",\n         \"quoteVolume24h\":\"10308157.95\",\n         \"symbol\":\"BTC_BRL\",\n         \"timestamp\":1599091115090\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"ask\":\"61946.1\",\n        //         \"baseVolume24h\":\"164.41930186\",\n        //         \"bid\":\"61815\",\n        //         \"high24h\":\"64930.72\",\n        //         \"lastPrice\":\"61928.41\",\n        //         \"low24h\":\"61156.32\",\n        //         \"open24h\":\"64512.46\",\n        //         \"quoteVolume24h\":\"10308157.95\",\n        //         \"symbol\":\"BTC_BRL\",\n        //         \"timestamp\":1599091115090\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const open = this.safeString (ticker, 'open24h');\n        const last = this.safeString (ticker, 'lastPrice');\n        const baseVolume = this.safeString (ticker, 'baseVolume24h');\n        const quoteVolume = this.safeString (ticker, 'quoteVolume24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high24h'),\n            'low': this.safeString (ticker, 'low24h'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 616,
        "line_end": 693,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'feeAmount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amount\":\"0.0632\",\n         \"price\":\"0.037288\",\n         \"side\":\"BUY\",\n         \"timestamp\":1599279694576\n     }",
          "{\n          \"id\": \"608717046691139584\",\n          \"orderId\": \"608716957545402368\",\n          \"symbol\": \"BTC_BRL\",\n          \"side\": \"BUY\",\n          \"amount\": \"0.0988\",\n          \"price\": \"45514.76\",\n          \"fee\": \"0.0000988 BTC\",\n          \"feeAmount\": \"0.0000988\",\n          \"feeCurrency\": \"BTC\",\n          \"role\": \"MAKER\",\n          \"timestamp\": 1565171053345\n       }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"amount\":\"0.0632\",\n        //         \"price\":\"0.037288\",\n        //         \"side\":\"BUY\",\n        //         \"timestamp\":1599279694576\n        //     }\n        //\n        // private fetchOrderTrades\n        //\n        //      {\n        //          \"id\": \"608717046691139584\",\n        //          \"orderId\": \"608716957545402368\",\n        //          \"symbol\": \"BTC_BRL\",\n        //          \"side\": \"BUY\",\n        //          \"amount\": \"0.0988\",\n        //          \"price\": \"45514.76\",\n        //          \"fee\": \"0.0000988 BTC\",\n        //          \"feeAmount\": \"0.0000988\",\n        //          \"feeCurrency\": \"BTC\",\n        //          \"role\": \"MAKER\",\n        //          \"timestamp\": 1565171053345\n        //       }\n        //\n        // private fetchMyTrades (same endpoint as fetchOrderTrades)\n        //\n        //      {\n        //          \"id\": \"608717046691139584\",\n        //          \"orderId\": \"608716957545402368\",\n        //          \"symbol\": \"BTC_BRL\",\n        //          \"side\": \"BUY\",\n        //          \"amount\": \"0.0988\",\n        //          \"price\": \"45514.76\",\n        //          \"fee\": \"0.0000988 BTC\",\n        //          \"feeAmount\": \"0.0000988\",\n        //          \"feeCurrency\": \"BTC\",\n        //          \"role\": \"MAKER\",\n        //          \"timestamp\": 1565171053345\n        //       }\n        //\n        const id = this.safeString (trade, 'id');\n        const orderId = this.safeString (trade, 'orderId');\n        const timestamp = this.safeInteger (trade, 'timestamp');\n        const side = this.safeStringLower (trade, 'side');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const marketId = this.safeString (trade, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const takerOrMaker = this.safeStringLower (trade, 'role');\n        const feeString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'feeCurrency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': this.safeString (trade, 'feeAmount'),\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1521,
        "line_end": 1590,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "network",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': undefined,\n                'cost': undefined,\n                'rate': undefined,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\":\"A10000\",\n         \"data\": \"DR123\",\n         \"message\":\"Success\"\n     }",
          "{\n         \"id\": \"DR562339304588709888\",\n         \"type\": \"COIN_IN\",\n         \"currency\": \"XLM\",\n         \"chain\": \"XLM\",\n         \"address\": \"GCUTK7KHPJC3ZQJ3OMWWFHAK2OXIBRD4LNZQRCCOVE7A2XOPP2K5PU5Q\",\n         \"addressTag\": \"1000009\",\n         \"amount\": 1.0,\n         \"state\": \"SUCCESS\",\n         \"txHash\": \"39210645748822f8d4ce673c7559aa6622e6e9cdd7073bc0fcae14b1edfda5f4\",\n         \"createdAt\": 1554113737000,\n         \"updatedAt\": 1601371273000\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"code\":\"A10000\",\n        //         \"data\": \"DR123\",\n        //         \"message\":\"Success\"\n        //     }\n        //\n        // fetchDepositsWithdrawals\n        //\n        //     {\n        //         \"id\": \"DR562339304588709888\",\n        //         \"type\": \"COIN_IN\",\n        //         \"currency\": \"XLM\",\n        //         \"chain\": \"XLM\",\n        //         \"address\": \"GCUTK7KHPJC3ZQJ3OMWWFHAK2OXIBRD4LNZQRCCOVE7A2XOPP2K5PU5Q\",\n        //         \"addressTag\": \"1000009\",\n        //         \"amount\": 1.0,\n        //         \"state\": \"SUCCESS\",\n        //         \"txHash\": \"39210645748822f8d4ce673c7559aa6622e6e9cdd7073bc0fcae14b1edfda5f4\",\n        //         \"createdAt\": 1554113737000,\n        //         \"updatedAt\": 1601371273000\n        //     }\n        //\n        const id = this.safeString2 (transaction, 'id', 'data');\n        let type = this.safeString (transaction, 'type');\n        if (type === 'COIN_IN') {\n            type = 'deposit';\n        } else if (type === 'COIN_OUT') {\n            type = 'withdraw';\n        }\n        const amount = this.safeNumber (transaction, 'amount');\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'addressTag');\n        const txid = this.safeString (transaction, 'txHash');\n        const timestamp = this.safeInteger (transaction, 'createdAt');\n        const updated = this.safeInteger (transaction, 'updatedAt');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const network = this.safeString (transaction, 'chain');\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': network,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'status': status,\n            'type': type,\n            'updated': updated,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'currency': undefined,\n                'cost': undefined,\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1505,
        "line_end": 1519,
        "comment": null,
        "mappings": [
          {
            "key": "Pending",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "confirming",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "SUCCESS",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "FAIL",
            "value": "'failed'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        // Pending the record is wait broadcast to chain\n        // x/M confirming the comfirming state of tx, the M is total confirmings needed\n        // SUCCESS the record is success full\n        // FAIL the record failed\n        const parts = status.split (' ');\n        status = this.safeString (parts, 1, status);\n        const statuses: Dict = {\n            'Pending': 'pending',\n            'confirming': 'pending',\n            'SUCCESS': 'ok',\n            'FAIL': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1309,
        "line_end": 1331,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"code\":\"A10000\",\n        \"message\":\"Success\",\n        \"data\":40\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    {\n        //        \"code\":\"A10000\",\n        //        \"message\":\"Success\",\n        //        \"data\":40\n        //    }\n        //\n        const id = this.safeString (transfer, 'data');\n        const status = this.safeString (transfer, 'message');\n        const currencyCode = this.safeCurrencyCode (undefined, currency);\n        return {\n            'info': transfer,\n            'id': id,\n            'amount': undefined,\n            'currency': currencyCode,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'status': status,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 1333,
        "line_end": 1338,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'SUCCESS': 'pending',\n        };\n        return this.safeString (statuses, status, 'failed');\n    }"
      }
    ],
    "okx": [
      {
        "name": "parseBalanceByType",
        "signature": "parseBalanceByType (type, response)",
        "line_start": 2722,
        "line_end": 2728,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceByType (type, response) {\n        if (type === 'funding') {\n            return this.parseFundingBalance (response);\n        } else {\n            return this.parseTradingBalance (response);\n        }\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 7520,
        "line_end": 7537,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'ccy'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'liab')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (info, 'mgnMode')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const instId = this.safeString (info, 'instId');\n        if (instId !== undefined) {\n            market = this.safeMarket (instId, market);\n        }\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'ccy')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'liab'),\n            'marginMode': this.safeString (info, 'mgnMode'),\n            'timestamp': timestamp,  // Interest accrued time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 7074,
        "line_end": 7093,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (ccy)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber2 (info, 'interestRate', 'rate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amt\": \"992.10341195\",\n        \"ccy\": \"BTC\",\n        \"rate\": \"0.01\",\n        \"ts\": \"1643954400000\"\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"amt\": \"992.10341195\",\n        //        \"ccy\": \"BTC\",\n        //        \"rate\": \"0.01\",\n        //        \"ts\": \"1643954400000\"\n        //    }\n        //\n        const ccy = this.safeString (info, 'ccy');\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'currency': this.safeCurrencyCode (ccy),\n            'rate': this.safeNumber2 (info, 'interestRate', 'rate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseBorrowRateHistories",
        "signature": "parseBorrowRateHistories (response, codes, since, limit)",
        "line_start": 7095,
        "line_end": 7126,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        {\n            \"amt\": \"992.10341195\",\n            \"ccy\": \"BTC\",\n            \"rate\": \"0.01\",\n            \"ts\": \"1643954400000\"\n        },\n        ...\n    ]"
        ],
        "source": "parseBorrowRateHistories (response, codes, since, limit) {\n        //\n        //    [\n        //        {\n        //            \"amt\": \"992.10341195\",\n        //            \"ccy\": \"BTC\",\n        //            \"rate\": \"0.01\",\n        //            \"ts\": \"1643954400000\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const borrowRateHistories: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const item = response[i];\n            const code = this.safeCurrencyCode (this.safeString (item, 'ccy'));\n            if (codes === undefined || this.inArray (code, codes)) {\n                if (!(code in borrowRateHistories)) {\n                    borrowRateHistories[code] = [];\n                }\n                const borrowRateStructure = this.parseBorrowRate (item);\n                const borrrowRateCode = borrowRateHistories[code];\n                borrrowRateCode.push (borrowRateStructure);\n            }\n        }\n        const keys = Object.keys (borrowRateHistories);\n        for (let i = 0; i < keys.length; i++) {\n            const code = keys[i];\n            borrowRateHistories[code] = this.filterByCurrencySinceLimit (borrowRateHistories[code], code, since, limit);\n        }\n        return borrowRateHistories;\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 8758,
        "line_end": 8828,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'clQReqId', 'tradeId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'baseSz', 'fillBaseSz')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'quoteSz', 'fillQuoteSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (conversion, 'cnvtPx', 'fillPx')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"baseCcy\": \"ETH\",\n         \"baseSz\": \"0.01023052\",\n         \"clQReqId\": \"\",\n         \"cnvtPx\": \"2932.40104429\",\n         \"origRfqSz\": \"30\",\n         \"quoteCcy\": \"USDT\",\n         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n         \"quoteSz\": \"30\",\n         \"quoteTime\": \"1646188510461\",\n         \"rfqSz\": \"30\",\n         \"rfqSzCcy\": \"USDT\",\n         \"side\": \"buy\",\n         \"ttlMs\": \"10000\"\n     }",
          "{\n         \"baseCcy\": \"ETH\",\n         \"clTReqId\": \"\",\n         \"fillBaseSz\": \"0.01023052\",\n         \"fillPx\": \"2932.40104429\",\n         \"fillQuoteSz\": \"30\",\n         \"instId\": \"ETH-USDT\",\n         \"quoteCcy\": \"USDT\",\n         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n         \"side\": \"buy\",\n         \"state\": \"fullyFilled\",\n         \"tradeId\": \"trader16461885203381437\",\n         \"ts\": \"1646188520338\"\n     }",
          "{\n         \"clTReqId\": \"\",\n         \"instId\": \"ETH-USDT\",\n         \"side\": \"buy\",\n         \"fillPx\": \"2932.401044\",\n         \"baseCcy\": \"ETH\",\n         \"quoteCcy\": \"USDT\",\n         \"fillBaseSz\": \"0.01023052\",\n         \"state\": \"fullyFilled\",\n         \"tradeId\": \"trader16461885203381437\",\n         \"fillQuoteSz\": \"30\",\n         \"ts\": \"1646188520000\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"baseCcy\": \"ETH\",\n        //         \"baseSz\": \"0.01023052\",\n        //         \"clQReqId\": \"\",\n        //         \"cnvtPx\": \"2932.40104429\",\n        //         \"origRfqSz\": \"30\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n        //         \"quoteSz\": \"30\",\n        //         \"quoteTime\": \"1646188510461\",\n        //         \"rfqSz\": \"30\",\n        //         \"rfqSzCcy\": \"USDT\",\n        //         \"side\": \"buy\",\n        //         \"ttlMs\": \"10000\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"baseCcy\": \"ETH\",\n        //         \"clTReqId\": \"\",\n        //         \"fillBaseSz\": \"0.01023052\",\n        //         \"fillPx\": \"2932.40104429\",\n        //         \"fillQuoteSz\": \"30\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n        //         \"side\": \"buy\",\n        //         \"state\": \"fullyFilled\",\n        //         \"tradeId\": \"trader16461885203381437\",\n        //         \"ts\": \"1646188520338\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory\n        //\n        //     {\n        //         \"clTReqId\": \"\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"side\": \"buy\",\n        //         \"fillPx\": \"2932.401044\",\n        //         \"baseCcy\": \"ETH\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"fillBaseSz\": \"0.01023052\",\n        //         \"state\": \"fullyFilled\",\n        //         \"tradeId\": \"trader16461885203381437\",\n        //         \"fillQuoteSz\": \"30\",\n        //         \"ts\": \"1646188520000\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (conversion, 'quoteTime', 'ts');\n        const fromCoin = this.safeString (conversion, 'baseCcy');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'quoteCcy');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'clQReqId', 'tradeId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'baseSz', 'fillBaseSz'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'quoteSz', 'fillQuoteSz'),\n            'price': this.safeNumber2 (conversion, 'cnvtPx', 'fillPx'),\n            'fee': undefined,\n        } as Conversion;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 5171,
        "line_end": 5267,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"addr\": \"okbtothemoon\",\n         \"memo\": \"971668\", // may be missing\n         \"tag\":\"52055\", // may be missing\n         \"pmtId\": \"\", // may be missing\n         \"ccy\": \"BTC\",\n         \"to\": \"6\", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account\n         \"selected\": true\n     }",
          "{\n         \"ccy\":\"usdt-erc20\",\n         \"to\":\"6\",\n         \"addr\":\"0x696abb81974a8793352cbd33aadcf78eda3cfdfa\",\n         \"selected\":true\n     }",
          "{\n        \"chain\": \"ETH-OKExChain\",\n        \"addrEx\": { \"comment\": \"6040348\" }, // some currencies like TON may have this field,\n        \"ctAddr\": \"72315c\",\n        \"ccy\": \"ETH\",\n        \"to\": \"6\",\n        \"addr\": \"0x1c9f2244d1ccaa060bd536827c18925db10db102\",\n        \"selected\": true\n     }",
          "{\n          \"chain\": \"USDT-Polygon\",\n          \"ctAddr\": \"\",\n          \"ccy\": \"USDT\",\n          \"to\":\"6\" ,\n          \"addr\": \"0x1903441e386cc49d937f6302955b5feb4286dcfa\",\n          \"selected\": true\n      }",
          "network information from currency['networks'] field:"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"addr\": \"okbtothemoon\",\n        //         \"memo\": \"971668\", // may be missing\n        //         \"tag\":\"52055\", // may be missing\n        //         \"pmtId\": \"\", // may be missing\n        //         \"ccy\": \"BTC\",\n        //         \"to\": \"6\", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account\n        //         \"selected\": true\n        //     }\n        //\n        //     {\n        //         \"ccy\":\"usdt-erc20\",\n        //         \"to\":\"6\",\n        //         \"addr\":\"0x696abb81974a8793352cbd33aadcf78eda3cfdfa\",\n        //         \"selected\":true\n        //     }\n        //\n        //     {\n        //        \"chain\": \"ETH-OKExChain\",\n        //        \"addrEx\": { \"comment\": \"6040348\" }, // some currencies like TON may have this field,\n        //        \"ctAddr\": \"72315c\",\n        //        \"ccy\": \"ETH\",\n        //        \"to\": \"6\",\n        //        \"addr\": \"0x1c9f2244d1ccaa060bd536827c18925db10db102\",\n        //        \"selected\": true\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'addr');\n        let tag = this.safeStringN (depositAddress, [ 'tag', 'pmtId', 'memo' ]);\n        if (tag === undefined) {\n            const addrEx = this.safeValue (depositAddress, 'addrEx', {});\n            tag = this.safeString (addrEx, 'comment');\n        }\n        const currencyId = this.safeString (depositAddress, 'ccy');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = currency['code'];\n        const chain = this.safeString (depositAddress, 'chain');\n        const networks = this.safeValue (currency, 'networks', {});\n        const networksById = this.indexBy (networks, 'id');\n        let networkData = this.safeValue (networksById, chain);\n        // inconsistent naming responses from exchange\n        // with respect to network naming provided in currency info vs address chain-names and ids\n        //\n        // response from address endpoint:\n        //      {\n        //          \"chain\": \"USDT-Polygon\",\n        //          \"ctAddr\": \"\",\n        //          \"ccy\": \"USDT\",\n        //          \"to\":\"6\" ,\n        //          \"addr\": \"0x1903441e386cc49d937f6302955b5feb4286dcfa\",\n        //          \"selected\": true\n        //      }\n        // network information from currency['networks'] field:\n        // Polygon: {\n        //        info: {\n        //            canDep: false,\n        //            canInternal: false,\n        //            canWd: false,\n        //            ccy: 'USDT',\n        //            chain: 'USDT-Polygon-Bridge',\n        //            mainNet: false,\n        //            maxFee: '26.879528',\n        //            minFee: '13.439764',\n        //            minWd: '0.001',\n        //            name: ''\n        //        },\n        //        id: 'USDT-Polygon-Bridge',\n        //        network: 'Polygon',\n        //        active: false,\n        //        deposit: false,\n        //        withdraw: false,\n        //        fee: 13.439764,\n        //        precision: undefined,\n        //        limits: {\n        //            withdraw: {\n        //                min: 0.001,\n        //                max: undefined\n        //            }\n        //        }\n        //     },\n        //\n        if (chain === 'USDT-Polygon') {\n            networkData = this.safeValue2 (networksById, 'USDT-Polygon-Bridge', 'USDT-Polygon');\n        }\n        const network = this.safeString (networkData, 'network');\n        const networkCode = this.networkIdToCode (network, code);\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 7948,
        "line_end": 8011,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n   {\n       \"canDep\": true,\n       \"canInternal\": false,\n       \"canWd\": true,\n       \"ccy\": \"USDT\",\n       \"chain\": \"USDT-TRC20\",\n       \"logoLink\": \"https://static.coinall.ltd/cdn/assets/imgs/221/5F74EB20302D7761.png\",\n       \"mainNet\": false,\n       \"maxFee\": \"1.6\",\n       \"maxWd\": \"8852150\",\n       \"minFee\": \"0.8\",\n       \"minWd\": \"2\",\n       \"name\": \"Tether\",\n       \"usedWdQuota\": \"0\",\n       \"wdQuota\": \"500\",\n       \"wdTickSz\": \"3\"\n   }\n ]"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        // [\n        //   {\n        //       \"canDep\": true,\n        //       \"canInternal\": false,\n        //       \"canWd\": true,\n        //       \"ccy\": \"USDT\",\n        //       \"chain\": \"USDT-TRC20\",\n        //       \"logoLink\": \"https://static.coinall.ltd/cdn/assets/imgs/221/5F74EB20302D7761.png\",\n        //       \"mainNet\": false,\n        //       \"maxFee\": \"1.6\",\n        //       \"maxWd\": \"8852150\",\n        //       \"minFee\": \"0.8\",\n        //       \"minWd\": \"2\",\n        //       \"name\": \"Tether\",\n        //       \"usedWdQuota\": \"0\",\n        //       \"wdQuota\": \"500\",\n        //       \"wdTickSz\": \"3\"\n        //   }\n        // ]\n        //\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        for (let i = 0; i < response.length; i++) {\n            const feeInfo = response[i];\n            const currencyId = this.safeString (feeInfo, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                const depositWithdrawFee = this.safeValue (depositWithdrawFees, code);\n                if (depositWithdrawFee === undefined) {\n                    depositWithdrawFees[code] = this.depositWithdrawFee ({});\n                }\n                depositWithdrawFees[code]['info'][currencyId] = feeInfo;\n                const chain = this.safeString (feeInfo, 'chain');\n                if (chain === undefined) {\n                    continue;\n                }\n                const chainSplit = chain.split ('-');\n                const networkId = this.safeValue (chainSplit, 1);\n                const withdrawFee = this.safeNumber (feeInfo, 'fee');\n                const withdrawResult: Dict = {\n                    'fee': withdrawFee,\n                    'percentage': (withdrawFee !== undefined) ? false : undefined,\n                };\n                const depositResult: Dict = {\n                    'fee': undefined,\n                    'percentage': undefined,\n                };\n                const networkCode = this.networkIdToCode (networkId, code);\n                depositWithdrawFees[code]['networks'][networkCode] = {\n                    'withdraw': withdrawResult,\n                    'deposit': depositResult,\n                };\n            }\n        }\n        const depositWithdrawCodes = Object.keys (depositWithdrawFees);\n        for (let i = 0; i < depositWithdrawCodes.length; i++) {\n            const code = depositWithdrawCodes[i];\n            const currency = this.currency (code);\n            depositWithdrawFees[code] = this.assignDefaultDepositWithdrawFees (depositWithdrawFees[code], currency);\n        }\n        return depositWithdrawFees;\n    }"
      },
      {
        "name": "parseFundingBalance",
        "signature": "parseFundingBalance (response)",
        "line_start": 2758,
        "line_end": 2773,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingBalance (response) {\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        for (let i = 0; i < data.length; i++) {\n            const balance = data[i];\n            const currencyId = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            account['total'] = this.safeString (balance, 'bal');\n            account['free'] = this.safeString (balance, 'availBal');\n            account['used'] = this.safeString (balance, 'frozenBal');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 6570,
        "line_end": 6579,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 6509,
        "line_end": 6568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"fundingRate\": \"0.00027815\",\n        \"fundingTime\": \"1634256000000\",\n        \"instId\": \"BTC-USD-SWAP\",\n        \"instType\": \"SWAP\",\n        \"nextFundingRate\": \"0.00017\",\n        \"nextFundingTime\": \"1634284800000\"\n    }",
          "{\n        \"fundingRate\":\"0.0001875391284828\",\n        \"fundingTime\":\"1700726400000\",\n        \"instId\":\"BTC-USD-SWAP\",\n        \"instType\":\"SWAP\",\n        \"method\": \"next_period\",\n        \"maxFundingRate\":\"0.00375\",\n        \"minFundingRate\":\"-0.00375\",\n        \"nextFundingRate\":\"0.0002608059239328\",\n        \"nextFundingTime\":\"1700755200000\",\n        \"premium\": \"0.0001233824646391\",\n        \"settFundingRate\":\"0.0001699799259033\",\n        \"settState\":\"settled\",\n        \"ts\":\"1700724675402\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"fundingRate\": \"0.00027815\",\n        //        \"fundingTime\": \"1634256000000\",\n        //        \"instId\": \"BTC-USD-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"nextFundingRate\": \"0.00017\",\n        //        \"nextFundingTime\": \"1634284800000\"\n        //    }\n        // ws\n        //     {\n        //        \"fundingRate\":\"0.0001875391284828\",\n        //        \"fundingTime\":\"1700726400000\",\n        //        \"instId\":\"BTC-USD-SWAP\",\n        //        \"instType\":\"SWAP\",\n        //        \"method\": \"next_period\",\n        //        \"maxFundingRate\":\"0.00375\",\n        //        \"minFundingRate\":\"-0.00375\",\n        //        \"nextFundingRate\":\"0.0002608059239328\",\n        //        \"nextFundingTime\":\"1700755200000\",\n        //        \"premium\": \"0.0001233824646391\",\n        //        \"settFundingRate\":\"0.0001699799259033\",\n        //        \"settState\":\"settled\",\n        //        \"ts\":\"1700724675402\"\n        //     }\n        //\n        // in the response above nextFundingRate is actually two funding rates from now\n        //\n        const nextFundingRateTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        const marketId = this.safeString (contract, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        const nextFundingRate = this.safeNumber (contract, 'nextFundingRate');\n        const fundingTime = this.safeInteger (contract, 'fundingTime');\n        const fundingTimeString = this.safeString (contract, 'fundingTime');\n        const nextFundingTimeString = this.safeString (contract, 'nextFundingTime');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        // https://www.okx.com/support/hc/en-us/articles/360053909272-Ⅸ-Introduction-to-perpetual-swap-funding-fee\n        // > The current interest is 0.\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': nextFundingRate,\n            'nextFundingTimestamp': nextFundingRateTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 8294,
        "line_end": 8342,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidVol')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askVol')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markVol')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"askVol\": \"0\",\n         \"bidVol\": \"0\",\n         \"delta\": \"0.5105464486882039\",\n         \"deltaBS\": \"0.7325502184143025\",\n         \"fwdPx\": \"37675.80158694987186\",\n         \"gamma\": \"-0.13183515090501083\",\n         \"gammaBS\": \"0.000024139685826358558\",\n         \"instId\": \"BTC-USD-240329-32000-C\",\n         \"instType\": \"OPTION\",\n         \"lever\": \"4.504428015946619\",\n         \"markVol\": \"0.5916253554539876\",\n         \"realVol\": \"0\",\n         \"theta\": \"-0.0004202992014012855\",\n         \"thetaBS\": \"-18.52354631567909\",\n         \"ts\": \"1699586421976\",\n         \"uly\": \"BTC-USD\",\n         \"vega\": \"0.0020207455080045846\",\n         \"vegaBS\": \"74.44022302387287\",\n         \"volLv\": \"0.5948549730405797\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"askVol\": \"0\",\n        //         \"bidVol\": \"0\",\n        //         \"delta\": \"0.5105464486882039\",\n        //         \"deltaBS\": \"0.7325502184143025\",\n        //         \"fwdPx\": \"37675.80158694987186\",\n        //         \"gamma\": \"-0.13183515090501083\",\n        //         \"gammaBS\": \"0.000024139685826358558\",\n        //         \"instId\": \"BTC-USD-240329-32000-C\",\n        //         \"instType\": \"OPTION\",\n        //         \"lever\": \"4.504428015946619\",\n        //         \"markVol\": \"0.5916253554539876\",\n        //         \"realVol\": \"0\",\n        //         \"theta\": \"-0.0004202992014012855\",\n        //         \"thetaBS\": \"-18.52354631567909\",\n        //         \"ts\": \"1699586421976\",\n        //         \"uly\": \"BTC-USD\",\n        //         \"vega\": \"0.0020207455080045846\",\n        //         \"vegaBS\": \"74.44022302387287\",\n        //         \"volLv\": \"0.5948549730405797\"\n        //     }\n        //\n        const timestamp = this.safeInteger (greeks, 'ts');\n        const marketId = this.safeString (greeks, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidVol'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askVol'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markVol'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseIds",
        "signature": "parseIds (ids)",
        "line_start": 3647,
        "line_end": 3660,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {string[]|string} ids order ids",
          "@returns {string[]} list of order ids"
        ],
        "source": "parseIds (ids) {\n        /**\n         * @ignore\n         * @method\n         * @name okx#parseIds\n         * @param {string[]|string} ids order ids\n         * @returns {string[]} list of order ids\n         */\n        if ((ids !== undefined) && typeof ids === 'string') {\n            return ids.split (',');\n        } else {\n            return ids;\n        }\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 5101,
        "line_end": 5169,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'billId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'ordId')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'balChg')",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'bal')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"bal\": \"0.0000819307998198\",\n         \"balChg\": \"-664.2679586599999802\",\n         \"billId\": \"310394313544966151\",\n         \"ccy\": \"USDT\",\n         \"fee\": \"0\",\n         \"from\": \"\",\n         \"instId\": \"LTC-USDT\",\n         \"instType\": \"SPOT\",\n         \"mgnMode\": \"cross\",\n         \"notes\": \"\",\n         \"ordId\": \"310394313519800320\",\n         \"pnl\": \"0\",\n         \"posBal\": \"0\",\n         \"posBalChg\": \"0\",\n         \"subType\": \"2\",\n         \"sz\": \"664.26795866\",\n         \"to\": \"\",\n         \"ts\": \"1620275771196\",\n         \"type\": \"2\"\n     }",
          "{\n         \"billId\": \"12344\",\n         \"ccy\": \"BTC\",\n         \"balChg\": \"2\",\n         \"bal\": \"12\",\n         \"type\": \"1\",\n         \"ts\": \"1597026383085\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // privateGetAccountBills, privateGetAccountBillsArchive\n        //\n        //     {\n        //         \"bal\": \"0.0000819307998198\",\n        //         \"balChg\": \"-664.2679586599999802\",\n        //         \"billId\": \"310394313544966151\",\n        //         \"ccy\": \"USDT\",\n        //         \"fee\": \"0\",\n        //         \"from\": \"\",\n        //         \"instId\": \"LTC-USDT\",\n        //         \"instType\": \"SPOT\",\n        //         \"mgnMode\": \"cross\",\n        //         \"notes\": \"\",\n        //         \"ordId\": \"310394313519800320\",\n        //         \"pnl\": \"0\",\n        //         \"posBal\": \"0\",\n        //         \"posBalChg\": \"0\",\n        //         \"subType\": \"2\",\n        //         \"sz\": \"664.26795866\",\n        //         \"to\": \"\",\n        //         \"ts\": \"1620275771196\",\n        //         \"type\": \"2\"\n        //     }\n        //\n        // privateGetAssetBills\n        //\n        //     {\n        //         \"billId\": \"12344\",\n        //         \"ccy\": \"BTC\",\n        //         \"balChg\": \"2\",\n        //         \"bal\": \"12\",\n        //         \"type\": \"1\",\n        //         \"ts\": \"1597026383085\"\n        //     }\n        //\n        const currencyId = this.safeString (item, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'ts');\n        const feeCostString = this.safeString (item, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n                'currency': code,\n            };\n        }\n        const marketId = this.safeString (item, 'instId');\n        const symbol = this.safeSymbol (marketId, undefined, '-');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'billId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'account': undefined,\n            'referenceId': this.safeString (item, 'ordId'),\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': code,\n            'symbol': symbol,\n            'amount': this.safeNumber (item, 'balChg'),\n            'before': undefined,\n            'after': this.safeNumber (item, 'bal'),\n            'status': 'ok',\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 5084,
        "line_end": 5099,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            '1': 'transfer', // transfer\n            '2': 'trade', // trade\n            '3': 'trade', // delivery\n            '4': 'rebate', // auto token conversion\n            '5': 'trade', // liquidation\n            '6': 'transfer', // margin transfer\n            '7': 'trade', // interest deduction\n            '8': 'fee', // funding rate\n            '9': 'trade', // adl\n            '10': 'trade', // clawback\n            '11': 'trade', // system token conversion\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 5825,
        "line_end": 5851,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        let marketId = undefined;\n        let marginMode = undefined;\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        for (let i = 0; i < leverage.length; i++) {\n            const entry = leverage[i];\n            marginMode = this.safeStringLower (entry, 'mgnMode');\n            marketId = this.safeString (entry, 'instId');\n            const positionSide = this.safeStringLower (entry, 'posSide');\n            if (positionSide === 'long') {\n                longLeverage = this.safeInteger (entry, 'lever');\n            } else if (positionSide === 'short') {\n                shortLeverage = this.safeInteger (entry, 'lever');\n            } else {\n                longLeverage = this.safeInteger (entry, 'lever');\n                shortLeverage = this.safeInteger (entry, 'lever');\n            }\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 9174,
        "line_end": 9188,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        const timestamp = this.safeInteger (info, 'timestamp');\n        let symbol = undefined;\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        return {\n            'info': info,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 7624,
        "line_end": 7646,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amt')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amt\": \"102\",\n         \"availLoan\": \"97\",\n         \"ccy\": \"USDT\",\n         \"loanQuota\": \"6000000\",\n         \"posLoan\": \"0\",\n         \"side\": \"repay\",\n         \"usedLoan\": \"97\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"amt\": \"102\",\n        //         \"availLoan\": \"97\",\n        //         \"ccy\": \"USDT\",\n        //         \"loanQuota\": \"6000000\",\n        //         \"posLoan\": \"0\",\n        //         \"side\": \"repay\",\n        //         \"usedLoan\": \"97\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'ccy');\n        return {\n            'id': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amt'),\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 7251,
        "line_end": 7324,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "responseMarket['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amt\": \"0.01\",\n        \"instId\": \"ETH-USD-SWAP\",\n        \"posSide\": \"net\",\n        \"type\": \"reduce\"\n    }",
          "{\n        bal: '67621.4325135010619812',\n        balChg: '-10.0000000000000000',\n        billId: '691293628710342659',\n        ccy: 'USDT',\n        clOrdId: '',\n        execType: '',\n        fee: '0',\n        fillFwdPx: '',\n        fillIdxPx: '',\n        fillMarkPx: '',\n        fillMarkVol: '',\n        fillPxUsd: '',\n        fillPxVol: '',\n        fillTime: '1711089244850',\n        from: '',\n        instId: 'XRP-USDT-SWAP',\n        instType: 'SWAP',\n        interest: '0',\n        mgnMode: 'isolated',\n        notes: '',\n        ordId: '',\n        pnl: '0',\n        posBal: '73.12',\n        posBalChg: '10.00',\n        px: '',\n        subType: '160',\n        sz: '10',\n        tag: '',\n        to: '',\n        tradeId: '0',\n        ts: '1711089244699',\n        type: '6'\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //    {\n        //        \"amt\": \"0.01\",\n        //        \"instId\": \"ETH-USD-SWAP\",\n        //        \"posSide\": \"net\",\n        //        \"type\": \"reduce\"\n        //    }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        bal: '67621.4325135010619812',\n        //        balChg: '-10.0000000000000000',\n        //        billId: '691293628710342659',\n        //        ccy: 'USDT',\n        //        clOrdId: '',\n        //        execType: '',\n        //        fee: '0',\n        //        fillFwdPx: '',\n        //        fillIdxPx: '',\n        //        fillMarkPx: '',\n        //        fillMarkVol: '',\n        //        fillPxUsd: '',\n        //        fillPxVol: '',\n        //        fillTime: '1711089244850',\n        //        from: '',\n        //        instId: 'XRP-USDT-SWAP',\n        //        instType: 'SWAP',\n        //        interest: '0',\n        //        mgnMode: 'isolated',\n        //        notes: '',\n        //        ordId: '',\n        //        pnl: '0',\n        //        posBal: '73.12',\n        //        posBalChg: '10.00',\n        //        px: '',\n        //        subType: '160',\n        //        sz: '10',\n        //        tag: '',\n        //        to: '',\n        //        tradeId: '0',\n        //        ts: '1711089244699',\n        //        type: '6'\n        //    }\n        //\n        const amountRaw = this.safeString2 (data, 'amt', 'posBalChg');\n        const typeRaw = this.safeString (data, 'type');\n        let type = undefined;\n        if (typeRaw === '6') {\n            type = Precise.stringGt (amountRaw, '0') ? 'add' : 'reduce';\n        } else {\n            type = typeRaw;\n        }\n        const amount = Precise.stringAbs (amountRaw);\n        const marketId = this.safeString (data, 'instId');\n        const responseMarket = this.safeMarket (marketId, market);\n        const code = responseMarket['inverse'] ? responseMarket['base'] : responseMarket['quote'];\n        const timestamp = this.safeInteger (data, 'ts');\n        return {\n            'info': data,\n            'symbol': responseMarket['symbol'],\n            'type': type,\n            'marginMode': 'isolated',\n            'amount': this.parseNumber (amount),\n            'code': code,\n            'total': undefined,\n            'status': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1669,
        "line_end": 1839,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "instIdCode",
            "value": "instIdCode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && (Precise.stringGt (maxLeverage, '1'))",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "status === 'live'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "contract ? (quoteId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "contract ? (baseId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contract ? this.safeNumber (market, 'ctVal') : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "this.parseNumber (strikePrice)",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "optionType",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger2 (market, 'contTdSwTime', 'listTime')",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSz')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"alias\": \"\", // this_week, next_week, quarter, next_quarter\n         \"baseCcy\": \"BTC\",\n         \"category\": \"1\",\n         \"ctMult\": \"\",\n         \"ctType\": \"\", // inverse, linear\n         \"ctVal\": \"\",\n         \"ctValCcy\": \"\",\n         \"expTime\": \"\",\n         \"instId\": \"BTC-USDT\", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C\n         \"instType\": \"SPOT\", // SPOT, FUTURES, SWAP, OPTION\n         \"lever\": \"10\",\n         \"listTime\": \"1548133413000\",\n         \"lotSz\": \"0.00000001\",\n         \"minSz\": \"0.00001\",\n         \"optType\": \"\",\n         \"quoteCcy\": \"USDT\",\n         \"settleCcy\": \"\",\n         \"state\": \"live\",\n         \"stk\": \"\",\n         \"tickSz\": \"0.1\",\n         \"uly\": \"\"\n     }",
          "{\n         \"alias\": \"\",\n         \"baseCcy\": \"\",\n         \"category\": \"1\",\n         \"ctMult\": \"0.1\",\n         \"ctType\": \"\",\n         \"ctVal\": \"1\",\n         \"ctValCcy\": \"BTC\",\n         \"expTime\": \"1648195200000\",\n         \"instId\": \"BTC-USD-220325-194000-P\",\n         \"instType\": \"OPTION\",\n         \"lever\": \"\",\n         \"listTime\": \"1631262612280\",\n         \"contTdSwTime\": \"1631262812280\",\n         \"lotSz\": \"1\",\n         \"minSz\": \"1\",\n         \"optType\": \"P\",\n         \"quoteCcy\": \"\",\n         \"settleCcy\": \"BTC\",\n         \"state\": \"live\",\n         \"stk\": \"194000\",\n         \"tickSz\": \"0.0005\",\n         \"uly\": \"BTC-USD\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"alias\": \"\", // this_week, next_week, quarter, next_quarter\n        //         \"baseCcy\": \"BTC\",\n        //         \"category\": \"1\",\n        //         \"ctMult\": \"\",\n        //         \"ctType\": \"\", // inverse, linear\n        //         \"ctVal\": \"\",\n        //         \"ctValCcy\": \"\",\n        //         \"expTime\": \"\",\n        //         \"instId\": \"BTC-USDT\", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C\n        //         \"instType\": \"SPOT\", // SPOT, FUTURES, SWAP, OPTION\n        //         \"lever\": \"10\",\n        //         \"listTime\": \"1548133413000\",\n        //         \"lotSz\": \"0.00000001\",\n        //         \"minSz\": \"0.00001\",\n        //         \"optType\": \"\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"settleCcy\": \"\",\n        //         \"state\": \"live\",\n        //         \"stk\": \"\",\n        //         \"tickSz\": \"0.1\",\n        //         \"uly\": \"\"\n        //     }\n        //\n        //     {\n        //         \"alias\": \"\",\n        //         \"baseCcy\": \"\",\n        //         \"category\": \"1\",\n        //         \"ctMult\": \"0.1\",\n        //         \"ctType\": \"\",\n        //         \"ctVal\": \"1\",\n        //         \"ctValCcy\": \"BTC\",\n        //         \"expTime\": \"1648195200000\",\n        //         \"instId\": \"BTC-USD-220325-194000-P\",\n        //         \"instType\": \"OPTION\",\n        //         \"lever\": \"\",\n        //         \"listTime\": \"1631262612280\",\n        //         \"contTdSwTime\": \"1631262812280\",\n        //         \"lotSz\": \"1\",\n        //         \"minSz\": \"1\",\n        //         \"optType\": \"P\",\n        //         \"quoteCcy\": \"\",\n        //         \"settleCcy\": \"BTC\",\n        //         \"state\": \"live\",\n        //         \"stk\": \"194000\",\n        //         \"tickSz\": \"0.0005\",\n        //         \"uly\": \"BTC-USD\"\n        //     }\n        //\n        // for swap \"preopen\" markets, only `instId` and `instType` are present\n        //\n        //         instId: \"ETH-USD_UM-SWAP\",\n        //         instType: \"SWAP\",\n        //         state: \"preopen\",\n        //\n        const id = this.safeString (market, 'instId');\n        let type = this.safeStringLower (market, 'instType');\n        if (type === 'futures') {\n            type = 'future';\n        }\n        const spot = (type === 'spot');\n        const future = (type === 'future');\n        const swap = (type === 'swap');\n        const option = (type === 'option');\n        const contract = swap || future || option;\n        let baseId = this.safeString (market, 'baseCcy', ''); // defaulting to '' because some weird preopen markets have empty baseId\n        let quoteId = this.safeString (market, 'quoteCcy', '');\n        const settleId = this.safeString (market, 'settleCcy');\n        const settle = this.safeCurrencyCode (settleId);\n        const underlying = this.safeString (market, 'uly');\n        if ((underlying !== undefined) && !spot) {\n            const parts = underlying.split ('-');\n            baseId = this.safeString (parts, 0);\n            quoteId = this.safeString (parts, 1);\n        }\n        if (((baseId === '') || (quoteId === '')) && spot) { // to fix weird preopen markets\n            const instId = this.safeString (market, 'instId', '');\n            const parts = instId.split ('-');\n            baseId = this.safeString (parts, 0);\n            quoteId = this.safeString (parts, 1);\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        // handle preopen empty markets\n        if (base === '' || quote === '') {\n            symbol = id;\n        }\n        let expiry = undefined;\n        let strikePrice = undefined;\n        let optionType = undefined;\n        if (contract) {\n            if (settle !== undefined) {\n                symbol = symbol + ':' + settle;\n            }\n            if (future) {\n                expiry = this.safeInteger (market, 'expTime');\n                if (expiry !== undefined) {\n                    const ymd = this.yymmdd (expiry);\n                    symbol = symbol + '-' + ymd;\n                }\n            } else if (option) {\n                expiry = this.safeInteger (market, 'expTime');\n                strikePrice = this.safeString (market, 'stk');\n                optionType = this.safeString (market, 'optType');\n                if (expiry !== undefined) {\n                    const ymd = this.yymmdd (expiry);\n                    symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;\n                    optionType = (optionType === 'P') ? 'put' : 'call';\n                }\n            }\n        }\n        const fees = this.safeDict2 (this.fees, type, 'trading', {});\n        let maxLeverage = this.safeString (market, 'lever', '1');\n        maxLeverage = Precise.stringMax (maxLeverage, '1');\n        const maxSpotCost = this.safeNumber (market, 'maxMktSz');\n        const status = this.safeString (market, 'state');\n        const instIdCode = this.safeInteger (market, 'instIdCode');\n        return this.extend (fees, {\n            'id': id,\n            'instIdCode': instIdCode,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': spot && (Precise.stringGt (maxLeverage, '1')),\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': status === 'live',\n            'contract': contract,\n            'linear': contract ? (quoteId === settleId) : undefined,\n            'inverse': contract ? (baseId === settleId) : undefined,\n            'contractSize': contract ? this.safeNumber (market, 'ctVal') : undefined,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': this.parseNumber (strikePrice),\n            'optionType': optionType,\n            'created': this.safeInteger2 (market, 'contTdSwTime', 'listTime'), // contTdSwTime is public trading start time, while listTime considers pre-trading too\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tickSz'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                },\n            },\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 7413,
        "line_end": 7454,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (tier, 'tier')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (tier, 'minSz')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'maxSz')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'mmr')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'maxLever')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "[\n        {\n            \"baseMaxLoan\": \"500\",\n            \"imr\": \"0.1\",\n            \"instId\": \"ETH-USDT\",\n            \"maxLever\": \"10\",\n            \"maxSz\": \"500\",\n            \"minSz\": \"0\",\n            \"mmr\": \"0.03\",\n            \"optMgnFactor\": \"0\",\n            \"quoteMaxLoan\": \"200000\",\n            \"tier\": \"1\",\n            \"uly\": \"\"\n        },\n        ...\n    ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    [\n        //        {\n        //            \"baseMaxLoan\": \"500\",\n        //            \"imr\": \"0.1\",\n        //            \"instId\": \"ETH-USDT\",\n        //            \"maxLever\": \"10\",\n        //            \"maxSz\": \"500\",\n        //            \"minSz\": \"0\",\n        //            \"mmr\": \"0.03\",\n        //            \"optMgnFactor\": \"0\",\n        //            \"quoteMaxLoan\": \"200000\",\n        //            \"tier\": \"1\",\n        //            \"uly\": \"\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const tier = info[i];\n            const marketId = this.safeString (tier, 'instId');\n            tiers.push ({\n                'tier': this.safeInteger (tier, 'tier'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber (tier, 'minSz'),\n                'maxNotional': this.safeNumber (tier, 'maxSz'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'mmr'),\n                'maxLeverage': this.safeNumber (tier, 'maxLever'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2507,
        "line_end": 2532,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1678928760000\", // timestamp\n         \"24341.4\", // open\n         \"24344\", // high\n         \"24313.2\", // low\n         \"24323\", // close\n         \"628\", // contract volume\n         \"2.5819\", // base volume\n         \"62800\", // quote volume\n         \"0\" // candlestick state\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1678928760000\", // timestamp\n        //         \"24341.4\", // open\n        //         \"24344\", // high\n        //         \"24313.2\", // low\n        //         \"24323\", // close\n        //         \"628\", // contract volume\n        //         \"2.5819\", // base volume\n        //         \"62800\", // quote volume\n        //         \"0\" // candlestick state\n        //     ]\n        //\n        const res = this.handleMarketTypeAndParams ('fetchOHLCV', market, undefined);\n        const type = res[0];\n        const volumeIndex = (type === 'spot') ? 5 : 6;\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, volumeIndex),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 7819,
        "line_end": 7872,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openInterestValue",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "[\n        \"1648221300000\",  // timestamp\n        \"2183354317.945\",  // open interest (USD) - (coin) for options\n        \"74285877.617\",  // volume (USD) - (coin) for options\n    ]",
          "{\n         \"instId\": \"BTC-USD-230520-25500-P\",\n         \"instType\": \"OPTION\",\n         \"oi\": \"300\",\n         \"oiCcy\": \"3\",\n         \"oiUsd\": \"3\",\n         \"ts\": \"1684551166251\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterestHistory\n        //\n        //    [\n        //        \"1648221300000\",  // timestamp\n        //        \"2183354317.945\",  // open interest (USD) - (coin) for options\n        //        \"74285877.617\",  // volume (USD) - (coin) for options\n        //    ]\n        //\n        // fetchOpenInterest\n        //\n        //     {\n        //         \"instId\": \"BTC-USD-230520-25500-P\",\n        //         \"instType\": \"OPTION\",\n        //         \"oi\": \"300\",\n        //         \"oiCcy\": \"3\",\n        //         \"oiUsd\": \"3\",\n        //         \"ts\": \"1684551166251\"\n        //     }\n        //\n        const id = this.safeString (interest, 'instId');\n        market = this.safeMarket (id, market);\n        const time = this.safeInteger (interest, 'ts');\n        const timestamp = this.safeInteger (interest, 0, time);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        let openInterestAmount = undefined;\n        let openInterestValue = undefined;\n        const type = this.safeString (this.options, 'defaultType');\n        if (Array.isArray (interest)) {\n            if (type === 'option') {\n                openInterestAmount = this.safeNumber (interest, 1);\n                baseVolume = this.safeNumber (interest, 2);\n            } else {\n                openInterestValue = this.safeNumber (interest, 1);\n                quoteVolume = this.safeNumber (interest, 2);\n            }\n        } else {\n            baseVolume = this.safeNumber (interest, 'oiCcy');\n            openInterestAmount = this.safeNumber (interest, 'oi');\n            openInterestValue = this.safeNumber (interest, 'oiUsd');\n        }\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id),\n            'baseVolume': baseVolume,  // deprecated\n            'quoteVolume': quoteVolume,  // deprecated\n            'openInterestAmount': openInterestAmount,\n            'openInterestValue': openInterestValue,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 8506,
        "line_end": 8549,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPx')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPx')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'last')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volCcy24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"OPTION\",\n         \"instId\": \"BTC-USD-241227-60000-P\",\n         \"last\": \"\",\n         \"lastSz\": \"0\",\n         \"askPx\": \"\",\n         \"askSz\": \"0\",\n         \"bidPx\": \"\",\n         \"bidSz\": \"0\",\n         \"open24h\": \"\",\n         \"high24h\": \"\",\n         \"low24h\": \"\",\n         \"volCcy24h\": \"0\",\n         \"vol24h\": \"0\",\n         \"ts\": \"1711176035035\",\n         \"sodUtc0\": \"\",\n         \"sodUtc8\": \"\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"instType\": \"OPTION\",\n        //         \"instId\": \"BTC-USD-241227-60000-P\",\n        //         \"last\": \"\",\n        //         \"lastSz\": \"0\",\n        //         \"askPx\": \"\",\n        //         \"askSz\": \"0\",\n        //         \"bidPx\": \"\",\n        //         \"bidSz\": \"0\",\n        //         \"open24h\": \"\",\n        //         \"high24h\": \"\",\n        //         \"low24h\": \"\",\n        //         \"volCcy24h\": \"0\",\n        //         \"vol24h\": \"0\",\n        //         \"ts\": \"1711176035035\",\n        //         \"sodUtc0\": \"\",\n        //         \"sodUtc8\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'instId');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (chain, 'ts');\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPx'),\n            'askPrice': this.safeNumber (chain, 'askPx'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'last'),\n            'underlyingPrice': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'baseVolume': this.safeNumber (chain, 'volCcy24h'),\n            'quoteVolume': undefined,\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3897,
        "line_end": 4178,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'ordId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clOrdId')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumberN (order, [ 'triggerPx', 'moveTriggerPx' ])",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostSigned)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clOrdId\": \"oktswap6\",\n         \"ordId\": \"312269865356374016\",\n         \"tag\": \"\",\n         \"sCode\": \"0\",\n         \"sMsg\": \"\"\n     }",
          "{\n         \"clOrdId\": \"e847386590ce4dBCc1a045253497a547\",\n         \"ordId\": \"559176536793178112\",\n         \"reqId\": \"\",\n         \"sCode\": \"0\",\n         \"sMsg\": \"\"\n     }",
          "{\n         \"accFillSz\": \"0\",\n         \"avgPx\": \"\",\n         \"cTime\": \"1621910749815\",\n         \"category\": \"normal\",\n         \"ccy\": \"\",\n         \"clOrdId\": \"\",\n         \"fee\": \"0\",\n         \"feeCcy\": \"ETH\",\n         \"fillPx\": \"\",\n         \"fillSz\": \"0\",\n         \"fillTime\": \"\",\n         \"instId\": \"ETH-USDT\",\n         \"instType\": \"SPOT\",\n         \"lever\": \"\",\n         \"ordId\": \"317251910906576896\",\n         \"ordType\": \"limit\",\n         \"pnl\": \"0\",\n         \"posSide\": \"net\",\n         \"px\": \"2000\",\n         \"rebate\": \"0\",\n         \"rebateCcy\": \"USDT\",\n         \"side\": \"buy\",\n         \"slOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"state\": \"live\",\n         \"sz\": \"0.001\",\n         \"tag\": \"\",\n         \"tdMode\": \"cash\",\n         \"tpOrdPx\": \"\",\n         \"tpTriggerPx\": \"\",\n         \"tradeId\": \"\",\n         \"uTime\": \"1621910749815\"\n     }",
          "{\n        \"algoClOrdId\": \"\",\n        \"algoId\": \"\",\n        \"attachAlgoClOrdId\": \"\",\n        \"attachAlgoOrds\": [],\n        \"cancelSource\": \"\",\n        \"cancelSourceReason\": \"\", // not present in WS, but present in fetchClosedOrders\n        \"category\": \"normal\",\n        \"ccy\": \"\", // empty in WS, but eg. `USDT` in fetchClosedOrders\n        \"clOrdId\": \"\",\n        \"cTime\": \"1751705801423\",\n        \"feeCcy\": \"USDT\",\n        \"instId\": \"LINK-USDT-SWAP\",\n        \"instType\": \"SWAP\",\n        \"isTpLimit\": \"false\",\n        \"lever\": \"3\",\n        \"linkedAlgoOrd\": { \"algoId\": \"\" },\n        \"ordId\": \"2657625147249614848\",\n        \"ordType\": \"limit\",\n        \"posSide\": \"net\",\n        \"px\": \"13.142\",\n        \"pxType\": \"\",\n        \"pxUsd\": \"\",\n        \"pxVol\": \"\",\n        \"quickMgnType\": \"\",\n        \"rebate\": \"0\",\n        \"rebateCcy\": \"USDT\",\n        \"reduceOnly\": \"true\",\n        \"side\": \"sell\",\n        \"slOrdPx\": \"\",\n        \"slTriggerPx\": \"\",\n        \"slTriggerPxType\": \"\",\n        \"source\": \"\",\n        \"stpId\": \"\",\n        \"stpMode\": \"cancel_maker\",\n        \"sz\": \"0.1\",\n        \"tag\": \"\",\n        \"tdMode\": \"isolated\",\n        \"tgtCcy\": \"\",\n        \"tpOrdPx\": \"\",\n        \"tpTriggerPx\": \"\",\n        \"tpTriggerPxType\": \"\",\n        \"uTime\": \"1751705807467\",\n        \"reqId\": \"\",                      // field present only in WS\n        \"msg\": \"\",                        // field present only in WS\n        \"amendResult\": \"\",                // field present only in WS\n        \"amendSource\": \"\",                // field present only in WS\n        \"code\": \"0\",                      // field present only in WS\n        \"fillFwdPx\": \"\",                  // field present only in WS\n        \"fillMarkVol\": \"\",                // field present only in WS\n        \"fillPxUsd\": \"\",                  // field present only in WS\n        \"fillPxVol\": \"\",                  // field present only in WS\n        \"lastPx\": \"13.142\",               // field present only in WS\n        \"notionalUsd\": \"1.314515408\",     // field present only in WS\n\n     #### these below fields are empty on first omit from websocket, because of \"creation\" event. however, if order is executed, it also immediately sends another update with these fields filled  ###\n\n        \"pnl\": \"-0.0001\",\n        \"accFillSz\": \"0.1\",\n        \"avgPx\": \"13.142\",\n        \"state\": \"filled\",\n        \"fee\": \"-0.00026284\",\n        \"fillPx\": \"13.142\",\n        \"tradeId\": \"293429690\",\n        \"fillSz\": \"0.1\",\n        \"fillTime\": \"1751705807467\",\n        \"fillNotionalUsd\": \"1.314515408\", // field present only in WS\n        \"fillPnl\": \"-0.0001\",             // field present only in WS\n        \"fillFee\": \"-0.00026284\",         // field present only in WS\n        \"fillFeeCcy\": \"USDT\",             // field present only in WS\n        \"execType\": \"M\",                  // field present only in WS\n        \"fillMarkPx\": \"13.141\",           // field present only in WS\n        \"fillIdxPx\": \"13.147\"             // field present only in WS\n    }",
          "{\n         \"activePx\": \"\",\n         \"activePxType\": \"\",\n         \"actualPx\": \"\",\n         \"actualSide\": \"buy\",\n         \"actualSz\": \"0\",\n         \"algoId\": \"431375349042380800\",\n         \"cTime\": \"1649119897778\",\n         \"callbackRatio\": \"\",\n         \"callbackSpread\": \"\",\n         \"ccy\": \"\",\n         \"ctVal\": \"0.01\",\n         \"instId\": \"BTC-USDT-SWAP\",\n         \"instType\": \"SWAP\",\n         \"last\": \"46538.9\",\n         \"lever\": \"125\",\n         \"moveTriggerPx\": \"\",\n         \"notionalUsd\": \"467.059\",\n         \"ordId\": \"\",\n         \"ordPx\": \"50000\",\n         \"ordType\": \"trigger\",\n         \"posSide\": \"long\",\n         \"pxLimit\": \"\",\n         \"pxSpread\": \"\",\n         \"pxVar\": \"\",\n         \"side\": \"buy\",\n         \"slOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"slTriggerPxType\": \"\",\n         \"state\": \"live\",\n         \"sz\": \"1\",\n         \"szLimit\": \"\",\n         \"tag\": \"\",\n         \"tdMode\": \"isolated\",\n         \"tgtCcy\": \"\",\n         \"timeInterval\": \"\",\n         \"tpOrdPx\": \"\",\n         \"tpTriggerPx\": \"\",\n         \"tpTriggerPxType\": \"\",\n         \"triggerPx\": \"50000\",\n         \"triggerPxType\": \"last\",\n         \"triggerTime\": \"\",\n         \"uly\": \"BTC-USDT\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"clOrdId\": \"oktswap6\",\n        //         \"ordId\": \"312269865356374016\",\n        //         \"tag\": \"\",\n        //         \"sCode\": \"0\",\n        //         \"sMsg\": \"\"\n        //     }\n        //\n        // editOrder\n        //\n        //     {\n        //         \"clOrdId\": \"e847386590ce4dBCc1a045253497a547\",\n        //         \"ordId\": \"559176536793178112\",\n        //         \"reqId\": \"\",\n        //         \"sCode\": \"0\",\n        //         \"sMsg\": \"\"\n        //     }\n        //\n        // Spot and Swap fetchOrder, fetchOpenOrders\n        //\n        //     {\n        //         \"accFillSz\": \"0\",\n        //         \"avgPx\": \"\",\n        //         \"cTime\": \"1621910749815\",\n        //         \"category\": \"normal\",\n        //         \"ccy\": \"\",\n        //         \"clOrdId\": \"\",\n        //         \"fee\": \"0\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"fillPx\": \"\",\n        //         \"fillSz\": \"0\",\n        //         \"fillTime\": \"\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"instType\": \"SPOT\",\n        //         \"lever\": \"\",\n        //         \"ordId\": \"317251910906576896\",\n        //         \"ordType\": \"limit\",\n        //         \"pnl\": \"0\",\n        //         \"posSide\": \"net\",\n        //         \"px\": \"2000\",\n        //         \"rebate\": \"0\",\n        //         \"rebateCcy\": \"USDT\",\n        //         \"side\": \"buy\",\n        //         \"slOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"state\": \"live\",\n        //         \"sz\": \"0.001\",\n        //         \"tag\": \"\",\n        //         \"tdMode\": \"cash\",\n        //         \"tpOrdPx\": \"\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tradeId\": \"\",\n        //         \"uTime\": \"1621910749815\"\n        //     }\n        //\n        // watchOrders & fetchClosedOrders\n        //\n        //    {\n        //        \"algoClOrdId\": \"\",\n        //        \"algoId\": \"\",\n        //        \"attachAlgoClOrdId\": \"\",\n        //        \"attachAlgoOrds\": [],\n        //        \"cancelSource\": \"\",\n        //        \"cancelSourceReason\": \"\", // not present in WS, but present in fetchClosedOrders\n        //        \"category\": \"normal\",\n        //        \"ccy\": \"\", // empty in WS, but eg. `USDT` in fetchClosedOrders\n        //        \"clOrdId\": \"\",\n        //        \"cTime\": \"1751705801423\",\n        //        \"feeCcy\": \"USDT\",\n        //        \"instId\": \"LINK-USDT-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"isTpLimit\": \"false\",\n        //        \"lever\": \"3\",\n        //        \"linkedAlgoOrd\": { \"algoId\": \"\" },\n        //        \"ordId\": \"2657625147249614848\",\n        //        \"ordType\": \"limit\",\n        //        \"posSide\": \"net\",\n        //        \"px\": \"13.142\",\n        //        \"pxType\": \"\",\n        //        \"pxUsd\": \"\",\n        //        \"pxVol\": \"\",\n        //        \"quickMgnType\": \"\",\n        //        \"rebate\": \"0\",\n        //        \"rebateCcy\": \"USDT\",\n        //        \"reduceOnly\": \"true\",\n        //        \"side\": \"sell\",\n        //        \"slOrdPx\": \"\",\n        //        \"slTriggerPx\": \"\",\n        //        \"slTriggerPxType\": \"\",\n        //        \"source\": \"\",\n        //        \"stpId\": \"\",\n        //        \"stpMode\": \"cancel_maker\",\n        //        \"sz\": \"0.1\",\n        //        \"tag\": \"\",\n        //        \"tdMode\": \"isolated\",\n        //        \"tgtCcy\": \"\",\n        //        \"tpOrdPx\": \"\",\n        //        \"tpTriggerPx\": \"\",\n        //        \"tpTriggerPxType\": \"\",\n        //        \"uTime\": \"1751705807467\",\n        //        \"reqId\": \"\",                      // field present only in WS\n        //        \"msg\": \"\",                        // field present only in WS\n        //        \"amendResult\": \"\",                // field present only in WS\n        //        \"amendSource\": \"\",                // field present only in WS\n        //        \"code\": \"0\",                      // field present only in WS\n        //        \"fillFwdPx\": \"\",                  // field present only in WS\n        //        \"fillMarkVol\": \"\",                // field present only in WS\n        //        \"fillPxUsd\": \"\",                  // field present only in WS\n        //        \"fillPxVol\": \"\",                  // field present only in WS\n        //        \"lastPx\": \"13.142\",               // field present only in WS\n        //        \"notionalUsd\": \"1.314515408\",     // field present only in WS\n        //\n        //     #### these below fields are empty on first omit from websocket, because of \"creation\" event. however, if order is executed, it also immediately sends another update with these fields filled  ###\n        //\n        //        \"pnl\": \"-0.0001\",\n        //        \"accFillSz\": \"0.1\",\n        //        \"avgPx\": \"13.142\",\n        //        \"state\": \"filled\",\n        //        \"fee\": \"-0.00026284\",\n        //        \"fillPx\": \"13.142\",\n        //        \"tradeId\": \"293429690\",\n        //        \"fillSz\": \"0.1\",\n        //        \"fillTime\": \"1751705807467\",\n        //        \"fillNotionalUsd\": \"1.314515408\", // field present only in WS\n        //        \"fillPnl\": \"-0.0001\",             // field present only in WS\n        //        \"fillFee\": \"-0.00026284\",         // field present only in WS\n        //        \"fillFeeCcy\": \"USDT\",             // field present only in WS\n        //        \"execType\": \"M\",                  // field present only in WS\n        //        \"fillMarkPx\": \"13.141\",           // field present only in WS\n        //        \"fillIdxPx\": \"13.147\"             // field present only in WS\n        //    }\n        //\n        //\n        // Algo Order fetchOpenOrders, fetchCanceledOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"activePx\": \"\",\n        //         \"activePxType\": \"\",\n        //         \"actualPx\": \"\",\n        //         \"actualSide\": \"buy\",\n        //         \"actualSz\": \"0\",\n        //         \"algoId\": \"431375349042380800\",\n        //         \"cTime\": \"1649119897778\",\n        //         \"callbackRatio\": \"\",\n        //         \"callbackSpread\": \"\",\n        //         \"ccy\": \"\",\n        //         \"ctVal\": \"0.01\",\n        //         \"instId\": \"BTC-USDT-SWAP\",\n        //         \"instType\": \"SWAP\",\n        //         \"last\": \"46538.9\",\n        //         \"lever\": \"125\",\n        //         \"moveTriggerPx\": \"\",\n        //         \"notionalUsd\": \"467.059\",\n        //         \"ordId\": \"\",\n        //         \"ordPx\": \"50000\",\n        //         \"ordType\": \"trigger\",\n        //         \"posSide\": \"long\",\n        //         \"pxLimit\": \"\",\n        //         \"pxSpread\": \"\",\n        //         \"pxVar\": \"\",\n        //         \"side\": \"buy\",\n        //         \"slOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"slTriggerPxType\": \"\",\n        //         \"state\": \"live\",\n        //         \"sz\": \"1\",\n        //         \"szLimit\": \"\",\n        //         \"tag\": \"\",\n        //         \"tdMode\": \"isolated\",\n        //         \"tgtCcy\": \"\",\n        //         \"timeInterval\": \"\",\n        //         \"tpOrdPx\": \"\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tpTriggerPxType\": \"\",\n        //         \"triggerPx\": \"50000\",\n        //         \"triggerPxType\": \"last\",\n        //         \"triggerTime\": \"\",\n        //         \"uly\": \"BTC-USDT\"\n        //     }\n        //\n        const scode = this.safeString (order, 'sCode');\n        if ((scode !== undefined) && (scode !== '0')) {\n            return this.safeOrder ({\n                'id': this.safeString (order, 'ordId'),\n                'clientOrderId': this.safeString (order, 'clOrdId'),\n                'status': 'rejected',\n                'info': order,\n            });\n        }\n        const id = this.safeString2 (order, 'algoId', 'ordId');\n        const timestamp = this.safeInteger (order, 'cTime');\n        const lastUpdateTimestamp = this.safeInteger (order, 'uTime');\n        const lastTradeTimestamp = this.safeInteger (order, 'fillTime');\n        const side = this.safeString (order, 'side');\n        let type = this.safeString (order, 'ordType');\n        let postOnly = undefined;\n        let timeInForce = undefined;\n        if (type === 'post_only') {\n            postOnly = true;\n            type = 'limit';\n        } else if (type === 'fok') {\n            timeInForce = 'FOK';\n            type = 'limit';\n        } else if (type === 'ioc') {\n            timeInForce = 'IOC';\n            type = 'limit';\n        }\n        const marketId = this.safeString (order, 'instId');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const filled = this.safeString (order, 'accFillSz');\n        const price = this.safeString2 (order, 'px', 'ordPx');\n        const average = this.safeString (order, 'avgPx');\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const feeCostString = this.safeString (order, 'fee');\n        let amount = undefined;\n        let cost = undefined;\n        // spot market buy: \"sz\" can refer either to base currency units or to quote currency units\n        // see documentation: https://www.okx.com/docs-v5/en/#rest-api-trade-place-order\n        const defaultTgtCcy = this.safeString (this.options, 'tgtCcy', 'base_ccy');\n        const tgtCcy = this.safeString (order, 'tgtCcy', defaultTgtCcy);\n        const instType = this.safeString (order, 'instType');\n        if ((side === 'buy') && (type === 'market') && (instType === 'SPOT') && (tgtCcy === 'quote_ccy')) {\n            // \"sz\" refers to the cost\n            cost = this.safeString (order, 'sz');\n        } else {\n            // \"sz\" refers to the trade currency amount\n            amount = this.safeString (order, 'sz');\n        }\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (order, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': this.parseNumber (feeCostSigned),\n                'currency': feeCurrencyCode,\n            };\n        }\n        let clientOrderId = this.safeString (order, 'clOrdId');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined; // fix empty clientOrderId string\n        }\n        const stopLossPrice = this.safeNumber2 (order, 'slTriggerPx', 'slOrdPx');\n        const takeProfitPrice = this.safeNumber2 (order, 'tpTriggerPx', 'tpOrdPx');\n        const reduceOnlyRaw = this.safeString (order, 'reduceOnly');\n        let reduceOnly = false;\n        if (reduceOnly !== undefined) {\n            reduceOnly = (reduceOnlyRaw === 'true');\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'stopLossPrice': stopLossPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'triggerPrice': this.safeNumberN (order, [ 'triggerPx', 'moveTriggerPx' ]),\n            'average': average,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'reduceOnly': reduceOnly,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3885,
        "line_end": 3895,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'canceled': 'canceled',\n            'order_failed': 'canceled',\n            'live': 'open',\n            'partially_filled': 'open',\n            'filled': 'closed',\n            'effective': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 6036,
        "line_end": 6203,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'posId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPriceString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealizedPnlString)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realizedPnl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPriceString)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (position, 'closeAvgPx')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'uTime')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateralString)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentage)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"adl\": \"3\",\n        \"availPos\": \"1\",\n        \"avgPx\": \"34131.1\",\n        \"cTime\": \"1627227626502\",\n        \"ccy\": \"USDT\",\n        \"deltaBS\": \"\",\n        \"deltaPA\": \"\",\n        \"gammaBS\": \"\",\n        \"gammaPA\": \"\",\n        \"imr\": \"170.66093041794787\",\n        \"instId\": \"BTC-USDT-SWAP\",\n        \"instType\": \"SWAP\",\n        \"interest\": \"0\",\n        \"last\": \"34134.4\",\n        \"lever\": \"2\",\n        \"liab\": \"\",\n        \"liabCcy\": \"\",\n        \"liqPx\": \"12608.959083877446\",\n        \"markPx\": \"4786.459271773621\",\n        \"margin\": \"\",\n        \"mgnMode\": \"cross\",\n        \"mgnRatio\": \"140.49930117599155\",\n        \"mmr\": \"1.3652874433435829\",\n        \"notionalUsd\": \"341.5130010779638\",\n        \"optVal\": \"\",\n        \"pos\": \"1\",\n        \"posCcy\": \"\",\n        \"posId\": \"339552508062380036\",\n        \"posSide\": \"long\",\n        \"thetaBS\": \"\",\n        \"thetaPA\": \"\",\n        \"tradeId\": \"98617799\",\n        \"uTime\": \"1627227626502\",\n        \"upl\": \"0.0108608358957281\",\n        \"uplRatio\": \"0.0000636418743944\",\n        \"vegaBS\": \"\",\n        \"vegaPA\": \"\"\n    }",
          "{\n        \"cTime\":\"1708351230102\",\n        \"ccy\":\"USDT\",\n        \"closeAvgPx\":\"1.2567\",\n        \"closeTotalPos\":\"40\",\n        \"direction\":\"short\",\n        \"fee\":\"-0.0351036\",\n        \"fundingFee\":\"0\",\n        \"instId\":\"SUSHI-USDT-SWAP\",\n        \"instType\":\"SWAP\",\n        \"lever\":\"10.0\",\n        \"liqPenalty\":\"0\",\n        \"mgnMode\":\"isolated\",\n        \"openAvgPx\":\"1.2462\",\n        \"openMaxPos\":\"40\",\n        \"pnl\":\"-0.42\",\n        \"pnlRatio\":\"-0.0912982667308618\",\n        \"posId\":\"666159086676836352\",\n        \"realizedPnl\":\"-0.4551036\",\n        \"triggerPx\":\"\",\n        \"type\":\"2\",\n        \"uTime\":\"1708354805699\",\n        \"uly\":\"SUSHI-USDT\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //        \"adl\": \"3\",\n        //        \"availPos\": \"1\",\n        //        \"avgPx\": \"34131.1\",\n        //        \"cTime\": \"1627227626502\",\n        //        \"ccy\": \"USDT\",\n        //        \"deltaBS\": \"\",\n        //        \"deltaPA\": \"\",\n        //        \"gammaBS\": \"\",\n        //        \"gammaPA\": \"\",\n        //        \"imr\": \"170.66093041794787\",\n        //        \"instId\": \"BTC-USDT-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"interest\": \"0\",\n        //        \"last\": \"34134.4\",\n        //        \"lever\": \"2\",\n        //        \"liab\": \"\",\n        //        \"liabCcy\": \"\",\n        //        \"liqPx\": \"12608.959083877446\",\n        //        \"markPx\": \"4786.459271773621\",\n        //        \"margin\": \"\",\n        //        \"mgnMode\": \"cross\",\n        //        \"mgnRatio\": \"140.49930117599155\",\n        //        \"mmr\": \"1.3652874433435829\",\n        //        \"notionalUsd\": \"341.5130010779638\",\n        //        \"optVal\": \"\",\n        //        \"pos\": \"1\",\n        //        \"posCcy\": \"\",\n        //        \"posId\": \"339552508062380036\",\n        //        \"posSide\": \"long\",\n        //        \"thetaBS\": \"\",\n        //        \"thetaPA\": \"\",\n        //        \"tradeId\": \"98617799\",\n        //        \"uTime\": \"1627227626502\",\n        //        \"upl\": \"0.0108608358957281\",\n        //        \"uplRatio\": \"0.0000636418743944\",\n        //        \"vegaBS\": \"\",\n        //        \"vegaPA\": \"\"\n        //    }\n        // history\n        //    {\n        //        \"cTime\":\"1708351230102\",\n        //        \"ccy\":\"USDT\",\n        //        \"closeAvgPx\":\"1.2567\",\n        //        \"closeTotalPos\":\"40\",\n        //        \"direction\":\"short\",\n        //        \"fee\":\"-0.0351036\",\n        //        \"fundingFee\":\"0\",\n        //        \"instId\":\"SUSHI-USDT-SWAP\",\n        //        \"instType\":\"SWAP\",\n        //        \"lever\":\"10.0\",\n        //        \"liqPenalty\":\"0\",\n        //        \"mgnMode\":\"isolated\",\n        //        \"openAvgPx\":\"1.2462\",\n        //        \"openMaxPos\":\"40\",\n        //        \"pnl\":\"-0.42\",\n        //        \"pnlRatio\":\"-0.0912982667308618\",\n        //        \"posId\":\"666159086676836352\",\n        //        \"realizedPnl\":\"-0.4551036\",\n        //        \"triggerPx\":\"\",\n        //        \"type\":\"2\",\n        //        \"uTime\":\"1708354805699\",\n        //        \"uly\":\"SUSHI-USDT\"\n        //    }\n        //\n        const marketId = this.safeString (position, 'instId');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = market['symbol'];\n        const pos = this.safeString (position, 'pos'); // 'pos' field: One way mode: 0 if position is not open, 1 if open | Two way (hedge) mode: -1 if short, 1 if long, 0 if position is not open\n        const contractsAbs = Precise.stringAbs (pos);\n        let side = this.safeString2 (position, 'posSide', 'direction');\n        const hedged = side !== 'net';\n        const contracts = this.parseNumber (contractsAbs);\n        if (market['margin']) {\n            // margin position\n            if (side === 'net') {\n                const posCcy = this.safeString (position, 'posCcy');\n                const parsedCurrency = this.safeCurrencyCode (posCcy);\n                if (parsedCurrency !== undefined) {\n                    side = (market['base'] === parsedCurrency) ? 'long' : 'short';\n                }\n            }\n            if (side === undefined) {\n                side = this.safeString (position, 'direction');\n            }\n        } else {\n            if (pos !== undefined) {\n                if (side === 'net') {\n                    if (Precise.stringGt (pos, '0')) {\n                        side = 'long';\n                    } else if (Precise.stringLt (pos, '0')) {\n                        side = 'short';\n                    } else {\n                        side = undefined;\n                    }\n                }\n            }\n        }\n        const contractSize = this.safeNumber (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const markPriceString = this.safeString (position, 'markPx');\n        let notionalString = this.safeString (position, 'notionalUsd');\n        if (market['inverse']) {\n            notionalString = Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), markPriceString);\n        }\n        const notional = this.parseNumber (notionalString);\n        const marginMode = this.safeString (position, 'mgnMode');\n        let initialMarginString = undefined;\n        const entryPriceString = this.safeString2 (position, 'avgPx', 'openAvgPx');\n        const unrealizedPnlString = this.safeString (position, 'upl');\n        const leverageString = this.safeString (position, 'lever');\n        let initialMarginPercentage = undefined;\n        let collateralString = undefined;\n        if (marginMode === 'cross') {\n            initialMarginString = this.safeString (position, 'imr');\n            collateralString = Precise.stringAdd (initialMarginString, unrealizedPnlString);\n        } else if (marginMode === 'isolated') {\n            initialMarginPercentage = Precise.stringDiv ('1', leverageString);\n            collateralString = this.safeString (position, 'margin');\n        }\n        const maintenanceMarginString = this.safeString (position, 'mmr');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const maintenanceMarginPercentageString = Precise.stringDiv (maintenanceMarginString, notionalString);\n        if (initialMarginPercentage === undefined) {\n            initialMarginPercentage = this.parseNumber (Precise.stringDiv (initialMarginString, notionalString, 4));\n        } else if (initialMarginString === undefined) {\n            initialMarginString = Precise.stringDiv (Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), entryPriceString), leverageString);\n        }\n        const rounder = '0.00005'; // round to closest 0.01%\n        const maintenanceMarginPercentage = this.parseNumber (Precise.stringDiv (Precise.stringAdd (maintenanceMarginPercentageString, rounder), '1', 4));\n        const liquidationPrice = this.safeNumber (position, 'liqPx');\n        const percentageString = this.safeString (position, 'uplRatio');\n        const percentage = this.parseNumber (Precise.stringMul (percentageString, '100'));\n        const timestamp = this.safeInteger (position, 'cTime');\n        const marginRatio = this.parseNumber (Precise.stringDiv (maintenanceMarginString, collateralString, 4));\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'posId'),\n            'symbol': symbol,\n            'notional': notional,\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.parseNumber (entryPriceString),\n            'unrealizedPnl': this.parseNumber (unrealizedPnlString),\n            'realizedPnl': this.safeNumber (position, 'realizedPnl'),\n            'percentage': percentage,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'markPrice': this.parseNumber (markPriceString),\n            'lastPrice': this.safeNumber (position, 'closeAvgPx'),\n            'side': side,\n            'hedged': hedged,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'uTime'),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'collateral': this.parseNumber (collateralString),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentage),\n            'leverage': this.parseNumber (leverageString),\n            'marginRatio': marginRatio,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 8070,
        "line_end": 8086,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'px')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"insId\": \"BTC-USD-230521-28500-P\",\n         \"px\": \"27081.2007345984751516\",\n         \"type\": \"exercised\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        //     {\n        //         \"insId\": \"BTC-USD-230521-28500-P\",\n        //         \"px\": \"27081.2007345984751516\",\n        //         \"type\": \"exercised\"\n        //     }\n        //\n        const marketId = this.safeString (settlement, 'insId');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'px'),\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 8088,
        "line_end": 8115,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"details\": [\n             {\n                 \"insId\": \"BTC-USD-230523-25750-C\",\n                 \"px\": \"27290.1486867000556483\",\n                 \"type\": \"exercised\"\n             },\n         ],\n         \"ts\":\"1684656000000\"\n     }"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        //     {\n        //         \"details\": [\n        //             {\n        //                 \"insId\": \"BTC-USD-230523-25750-C\",\n        //                 \"px\": \"27290.1486867000556483\",\n        //                 \"type\": \"exercised\"\n        //             },\n        //         ],\n        //         \"ts\":\"1684656000000\"\n        //     }\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            const entry = settlements[i];\n            const timestamp = this.safeInteger (entry, 'ts');\n            const details = this.safeList (entry, 'details', []);\n            for (let j = 0; j < details.length; j++) {\n                const settlement = this.parseSettlement (details[j], market);\n                result.push (this.extend (settlement, {\n                    'timestamp': timestamp,\n                    'datetime': this.iso8601 (timestamp),\n                }));\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2090,
        "line_end": 2163,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPx')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSz')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPx')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSz')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPx')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'idxPx')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"instType\":\"SWAP\",\n          \"instId\":\"BTC-USDT-SWAP\",\n          \"markPx\":\"200\",\n          \"ts\":\"1597026383085\"\n      }",
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-BTC\",\n         \"last\": \"0.07319\",\n         \"lastSz\": \"0.044378\",\n         \"askPx\": \"0.07322\",\n         \"askSz\": \"4.2\",\n         \"bidPx\": \"0.0732\",\n         \"bidSz\": \"6.050058\",\n         \"open24h\": \"0.07801\",\n         \"high24h\": \"0.07975\",\n         \"low24h\": \"0.06019\",\n         \"volCcy24h\": \"11788.887619\",\n         \"vol24h\": \"167493.829229\",\n         \"ts\": \"1621440583784\",\n         \"sodUtc0\": \"0.07872\",\n         \"sodUtc8\": \"0.07345\"\n     }",
          "{\n          instId: 'LTC-USDT',\n          idxPx: '65.74',\n          open24h: '65.37',\n          high24h: '66.15',\n          low24h: '64.97',\n          sodUtc0: '65.68',\n          sodUtc8: '65.54',\n          ts: '1728467346900'\n     },"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //      {\n        //          \"instType\":\"SWAP\",\n        //          \"instId\":\"BTC-USDT-SWAP\",\n        //          \"markPx\":\"200\",\n        //          \"ts\":\"1597026383085\"\n        //      }\n        //\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-BTC\",\n        //         \"last\": \"0.07319\",\n        //         \"lastSz\": \"0.044378\",\n        //         \"askPx\": \"0.07322\",\n        //         \"askSz\": \"4.2\",\n        //         \"bidPx\": \"0.0732\",\n        //         \"bidSz\": \"6.050058\",\n        //         \"open24h\": \"0.07801\",\n        //         \"high24h\": \"0.07975\",\n        //         \"low24h\": \"0.06019\",\n        //         \"volCcy24h\": \"11788.887619\",\n        //         \"vol24h\": \"167493.829229\",\n        //         \"ts\": \"1621440583784\",\n        //         \"sodUtc0\": \"0.07872\",\n        //         \"sodUtc8\": \"0.07345\"\n        //     }\n        //     {\n        //          instId: 'LTC-USDT',\n        //          idxPx: '65.74',\n        //          open24h: '65.37',\n        //          high24h: '66.15',\n        //          low24h: '64.97',\n        //          sodUtc0: '65.68',\n        //          sodUtc8: '65.54',\n        //          ts: '1728467346900'\n        //     },\n        //\n        const timestamp = this.safeInteger (ticker, 'ts');\n        const marketId = this.safeString (ticker, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'last');\n        const open = this.safeString (ticker, 'open24h');\n        const spot = this.safeBool (market, 'spot', false);\n        const quoteVolume = spot ? this.safeString (ticker, 'volCcy24h') : undefined;\n        const baseVolume = this.safeString (ticker, 'vol24h');\n        const high = this.safeString (ticker, 'high24h');\n        const low = this.safeString (ticker, 'low24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': this.safeString (ticker, 'bidPx'),\n            'bidVolume': this.safeString (ticker, 'bidSz'),\n            'ask': this.safeString (ticker, 'askPx'),\n            'askVolume': this.safeString (ticker, 'askSz'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPx'),\n            'indexPrice': this.safeString (ticker, 'idxPx'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2336,
        "line_end": 2427,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostSigned",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instId\": \"ETH-BTC\",\n         \"side\": \"sell\",\n         \"sz\": \"0.119501\",\n         \"px\": \"0.07065\",\n         \"tradeId\": \"15826757\",\n         \"ts\": \"1621446178316\"\n     }",
          "{\n         \"fillVol\": \"0.46387625976562497\",\n         \"fwdPx\": \"26299.754935451125\",\n         \"indexPx\": \"26309.7\",\n         \"instFamily\": \"BTC-USD\",\n         \"instId\": \"BTC-USD-230526-26000-C\",\n         \"markPx\": \"0.042386283557554236\",\n         \"optType\": \"C\",\n         \"px\": \"0.0415\",\n         \"side\": \"sell\",\n         \"sz\": \"90\",\n         \"tradeId\": \"112\",\n         \"ts\": \"1683907480154\"\n     }",
          "{\n         \"side\": \"buy\",\n         \"fillSz\": \"0.007533\",\n         \"fillPx\": \"2654.98\",\n         \"fee\": \"-0.000007533\",\n         \"ordId\": \"317321390244397056\",\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-USDT\",\n         \"clOrdId\": \"\",\n         \"posSide\": \"net\",\n         \"billId\": \"317321390265368576\",\n         \"tag\": \"0\",\n         \"execType\": \"T\",\n         \"tradeId\": \"107601752\",\n         \"feeCcy\": \"ETH\",\n         \"ts\": \"1621927314985\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"instId\": \"ETH-BTC\",\n        //         \"side\": \"sell\",\n        //         \"sz\": \"0.119501\",\n        //         \"px\": \"0.07065\",\n        //         \"tradeId\": \"15826757\",\n        //         \"ts\": \"1621446178316\"\n        //     }\n        //\n        // option: fetchTrades\n        //\n        //     {\n        //         \"fillVol\": \"0.46387625976562497\",\n        //         \"fwdPx\": \"26299.754935451125\",\n        //         \"indexPx\": \"26309.7\",\n        //         \"instFamily\": \"BTC-USD\",\n        //         \"instId\": \"BTC-USD-230526-26000-C\",\n        //         \"markPx\": \"0.042386283557554236\",\n        //         \"optType\": \"C\",\n        //         \"px\": \"0.0415\",\n        //         \"side\": \"sell\",\n        //         \"sz\": \"90\",\n        //         \"tradeId\": \"112\",\n        //         \"ts\": \"1683907480154\"\n        //     }\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"side\": \"buy\",\n        //         \"fillSz\": \"0.007533\",\n        //         \"fillPx\": \"2654.98\",\n        //         \"fee\": \"-0.000007533\",\n        //         \"ordId\": \"317321390244397056\",\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"clOrdId\": \"\",\n        //         \"posSide\": \"net\",\n        //         \"billId\": \"317321390265368576\",\n        //         \"tag\": \"0\",\n        //         \"execType\": \"T\",\n        //         \"tradeId\": \"107601752\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"ts\": \"1621927314985\"\n        //     }\n        //\n        const id = this.safeString (trade, 'tradeId');\n        const marketId = this.safeString (trade, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (trade, 'ts');\n        const price = this.safeString2 (trade, 'fillPx', 'px');\n        const amount = this.safeString2 (trade, 'fillSz', 'sz');\n        const side = this.safeString (trade, 'side');\n        const orderId = this.safeString (trade, 'ordId');\n        const feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (trade, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostSigned,\n                'currency': feeCurrencyCode,\n            };\n        }\n        let takerOrMaker = this.safeString (trade, 'execType');\n        if (takerOrMaker === 'T') {\n            takerOrMaker = 'taker';\n        } else if (takerOrMaker === 'M') {\n            takerOrMaker = 'maker';\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingBalance",
        "signature": "parseTradingBalance (response)",
        "line_start": 2730,
        "line_end": 2756,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingBalance (response) {\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        const first = this.safeDict (data, 0, {});\n        const timestamp = this.safeInteger (first, 'uTime');\n        const details = this.safeList (first, 'details', []);\n        for (let i = 0; i < details.length; i++) {\n            const balance = details[i];\n            const currencyId = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            const eq = this.safeString (balance, 'eq');\n            const availEq = this.safeString (balance, 'availEq');\n            account['total'] = eq;\n            if (availEq === undefined) {\n                account['free'] = this.safeString (balance, 'availBal');\n                account['used'] = this.safeString (balance, 'frozenBal');\n            } else {\n                account['free'] = availEq;\n            }\n            result[code] = account;\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 2775,
        "line_end": 2798,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU')))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"category\": \"1\",\n         \"delivery\": \"\",\n         \"exercise\": \"\",\n         \"instType\": \"SPOT\",\n         \"level\": \"Lv1\",\n         \"maker\": \"-0.0008\",\n         \"taker\": \"-0.001\",\n         \"ts\": \"1639043138472\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        // https://www.okx.com/docs-v5/en/#rest-api-account-get-fee-rates\n        //\n        //     {\n        //         \"category\": \"1\",\n        //         \"delivery\": \"\",\n        //         \"exercise\": \"\",\n        //         \"instType\": \"SPOT\",\n        //         \"level\": \"Lv1\",\n        //         \"maker\": \"-0.0008\",\n        //         \"taker\": \"-0.001\",\n        //         \"ts\": \"1639043138472\"\n        //     }\n        //\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (undefined, market),\n            // OKX returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped\n            'maker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'maker', 'makerU'))),\n            'taker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU'))),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 5685,
        "line_end": 5779,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': feeCost,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amt\": \"0.1\",\n         \"wdId\": \"67485\",\n         \"ccy\": \"BTC\"\n     }",
          "{\n         \"amt\": \"0.094\",\n         \"wdId\": \"4703879\",\n         \"fee\": \"0.01000000eth\",\n         \"txId\": \"0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85\",\n         \"ccy\": \"ETH\",\n         \"from\": \"13426335357\",\n         \"to\": \"0xA41446125D0B5b6785f6898c9D67874D763A1519\",\n         \"tag\",\n         \"pmtId\",\n         \"memo\",\n         \"ts\": \"1597026383085\",\n         \"state\": \"2\"\n     }",
          "{\n         \"amt\": \"0.01044408\",\n         \"txId\": \"1915737_3_0_0_asset\",\n         \"ccy\": \"BTC\",\n         \"from\": \"13801825426\",\n         \"to\": \"\",\n         \"ts\": \"1597026383085\",\n         \"state\": \"2\",\n         \"depId\": \"4703879\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"amt\": \"0.1\",\n        //         \"wdId\": \"67485\",\n        //         \"ccy\": \"BTC\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"amt\": \"0.094\",\n        //         \"wdId\": \"4703879\",\n        //         \"fee\": \"0.01000000eth\",\n        //         \"txId\": \"0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85\",\n        //         \"ccy\": \"ETH\",\n        //         \"from\": \"13426335357\",\n        //         \"to\": \"0xA41446125D0B5b6785f6898c9D67874D763A1519\",\n        //         \"tag\",\n        //         \"pmtId\",\n        //         \"memo\",\n        //         \"ts\": \"1597026383085\",\n        //         \"state\": \"2\"\n        //     }\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"amt\": \"0.01044408\",\n        //         \"txId\": \"1915737_3_0_0_asset\",\n        //         \"ccy\": \"BTC\",\n        //         \"from\": \"13801825426\",\n        //         \"to\": \"\",\n        //         \"ts\": \"1597026383085\",\n        //         \"state\": \"2\",\n        //         \"depId\": \"4703879\"\n        //     }\n        //\n        let type = undefined;\n        let id = undefined;\n        const withdrawalId = this.safeString (transaction, 'wdId');\n        const addressFrom = this.safeString (transaction, 'from');\n        const addressTo = this.safeString (transaction, 'to');\n        const address = addressTo;\n        let tagTo = this.safeString2 (transaction, 'tag', 'memo');\n        tagTo = this.safeString2 (transaction, 'pmtId', tagTo);\n        if (withdrawalId !== undefined) {\n            type = 'withdrawal';\n            id = withdrawalId;\n        } else {\n            // the payment_id will appear on new deposits but appears to be removed from the response after 2 months\n            id = this.safeString (transaction, 'depId');\n            type = 'deposit';\n        }\n        const currencyId = this.safeString (transaction, 'ccy');\n        const code = this.safeCurrencyCode (currencyId);\n        const amount = this.safeNumber (transaction, 'amt');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const txid = this.safeString (transaction, 'txId');\n        const timestamp = this.safeInteger (transaction, 'ts');\n        let feeCost = undefined;\n        if (type === 'deposit') {\n            feeCost = 0;\n        } else {\n            feeCost = this.safeNumber (transaction, 'fee');\n        }\n        // todo parse tags\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'address': address,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'tag': tagTo,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': feeCost,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 5639,
        "line_end": 5683,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"0\": \"waiting for confirmation\",\n         \"1\": \"deposit credited\",\n         \"2\": \"deposit successful\"\n     }",
          "{\n        '-3': \"pending cancel\",\n        \"-2\": \"canceled\",\n        \"-1\": \"failed\",\n         \"0\": \"pending\",\n         \"1\": \"sending\",\n         \"2\": \"sent\",\n         \"3\": \"awaiting email verification\",\n         \"4\": \"awaiting manual verification\",\n         \"5\": \"awaiting identity verification\"\n     }"
        ],
        "source": "parseTransactionStatus (status: Str) {\n        //\n        // deposit statuses\n        //\n        //     {\n        //         \"0\": \"waiting for confirmation\",\n        //         \"1\": \"deposit credited\",\n        //         \"2\": \"deposit successful\"\n        //     }\n        //\n        // withdrawal statuses\n        //\n        //     {\n        //        '-3': \"pending cancel\",\n        //        \"-2\": \"canceled\",\n        //        \"-1\": \"failed\",\n        //         \"0\": \"pending\",\n        //         \"1\": \"sending\",\n        //         \"2\": \"sent\",\n        //         \"3\": \"awaiting email verification\",\n        //         \"4\": \"awaiting manual verification\",\n        //         \"5\": \"awaiting identity verification\"\n        //     }\n        //\n        const statuses: Dict = {\n            '-3': 'pending',\n            '-2': 'canceled',\n            '-1': 'failed',\n            '0': 'pending',\n            '1': 'pending',\n            '2': 'ok',\n            '3': 'pending',\n            '4': 'pending',\n            '5': 'pending',\n            '6': 'pending',\n            '7': 'pending',\n            '8': 'pending',\n            '9': 'pending',\n            '10': 'pending',\n            '12': 'pending',\n            '15': 'pending',\n            '16': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 6266,
        "line_end": 6342,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (accountsById, fromAccountId)",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (accountsById, toAccountId)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'state'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transId\": \"754147\",\n         \"ccy\": \"USDT\",\n         \"from\": \"6\",\n         \"amt\": \"0.1\",\n         \"to\": \"18\"\n     }",
          "{\n         \"amt\": \"5\",\n         \"ccy\": \"USDT\",\n         \"from\": \"18\",\n         \"instId\": \"\",\n         \"state\": \"success\",\n         \"subAcct\": \"\",\n         \"to\": \"6\",\n         \"toInstId\": \"\",\n         \"transId\": \"464424732\",\n         \"type\": \"0\"\n     }",
          "{\n         \"bal\": \"70.6874353780312913\",\n         \"balChg\": \"-4.0000000000000000\", // negative means \"to funding\", positive meand \"from funding\"\n         \"billId\": \"588900695232225299\",\n         \"ccy\": \"USDT\",\n         \"execType\": \"\",\n         \"fee\": \"\",\n         \"from\": \"18\",\n         \"instId\": \"\",\n         \"instType\": \"\",\n         \"mgnMode\": \"\",\n         \"notes\": \"To Funding Account\",\n         \"ordId\": \"\",\n         \"pnl\": \"\",\n         \"posBal\": \"\",\n         \"posBalChg\": \"\",\n         \"price\": \"0\",\n         \"subType\": \"12\",\n         \"sz\": \"-4\",\n         \"to\": \"6\",\n         \"ts\": \"1686676866989\",\n         \"type\": \"1\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"transId\": \"754147\",\n        //         \"ccy\": \"USDT\",\n        //         \"from\": \"6\",\n        //         \"amt\": \"0.1\",\n        //         \"to\": \"18\"\n        //     }\n        //\n        // fetchTransfer\n        //\n        //     {\n        //         \"amt\": \"5\",\n        //         \"ccy\": \"USDT\",\n        //         \"from\": \"18\",\n        //         \"instId\": \"\",\n        //         \"state\": \"success\",\n        //         \"subAcct\": \"\",\n        //         \"to\": \"6\",\n        //         \"toInstId\": \"\",\n        //         \"transId\": \"464424732\",\n        //         \"type\": \"0\"\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"bal\": \"70.6874353780312913\",\n        //         \"balChg\": \"-4.0000000000000000\", // negative means \"to funding\", positive meand \"from funding\"\n        //         \"billId\": \"588900695232225299\",\n        //         \"ccy\": \"USDT\",\n        //         \"execType\": \"\",\n        //         \"fee\": \"\",\n        //         \"from\": \"18\",\n        //         \"instId\": \"\",\n        //         \"instType\": \"\",\n        //         \"mgnMode\": \"\",\n        //         \"notes\": \"To Funding Account\",\n        //         \"ordId\": \"\",\n        //         \"pnl\": \"\",\n        //         \"posBal\": \"\",\n        //         \"posBalChg\": \"\",\n        //         \"price\": \"0\",\n        //         \"subType\": \"12\",\n        //         \"sz\": \"-4\",\n        //         \"to\": \"6\",\n        //         \"ts\": \"1686676866989\",\n        //         \"type\": \"1\"\n        //     }\n        //\n        const id = this.safeString2 (transfer, 'transId', 'billId');\n        const currencyId = this.safeString (transfer, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let amount = this.safeNumber (transfer, 'amt');\n        const fromAccountId = this.safeString (transfer, 'from');\n        const toAccountId = this.safeString (transfer, 'to');\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        const timestamp = this.safeInteger (transfer, 'ts');\n        const balanceChange = this.safeString (transfer, 'sz');\n        if (balanceChange !== undefined) {\n            amount = this.parseNumber (Precise.stringAbs (balanceChange));\n        }\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': this.safeString (accountsById, fromAccountId),\n            'toAccount': this.safeString (accountsById, toAccountId),\n            'status': this.parseTransferStatus (this.safeString (transfer, 'state')),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 6344,
        "line_end": 6349,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'success': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "okxus": [
      {
        "name": "parseBalanceByType",
        "signature": "parseBalanceByType (type, response)",
        "line_start": 2722,
        "line_end": 2728,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalanceByType (type, response) {\n        if (type === 'funding') {\n            return this.parseFundingBalance (response);\n        } else {\n            return this.parseTradingBalance (response);\n        }\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 7520,
        "line_end": 7537,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (info, 'ccy'))",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'interest')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.safeNumber (info, 'interestRate')",
            "comment": null
          },
          {
            "key": "amountBorrowed",
            "value": "this.safeNumber (info, 'liab')",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeString (info, 'mgnMode')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        const instId = this.safeString (info, 'instId');\n        if (instId !== undefined) {\n            market = this.safeMarket (instId, market);\n        }\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'info': info,\n            'symbol': this.safeString (market, 'symbol'),\n            'currency': this.safeCurrencyCode (this.safeString (info, 'ccy')),\n            'interest': this.safeNumber (info, 'interest'),\n            'interestRate': this.safeNumber (info, 'interestRate'),\n            'amountBorrowed': this.safeNumber (info, 'liab'),\n            'marginMode': this.safeString (info, 'mgnMode'),\n            'timestamp': timestamp,  // Interest accrued time\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 7074,
        "line_end": 7093,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (ccy)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.safeNumber2 (info, 'interestRate', 'rate')",
            "comment": null
          },
          {
            "key": "period",
            "value": "86400000",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amt\": \"992.10341195\",\n        \"ccy\": \"BTC\",\n        \"rate\": \"0.01\",\n        \"ts\": \"1643954400000\"\n    }"
        ],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //    {\n        //        \"amt\": \"992.10341195\",\n        //        \"ccy\": \"BTC\",\n        //        \"rate\": \"0.01\",\n        //        \"ts\": \"1643954400000\"\n        //    }\n        //\n        const ccy = this.safeString (info, 'ccy');\n        const timestamp = this.safeInteger (info, 'ts');\n        return {\n            'currency': this.safeCurrencyCode (ccy),\n            'rate': this.safeNumber2 (info, 'interestRate', 'rate'),\n            'period': 86400000,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseBorrowRateHistories",
        "signature": "parseBorrowRateHistories (response, codes, since, limit)",
        "line_start": 7095,
        "line_end": 7126,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        {\n            \"amt\": \"992.10341195\",\n            \"ccy\": \"BTC\",\n            \"rate\": \"0.01\",\n            \"ts\": \"1643954400000\"\n        },\n        ...\n    ]"
        ],
        "source": "parseBorrowRateHistories (response, codes, since, limit) {\n        //\n        //    [\n        //        {\n        //            \"amt\": \"992.10341195\",\n        //            \"ccy\": \"BTC\",\n        //            \"rate\": \"0.01\",\n        //            \"ts\": \"1643954400000\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const borrowRateHistories: Dict = {};\n        for (let i = 0; i < response.length; i++) {\n            const item = response[i];\n            const code = this.safeCurrencyCode (this.safeString (item, 'ccy'));\n            if (codes === undefined || this.inArray (code, codes)) {\n                if (!(code in borrowRateHistories)) {\n                    borrowRateHistories[code] = [];\n                }\n                const borrowRateStructure = this.parseBorrowRate (item);\n                const borrrowRateCode = borrowRateHistories[code];\n                borrrowRateCode.push (borrowRateStructure);\n            }\n        }\n        const keys = Object.keys (borrowRateHistories);\n        for (let i = 0; i < keys.length; i++) {\n            const code = keys[i];\n            borrowRateHistories[code] = this.filterByCurrencySinceLimit (borrowRateHistories[code], code, since, limit);\n        }\n        return borrowRateHistories;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 8758,
        "line_end": 8828,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (conversion, [ 'clQReqId', 'tradeId', 'quoteId' ])",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'baseSz', 'fillBaseSz')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'quoteSz', 'fillQuoteSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber2 (conversion, 'cnvtPx', 'fillPx')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"baseCcy\": \"ETH\",\n         \"baseSz\": \"0.01023052\",\n         \"clQReqId\": \"\",\n         \"cnvtPx\": \"2932.40104429\",\n         \"origRfqSz\": \"30\",\n         \"quoteCcy\": \"USDT\",\n         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n         \"quoteSz\": \"30\",\n         \"quoteTime\": \"1646188510461\",\n         \"rfqSz\": \"30\",\n         \"rfqSzCcy\": \"USDT\",\n         \"side\": \"buy\",\n         \"ttlMs\": \"10000\"\n     }",
          "{\n         \"baseCcy\": \"ETH\",\n         \"clTReqId\": \"\",\n         \"fillBaseSz\": \"0.01023052\",\n         \"fillPx\": \"2932.40104429\",\n         \"fillQuoteSz\": \"30\",\n         \"instId\": \"ETH-USDT\",\n         \"quoteCcy\": \"USDT\",\n         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n         \"side\": \"buy\",\n         \"state\": \"fullyFilled\",\n         \"tradeId\": \"trader16461885203381437\",\n         \"ts\": \"1646188520338\"\n     }",
          "{\n         \"clTReqId\": \"\",\n         \"instId\": \"ETH-USDT\",\n         \"side\": \"buy\",\n         \"fillPx\": \"2932.401044\",\n         \"baseCcy\": \"ETH\",\n         \"quoteCcy\": \"USDT\",\n         \"fillBaseSz\": \"0.01023052\",\n         \"state\": \"fullyFilled\",\n         \"tradeId\": \"trader16461885203381437\",\n         \"fillQuoteSz\": \"30\",\n         \"ts\": \"1646188520000\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"baseCcy\": \"ETH\",\n        //         \"baseSz\": \"0.01023052\",\n        //         \"clQReqId\": \"\",\n        //         \"cnvtPx\": \"2932.40104429\",\n        //         \"origRfqSz\": \"30\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n        //         \"quoteSz\": \"30\",\n        //         \"quoteTime\": \"1646188510461\",\n        //         \"rfqSz\": \"30\",\n        //         \"rfqSzCcy\": \"USDT\",\n        //         \"side\": \"buy\",\n        //         \"ttlMs\": \"10000\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"baseCcy\": \"ETH\",\n        //         \"clTReqId\": \"\",\n        //         \"fillBaseSz\": \"0.01023052\",\n        //         \"fillPx\": \"2932.40104429\",\n        //         \"fillQuoteSz\": \"30\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"quoteId\": \"quoterETH-USDT16461885104612381\",\n        //         \"side\": \"buy\",\n        //         \"state\": \"fullyFilled\",\n        //         \"tradeId\": \"trader16461885203381437\",\n        //         \"ts\": \"1646188520338\"\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory\n        //\n        //     {\n        //         \"clTReqId\": \"\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"side\": \"buy\",\n        //         \"fillPx\": \"2932.401044\",\n        //         \"baseCcy\": \"ETH\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"fillBaseSz\": \"0.01023052\",\n        //         \"state\": \"fullyFilled\",\n        //         \"tradeId\": \"trader16461885203381437\",\n        //         \"fillQuoteSz\": \"30\",\n        //         \"ts\": \"1646188520000\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (conversion, 'quoteTime', 'ts');\n        const fromCoin = this.safeString (conversion, 'baseCcy');\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const to = this.safeString (conversion, 'quoteCcy');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeStringN (conversion, [ 'clQReqId', 'tradeId', 'quoteId' ]),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'baseSz', 'fillBaseSz'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'quoteSz', 'fillQuoteSz'),\n            'price': this.safeNumber2 (conversion, 'cnvtPx', 'fillPx'),\n            'fee': undefined,\n        } as Conversion;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 5171,
        "line_end": 5267,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"addr\": \"okbtothemoon\",\n         \"memo\": \"971668\", // may be missing\n         \"tag\":\"52055\", // may be missing\n         \"pmtId\": \"\", // may be missing\n         \"ccy\": \"BTC\",\n         \"to\": \"6\", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account\n         \"selected\": true\n     }",
          "{\n         \"ccy\":\"usdt-erc20\",\n         \"to\":\"6\",\n         \"addr\":\"0x696abb81974a8793352cbd33aadcf78eda3cfdfa\",\n         \"selected\":true\n     }",
          "{\n        \"chain\": \"ETH-OKExChain\",\n        \"addrEx\": { \"comment\": \"6040348\" }, // some currencies like TON may have this field,\n        \"ctAddr\": \"72315c\",\n        \"ccy\": \"ETH\",\n        \"to\": \"6\",\n        \"addr\": \"0x1c9f2244d1ccaa060bd536827c18925db10db102\",\n        \"selected\": true\n     }",
          "{\n          \"chain\": \"USDT-Polygon\",\n          \"ctAddr\": \"\",\n          \"ccy\": \"USDT\",\n          \"to\":\"6\" ,\n          \"addr\": \"0x1903441e386cc49d937f6302955b5feb4286dcfa\",\n          \"selected\": true\n      }",
          "network information from currency['networks'] field:"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"addr\": \"okbtothemoon\",\n        //         \"memo\": \"971668\", // may be missing\n        //         \"tag\":\"52055\", // may be missing\n        //         \"pmtId\": \"\", // may be missing\n        //         \"ccy\": \"BTC\",\n        //         \"to\": \"6\", // 1 SPOT, 3 FUTURES, 6 FUNDING, 9 SWAP, 12 OPTION, 18 Unified account\n        //         \"selected\": true\n        //     }\n        //\n        //     {\n        //         \"ccy\":\"usdt-erc20\",\n        //         \"to\":\"6\",\n        //         \"addr\":\"0x696abb81974a8793352cbd33aadcf78eda3cfdfa\",\n        //         \"selected\":true\n        //     }\n        //\n        //     {\n        //        \"chain\": \"ETH-OKExChain\",\n        //        \"addrEx\": { \"comment\": \"6040348\" }, // some currencies like TON may have this field,\n        //        \"ctAddr\": \"72315c\",\n        //        \"ccy\": \"ETH\",\n        //        \"to\": \"6\",\n        //        \"addr\": \"0x1c9f2244d1ccaa060bd536827c18925db10db102\",\n        //        \"selected\": true\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'addr');\n        let tag = this.safeStringN (depositAddress, [ 'tag', 'pmtId', 'memo' ]);\n        if (tag === undefined) {\n            const addrEx = this.safeValue (depositAddress, 'addrEx', {});\n            tag = this.safeString (addrEx, 'comment');\n        }\n        const currencyId = this.safeString (depositAddress, 'ccy');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = currency['code'];\n        const chain = this.safeString (depositAddress, 'chain');\n        const networks = this.safeValue (currency, 'networks', {});\n        const networksById = this.indexBy (networks, 'id');\n        let networkData = this.safeValue (networksById, chain);\n        // inconsistent naming responses from exchange\n        // with respect to network naming provided in currency info vs address chain-names and ids\n        //\n        // response from address endpoint:\n        //      {\n        //          \"chain\": \"USDT-Polygon\",\n        //          \"ctAddr\": \"\",\n        //          \"ccy\": \"USDT\",\n        //          \"to\":\"6\" ,\n        //          \"addr\": \"0x1903441e386cc49d937f6302955b5feb4286dcfa\",\n        //          \"selected\": true\n        //      }\n        // network information from currency['networks'] field:\n        // Polygon: {\n        //        info: {\n        //            canDep: false,\n        //            canInternal: false,\n        //            canWd: false,\n        //            ccy: 'USDT',\n        //            chain: 'USDT-Polygon-Bridge',\n        //            mainNet: false,\n        //            maxFee: '26.879528',\n        //            minFee: '13.439764',\n        //            minWd: '0.001',\n        //            name: ''\n        //        },\n        //        id: 'USDT-Polygon-Bridge',\n        //        network: 'Polygon',\n        //        active: false,\n        //        deposit: false,\n        //        withdraw: false,\n        //        fee: 13.439764,\n        //        precision: undefined,\n        //        limits: {\n        //            withdraw: {\n        //                min: 0.001,\n        //                max: undefined\n        //            }\n        //        }\n        //     },\n        //\n        if (chain === 'USDT-Polygon') {\n            networkData = this.safeValue2 (networksById, 'USDT-Polygon-Bridge', 'USDT-Polygon');\n        }\n        const network = this.safeString (networkData, 'network');\n        const networkCode = this.networkIdToCode (network, code);\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': networkCode,\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 7948,
        "line_end": 8011,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "[\n   {\n       \"canDep\": true,\n       \"canInternal\": false,\n       \"canWd\": true,\n       \"ccy\": \"USDT\",\n       \"chain\": \"USDT-TRC20\",\n       \"logoLink\": \"https://static.coinall.ltd/cdn/assets/imgs/221/5F74EB20302D7761.png\",\n       \"mainNet\": false,\n       \"maxFee\": \"1.6\",\n       \"maxWd\": \"8852150\",\n       \"minFee\": \"0.8\",\n       \"minWd\": \"2\",\n       \"name\": \"Tether\",\n       \"usedWdQuota\": \"0\",\n       \"wdQuota\": \"500\",\n       \"wdTickSz\": \"3\"\n   }\n ]"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        // [\n        //   {\n        //       \"canDep\": true,\n        //       \"canInternal\": false,\n        //       \"canWd\": true,\n        //       \"ccy\": \"USDT\",\n        //       \"chain\": \"USDT-TRC20\",\n        //       \"logoLink\": \"https://static.coinall.ltd/cdn/assets/imgs/221/5F74EB20302D7761.png\",\n        //       \"mainNet\": false,\n        //       \"maxFee\": \"1.6\",\n        //       \"maxWd\": \"8852150\",\n        //       \"minFee\": \"0.8\",\n        //       \"minWd\": \"2\",\n        //       \"name\": \"Tether\",\n        //       \"usedWdQuota\": \"0\",\n        //       \"wdQuota\": \"500\",\n        //       \"wdTickSz\": \"3\"\n        //   }\n        // ]\n        //\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        for (let i = 0; i < response.length; i++) {\n            const feeInfo = response[i];\n            const currencyId = this.safeString (feeInfo, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                const depositWithdrawFee = this.safeValue (depositWithdrawFees, code);\n                if (depositWithdrawFee === undefined) {\n                    depositWithdrawFees[code] = this.depositWithdrawFee ({});\n                }\n                depositWithdrawFees[code]['info'][currencyId] = feeInfo;\n                const chain = this.safeString (feeInfo, 'chain');\n                if (chain === undefined) {\n                    continue;\n                }\n                const chainSplit = chain.split ('-');\n                const networkId = this.safeValue (chainSplit, 1);\n                const withdrawFee = this.safeNumber (feeInfo, 'fee');\n                const withdrawResult: Dict = {\n                    'fee': withdrawFee,\n                    'percentage': (withdrawFee !== undefined) ? false : undefined,\n                };\n                const depositResult: Dict = {\n                    'fee': undefined,\n                    'percentage': undefined,\n                };\n                const networkCode = this.networkIdToCode (networkId, code);\n                depositWithdrawFees[code]['networks'][networkCode] = {\n                    'withdraw': withdrawResult,\n                    'deposit': depositResult,\n                };\n            }\n        }\n        const depositWithdrawCodes = Object.keys (depositWithdrawFees);\n        for (let i = 0; i < depositWithdrawCodes.length; i++) {\n            const code = depositWithdrawCodes[i];\n            const currency = this.currency (code);\n            depositWithdrawFees[code] = this.assignDefaultDepositWithdrawFees (depositWithdrawFees[code], currency);\n        }\n        return depositWithdrawFees;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseFundingBalance",
        "signature": "parseFundingBalance (response)",
        "line_start": 2758,
        "line_end": 2773,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingBalance (response) {\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        for (let i = 0; i < data.length; i++) {\n            const balance = data[i];\n            const currencyId = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            account['total'] = this.safeString (balance, 'bal');\n            account['free'] = this.safeString (balance, 'availBal');\n            account['used'] = this.safeString (balance, 'frozenBal');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 6570,
        "line_end": 6579,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 6509,
        "line_end": 6568,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "nextFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "this.iso8601 (nextFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"fundingRate\": \"0.00027815\",\n        \"fundingTime\": \"1634256000000\",\n        \"instId\": \"BTC-USD-SWAP\",\n        \"instType\": \"SWAP\",\n        \"nextFundingRate\": \"0.00017\",\n        \"nextFundingTime\": \"1634284800000\"\n    }",
          "{\n        \"fundingRate\":\"0.0001875391284828\",\n        \"fundingTime\":\"1700726400000\",\n        \"instId\":\"BTC-USD-SWAP\",\n        \"instType\":\"SWAP\",\n        \"method\": \"next_period\",\n        \"maxFundingRate\":\"0.00375\",\n        \"minFundingRate\":\"-0.00375\",\n        \"nextFundingRate\":\"0.0002608059239328\",\n        \"nextFundingTime\":\"1700755200000\",\n        \"premium\": \"0.0001233824646391\",\n        \"settFundingRate\":\"0.0001699799259033\",\n        \"settState\":\"settled\",\n        \"ts\":\"1700724675402\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //    {\n        //        \"fundingRate\": \"0.00027815\",\n        //        \"fundingTime\": \"1634256000000\",\n        //        \"instId\": \"BTC-USD-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"nextFundingRate\": \"0.00017\",\n        //        \"nextFundingTime\": \"1634284800000\"\n        //    }\n        // ws\n        //     {\n        //        \"fundingRate\":\"0.0001875391284828\",\n        //        \"fundingTime\":\"1700726400000\",\n        //        \"instId\":\"BTC-USD-SWAP\",\n        //        \"instType\":\"SWAP\",\n        //        \"method\": \"next_period\",\n        //        \"maxFundingRate\":\"0.00375\",\n        //        \"minFundingRate\":\"-0.00375\",\n        //        \"nextFundingRate\":\"0.0002608059239328\",\n        //        \"nextFundingTime\":\"1700755200000\",\n        //        \"premium\": \"0.0001233824646391\",\n        //        \"settFundingRate\":\"0.0001699799259033\",\n        //        \"settState\":\"settled\",\n        //        \"ts\":\"1700724675402\"\n        //     }\n        //\n        // in the response above nextFundingRate is actually two funding rates from now\n        //\n        const nextFundingRateTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        const marketId = this.safeString (contract, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        const nextFundingRate = this.safeNumber (contract, 'nextFundingRate');\n        const fundingTime = this.safeInteger (contract, 'fundingTime');\n        const fundingTimeString = this.safeString (contract, 'fundingTime');\n        const nextFundingTimeString = this.safeString (contract, 'nextFundingTime');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        // https://www.okx.com/support/hc/en-us/articles/360053909272-Ⅸ-Introduction-to-perpetual-swap-funding-fee\n        // > The current interest is 0.\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': nextFundingRate,\n            'nextFundingTimestamp': nextFundingRateTimestamp,\n            'nextFundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 8294,
        "line_end": 8342,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeks, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeks, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "this.safeNumber (greeks, 'theta')",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeks, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bidVol')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'askVol')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'markVol')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"askVol\": \"0\",\n         \"bidVol\": \"0\",\n         \"delta\": \"0.5105464486882039\",\n         \"deltaBS\": \"0.7325502184143025\",\n         \"fwdPx\": \"37675.80158694987186\",\n         \"gamma\": \"-0.13183515090501083\",\n         \"gammaBS\": \"0.000024139685826358558\",\n         \"instId\": \"BTC-USD-240329-32000-C\",\n         \"instType\": \"OPTION\",\n         \"lever\": \"4.504428015946619\",\n         \"markVol\": \"0.5916253554539876\",\n         \"realVol\": \"0\",\n         \"theta\": \"-0.0004202992014012855\",\n         \"thetaBS\": \"-18.52354631567909\",\n         \"ts\": \"1699586421976\",\n         \"uly\": \"BTC-USD\",\n         \"vega\": \"0.0020207455080045846\",\n         \"vegaBS\": \"74.44022302387287\",\n         \"volLv\": \"0.5948549730405797\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"askVol\": \"0\",\n        //         \"bidVol\": \"0\",\n        //         \"delta\": \"0.5105464486882039\",\n        //         \"deltaBS\": \"0.7325502184143025\",\n        //         \"fwdPx\": \"37675.80158694987186\",\n        //         \"gamma\": \"-0.13183515090501083\",\n        //         \"gammaBS\": \"0.000024139685826358558\",\n        //         \"instId\": \"BTC-USD-240329-32000-C\",\n        //         \"instType\": \"OPTION\",\n        //         \"lever\": \"4.504428015946619\",\n        //         \"markVol\": \"0.5916253554539876\",\n        //         \"realVol\": \"0\",\n        //         \"theta\": \"-0.0004202992014012855\",\n        //         \"thetaBS\": \"-18.52354631567909\",\n        //         \"ts\": \"1699586421976\",\n        //         \"uly\": \"BTC-USD\",\n        //         \"vega\": \"0.0020207455080045846\",\n        //         \"vegaBS\": \"74.44022302387287\",\n        //         \"volLv\": \"0.5948549730405797\"\n        //     }\n        //\n        const timestamp = this.safeInteger (greeks, 'ts');\n        const marketId = this.safeString (greeks, 'instId');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'delta': this.safeNumber (greeks, 'delta'),\n            'gamma': this.safeNumber (greeks, 'gamma'),\n            'theta': this.safeNumber (greeks, 'theta'),\n            'vega': this.safeNumber (greeks, 'vega'),\n            'rho': undefined,\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bidVol'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'askVol'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'markVol'),\n            'bidPrice': undefined,\n            'askPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'underlyingPrice': undefined,\n            'info': greeks,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseIds",
        "signature": "parseIds (ids)",
        "line_start": 3647,
        "line_end": 3660,
        "comment": null,
        "mappings": [],
        "examples": [
          "@param {string[]|string} ids order ids",
          "@returns {string[]} list of order ids"
        ],
        "source": "parseIds (ids) {\n        /**\n         * @ignore\n         * @method\n         * @name okx#parseIds\n         * @param {string[]|string} ids order ids\n         * @returns {string[]} list of order ids\n         */\n        if ((ids !== undefined) && typeof ids === 'string') {\n            return ids.split (',');\n        } else {\n            return ids;\n        }\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 5101,
        "line_end": 5169,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'billId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'ordId')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'balChg')",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'bal')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"bal\": \"0.0000819307998198\",\n         \"balChg\": \"-664.2679586599999802\",\n         \"billId\": \"310394313544966151\",\n         \"ccy\": \"USDT\",\n         \"fee\": \"0\",\n         \"from\": \"\",\n         \"instId\": \"LTC-USDT\",\n         \"instType\": \"SPOT\",\n         \"mgnMode\": \"cross\",\n         \"notes\": \"\",\n         \"ordId\": \"310394313519800320\",\n         \"pnl\": \"0\",\n         \"posBal\": \"0\",\n         \"posBalChg\": \"0\",\n         \"subType\": \"2\",\n         \"sz\": \"664.26795866\",\n         \"to\": \"\",\n         \"ts\": \"1620275771196\",\n         \"type\": \"2\"\n     }",
          "{\n         \"billId\": \"12344\",\n         \"ccy\": \"BTC\",\n         \"balChg\": \"2\",\n         \"bal\": \"12\",\n         \"type\": \"1\",\n         \"ts\": \"1597026383085\"\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        // privateGetAccountBills, privateGetAccountBillsArchive\n        //\n        //     {\n        //         \"bal\": \"0.0000819307998198\",\n        //         \"balChg\": \"-664.2679586599999802\",\n        //         \"billId\": \"310394313544966151\",\n        //         \"ccy\": \"USDT\",\n        //         \"fee\": \"0\",\n        //         \"from\": \"\",\n        //         \"instId\": \"LTC-USDT\",\n        //         \"instType\": \"SPOT\",\n        //         \"mgnMode\": \"cross\",\n        //         \"notes\": \"\",\n        //         \"ordId\": \"310394313519800320\",\n        //         \"pnl\": \"0\",\n        //         \"posBal\": \"0\",\n        //         \"posBalChg\": \"0\",\n        //         \"subType\": \"2\",\n        //         \"sz\": \"664.26795866\",\n        //         \"to\": \"\",\n        //         \"ts\": \"1620275771196\",\n        //         \"type\": \"2\"\n        //     }\n        //\n        // privateGetAssetBills\n        //\n        //     {\n        //         \"billId\": \"12344\",\n        //         \"ccy\": \"BTC\",\n        //         \"balChg\": \"2\",\n        //         \"bal\": \"12\",\n        //         \"type\": \"1\",\n        //         \"ts\": \"1597026383085\"\n        //     }\n        //\n        const currencyId = this.safeString (item, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'ts');\n        const feeCostString = this.safeString (item, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            fee = {\n                'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n                'currency': code,\n            };\n        }\n        const marketId = this.safeString (item, 'instId');\n        const symbol = this.safeSymbol (marketId, undefined, '-');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'billId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'account': undefined,\n            'referenceId': this.safeString (item, 'ordId'),\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': code,\n            'symbol': symbol,\n            'amount': this.safeNumber (item, 'balChg'),\n            'before': undefined,\n            'after': this.safeNumber (item, 'bal'),\n            'status': 'ok',\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 5084,
        "line_end": 5099,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            '1': 'transfer', // transfer\n            '2': 'trade', // trade\n            '3': 'trade', // delivery\n            '4': 'rebate', // auto token conversion\n            '5': 'trade', // liquidation\n            '6': 'transfer', // margin transfer\n            '7': 'trade', // interest deduction\n            '8': 'fee', // funding rate\n            '9': 'trade', // adl\n            '10': 'trade', // clawback\n            '11': 'trade', // system token conversion\n        };\n        return this.safeString (types, type, type);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 5825,
        "line_end": 5851,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        let marketId = undefined;\n        let marginMode = undefined;\n        let longLeverage = undefined;\n        let shortLeverage = undefined;\n        for (let i = 0; i < leverage.length; i++) {\n            const entry = leverage[i];\n            marginMode = this.safeStringLower (entry, 'mgnMode');\n            marketId = this.safeString (entry, 'instId');\n            const positionSide = this.safeStringLower (entry, 'posSide');\n            if (positionSide === 'long') {\n                longLeverage = this.safeInteger (entry, 'lever');\n            } else if (positionSide === 'short') {\n                shortLeverage = this.safeInteger (entry, 'lever');\n            } else {\n                longLeverage = this.safeInteger (entry, 'lever');\n                shortLeverage = this.safeInteger (entry, 'lever');\n            }\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseLongShortRatio",
        "signature": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio",
        "line_start": 9174,
        "line_end": 9188,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timeframe",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longShortRatio",
            "value": "this.safeNumber (info, 'longShortRatio')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLongShortRatio (info: Dict, market: Market = undefined): LongShortRatio {\n        const timestamp = this.safeInteger (info, 'timestamp');\n        let symbol = undefined;\n        if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        return {\n            'info': info,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'timeframe': undefined,\n            'longShortRatio': this.safeNumber (info, 'longShortRatio'),\n        } as LongShortRatio;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 7624,
        "line_end": 7646,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amt')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amt\": \"102\",\n         \"availLoan\": \"97\",\n         \"ccy\": \"USDT\",\n         \"loanQuota\": \"6000000\",\n         \"posLoan\": \"0\",\n         \"side\": \"repay\",\n         \"usedLoan\": \"97\"\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"amt\": \"102\",\n        //         \"availLoan\": \"97\",\n        //         \"ccy\": \"USDT\",\n        //         \"loanQuota\": \"6000000\",\n        //         \"posLoan\": \"0\",\n        //         \"side\": \"repay\",\n        //         \"usedLoan\": \"97\"\n        //     }\n        //\n        const currencyId = this.safeString (info, 'ccy');\n        return {\n            'id': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (info, 'amt'),\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 7251,
        "line_end": 7324,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "responseMarket['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"amt\": \"0.01\",\n        \"instId\": \"ETH-USD-SWAP\",\n        \"posSide\": \"net\",\n        \"type\": \"reduce\"\n    }",
          "{\n        bal: '67621.4325135010619812',\n        balChg: '-10.0000000000000000',\n        billId: '691293628710342659',\n        ccy: 'USDT',\n        clOrdId: '',\n        execType: '',\n        fee: '0',\n        fillFwdPx: '',\n        fillIdxPx: '',\n        fillMarkPx: '',\n        fillMarkVol: '',\n        fillPxUsd: '',\n        fillPxVol: '',\n        fillTime: '1711089244850',\n        from: '',\n        instId: 'XRP-USDT-SWAP',\n        instType: 'SWAP',\n        interest: '0',\n        mgnMode: 'isolated',\n        notes: '',\n        ordId: '',\n        pnl: '0',\n        posBal: '73.12',\n        posBalChg: '10.00',\n        px: '',\n        subType: '160',\n        sz: '10',\n        tag: '',\n        to: '',\n        tradeId: '0',\n        ts: '1711089244699',\n        type: '6'\n    }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        // addMargin/reduceMargin\n        //\n        //    {\n        //        \"amt\": \"0.01\",\n        //        \"instId\": \"ETH-USD-SWAP\",\n        //        \"posSide\": \"net\",\n        //        \"type\": \"reduce\"\n        //    }\n        //\n        // fetchMarginAdjustmentHistory\n        //\n        //    {\n        //        bal: '67621.4325135010619812',\n        //        balChg: '-10.0000000000000000',\n        //        billId: '691293628710342659',\n        //        ccy: 'USDT',\n        //        clOrdId: '',\n        //        execType: '',\n        //        fee: '0',\n        //        fillFwdPx: '',\n        //        fillIdxPx: '',\n        //        fillMarkPx: '',\n        //        fillMarkVol: '',\n        //        fillPxUsd: '',\n        //        fillPxVol: '',\n        //        fillTime: '1711089244850',\n        //        from: '',\n        //        instId: 'XRP-USDT-SWAP',\n        //        instType: 'SWAP',\n        //        interest: '0',\n        //        mgnMode: 'isolated',\n        //        notes: '',\n        //        ordId: '',\n        //        pnl: '0',\n        //        posBal: '73.12',\n        //        posBalChg: '10.00',\n        //        px: '',\n        //        subType: '160',\n        //        sz: '10',\n        //        tag: '',\n        //        to: '',\n        //        tradeId: '0',\n        //        ts: '1711089244699',\n        //        type: '6'\n        //    }\n        //\n        const amountRaw = this.safeString2 (data, 'amt', 'posBalChg');\n        const typeRaw = this.safeString (data, 'type');\n        let type = undefined;\n        if (typeRaw === '6') {\n            type = Precise.stringGt (amountRaw, '0') ? 'add' : 'reduce';\n        } else {\n            type = typeRaw;\n        }\n        const amount = Precise.stringAbs (amountRaw);\n        const marketId = this.safeString (data, 'instId');\n        const responseMarket = this.safeMarket (marketId, market);\n        const code = responseMarket['inverse'] ? responseMarket['base'] : responseMarket['quote'];\n        const timestamp = this.safeInteger (data, 'ts');\n        return {\n            'info': data,\n            'symbol': responseMarket['symbol'],\n            'type': type,\n            'marginMode': 'isolated',\n            'amount': this.parseNumber (amount),\n            'code': code,\n            'total': undefined,\n            'status': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1669,
        "line_end": 1839,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "instIdCode",
            "value": "instIdCode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "spot && (Precise.stringGt (maxLeverage, '1'))",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "option",
            "comment": null
          },
          {
            "key": "active",
            "value": "status === 'live'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "contract ? (quoteId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "contract ? (baseId === settleId) : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contract ? this.safeNumber (market, 'ctVal') : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "this.parseNumber (strikePrice)",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "optionType",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger2 (market, 'contTdSwTime', 'listTime')",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSz')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"alias\": \"\", // this_week, next_week, quarter, next_quarter\n         \"baseCcy\": \"BTC\",\n         \"category\": \"1\",\n         \"ctMult\": \"\",\n         \"ctType\": \"\", // inverse, linear\n         \"ctVal\": \"\",\n         \"ctValCcy\": \"\",\n         \"expTime\": \"\",\n         \"instId\": \"BTC-USDT\", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C\n         \"instType\": \"SPOT\", // SPOT, FUTURES, SWAP, OPTION\n         \"lever\": \"10\",\n         \"listTime\": \"1548133413000\",\n         \"lotSz\": \"0.00000001\",\n         \"minSz\": \"0.00001\",\n         \"optType\": \"\",\n         \"quoteCcy\": \"USDT\",\n         \"settleCcy\": \"\",\n         \"state\": \"live\",\n         \"stk\": \"\",\n         \"tickSz\": \"0.1\",\n         \"uly\": \"\"\n     }",
          "{\n         \"alias\": \"\",\n         \"baseCcy\": \"\",\n         \"category\": \"1\",\n         \"ctMult\": \"0.1\",\n         \"ctType\": \"\",\n         \"ctVal\": \"1\",\n         \"ctValCcy\": \"BTC\",\n         \"expTime\": \"1648195200000\",\n         \"instId\": \"BTC-USD-220325-194000-P\",\n         \"instType\": \"OPTION\",\n         \"lever\": \"\",\n         \"listTime\": \"1631262612280\",\n         \"contTdSwTime\": \"1631262812280\",\n         \"lotSz\": \"1\",\n         \"minSz\": \"1\",\n         \"optType\": \"P\",\n         \"quoteCcy\": \"\",\n         \"settleCcy\": \"BTC\",\n         \"state\": \"live\",\n         \"stk\": \"194000\",\n         \"tickSz\": \"0.0005\",\n         \"uly\": \"BTC-USD\"\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"alias\": \"\", // this_week, next_week, quarter, next_quarter\n        //         \"baseCcy\": \"BTC\",\n        //         \"category\": \"1\",\n        //         \"ctMult\": \"\",\n        //         \"ctType\": \"\", // inverse, linear\n        //         \"ctVal\": \"\",\n        //         \"ctValCcy\": \"\",\n        //         \"expTime\": \"\",\n        //         \"instId\": \"BTC-USDT\", // BTC-USD-210521, CSPR-USDT-SWAP, BTC-USD-210517-44000-C\n        //         \"instType\": \"SPOT\", // SPOT, FUTURES, SWAP, OPTION\n        //         \"lever\": \"10\",\n        //         \"listTime\": \"1548133413000\",\n        //         \"lotSz\": \"0.00000001\",\n        //         \"minSz\": \"0.00001\",\n        //         \"optType\": \"\",\n        //         \"quoteCcy\": \"USDT\",\n        //         \"settleCcy\": \"\",\n        //         \"state\": \"live\",\n        //         \"stk\": \"\",\n        //         \"tickSz\": \"0.1\",\n        //         \"uly\": \"\"\n        //     }\n        //\n        //     {\n        //         \"alias\": \"\",\n        //         \"baseCcy\": \"\",\n        //         \"category\": \"1\",\n        //         \"ctMult\": \"0.1\",\n        //         \"ctType\": \"\",\n        //         \"ctVal\": \"1\",\n        //         \"ctValCcy\": \"BTC\",\n        //         \"expTime\": \"1648195200000\",\n        //         \"instId\": \"BTC-USD-220325-194000-P\",\n        //         \"instType\": \"OPTION\",\n        //         \"lever\": \"\",\n        //         \"listTime\": \"1631262612280\",\n        //         \"contTdSwTime\": \"1631262812280\",\n        //         \"lotSz\": \"1\",\n        //         \"minSz\": \"1\",\n        //         \"optType\": \"P\",\n        //         \"quoteCcy\": \"\",\n        //         \"settleCcy\": \"BTC\",\n        //         \"state\": \"live\",\n        //         \"stk\": \"194000\",\n        //         \"tickSz\": \"0.0005\",\n        //         \"uly\": \"BTC-USD\"\n        //     }\n        //\n        // for swap \"preopen\" markets, only `instId` and `instType` are present\n        //\n        //         instId: \"ETH-USD_UM-SWAP\",\n        //         instType: \"SWAP\",\n        //         state: \"preopen\",\n        //\n        const id = this.safeString (market, 'instId');\n        let type = this.safeStringLower (market, 'instType');\n        if (type === 'futures') {\n            type = 'future';\n        }\n        const spot = (type === 'spot');\n        const future = (type === 'future');\n        const swap = (type === 'swap');\n        const option = (type === 'option');\n        const contract = swap || future || option;\n        let baseId = this.safeString (market, 'baseCcy', ''); // defaulting to '' because some weird preopen markets have empty baseId\n        let quoteId = this.safeString (market, 'quoteCcy', '');\n        const settleId = this.safeString (market, 'settleCcy');\n        const settle = this.safeCurrencyCode (settleId);\n        const underlying = this.safeString (market, 'uly');\n        if ((underlying !== undefined) && !spot) {\n            const parts = underlying.split ('-');\n            baseId = this.safeString (parts, 0);\n            quoteId = this.safeString (parts, 1);\n        }\n        if (((baseId === '') || (quoteId === '')) && spot) { // to fix weird preopen markets\n            const instId = this.safeString (market, 'instId', '');\n            const parts = instId.split ('-');\n            baseId = this.safeString (parts, 0);\n            quoteId = this.safeString (parts, 1);\n        }\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        // handle preopen empty markets\n        if (base === '' || quote === '') {\n            symbol = id;\n        }\n        let expiry = undefined;\n        let strikePrice = undefined;\n        let optionType = undefined;\n        if (contract) {\n            if (settle !== undefined) {\n                symbol = symbol + ':' + settle;\n            }\n            if (future) {\n                expiry = this.safeInteger (market, 'expTime');\n                if (expiry !== undefined) {\n                    const ymd = this.yymmdd (expiry);\n                    symbol = symbol + '-' + ymd;\n                }\n            } else if (option) {\n                expiry = this.safeInteger (market, 'expTime');\n                strikePrice = this.safeString (market, 'stk');\n                optionType = this.safeString (market, 'optType');\n                if (expiry !== undefined) {\n                    const ymd = this.yymmdd (expiry);\n                    symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;\n                    optionType = (optionType === 'P') ? 'put' : 'call';\n                }\n            }\n        }\n        const fees = this.safeDict2 (this.fees, type, 'trading', {});\n        let maxLeverage = this.safeString (market, 'lever', '1');\n        maxLeverage = Precise.stringMax (maxLeverage, '1');\n        const maxSpotCost = this.safeNumber (market, 'maxMktSz');\n        const status = this.safeString (market, 'state');\n        const instIdCode = this.safeInteger (market, 'instIdCode');\n        return this.extend (fees, {\n            'id': id,\n            'instIdCode': instIdCode,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': spot && (Precise.stringGt (maxLeverage, '1')),\n            'swap': swap,\n            'future': future,\n            'option': option,\n            'active': status === 'live',\n            'contract': contract,\n            'linear': contract ? (quoteId === settleId) : undefined,\n            'inverse': contract ? (baseId === settleId) : undefined,\n            'contractSize': contract ? this.safeNumber (market, 'ctVal') : undefined,\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': this.parseNumber (strikePrice),\n            'optionType': optionType,\n            'created': this.safeInteger2 (market, 'contTdSwTime', 'listTime'), // contTdSwTime is public trading start time, while listTime considers pre-trading too\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tickSz'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.parseNumber (maxLeverage),\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': contract ? undefined : maxSpotCost,\n                },\n            },\n            'info': market,\n        });\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 7413,
        "line_end": 7454,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (tier, 'tier')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (tier, 'minSz')",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'maxSz')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'mmr')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'maxLever')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "@param {object} info Exchange response for 1 market",
          "@param {object} market CCXT market",
          "[\n        {\n            \"baseMaxLoan\": \"500\",\n            \"imr\": \"0.1\",\n            \"instId\": \"ETH-USDT\",\n            \"maxLever\": \"10\",\n            \"maxSz\": \"500\",\n            \"minSz\": \"0\",\n            \"mmr\": \"0.03\",\n            \"optMgnFactor\": \"0\",\n            \"quoteMaxLoan\": \"200000\",\n            \"tier\": \"1\",\n            \"uly\": \"\"\n        },\n        ...\n    ]"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @ignore\n         * @method\n         * @param {object} info Exchange response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //    [\n        //        {\n        //            \"baseMaxLoan\": \"500\",\n        //            \"imr\": \"0.1\",\n        //            \"instId\": \"ETH-USDT\",\n        //            \"maxLever\": \"10\",\n        //            \"maxSz\": \"500\",\n        //            \"minSz\": \"0\",\n        //            \"mmr\": \"0.03\",\n        //            \"optMgnFactor\": \"0\",\n        //            \"quoteMaxLoan\": \"200000\",\n        //            \"tier\": \"1\",\n        //            \"uly\": \"\"\n        //        },\n        //        ...\n        //    ]\n        //\n        const tiers = [];\n        for (let i = 0; i < info.length; i++) {\n            const tier = info[i];\n            const marketId = this.safeString (tier, 'instId');\n            tiers.push ({\n                'tier': this.safeInteger (tier, 'tier'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['quote'],\n                'minNotional': this.safeNumber (tier, 'minSz'),\n                'maxNotional': this.safeNumber (tier, 'maxSz'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'mmr'),\n                'maxLeverage': this.safeNumber (tier, 'maxLever'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2507,
        "line_end": 2532,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1678928760000\", // timestamp\n         \"24341.4\", // open\n         \"24344\", // high\n         \"24313.2\", // low\n         \"24323\", // close\n         \"628\", // contract volume\n         \"2.5819\", // base volume\n         \"62800\", // quote volume\n         \"0\" // candlestick state\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1678928760000\", // timestamp\n        //         \"24341.4\", // open\n        //         \"24344\", // high\n        //         \"24313.2\", // low\n        //         \"24323\", // close\n        //         \"628\", // contract volume\n        //         \"2.5819\", // base volume\n        //         \"62800\", // quote volume\n        //         \"0\" // candlestick state\n        //     ]\n        //\n        const res = this.handleMarketTypeAndParams ('fetchOHLCV', market, undefined);\n        const type = res[0];\n        const volumeIndex = (type === 'spot') ? 5 : 6;\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, volumeIndex),\n        ];\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 7819,
        "line_end": 7872,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (id)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "openInterestValue",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "[\n        \"1648221300000\",  // timestamp\n        \"2183354317.945\",  // open interest (USD) - (coin) for options\n        \"74285877.617\",  // volume (USD) - (coin) for options\n    ]",
          "{\n         \"instId\": \"BTC-USD-230520-25500-P\",\n         \"instType\": \"OPTION\",\n         \"oi\": \"300\",\n         \"oiCcy\": \"3\",\n         \"oiUsd\": \"3\",\n         \"ts\": \"1684551166251\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        // fetchOpenInterestHistory\n        //\n        //    [\n        //        \"1648221300000\",  // timestamp\n        //        \"2183354317.945\",  // open interest (USD) - (coin) for options\n        //        \"74285877.617\",  // volume (USD) - (coin) for options\n        //    ]\n        //\n        // fetchOpenInterest\n        //\n        //     {\n        //         \"instId\": \"BTC-USD-230520-25500-P\",\n        //         \"instType\": \"OPTION\",\n        //         \"oi\": \"300\",\n        //         \"oiCcy\": \"3\",\n        //         \"oiUsd\": \"3\",\n        //         \"ts\": \"1684551166251\"\n        //     }\n        //\n        const id = this.safeString (interest, 'instId');\n        market = this.safeMarket (id, market);\n        const time = this.safeInteger (interest, 'ts');\n        const timestamp = this.safeInteger (interest, 0, time);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        let openInterestAmount = undefined;\n        let openInterestValue = undefined;\n        const type = this.safeString (this.options, 'defaultType');\n        if (Array.isArray (interest)) {\n            if (type === 'option') {\n                openInterestAmount = this.safeNumber (interest, 1);\n                baseVolume = this.safeNumber (interest, 2);\n            } else {\n                openInterestValue = this.safeNumber (interest, 1);\n                quoteVolume = this.safeNumber (interest, 2);\n            }\n        } else {\n            baseVolume = this.safeNumber (interest, 'oiCcy');\n            openInterestAmount = this.safeNumber (interest, 'oi');\n            openInterestValue = this.safeNumber (interest, 'oiUsd');\n        }\n        return this.safeOpenInterest ({\n            'symbol': this.safeSymbol (id),\n            'baseVolume': baseVolume,  // deprecated\n            'quoteVolume': quoteVolume,  // deprecated\n            'openInterestAmount': openInterestAmount,\n            'openInterestValue': openInterestValue,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOption",
        "signature": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option",
        "line_start": 8506,
        "line_end": 8549,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "chain",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "impliedVolatility",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterest",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (chain, 'bidPx')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (chain, 'askPx')",
            "comment": null
          },
          {
            "key": "midPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (chain, 'last')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (chain, 'volCcy24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instType\": \"OPTION\",\n         \"instId\": \"BTC-USD-241227-60000-P\",\n         \"last\": \"\",\n         \"lastSz\": \"0\",\n         \"askPx\": \"\",\n         \"askSz\": \"0\",\n         \"bidPx\": \"\",\n         \"bidSz\": \"0\",\n         \"open24h\": \"\",\n         \"high24h\": \"\",\n         \"low24h\": \"\",\n         \"volCcy24h\": \"0\",\n         \"vol24h\": \"0\",\n         \"ts\": \"1711176035035\",\n         \"sodUtc0\": \"\",\n         \"sodUtc8\": \"\"\n     }"
        ],
        "source": "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n        //\n        //     {\n        //         \"instType\": \"OPTION\",\n        //         \"instId\": \"BTC-USD-241227-60000-P\",\n        //         \"last\": \"\",\n        //         \"lastSz\": \"0\",\n        //         \"askPx\": \"\",\n        //         \"askSz\": \"0\",\n        //         \"bidPx\": \"\",\n        //         \"bidSz\": \"0\",\n        //         \"open24h\": \"\",\n        //         \"high24h\": \"\",\n        //         \"low24h\": \"\",\n        //         \"volCcy24h\": \"0\",\n        //         \"vol24h\": \"0\",\n        //         \"ts\": \"1711176035035\",\n        //         \"sodUtc0\": \"\",\n        //         \"sodUtc8\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (chain, 'instId');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (chain, 'ts');\n        return {\n            'info': chain,\n            'currency': undefined,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'impliedVolatility': undefined,\n            'openInterest': undefined,\n            'bidPrice': this.safeNumber (chain, 'bidPx'),\n            'askPrice': this.safeNumber (chain, 'askPx'),\n            'midPrice': undefined,\n            'markPrice': undefined,\n            'lastPrice': this.safeNumber (chain, 'last'),\n            'underlyingPrice': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'baseVolume': this.safeNumber (chain, 'volCcy24h'),\n            'quoteVolume': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 3897,
        "line_end": 4178,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'ordId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clOrdId')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumberN (order, [ 'triggerPx', 'moveTriggerPx' ])",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (feeCostSigned)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"clOrdId\": \"oktswap6\",\n         \"ordId\": \"312269865356374016\",\n         \"tag\": \"\",\n         \"sCode\": \"0\",\n         \"sMsg\": \"\"\n     }",
          "{\n         \"clOrdId\": \"e847386590ce4dBCc1a045253497a547\",\n         \"ordId\": \"559176536793178112\",\n         \"reqId\": \"\",\n         \"sCode\": \"0\",\n         \"sMsg\": \"\"\n     }",
          "{\n         \"accFillSz\": \"0\",\n         \"avgPx\": \"\",\n         \"cTime\": \"1621910749815\",\n         \"category\": \"normal\",\n         \"ccy\": \"\",\n         \"clOrdId\": \"\",\n         \"fee\": \"0\",\n         \"feeCcy\": \"ETH\",\n         \"fillPx\": \"\",\n         \"fillSz\": \"0\",\n         \"fillTime\": \"\",\n         \"instId\": \"ETH-USDT\",\n         \"instType\": \"SPOT\",\n         \"lever\": \"\",\n         \"ordId\": \"317251910906576896\",\n         \"ordType\": \"limit\",\n         \"pnl\": \"0\",\n         \"posSide\": \"net\",\n         \"px\": \"2000\",\n         \"rebate\": \"0\",\n         \"rebateCcy\": \"USDT\",\n         \"side\": \"buy\",\n         \"slOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"state\": \"live\",\n         \"sz\": \"0.001\",\n         \"tag\": \"\",\n         \"tdMode\": \"cash\",\n         \"tpOrdPx\": \"\",\n         \"tpTriggerPx\": \"\",\n         \"tradeId\": \"\",\n         \"uTime\": \"1621910749815\"\n     }",
          "{\n        \"algoClOrdId\": \"\",\n        \"algoId\": \"\",\n        \"attachAlgoClOrdId\": \"\",\n        \"attachAlgoOrds\": [],\n        \"cancelSource\": \"\",\n        \"cancelSourceReason\": \"\", // not present in WS, but present in fetchClosedOrders\n        \"category\": \"normal\",\n        \"ccy\": \"\", // empty in WS, but eg. `USDT` in fetchClosedOrders\n        \"clOrdId\": \"\",\n        \"cTime\": \"1751705801423\",\n        \"feeCcy\": \"USDT\",\n        \"instId\": \"LINK-USDT-SWAP\",\n        \"instType\": \"SWAP\",\n        \"isTpLimit\": \"false\",\n        \"lever\": \"3\",\n        \"linkedAlgoOrd\": { \"algoId\": \"\" },\n        \"ordId\": \"2657625147249614848\",\n        \"ordType\": \"limit\",\n        \"posSide\": \"net\",\n        \"px\": \"13.142\",\n        \"pxType\": \"\",\n        \"pxUsd\": \"\",\n        \"pxVol\": \"\",\n        \"quickMgnType\": \"\",\n        \"rebate\": \"0\",\n        \"rebateCcy\": \"USDT\",\n        \"reduceOnly\": \"true\",\n        \"side\": \"sell\",\n        \"slOrdPx\": \"\",\n        \"slTriggerPx\": \"\",\n        \"slTriggerPxType\": \"\",\n        \"source\": \"\",\n        \"stpId\": \"\",\n        \"stpMode\": \"cancel_maker\",\n        \"sz\": \"0.1\",\n        \"tag\": \"\",\n        \"tdMode\": \"isolated\",\n        \"tgtCcy\": \"\",\n        \"tpOrdPx\": \"\",\n        \"tpTriggerPx\": \"\",\n        \"tpTriggerPxType\": \"\",\n        \"uTime\": \"1751705807467\",\n        \"reqId\": \"\",                      // field present only in WS\n        \"msg\": \"\",                        // field present only in WS\n        \"amendResult\": \"\",                // field present only in WS\n        \"amendSource\": \"\",                // field present only in WS\n        \"code\": \"0\",                      // field present only in WS\n        \"fillFwdPx\": \"\",                  // field present only in WS\n        \"fillMarkVol\": \"\",                // field present only in WS\n        \"fillPxUsd\": \"\",                  // field present only in WS\n        \"fillPxVol\": \"\",                  // field present only in WS\n        \"lastPx\": \"13.142\",               // field present only in WS\n        \"notionalUsd\": \"1.314515408\",     // field present only in WS\n\n     #### these below fields are empty on first omit from websocket, because of \"creation\" event. however, if order is executed, it also immediately sends another update with these fields filled  ###\n\n        \"pnl\": \"-0.0001\",\n        \"accFillSz\": \"0.1\",\n        \"avgPx\": \"13.142\",\n        \"state\": \"filled\",\n        \"fee\": \"-0.00026284\",\n        \"fillPx\": \"13.142\",\n        \"tradeId\": \"293429690\",\n        \"fillSz\": \"0.1\",\n        \"fillTime\": \"1751705807467\",\n        \"fillNotionalUsd\": \"1.314515408\", // field present only in WS\n        \"fillPnl\": \"-0.0001\",             // field present only in WS\n        \"fillFee\": \"-0.00026284\",         // field present only in WS\n        \"fillFeeCcy\": \"USDT\",             // field present only in WS\n        \"execType\": \"M\",                  // field present only in WS\n        \"fillMarkPx\": \"13.141\",           // field present only in WS\n        \"fillIdxPx\": \"13.147\"             // field present only in WS\n    }",
          "{\n         \"activePx\": \"\",\n         \"activePxType\": \"\",\n         \"actualPx\": \"\",\n         \"actualSide\": \"buy\",\n         \"actualSz\": \"0\",\n         \"algoId\": \"431375349042380800\",\n         \"cTime\": \"1649119897778\",\n         \"callbackRatio\": \"\",\n         \"callbackSpread\": \"\",\n         \"ccy\": \"\",\n         \"ctVal\": \"0.01\",\n         \"instId\": \"BTC-USDT-SWAP\",\n         \"instType\": \"SWAP\",\n         \"last\": \"46538.9\",\n         \"lever\": \"125\",\n         \"moveTriggerPx\": \"\",\n         \"notionalUsd\": \"467.059\",\n         \"ordId\": \"\",\n         \"ordPx\": \"50000\",\n         \"ordType\": \"trigger\",\n         \"posSide\": \"long\",\n         \"pxLimit\": \"\",\n         \"pxSpread\": \"\",\n         \"pxVar\": \"\",\n         \"side\": \"buy\",\n         \"slOrdPx\": \"\",\n         \"slTriggerPx\": \"\",\n         \"slTriggerPxType\": \"\",\n         \"state\": \"live\",\n         \"sz\": \"1\",\n         \"szLimit\": \"\",\n         \"tag\": \"\",\n         \"tdMode\": \"isolated\",\n         \"tgtCcy\": \"\",\n         \"timeInterval\": \"\",\n         \"tpOrdPx\": \"\",\n         \"tpTriggerPx\": \"\",\n         \"tpTriggerPxType\": \"\",\n         \"triggerPx\": \"50000\",\n         \"triggerPxType\": \"last\",\n         \"triggerTime\": \"\",\n         \"uly\": \"BTC-USDT\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"clOrdId\": \"oktswap6\",\n        //         \"ordId\": \"312269865356374016\",\n        //         \"tag\": \"\",\n        //         \"sCode\": \"0\",\n        //         \"sMsg\": \"\"\n        //     }\n        //\n        // editOrder\n        //\n        //     {\n        //         \"clOrdId\": \"e847386590ce4dBCc1a045253497a547\",\n        //         \"ordId\": \"559176536793178112\",\n        //         \"reqId\": \"\",\n        //         \"sCode\": \"0\",\n        //         \"sMsg\": \"\"\n        //     }\n        //\n        // Spot and Swap fetchOrder, fetchOpenOrders\n        //\n        //     {\n        //         \"accFillSz\": \"0\",\n        //         \"avgPx\": \"\",\n        //         \"cTime\": \"1621910749815\",\n        //         \"category\": \"normal\",\n        //         \"ccy\": \"\",\n        //         \"clOrdId\": \"\",\n        //         \"fee\": \"0\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"fillPx\": \"\",\n        //         \"fillSz\": \"0\",\n        //         \"fillTime\": \"\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"instType\": \"SPOT\",\n        //         \"lever\": \"\",\n        //         \"ordId\": \"317251910906576896\",\n        //         \"ordType\": \"limit\",\n        //         \"pnl\": \"0\",\n        //         \"posSide\": \"net\",\n        //         \"px\": \"2000\",\n        //         \"rebate\": \"0\",\n        //         \"rebateCcy\": \"USDT\",\n        //         \"side\": \"buy\",\n        //         \"slOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"state\": \"live\",\n        //         \"sz\": \"0.001\",\n        //         \"tag\": \"\",\n        //         \"tdMode\": \"cash\",\n        //         \"tpOrdPx\": \"\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tradeId\": \"\",\n        //         \"uTime\": \"1621910749815\"\n        //     }\n        //\n        // watchOrders & fetchClosedOrders\n        //\n        //    {\n        //        \"algoClOrdId\": \"\",\n        //        \"algoId\": \"\",\n        //        \"attachAlgoClOrdId\": \"\",\n        //        \"attachAlgoOrds\": [],\n        //        \"cancelSource\": \"\",\n        //        \"cancelSourceReason\": \"\", // not present in WS, but present in fetchClosedOrders\n        //        \"category\": \"normal\",\n        //        \"ccy\": \"\", // empty in WS, but eg. `USDT` in fetchClosedOrders\n        //        \"clOrdId\": \"\",\n        //        \"cTime\": \"1751705801423\",\n        //        \"feeCcy\": \"USDT\",\n        //        \"instId\": \"LINK-USDT-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"isTpLimit\": \"false\",\n        //        \"lever\": \"3\",\n        //        \"linkedAlgoOrd\": { \"algoId\": \"\" },\n        //        \"ordId\": \"2657625147249614848\",\n        //        \"ordType\": \"limit\",\n        //        \"posSide\": \"net\",\n        //        \"px\": \"13.142\",\n        //        \"pxType\": \"\",\n        //        \"pxUsd\": \"\",\n        //        \"pxVol\": \"\",\n        //        \"quickMgnType\": \"\",\n        //        \"rebate\": \"0\",\n        //        \"rebateCcy\": \"USDT\",\n        //        \"reduceOnly\": \"true\",\n        //        \"side\": \"sell\",\n        //        \"slOrdPx\": \"\",\n        //        \"slTriggerPx\": \"\",\n        //        \"slTriggerPxType\": \"\",\n        //        \"source\": \"\",\n        //        \"stpId\": \"\",\n        //        \"stpMode\": \"cancel_maker\",\n        //        \"sz\": \"0.1\",\n        //        \"tag\": \"\",\n        //        \"tdMode\": \"isolated\",\n        //        \"tgtCcy\": \"\",\n        //        \"tpOrdPx\": \"\",\n        //        \"tpTriggerPx\": \"\",\n        //        \"tpTriggerPxType\": \"\",\n        //        \"uTime\": \"1751705807467\",\n        //        \"reqId\": \"\",                      // field present only in WS\n        //        \"msg\": \"\",                        // field present only in WS\n        //        \"amendResult\": \"\",                // field present only in WS\n        //        \"amendSource\": \"\",                // field present only in WS\n        //        \"code\": \"0\",                      // field present only in WS\n        //        \"fillFwdPx\": \"\",                  // field present only in WS\n        //        \"fillMarkVol\": \"\",                // field present only in WS\n        //        \"fillPxUsd\": \"\",                  // field present only in WS\n        //        \"fillPxVol\": \"\",                  // field present only in WS\n        //        \"lastPx\": \"13.142\",               // field present only in WS\n        //        \"notionalUsd\": \"1.314515408\",     // field present only in WS\n        //\n        //     #### these below fields are empty on first omit from websocket, because of \"creation\" event. however, if order is executed, it also immediately sends another update with these fields filled  ###\n        //\n        //        \"pnl\": \"-0.0001\",\n        //        \"accFillSz\": \"0.1\",\n        //        \"avgPx\": \"13.142\",\n        //        \"state\": \"filled\",\n        //        \"fee\": \"-0.00026284\",\n        //        \"fillPx\": \"13.142\",\n        //        \"tradeId\": \"293429690\",\n        //        \"fillSz\": \"0.1\",\n        //        \"fillTime\": \"1751705807467\",\n        //        \"fillNotionalUsd\": \"1.314515408\", // field present only in WS\n        //        \"fillPnl\": \"-0.0001\",             // field present only in WS\n        //        \"fillFee\": \"-0.00026284\",         // field present only in WS\n        //        \"fillFeeCcy\": \"USDT\",             // field present only in WS\n        //        \"execType\": \"M\",                  // field present only in WS\n        //        \"fillMarkPx\": \"13.141\",           // field present only in WS\n        //        \"fillIdxPx\": \"13.147\"             // field present only in WS\n        //    }\n        //\n        //\n        // Algo Order fetchOpenOrders, fetchCanceledOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"activePx\": \"\",\n        //         \"activePxType\": \"\",\n        //         \"actualPx\": \"\",\n        //         \"actualSide\": \"buy\",\n        //         \"actualSz\": \"0\",\n        //         \"algoId\": \"431375349042380800\",\n        //         \"cTime\": \"1649119897778\",\n        //         \"callbackRatio\": \"\",\n        //         \"callbackSpread\": \"\",\n        //         \"ccy\": \"\",\n        //         \"ctVal\": \"0.01\",\n        //         \"instId\": \"BTC-USDT-SWAP\",\n        //         \"instType\": \"SWAP\",\n        //         \"last\": \"46538.9\",\n        //         \"lever\": \"125\",\n        //         \"moveTriggerPx\": \"\",\n        //         \"notionalUsd\": \"467.059\",\n        //         \"ordId\": \"\",\n        //         \"ordPx\": \"50000\",\n        //         \"ordType\": \"trigger\",\n        //         \"posSide\": \"long\",\n        //         \"pxLimit\": \"\",\n        //         \"pxSpread\": \"\",\n        //         \"pxVar\": \"\",\n        //         \"side\": \"buy\",\n        //         \"slOrdPx\": \"\",\n        //         \"slTriggerPx\": \"\",\n        //         \"slTriggerPxType\": \"\",\n        //         \"state\": \"live\",\n        //         \"sz\": \"1\",\n        //         \"szLimit\": \"\",\n        //         \"tag\": \"\",\n        //         \"tdMode\": \"isolated\",\n        //         \"tgtCcy\": \"\",\n        //         \"timeInterval\": \"\",\n        //         \"tpOrdPx\": \"\",\n        //         \"tpTriggerPx\": \"\",\n        //         \"tpTriggerPxType\": \"\",\n        //         \"triggerPx\": \"50000\",\n        //         \"triggerPxType\": \"last\",\n        //         \"triggerTime\": \"\",\n        //         \"uly\": \"BTC-USDT\"\n        //     }\n        //\n        const scode = this.safeString (order, 'sCode');\n        if ((scode !== undefined) && (scode !== '0')) {\n            return this.safeOrder ({\n                'id': this.safeString (order, 'ordId'),\n                'clientOrderId': this.safeString (order, 'clOrdId'),\n                'status': 'rejected',\n                'info': order,\n            });\n        }\n        const id = this.safeString2 (order, 'algoId', 'ordId');\n        const timestamp = this.safeInteger (order, 'cTime');\n        const lastUpdateTimestamp = this.safeInteger (order, 'uTime');\n        const lastTradeTimestamp = this.safeInteger (order, 'fillTime');\n        const side = this.safeString (order, 'side');\n        let type = this.safeString (order, 'ordType');\n        let postOnly = undefined;\n        let timeInForce = undefined;\n        if (type === 'post_only') {\n            postOnly = true;\n            type = 'limit';\n        } else if (type === 'fok') {\n            timeInForce = 'FOK';\n            type = 'limit';\n        } else if (type === 'ioc') {\n            timeInForce = 'IOC';\n            type = 'limit';\n        }\n        const marketId = this.safeString (order, 'instId');\n        market = this.safeMarket (marketId, market);\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const filled = this.safeString (order, 'accFillSz');\n        const price = this.safeString2 (order, 'px', 'ordPx');\n        const average = this.safeString (order, 'avgPx');\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const feeCostString = this.safeString (order, 'fee');\n        let amount = undefined;\n        let cost = undefined;\n        // spot market buy: \"sz\" can refer either to base currency units or to quote currency units\n        // see documentation: https://www.okx.com/docs-v5/en/#rest-api-trade-place-order\n        const defaultTgtCcy = this.safeString (this.options, 'tgtCcy', 'base_ccy');\n        const tgtCcy = this.safeString (order, 'tgtCcy', defaultTgtCcy);\n        const instType = this.safeString (order, 'instType');\n        if ((side === 'buy') && (type === 'market') && (instType === 'SPOT') && (tgtCcy === 'quote_ccy')) {\n            // \"sz\" refers to the cost\n            cost = this.safeString (order, 'sz');\n        } else {\n            // \"sz\" refers to the trade currency amount\n            amount = this.safeString (order, 'sz');\n        }\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (order, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': this.parseNumber (feeCostSigned),\n                'currency': feeCurrencyCode,\n            };\n        }\n        let clientOrderId = this.safeString (order, 'clOrdId');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined; // fix empty clientOrderId string\n        }\n        const stopLossPrice = this.safeNumber2 (order, 'slTriggerPx', 'slOrdPx');\n        const takeProfitPrice = this.safeNumber2 (order, 'tpTriggerPx', 'tpOrdPx');\n        const reduceOnlyRaw = this.safeString (order, 'reduceOnly');\n        let reduceOnly = false;\n        if (reduceOnly !== undefined) {\n            reduceOnly = (reduceOnlyRaw === 'true');\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'stopLossPrice': stopLossPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'triggerPrice': this.safeNumberN (order, [ 'triggerPx', 'moveTriggerPx' ]),\n            'average': average,\n            'cost': cost,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n            'reduceOnly': reduceOnly,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 3885,
        "line_end": 3895,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'canceled': 'canceled',\n            'order_failed': 'canceled',\n            'live': 'open',\n            'partially_filled': 'open',\n            'filled': 'closed',\n            'effective': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 6036,
        "line_end": 6203,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'posId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPriceString)",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealizedPnlString)",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'realizedPnl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "contracts",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPriceString)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (position, 'closeAvgPx')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'uTime')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "maintenanceMargin",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "maintenanceMarginPercentage",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateralString)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentage)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.parseNumber (leverageString)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "marginRatio",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"adl\": \"3\",\n        \"availPos\": \"1\",\n        \"avgPx\": \"34131.1\",\n        \"cTime\": \"1627227626502\",\n        \"ccy\": \"USDT\",\n        \"deltaBS\": \"\",\n        \"deltaPA\": \"\",\n        \"gammaBS\": \"\",\n        \"gammaPA\": \"\",\n        \"imr\": \"170.66093041794787\",\n        \"instId\": \"BTC-USDT-SWAP\",\n        \"instType\": \"SWAP\",\n        \"interest\": \"0\",\n        \"last\": \"34134.4\",\n        \"lever\": \"2\",\n        \"liab\": \"\",\n        \"liabCcy\": \"\",\n        \"liqPx\": \"12608.959083877446\",\n        \"markPx\": \"4786.459271773621\",\n        \"margin\": \"\",\n        \"mgnMode\": \"cross\",\n        \"mgnRatio\": \"140.49930117599155\",\n        \"mmr\": \"1.3652874433435829\",\n        \"notionalUsd\": \"341.5130010779638\",\n        \"optVal\": \"\",\n        \"pos\": \"1\",\n        \"posCcy\": \"\",\n        \"posId\": \"339552508062380036\",\n        \"posSide\": \"long\",\n        \"thetaBS\": \"\",\n        \"thetaPA\": \"\",\n        \"tradeId\": \"98617799\",\n        \"uTime\": \"1627227626502\",\n        \"upl\": \"0.0108608358957281\",\n        \"uplRatio\": \"0.0000636418743944\",\n        \"vegaBS\": \"\",\n        \"vegaPA\": \"\"\n    }",
          "{\n        \"cTime\":\"1708351230102\",\n        \"ccy\":\"USDT\",\n        \"closeAvgPx\":\"1.2567\",\n        \"closeTotalPos\":\"40\",\n        \"direction\":\"short\",\n        \"fee\":\"-0.0351036\",\n        \"fundingFee\":\"0\",\n        \"instId\":\"SUSHI-USDT-SWAP\",\n        \"instType\":\"SWAP\",\n        \"lever\":\"10.0\",\n        \"liqPenalty\":\"0\",\n        \"mgnMode\":\"isolated\",\n        \"openAvgPx\":\"1.2462\",\n        \"openMaxPos\":\"40\",\n        \"pnl\":\"-0.42\",\n        \"pnlRatio\":\"-0.0912982667308618\",\n        \"posId\":\"666159086676836352\",\n        \"realizedPnl\":\"-0.4551036\",\n        \"triggerPx\":\"\",\n        \"type\":\"2\",\n        \"uTime\":\"1708354805699\",\n        \"uly\":\"SUSHI-USDT\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //        \"adl\": \"3\",\n        //        \"availPos\": \"1\",\n        //        \"avgPx\": \"34131.1\",\n        //        \"cTime\": \"1627227626502\",\n        //        \"ccy\": \"USDT\",\n        //        \"deltaBS\": \"\",\n        //        \"deltaPA\": \"\",\n        //        \"gammaBS\": \"\",\n        //        \"gammaPA\": \"\",\n        //        \"imr\": \"170.66093041794787\",\n        //        \"instId\": \"BTC-USDT-SWAP\",\n        //        \"instType\": \"SWAP\",\n        //        \"interest\": \"0\",\n        //        \"last\": \"34134.4\",\n        //        \"lever\": \"2\",\n        //        \"liab\": \"\",\n        //        \"liabCcy\": \"\",\n        //        \"liqPx\": \"12608.959083877446\",\n        //        \"markPx\": \"4786.459271773621\",\n        //        \"margin\": \"\",\n        //        \"mgnMode\": \"cross\",\n        //        \"mgnRatio\": \"140.49930117599155\",\n        //        \"mmr\": \"1.3652874433435829\",\n        //        \"notionalUsd\": \"341.5130010779638\",\n        //        \"optVal\": \"\",\n        //        \"pos\": \"1\",\n        //        \"posCcy\": \"\",\n        //        \"posId\": \"339552508062380036\",\n        //        \"posSide\": \"long\",\n        //        \"thetaBS\": \"\",\n        //        \"thetaPA\": \"\",\n        //        \"tradeId\": \"98617799\",\n        //        \"uTime\": \"1627227626502\",\n        //        \"upl\": \"0.0108608358957281\",\n        //        \"uplRatio\": \"0.0000636418743944\",\n        //        \"vegaBS\": \"\",\n        //        \"vegaPA\": \"\"\n        //    }\n        // history\n        //    {\n        //        \"cTime\":\"1708351230102\",\n        //        \"ccy\":\"USDT\",\n        //        \"closeAvgPx\":\"1.2567\",\n        //        \"closeTotalPos\":\"40\",\n        //        \"direction\":\"short\",\n        //        \"fee\":\"-0.0351036\",\n        //        \"fundingFee\":\"0\",\n        //        \"instId\":\"SUSHI-USDT-SWAP\",\n        //        \"instType\":\"SWAP\",\n        //        \"lever\":\"10.0\",\n        //        \"liqPenalty\":\"0\",\n        //        \"mgnMode\":\"isolated\",\n        //        \"openAvgPx\":\"1.2462\",\n        //        \"openMaxPos\":\"40\",\n        //        \"pnl\":\"-0.42\",\n        //        \"pnlRatio\":\"-0.0912982667308618\",\n        //        \"posId\":\"666159086676836352\",\n        //        \"realizedPnl\":\"-0.4551036\",\n        //        \"triggerPx\":\"\",\n        //        \"type\":\"2\",\n        //        \"uTime\":\"1708354805699\",\n        //        \"uly\":\"SUSHI-USDT\"\n        //    }\n        //\n        const marketId = this.safeString (position, 'instId');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = market['symbol'];\n        const pos = this.safeString (position, 'pos'); // 'pos' field: One way mode: 0 if position is not open, 1 if open | Two way (hedge) mode: -1 if short, 1 if long, 0 if position is not open\n        const contractsAbs = Precise.stringAbs (pos);\n        let side = this.safeString2 (position, 'posSide', 'direction');\n        const hedged = side !== 'net';\n        const contracts = this.parseNumber (contractsAbs);\n        if (market['margin']) {\n            // margin position\n            if (side === 'net') {\n                const posCcy = this.safeString (position, 'posCcy');\n                const parsedCurrency = this.safeCurrencyCode (posCcy);\n                if (parsedCurrency !== undefined) {\n                    side = (market['base'] === parsedCurrency) ? 'long' : 'short';\n                }\n            }\n            if (side === undefined) {\n                side = this.safeString (position, 'direction');\n            }\n        } else {\n            if (pos !== undefined) {\n                if (side === 'net') {\n                    if (Precise.stringGt (pos, '0')) {\n                        side = 'long';\n                    } else if (Precise.stringLt (pos, '0')) {\n                        side = 'short';\n                    } else {\n                        side = undefined;\n                    }\n                }\n            }\n        }\n        const contractSize = this.safeNumber (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const markPriceString = this.safeString (position, 'markPx');\n        let notionalString = this.safeString (position, 'notionalUsd');\n        if (market['inverse']) {\n            notionalString = Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), markPriceString);\n        }\n        const notional = this.parseNumber (notionalString);\n        const marginMode = this.safeString (position, 'mgnMode');\n        let initialMarginString = undefined;\n        const entryPriceString = this.safeString2 (position, 'avgPx', 'openAvgPx');\n        const unrealizedPnlString = this.safeString (position, 'upl');\n        const leverageString = this.safeString (position, 'lever');\n        let initialMarginPercentage = undefined;\n        let collateralString = undefined;\n        if (marginMode === 'cross') {\n            initialMarginString = this.safeString (position, 'imr');\n            collateralString = Precise.stringAdd (initialMarginString, unrealizedPnlString);\n        } else if (marginMode === 'isolated') {\n            initialMarginPercentage = Precise.stringDiv ('1', leverageString);\n            collateralString = this.safeString (position, 'margin');\n        }\n        const maintenanceMarginString = this.safeString (position, 'mmr');\n        const maintenanceMargin = this.parseNumber (maintenanceMarginString);\n        const maintenanceMarginPercentageString = Precise.stringDiv (maintenanceMarginString, notionalString);\n        if (initialMarginPercentage === undefined) {\n            initialMarginPercentage = this.parseNumber (Precise.stringDiv (initialMarginString, notionalString, 4));\n        } else if (initialMarginString === undefined) {\n            initialMarginString = Precise.stringDiv (Precise.stringDiv (Precise.stringMul (contractsAbs, contractSizeString), entryPriceString), leverageString);\n        }\n        const rounder = '0.00005'; // round to closest 0.01%\n        const maintenanceMarginPercentage = this.parseNumber (Precise.stringDiv (Precise.stringAdd (maintenanceMarginPercentageString, rounder), '1', 4));\n        const liquidationPrice = this.safeNumber (position, 'liqPx');\n        const percentageString = this.safeString (position, 'uplRatio');\n        const percentage = this.parseNumber (Precise.stringMul (percentageString, '100'));\n        const timestamp = this.safeInteger (position, 'cTime');\n        const marginRatio = this.parseNumber (Precise.stringDiv (maintenanceMarginString, collateralString, 4));\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'posId'),\n            'symbol': symbol,\n            'notional': notional,\n            'marginMode': marginMode,\n            'liquidationPrice': liquidationPrice,\n            'entryPrice': this.parseNumber (entryPriceString),\n            'unrealizedPnl': this.parseNumber (unrealizedPnlString),\n            'realizedPnl': this.safeNumber (position, 'realizedPnl'),\n            'percentage': percentage,\n            'contracts': contracts,\n            'contractSize': contractSize,\n            'markPrice': this.parseNumber (markPriceString),\n            'lastPrice': this.safeNumber (position, 'closeAvgPx'),\n            'side': side,\n            'hedged': hedged,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeInteger (position, 'uTime'),\n            'maintenanceMargin': maintenanceMargin,\n            'maintenanceMarginPercentage': maintenanceMarginPercentage,\n            'collateral': this.parseNumber (collateralString),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentage),\n            'leverage': this.parseNumber (leverageString),\n            'marginRatio': marginRatio,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseSettlement",
        "signature": "parseSettlement (settlement, market)",
        "line_start": 8070,
        "line_end": 8086,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "settlement",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (settlement, 'px')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"insId\": \"BTC-USD-230521-28500-P\",\n         \"px\": \"27081.2007345984751516\",\n         \"type\": \"exercised\"\n     }"
        ],
        "source": "parseSettlement (settlement, market) {\n        //\n        //     {\n        //         \"insId\": \"BTC-USD-230521-28500-P\",\n        //         \"px\": \"27081.2007345984751516\",\n        //         \"type\": \"exercised\"\n        //     }\n        //\n        const marketId = this.safeString (settlement, 'insId');\n        return {\n            'info': settlement,\n            'symbol': this.safeSymbol (marketId, market),\n            'price': this.safeNumber (settlement, 'px'),\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseSettlements",
        "signature": "parseSettlements (settlements, market)",
        "line_start": 8088,
        "line_end": 8115,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"details\": [\n             {\n                 \"insId\": \"BTC-USD-230523-25750-C\",\n                 \"px\": \"27290.1486867000556483\",\n                 \"type\": \"exercised\"\n             },\n         ],\n         \"ts\":\"1684656000000\"\n     }"
        ],
        "source": "parseSettlements (settlements, market) {\n        //\n        //     {\n        //         \"details\": [\n        //             {\n        //                 \"insId\": \"BTC-USD-230523-25750-C\",\n        //                 \"px\": \"27290.1486867000556483\",\n        //                 \"type\": \"exercised\"\n        //             },\n        //         ],\n        //         \"ts\":\"1684656000000\"\n        //     }\n        //\n        const result = [];\n        for (let i = 0; i < settlements.length; i++) {\n            const entry = settlements[i];\n            const timestamp = this.safeInteger (entry, 'ts');\n            const details = this.safeList (entry, 'details', []);\n            for (let j = 0; j < details.length; j++) {\n                const settlement = this.parseSettlement (details[j], market);\n                result.push (this.extend (settlement, {\n                    'timestamp': timestamp,\n                    'datetime': this.iso8601 (timestamp),\n                }));\n            }\n        }\n        return result;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 2090,
        "line_end": 2163,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPx')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidSz')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPx')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askSz')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'markPx')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'idxPx')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"instType\":\"SWAP\",\n          \"instId\":\"BTC-USDT-SWAP\",\n          \"markPx\":\"200\",\n          \"ts\":\"1597026383085\"\n      }",
          "{\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-BTC\",\n         \"last\": \"0.07319\",\n         \"lastSz\": \"0.044378\",\n         \"askPx\": \"0.07322\",\n         \"askSz\": \"4.2\",\n         \"bidPx\": \"0.0732\",\n         \"bidSz\": \"6.050058\",\n         \"open24h\": \"0.07801\",\n         \"high24h\": \"0.07975\",\n         \"low24h\": \"0.06019\",\n         \"volCcy24h\": \"11788.887619\",\n         \"vol24h\": \"167493.829229\",\n         \"ts\": \"1621440583784\",\n         \"sodUtc0\": \"0.07872\",\n         \"sodUtc8\": \"0.07345\"\n     }",
          "{\n          instId: 'LTC-USDT',\n          idxPx: '65.74',\n          open24h: '65.37',\n          high24h: '66.15',\n          low24h: '64.97',\n          sodUtc0: '65.68',\n          sodUtc8: '65.54',\n          ts: '1728467346900'\n     },"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //      {\n        //          \"instType\":\"SWAP\",\n        //          \"instId\":\"BTC-USDT-SWAP\",\n        //          \"markPx\":\"200\",\n        //          \"ts\":\"1597026383085\"\n        //      }\n        //\n        //     {\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-BTC\",\n        //         \"last\": \"0.07319\",\n        //         \"lastSz\": \"0.044378\",\n        //         \"askPx\": \"0.07322\",\n        //         \"askSz\": \"4.2\",\n        //         \"bidPx\": \"0.0732\",\n        //         \"bidSz\": \"6.050058\",\n        //         \"open24h\": \"0.07801\",\n        //         \"high24h\": \"0.07975\",\n        //         \"low24h\": \"0.06019\",\n        //         \"volCcy24h\": \"11788.887619\",\n        //         \"vol24h\": \"167493.829229\",\n        //         \"ts\": \"1621440583784\",\n        //         \"sodUtc0\": \"0.07872\",\n        //         \"sodUtc8\": \"0.07345\"\n        //     }\n        //     {\n        //          instId: 'LTC-USDT',\n        //          idxPx: '65.74',\n        //          open24h: '65.37',\n        //          high24h: '66.15',\n        //          low24h: '64.97',\n        //          sodUtc0: '65.68',\n        //          sodUtc8: '65.54',\n        //          ts: '1728467346900'\n        //     },\n        //\n        const timestamp = this.safeInteger (ticker, 'ts');\n        const marketId = this.safeString (ticker, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'last');\n        const open = this.safeString (ticker, 'open24h');\n        const spot = this.safeBool (market, 'spot', false);\n        const quoteVolume = spot ? this.safeString (ticker, 'volCcy24h') : undefined;\n        const baseVolume = this.safeString (ticker, 'vol24h');\n        const high = this.safeString (ticker, 'high24h');\n        const low = this.safeString (ticker, 'low24h');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': this.safeString (ticker, 'bidPx'),\n            'bidVolume': this.safeString (ticker, 'bidSz'),\n            'ask': this.safeString (ticker, 'askPx'),\n            'askVolume': this.safeString (ticker, 'askSz'),\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'markPrice': this.safeString (ticker, 'markPx'),\n            'indexPrice': this.safeString (ticker, 'idxPx'),\n            'info': ticker,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2336,
        "line_end": 2427,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostSigned",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instId\": \"ETH-BTC\",\n         \"side\": \"sell\",\n         \"sz\": \"0.119501\",\n         \"px\": \"0.07065\",\n         \"tradeId\": \"15826757\",\n         \"ts\": \"1621446178316\"\n     }",
          "{\n         \"fillVol\": \"0.46387625976562497\",\n         \"fwdPx\": \"26299.754935451125\",\n         \"indexPx\": \"26309.7\",\n         \"instFamily\": \"BTC-USD\",\n         \"instId\": \"BTC-USD-230526-26000-C\",\n         \"markPx\": \"0.042386283557554236\",\n         \"optType\": \"C\",\n         \"px\": \"0.0415\",\n         \"side\": \"sell\",\n         \"sz\": \"90\",\n         \"tradeId\": \"112\",\n         \"ts\": \"1683907480154\"\n     }",
          "{\n         \"side\": \"buy\",\n         \"fillSz\": \"0.007533\",\n         \"fillPx\": \"2654.98\",\n         \"fee\": \"-0.000007533\",\n         \"ordId\": \"317321390244397056\",\n         \"instType\": \"SPOT\",\n         \"instId\": \"ETH-USDT\",\n         \"clOrdId\": \"\",\n         \"posSide\": \"net\",\n         \"billId\": \"317321390265368576\",\n         \"tag\": \"0\",\n         \"execType\": \"T\",\n         \"tradeId\": \"107601752\",\n         \"feeCcy\": \"ETH\",\n         \"ts\": \"1621927314985\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"instId\": \"ETH-BTC\",\n        //         \"side\": \"sell\",\n        //         \"sz\": \"0.119501\",\n        //         \"px\": \"0.07065\",\n        //         \"tradeId\": \"15826757\",\n        //         \"ts\": \"1621446178316\"\n        //     }\n        //\n        // option: fetchTrades\n        //\n        //     {\n        //         \"fillVol\": \"0.46387625976562497\",\n        //         \"fwdPx\": \"26299.754935451125\",\n        //         \"indexPx\": \"26309.7\",\n        //         \"instFamily\": \"BTC-USD\",\n        //         \"instId\": \"BTC-USD-230526-26000-C\",\n        //         \"markPx\": \"0.042386283557554236\",\n        //         \"optType\": \"C\",\n        //         \"px\": \"0.0415\",\n        //         \"side\": \"sell\",\n        //         \"sz\": \"90\",\n        //         \"tradeId\": \"112\",\n        //         \"ts\": \"1683907480154\"\n        //     }\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"side\": \"buy\",\n        //         \"fillSz\": \"0.007533\",\n        //         \"fillPx\": \"2654.98\",\n        //         \"fee\": \"-0.000007533\",\n        //         \"ordId\": \"317321390244397056\",\n        //         \"instType\": \"SPOT\",\n        //         \"instId\": \"ETH-USDT\",\n        //         \"clOrdId\": \"\",\n        //         \"posSide\": \"net\",\n        //         \"billId\": \"317321390265368576\",\n        //         \"tag\": \"0\",\n        //         \"execType\": \"T\",\n        //         \"tradeId\": \"107601752\",\n        //         \"feeCcy\": \"ETH\",\n        //         \"ts\": \"1621927314985\"\n        //     }\n        //\n        const id = this.safeString (trade, 'tradeId');\n        const marketId = this.safeString (trade, 'instId');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (trade, 'ts');\n        const price = this.safeString2 (trade, 'fillPx', 'px');\n        const amount = this.safeString2 (trade, 'fillSz', 'sz');\n        const side = this.safeString (trade, 'side');\n        const orderId = this.safeString (trade, 'ordId');\n        const feeCostString = this.safeString (trade, 'fee');\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCostSigned = Precise.stringNeg (feeCostString);\n            const feeCurrencyId = this.safeString (trade, 'feeCcy');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostSigned,\n                'currency': feeCurrencyCode,\n            };\n        }\n        let takerOrMaker = this.safeString (trade, 'execType');\n        if (takerOrMaker === 'T') {\n            takerOrMaker = 'taker';\n        } else if (takerOrMaker === 'M') {\n            takerOrMaker = 'maker';\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTradingBalance",
        "signature": "parseTradingBalance (response)",
        "line_start": 2730,
        "line_end": 2756,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTradingBalance (response) {\n        const result: Dict = { 'info': response };\n        const data = this.safeList (response, 'data', []);\n        const first = this.safeDict (data, 0, {});\n        const timestamp = this.safeInteger (first, 'uTime');\n        const details = this.safeList (first, 'details', []);\n        for (let i = 0; i < details.length; i++) {\n            const balance = details[i];\n            const currencyId = this.safeString (balance, 'ccy');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            // it may be incorrect to use total, free and used for swap accounts\n            const eq = this.safeString (balance, 'eq');\n            const availEq = this.safeString (balance, 'availEq');\n            account['total'] = eq;\n            if (availEq === undefined) {\n                account['free'] = this.safeString (balance, 'availBal');\n                account['used'] = this.safeString (balance, 'frozenBal');\n            } else {\n                account['free'] = availEq;\n            }\n            result[code] = account;\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return this.safeBalance (result);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 2775,
        "line_end": 2798,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU')))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"category\": \"1\",\n         \"delivery\": \"\",\n         \"exercise\": \"\",\n         \"instType\": \"SPOT\",\n         \"level\": \"Lv1\",\n         \"maker\": \"-0.0008\",\n         \"taker\": \"-0.001\",\n         \"ts\": \"1639043138472\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        // https://www.okx.com/docs-v5/en/#rest-api-account-get-fee-rates\n        //\n        //     {\n        //         \"category\": \"1\",\n        //         \"delivery\": \"\",\n        //         \"exercise\": \"\",\n        //         \"instType\": \"SPOT\",\n        //         \"level\": \"Lv1\",\n        //         \"maker\": \"-0.0008\",\n        //         \"taker\": \"-0.001\",\n        //         \"ts\": \"1639043138472\"\n        //     }\n        //\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (undefined, market),\n            // OKX returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped\n            'maker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'maker', 'makerU'))),\n            'taker': this.parseNumber (Precise.stringNeg (this.safeString2 (fee, 'taker', 'takerU'))),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 5685,
        "line_end": 5779,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': feeCost,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"amt\": \"0.1\",\n         \"wdId\": \"67485\",\n         \"ccy\": \"BTC\"\n     }",
          "{\n         \"amt\": \"0.094\",\n         \"wdId\": \"4703879\",\n         \"fee\": \"0.01000000eth\",\n         \"txId\": \"0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85\",\n         \"ccy\": \"ETH\",\n         \"from\": \"13426335357\",\n         \"to\": \"0xA41446125D0B5b6785f6898c9D67874D763A1519\",\n         \"tag\",\n         \"pmtId\",\n         \"memo\",\n         \"ts\": \"1597026383085\",\n         \"state\": \"2\"\n     }",
          "{\n         \"amt\": \"0.01044408\",\n         \"txId\": \"1915737_3_0_0_asset\",\n         \"ccy\": \"BTC\",\n         \"from\": \"13801825426\",\n         \"to\": \"\",\n         \"ts\": \"1597026383085\",\n         \"state\": \"2\",\n         \"depId\": \"4703879\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"amt\": \"0.1\",\n        //         \"wdId\": \"67485\",\n        //         \"ccy\": \"BTC\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"amt\": \"0.094\",\n        //         \"wdId\": \"4703879\",\n        //         \"fee\": \"0.01000000eth\",\n        //         \"txId\": \"0x62477bac6509a04512819bb1455e923a60dea5966c7caeaa0b24eb8fb0432b85\",\n        //         \"ccy\": \"ETH\",\n        //         \"from\": \"13426335357\",\n        //         \"to\": \"0xA41446125D0B5b6785f6898c9D67874D763A1519\",\n        //         \"tag\",\n        //         \"pmtId\",\n        //         \"memo\",\n        //         \"ts\": \"1597026383085\",\n        //         \"state\": \"2\"\n        //     }\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"amt\": \"0.01044408\",\n        //         \"txId\": \"1915737_3_0_0_asset\",\n        //         \"ccy\": \"BTC\",\n        //         \"from\": \"13801825426\",\n        //         \"to\": \"\",\n        //         \"ts\": \"1597026383085\",\n        //         \"state\": \"2\",\n        //         \"depId\": \"4703879\"\n        //     }\n        //\n        let type = undefined;\n        let id = undefined;\n        const withdrawalId = this.safeString (transaction, 'wdId');\n        const addressFrom = this.safeString (transaction, 'from');\n        const addressTo = this.safeString (transaction, 'to');\n        const address = addressTo;\n        let tagTo = this.safeString2 (transaction, 'tag', 'memo');\n        tagTo = this.safeString2 (transaction, 'pmtId', tagTo);\n        if (withdrawalId !== undefined) {\n            type = 'withdrawal';\n            id = withdrawalId;\n        } else {\n            // the payment_id will appear on new deposits but appears to be removed from the response after 2 months\n            id = this.safeString (transaction, 'depId');\n            type = 'deposit';\n        }\n        const currencyId = this.safeString (transaction, 'ccy');\n        const code = this.safeCurrencyCode (currencyId);\n        const amount = this.safeNumber (transaction, 'amt');\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n        const txid = this.safeString (transaction, 'txId');\n        const timestamp = this.safeInteger (transaction, 'ts');\n        let feeCost = undefined;\n        if (type === 'deposit') {\n            feeCost = 0;\n        } else {\n            feeCost = this.safeNumber (transaction, 'fee');\n        }\n        // todo parse tags\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': amount,\n            'network': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'address': address,\n            'tagFrom': undefined,\n            'tagTo': tagTo,\n            'tag': tagTo,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': feeCost,\n            },\n        } as Transaction;\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 5639,
        "line_end": 5683,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"0\": \"waiting for confirmation\",\n         \"1\": \"deposit credited\",\n         \"2\": \"deposit successful\"\n     }",
          "{\n        '-3': \"pending cancel\",\n        \"-2\": \"canceled\",\n        \"-1\": \"failed\",\n         \"0\": \"pending\",\n         \"1\": \"sending\",\n         \"2\": \"sent\",\n         \"3\": \"awaiting email verification\",\n         \"4\": \"awaiting manual verification\",\n         \"5\": \"awaiting identity verification\"\n     }"
        ],
        "source": "parseTransactionStatus (status: Str) {\n        //\n        // deposit statuses\n        //\n        //     {\n        //         \"0\": \"waiting for confirmation\",\n        //         \"1\": \"deposit credited\",\n        //         \"2\": \"deposit successful\"\n        //     }\n        //\n        // withdrawal statuses\n        //\n        //     {\n        //        '-3': \"pending cancel\",\n        //        \"-2\": \"canceled\",\n        //        \"-1\": \"failed\",\n        //         \"0\": \"pending\",\n        //         \"1\": \"sending\",\n        //         \"2\": \"sent\",\n        //         \"3\": \"awaiting email verification\",\n        //         \"4\": \"awaiting manual verification\",\n        //         \"5\": \"awaiting identity verification\"\n        //     }\n        //\n        const statuses: Dict = {\n            '-3': 'pending',\n            '-2': 'canceled',\n            '-1': 'failed',\n            '0': 'pending',\n            '1': 'pending',\n            '2': 'ok',\n            '3': 'pending',\n            '4': 'pending',\n            '5': 'pending',\n            '6': 'pending',\n            '7': 'pending',\n            '8': 'pending',\n            '9': 'pending',\n            '10': 'pending',\n            '12': 'pending',\n            '15': 'pending',\n            '16': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 6266,
        "line_end": 6342,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (accountsById, fromAccountId)",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (accountsById, toAccountId)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'state'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"transId\": \"754147\",\n         \"ccy\": \"USDT\",\n         \"from\": \"6\",\n         \"amt\": \"0.1\",\n         \"to\": \"18\"\n     }",
          "{\n         \"amt\": \"5\",\n         \"ccy\": \"USDT\",\n         \"from\": \"18\",\n         \"instId\": \"\",\n         \"state\": \"success\",\n         \"subAcct\": \"\",\n         \"to\": \"6\",\n         \"toInstId\": \"\",\n         \"transId\": \"464424732\",\n         \"type\": \"0\"\n     }",
          "{\n         \"bal\": \"70.6874353780312913\",\n         \"balChg\": \"-4.0000000000000000\", // negative means \"to funding\", positive meand \"from funding\"\n         \"billId\": \"588900695232225299\",\n         \"ccy\": \"USDT\",\n         \"execType\": \"\",\n         \"fee\": \"\",\n         \"from\": \"18\",\n         \"instId\": \"\",\n         \"instType\": \"\",\n         \"mgnMode\": \"\",\n         \"notes\": \"To Funding Account\",\n         \"ordId\": \"\",\n         \"pnl\": \"\",\n         \"posBal\": \"\",\n         \"posBalChg\": \"\",\n         \"price\": \"0\",\n         \"subType\": \"12\",\n         \"sz\": \"-4\",\n         \"to\": \"6\",\n         \"ts\": \"1686676866989\",\n         \"type\": \"1\"\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"transId\": \"754147\",\n        //         \"ccy\": \"USDT\",\n        //         \"from\": \"6\",\n        //         \"amt\": \"0.1\",\n        //         \"to\": \"18\"\n        //     }\n        //\n        // fetchTransfer\n        //\n        //     {\n        //         \"amt\": \"5\",\n        //         \"ccy\": \"USDT\",\n        //         \"from\": \"18\",\n        //         \"instId\": \"\",\n        //         \"state\": \"success\",\n        //         \"subAcct\": \"\",\n        //         \"to\": \"6\",\n        //         \"toInstId\": \"\",\n        //         \"transId\": \"464424732\",\n        //         \"type\": \"0\"\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"bal\": \"70.6874353780312913\",\n        //         \"balChg\": \"-4.0000000000000000\", // negative means \"to funding\", positive meand \"from funding\"\n        //         \"billId\": \"588900695232225299\",\n        //         \"ccy\": \"USDT\",\n        //         \"execType\": \"\",\n        //         \"fee\": \"\",\n        //         \"from\": \"18\",\n        //         \"instId\": \"\",\n        //         \"instType\": \"\",\n        //         \"mgnMode\": \"\",\n        //         \"notes\": \"To Funding Account\",\n        //         \"ordId\": \"\",\n        //         \"pnl\": \"\",\n        //         \"posBal\": \"\",\n        //         \"posBalChg\": \"\",\n        //         \"price\": \"0\",\n        //         \"subType\": \"12\",\n        //         \"sz\": \"-4\",\n        //         \"to\": \"6\",\n        //         \"ts\": \"1686676866989\",\n        //         \"type\": \"1\"\n        //     }\n        //\n        const id = this.safeString2 (transfer, 'transId', 'billId');\n        const currencyId = this.safeString (transfer, 'ccy');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let amount = this.safeNumber (transfer, 'amt');\n        const fromAccountId = this.safeString (transfer, 'from');\n        const toAccountId = this.safeString (transfer, 'to');\n        const accountsById = this.safeDict (this.options, 'accountsById', {});\n        const timestamp = this.safeInteger (transfer, 'ts');\n        const balanceChange = this.safeString (transfer, 'sz');\n        if (balanceChange !== undefined) {\n            amount = this.parseNumber (Precise.stringAbs (balanceChange));\n        }\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amount,\n            'fromAccount': this.safeString (accountsById, fromAccountId),\n            'toAccount': this.safeString (accountsById, toAccountId),\n            'status': this.parseTransferStatus (this.safeString (transfer, 'state')),\n        };\n    }",
        "inherited": true,
        "inherited_from": "okx"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 6344,
        "line_end": 6349,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'success': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }",
        "inherited": true,
        "inherited_from": "okx"
      }
    ],
    "onetrading": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1169,
        "line_end": 1182,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response, 'balances', []);\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'currency_code');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'available');\n            account['used'] = this.safeString (balance, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFeeTiers",
        "signature": "parseFeeTiers (feeTiers, market: Market = undefined)",
        "line_start": 759,
        "line_end": 776,
        "comment": null,
        "mappings": [
          {
            "key": "maker",
            "value": "makerFees",
            "comment": null
          },
          {
            "key": "taker",
            "value": "takerFees",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFeeTiers (feeTiers, market: Market = undefined) {\n        const takerFees = [];\n        const makerFees = [];\n        for (let i = 0; i < feeTiers.length; i++) {\n            const tier = feeTiers[i];\n            const volume = this.safeNumber (tier, 'volume');\n            let taker = this.safeString (tier, 'taker_fee');\n            let maker = this.safeString (tier, 'maker_fee');\n            maker = Precise.stringDiv (maker, '100');\n            taker = Precise.stringDiv (taker, '100');\n            makerFees.push ([ volume, this.parseNumber (maker) ]);\n            takerFees.push ([ volume, this.parseNumber (taker) ]);\n        }\n        return {\n            'maker': makerFees,\n            'taker': takerFees,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 490,
        "line_end": 594,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "isPerp ? quote : undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "isPerp ? quoteId : undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "isPerp ? 'swap' : 'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "!isPerp",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isPerp",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "(state === 'ACTIVE')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "isPerp",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isPerp ? true : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isPerp ? false : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "isPerp ? this.parseNumber ('1') : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'market_precision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_size'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'min_size'),\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"base\":{\n         \"code\":\"BTC\",\n         \"precision\":\"5\"\n      },\n      \"quote\":{\n         \"code\":\"USDC\",\n         \"precision\":\"2\"\n      },\n      \"amount_precision\":\"5\",\n      \"market_precision\":\"2\",\n      \"min_size\":\"10.0\",\n      \"min_price\":\"1000\",\n      \"max_price\":\"10000000\",\n      \"id\":\"BTC_USDC\",\n      \"type\":\"SPOT\",\n      \"state\":\"ACTIVE\"\n   }",
          "{\n      \"base\": {\n          \"code\": \"BTC\",\n          \"precision\": 5\n      },\n      \"quote\": {\n          \"code\": \"EUR\",\n          \"precision\": 2\n      },\n      \"amount_precision\": 5,\n      \"market_precision\": 2,\n      \"min_size\": \"10.0\",\n      \"min_price\": \"1000\",\n      \"max_price\": \"10000000\",\n      \"id\": \"BTC_EUR_P\",\n      \"type\": \"PERP\",\n      \"state\": \"ACTIVE\"\n  }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //   {\n        //      \"base\":{\n        //         \"code\":\"BTC\",\n        //         \"precision\":\"5\"\n        //      },\n        //      \"quote\":{\n        //         \"code\":\"USDC\",\n        //         \"precision\":\"2\"\n        //      },\n        //      \"amount_precision\":\"5\",\n        //      \"market_precision\":\"2\",\n        //      \"min_size\":\"10.0\",\n        //      \"min_price\":\"1000\",\n        //      \"max_price\":\"10000000\",\n        //      \"id\":\"BTC_USDC\",\n        //      \"type\":\"SPOT\",\n        //      \"state\":\"ACTIVE\"\n        //   }\n        //\n        //\n        //  {\n        //      \"base\": {\n        //          \"code\": \"BTC\",\n        //          \"precision\": 5\n        //      },\n        //      \"quote\": {\n        //          \"code\": \"EUR\",\n        //          \"precision\": 2\n        //      },\n        //      \"amount_precision\": 5,\n        //      \"market_precision\": 2,\n        //      \"min_size\": \"10.0\",\n        //      \"min_price\": \"1000\",\n        //      \"max_price\": \"10000000\",\n        //      \"id\": \"BTC_EUR_P\",\n        //      \"type\": \"PERP\",\n        //      \"state\": \"ACTIVE\"\n        //  }\n        //\n        const baseAsset = this.safeDict (market, 'base', {});\n        const quoteAsset = this.safeDict (market, 'quote', {});\n        const baseId = this.safeString (baseAsset, 'code');\n        const quoteId = this.safeString (quoteAsset, 'code');\n        const id = this.safeString (market, 'id');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const state = this.safeString (market, 'state');\n        const type = this.safeString (market, 'type');\n        const isPerp = type === 'PERP';\n        let symbol = base + '/' + quote;\n        if (isPerp) {\n            symbol = symbol + ':' + quote;\n        }\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': isPerp ? quote : undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': isPerp ? quoteId : undefined,\n            'type': isPerp ? 'swap' : 'spot',\n            'spot': !isPerp,\n            'margin': false,\n            'swap': isPerp,\n            'future': false,\n            'option': false,\n            'active': (state === 'ACTIVE'),\n            'contract': isPerp,\n            'linear': isPerp ? true : undefined,\n            'inverse': isPerp ? false : undefined,\n            'contractSize': isPerp ? this.parseNumber ('1') : undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'market_precision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_size'),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 995,
        "line_end": 1036,
        "comment": null,
        "mappings": [
          {
            "key": "MINUTES",
            "value": "'m'",
            "comment": null
          },
          {
            "key": "HOURS",
            "value": "'h'",
            "comment": null
          },
          {
            "key": "DAYS",
            "value": "'d'",
            "comment": null
          },
          {
            "key": "WEEKS",
            "value": "'w'",
            "comment": null
          },
          {
            "key": "MONTHS",
            "value": "'M'",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_code\":\"BTC_EUR\",\n         \"granularity\":{\"unit\":\"HOURS\",\"period\":1},\n         \"high\":\"9252.65\",\n         \"low\":\"9115.27\",\n         \"open\":\"9250.0\",\n         \"close\":\"9132.35\",\n         \"total_amount\":\"33.85924\",\n         \"volume\":\"311958.9635744\",\n         \"time\":\"2020-05-08T22:59:59.999Z\",\n         \"last_sequence\":461123\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"instrument_code\":\"BTC_EUR\",\n        //         \"granularity\":{\"unit\":\"HOURS\",\"period\":1},\n        //         \"high\":\"9252.65\",\n        //         \"low\":\"9115.27\",\n        //         \"open\":\"9250.0\",\n        //         \"close\":\"9132.35\",\n        //         \"total_amount\":\"33.85924\",\n        //         \"volume\":\"311958.9635744\",\n        //         \"time\":\"2020-05-08T22:59:59.999Z\",\n        //         \"last_sequence\":461123\n        //     }\n        //\n        const granularity = this.safeValue (ohlcv, 'granularity');\n        const unit = this.safeString (granularity, 'unit');\n        const period = this.safeString (granularity, 'period');\n        const units: Dict = {\n            'MINUTES': 'm',\n            'HOURS': 'h',\n            'DAYS': 'd',\n            'WEEKS': 'w',\n            'MONTHS': 'M',\n        };\n        const lowercaseUnit = this.safeString (units, unit);\n        const timeframe = period + lowercaseUnit;\n        const durationInSeconds = this.parseTimeframe (timeframe);\n        const duration = durationInSeconds * 1000;\n        const timestamp = this.parse8601 (this.safeString (ohlcv, 'time'));\n        const alignedTimestamp = duration * this.parseToInt (timestamp / duration);\n        const options = this.safeValue (this.options, 'fetchOHLCV', {});\n        const volumeField = this.safeString (options, 'volume', 'total_amount');\n        return [\n            alignedTimestamp,\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, volumeField),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1230,
        "line_end": 1336,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (type)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (rawOrder, 'trigger_price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"order_id\": \"d5492c24-2995-4c18-993a-5b8bf8fffc0d\",\n         \"client_id\": \"d75fb03b-b599-49e9-b926-3f0b6d103206\",\n         \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n         \"instrument_code\": \"BTC_EUR\",\n         \"time\": \"2019-08-01T08:00:44.026Z\",\n         \"side\": \"BUY\",\n         \"price\": \"5000\",\n         \"amount\": \"1\",\n         \"filled_amount\": \"0.5\",\n         \"type\": \"LIMIT\",\n         \"time_in_force\": \"GOOD_TILL_CANCELLED\"\n     }",
          "{\n         \"order\": {\n             \"order_id\": \"66756a10-3e86-48f4-9678-b634c4b135b2\",\n             \"account_id\": \"1eb2ad5d-55f1-40b5-bc92-7dc05869e905\",\n             \"instrument_code\": \"BTC_EUR\",\n             \"amount\": \"1234.5678\",\n             \"filled_amount\": \"1234.5678\",\n             \"side\": \"BUY\",\n             \"type\": \"LIMIT\",\n             \"status\": \"OPEN\",\n             \"sequence\": 123456789,\n             \"price\": \"1234.5678\",\n             \"average_price\": \"1234.5678\",\n             \"reason\": \"INSUFFICIENT_FUNDS\",\n             \"time\": \"2019-08-24T14:15:22Z\",\n             \"time_in_force\": \"GOOD_TILL_CANCELLED\",\n             \"time_last_updated\": \"2019-08-24T14:15:22Z\",\n             \"expire_after\": \"2019-08-24T14:15:22Z\",\n             \"is_post_only\": false,\n             \"time_triggered\": \"2019-08-24T14:15:22Z\",\n             \"trigger_price\": \"1234.5678\"\n         },\n         \"trades\": [\n             {\n                 \"fee\": {\n                     \"fee_amount\": \"0.0014\",\n                     \"fee_currency\": \"BTC\",\n                     \"fee_percentage\": \"0.1\",\n                     \"fee_group_id\": \"default\",\n                     \"fee_type\": \"TAKER\",\n                     \"running_trading_volume\": \"0.0\"\n                 },\n                 \"trade\": {\n                     \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n                     \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n                     \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n                     \"amount\": \"1.4\",\n                     \"side\": \"BUY\",\n                     \"instrument_code\": \"BTC_EUR\",\n                     \"price\": \"7341.4\",\n                     \"time\": \"2019-09-27T15:05:32.564Z\",\n                     \"sequence\": 48670\n                 }\n             }\n         ]\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"order_id\": \"d5492c24-2995-4c18-993a-5b8bf8fffc0d\",\n        //         \"client_id\": \"d75fb03b-b599-49e9-b926-3f0b6d103206\",\n        //         \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n        //         \"instrument_code\": \"BTC_EUR\",\n        //         \"time\": \"2019-08-01T08:00:44.026Z\",\n        //         \"side\": \"BUY\",\n        //         \"price\": \"5000\",\n        //         \"amount\": \"1\",\n        //         \"filled_amount\": \"0.5\",\n        //         \"type\": \"LIMIT\",\n        //         \"time_in_force\": \"GOOD_TILL_CANCELLED\"\n        //     }\n        //\n        // fetchOrder, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"order\": {\n        //             \"order_id\": \"66756a10-3e86-48f4-9678-b634c4b135b2\",\n        //             \"account_id\": \"1eb2ad5d-55f1-40b5-bc92-7dc05869e905\",\n        //             \"instrument_code\": \"BTC_EUR\",\n        //             \"amount\": \"1234.5678\",\n        //             \"filled_amount\": \"1234.5678\",\n        //             \"side\": \"BUY\",\n        //             \"type\": \"LIMIT\",\n        //             \"status\": \"OPEN\",\n        //             \"sequence\": 123456789,\n        //             \"price\": \"1234.5678\",\n        //             \"average_price\": \"1234.5678\",\n        //             \"reason\": \"INSUFFICIENT_FUNDS\",\n        //             \"time\": \"2019-08-24T14:15:22Z\",\n        //             \"time_in_force\": \"GOOD_TILL_CANCELLED\",\n        //             \"time_last_updated\": \"2019-08-24T14:15:22Z\",\n        //             \"expire_after\": \"2019-08-24T14:15:22Z\",\n        //             \"is_post_only\": false,\n        //             \"time_triggered\": \"2019-08-24T14:15:22Z\",\n        //             \"trigger_price\": \"1234.5678\"\n        //         },\n        //         \"trades\": [\n        //             {\n        //                 \"fee\": {\n        //                     \"fee_amount\": \"0.0014\",\n        //                     \"fee_currency\": \"BTC\",\n        //                     \"fee_percentage\": \"0.1\",\n        //                     \"fee_group_id\": \"default\",\n        //                     \"fee_type\": \"TAKER\",\n        //                     \"running_trading_volume\": \"0.0\"\n        //                 },\n        //                 \"trade\": {\n        //                     \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n        //                     \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n        //                     \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n        //                     \"amount\": \"1.4\",\n        //                     \"side\": \"BUY\",\n        //                     \"instrument_code\": \"BTC_EUR\",\n        //                     \"price\": \"7341.4\",\n        //                     \"time\": \"2019-09-27T15:05:32.564Z\",\n        //                     \"sequence\": 48670\n        //                 }\n        //             }\n        //         ]\n        //     }\n        //\n        const rawOrder = this.safeValue (order, 'order', order);\n        const id = this.safeString (rawOrder, 'order_id');\n        const clientOrderId = this.safeString (rawOrder, 'client_id');\n        const timestamp = this.parse8601 (this.safeString (rawOrder, 'time'));\n        const rawStatus = this.parseOrderStatus (this.safeString (rawOrder, 'status'));\n        const status = this.parseOrderStatus (rawStatus);\n        const marketId = this.safeString (rawOrder, 'instrument_code');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const price = this.safeString (rawOrder, 'price');\n        const amount = this.safeString (rawOrder, 'amount');\n        const filled = this.safeString (rawOrder, 'filled_amount');\n        const side = this.safeStringLower (rawOrder, 'side');\n        const type = this.safeStringLower (rawOrder, 'type');\n        const timeInForce = this.parseTimeInForce (this.safeString (rawOrder, 'time_in_force'));\n        const postOnly = this.safeValue (rawOrder, 'is_post_only');\n        const rawTrades = this.safeValue (order, 'trades', []);\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': this.parseOrderType (type),\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeNumber (rawOrder, 'trigger_price'),\n            'amount': amount,\n            'cost': undefined,\n            'average': undefined,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            // 'fee': undefined,\n            'trades': rawTrades,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1214,
        "line_end": 1228,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'FILLED': 'open',\n            'FILLED_FULLY': 'closed',\n            'FILLED_CLOSED': 'canceled',\n            'FILLED_REJECTED': 'rejected',\n            'OPEN': 'open',\n            'REJECTED': 'rejected',\n            'CLOSED': 'canceled',\n            'FAILED': 'failed',\n            'STOP_TRIGGERED': 'triggered',\n            'DONE': 'closed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1338,
        "line_end": 1343,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'booked': 'limit',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 778,
        "line_end": 829,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'best_bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'best_ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "change",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_code\":\"BTC_EUR\",\n         \"sequence\":602562,\n         \"time\":\"2020-07-10T06:27:34.951Z\",\n         \"state\":\"ACTIVE\",\n         \"is_frozen\":0,\n         \"quote_volume\":\"1695555.1783768\",\n         \"base_volume\":\"205.67436\",\n         \"last_price\":\"8143.91\",\n         \"best_bid\":\"8143.71\",\n         \"best_ask\":\"8156.9\",\n         \"price_change\":\"-147.47\",\n         \"price_change_percentage\":\"-1.78\",\n         \"high\":\"8337.45\",\n         \"low\":\"8110.0\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"instrument_code\":\"BTC_EUR\",\n        //         \"sequence\":602562,\n        //         \"time\":\"2020-07-10T06:27:34.951Z\",\n        //         \"state\":\"ACTIVE\",\n        //         \"is_frozen\":0,\n        //         \"quote_volume\":\"1695555.1783768\",\n        //         \"base_volume\":\"205.67436\",\n        //         \"last_price\":\"8143.91\",\n        //         \"best_bid\":\"8143.71\",\n        //         \"best_ask\":\"8156.9\",\n        //         \"price_change\":\"-147.47\",\n        //         \"price_change_percentage\":\"-1.78\",\n        //         \"high\":\"8337.45\",\n        //         \"low\":\"8110.0\"\n        //     }\n        //\n        const timestamp = this.parse8601 (this.safeString (ticker, 'time'));\n        const marketId = this.safeString (ticker, 'instrument_code');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const last = this.safeString (ticker, 'last_price');\n        const percentage = this.safeString (ticker, 'price_change_percentage');\n        const change = this.safeString (ticker, 'price_change');\n        const baseVolume = this.safeString (ticker, 'base_volume');\n        const quoteVolume = this.safeString (ticker, 'quote_volume');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'best_bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'best_ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': change,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1345,
        "line_end": 1353,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GOOD_TILL_CANCELLED': 'GTC',\n            'GOOD_TILL_TIME': 'GTT',\n            'IMMEDIATE_OR_CANCELLED': 'IOC',\n            'FILL_OR_KILL': 'FOK',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1087,
        "line_end": 1167,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'trade_id', 'sequence')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          },
          {
            "key": "rate",
            "value": "feeRateString",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"instrument_code\":\"BTC_EUR\",\n         \"price\":\"8137.28\",\n         \"amount\":\"0.22269\",\n         \"taker_side\":\"BUY\",\n         \"volume\":\"1812.0908832\",\n         \"time\":\"2020-07-10T14:44:32.299Z\",\n         \"trade_timestamp\":1594392272299,\n         \"sequence\":603047\n     }",
          "{\n         \"fee\": {\n             \"fee_amount\": \"0.0014\",\n             \"fee_currency\": \"BTC\",\n             \"fee_percentage\": \"0.1\",\n             \"fee_group_id\": \"default\",\n             \"fee_type\": \"TAKER\",\n             \"running_trading_volume\": \"0.0\"\n         },\n         \"trade\": {\n             \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n             \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n             \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n             \"amount\": \"1.4\",\n             \"side\": \"BUY\",\n             \"instrument_code\": \"BTC_EUR\",\n             \"price\": \"7341.4\",\n             \"time\": \"2019-09-27T15:05:32.564Z\",\n             \"sequence\": 48670\n         }\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"instrument_code\":\"BTC_EUR\",\n        //         \"price\":\"8137.28\",\n        //         \"amount\":\"0.22269\",\n        //         \"taker_side\":\"BUY\",\n        //         \"volume\":\"1812.0908832\",\n        //         \"time\":\"2020-07-10T14:44:32.299Z\",\n        //         \"trade_timestamp\":1594392272299,\n        //         \"sequence\":603047\n        //     }\n        //\n        // fetchMyTrades, fetchOrder, fetchOpenOrders, fetchClosedOrders trades (private)\n        //\n        //     {\n        //         \"fee\": {\n        //             \"fee_amount\": \"0.0014\",\n        //             \"fee_currency\": \"BTC\",\n        //             \"fee_percentage\": \"0.1\",\n        //             \"fee_group_id\": \"default\",\n        //             \"fee_type\": \"TAKER\",\n        //             \"running_trading_volume\": \"0.0\"\n        //         },\n        //         \"trade\": {\n        //             \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n        //             \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n        //             \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n        //             \"amount\": \"1.4\",\n        //             \"side\": \"BUY\",\n        //             \"instrument_code\": \"BTC_EUR\",\n        //             \"price\": \"7341.4\",\n        //             \"time\": \"2019-09-27T15:05:32.564Z\",\n        //             \"sequence\": 48670\n        //         }\n        //     }\n        //\n        const feeInfo = this.safeValue (trade, 'fee', {});\n        trade = this.safeValue (trade, 'trade', trade);\n        let timestamp = this.safeInteger (trade, 'trade_timestamp');\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (trade, 'time'));\n        }\n        const side = this.safeStringLower2 (trade, 'side', 'taker_side');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const costString = this.safeString (trade, 'volume');\n        const marketId = this.safeString (trade, 'instrument_code');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const feeCostString = this.safeString (feeInfo, 'fee_amount');\n        let takerOrMaker = undefined;\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (feeInfo, 'fee_currency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            const feeRateString = this.safeString (feeInfo, 'fee_percentage');\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n                'rate': feeRateString,\n            };\n            takerOrMaker = this.safeStringLower (feeInfo, 'fee_type');\n        }\n        return this.safeTrade ({\n            'id': this.safeString2 (trade, 'trade_id', 'sequence'),\n            'order': this.safeString (trade, 'order_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      }
    ],
    "oxfun": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 1667,
        "line_end": 1680,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (account, 'accountId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "account",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"accountId\": \"106526\",\n         \"name\": \"testSubAccount\"\n     },"
        ],
        "source": "parseAccount (account) {\n        //\n        //     {\n        //         \"accountId\": \"106526\",\n        //         \"name\": \"testSubAccount\"\n        //     },\n        //\n        return {\n            'id': this.safeString (account, 'accountId'),\n            'type': undefined,\n            'code': undefined,\n            'info': account,\n        };\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (balance): Balances",
        "line_start": 1598,
        "line_end": 1637,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"accountId\": \"106490\",\n         \"name\": \"main\",\n         \"balances\": [\n             {\n                 \"asset\": \"OX\",\n                 \"total\": \"-7.55145065000\",\n                 \"available\": \"-71.16445065000\",\n                 \"reserved\": \"0\",\n                 \"lastUpdatedAt\": \"1715000448946\"\n             },\n             {\n                 \"asset\": \"ETH\",\n                 \"total\": \"0.01\",\n                 \"available\": \"0.01\",\n                 \"reserved\": \"0\",\n                 \"lastUpdatedAt\": \"1714914512750\"\n             },\n             ...\n         ]\n     }"
        ],
        "source": "parseBalance (balance): Balances {\n        //\n        //     {\n        //         \"accountId\": \"106490\",\n        //         \"name\": \"main\",\n        //         \"balances\": [\n        //             {\n        //                 \"asset\": \"OX\",\n        //                 \"total\": \"-7.55145065000\",\n        //                 \"available\": \"-71.16445065000\",\n        //                 \"reserved\": \"0\",\n        //                 \"lastUpdatedAt\": \"1715000448946\"\n        //             },\n        //             {\n        //                 \"asset\": \"ETH\",\n        //                 \"total\": \"0.01\",\n        //                 \"available\": \"0.01\",\n        //                 \"reserved\": \"0\",\n        //                 \"lastUpdatedAt\": \"1714914512750\"\n        //             },\n        //             ...\n        //         ]\n        //     }\n        //\n        const result: Dict = {\n            'info': balance,\n        };\n        const balances = this.safeList (balance, 'balances', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balanceEntry = balances[i];\n            const currencyId = this.safeString (balanceEntry, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balanceEntry, 'total');\n            account['free'] = this.safeString (balanceEntry, 'available');\n            account['used'] = this.safeString (balanceEntry, 'reserved');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1849,
        "line_end": 1862,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\"address\":\"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\"}"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\"address\":\"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\"}\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': currency['code'],\n            'network': undefined,\n            'address': address,\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositStatus",
        "signature": "parseDepositStatus (status)",
        "line_start": 2083,
        "line_end": 2088,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositStatus (status) {\n        const statuses: Dict = {\n            'COMPLETED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate",
        "line_start": 1071,
        "line_end": 1102,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "estFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (estFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (fundingRate, 'estFundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marketCode\": \"OX-USD-SWAP-LIN\",\n         \"fundingAt\": \"1715515200000\",\n         \"estFundingRate\": \"0.000200000\"\n     }"
        ],
        "source": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"marketCode\": \"OX-USD-SWAP-LIN\",\n        //         \"fundingAt\": \"1715515200000\",\n        //         \"estFundingRate\": \"0.000200000\"\n        //     }\n        //\n        const symbol = this.safeString (fundingRate, 'marketCode');\n        market = this.market (symbol);\n        const estFundingRateTimestamp = this.safeInteger (fundingRate, 'fundingAt');\n        return {\n            'info': fundingRate,\n            'symbol': market['symbol'],\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': estFundingRateTimestamp,\n            'datetime': this.iso8601 (estFundingRateTimestamp),\n            'fundingRate': this.safeNumber (fundingRate, 'estFundingRate'),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (info, market: Market = undefined)",
        "line_start": 1155,
        "line_end": 1184,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (info, 'fundingRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRateHistory (info, market: Market = undefined) {\n        //\n        //     {\n        //         success: true,\n        //         data: [\n        //         {\n        //             marketCode: 'NEAR-USD-SWAP-LIN',\n        //             fundingRate: '-0.000010000',\n        //             createdAt: '1715428870755'\n        //         },\n        //         {\n        //             marketCode: 'ENA-USD-SWAP-LIN',\n        //             fundingRate: '0.000150000',\n        //             createdAt: '1715428868616'\n        //         },\n        //         ...\n        //     }\n        //\n        const marketId = this.safeString (info, 'marketCode');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (info, 'createdAt');\n        return {\n            'info': info,\n            'symbol': symbol,\n            'fundingRate': this.safeNumber (info, 'fundingRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 1246,
        "line_end": 1275,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n         id: '966709913041305605',\n         marketCode: 'ETH-USD-SWAP-LIN',\n         payment: '-0.00430822',\n         fundingRate: '0.000014',\n         position: '0.001',\n         indexPrice: '3077.3',\n         createdAt: '1715086852890'\n     },"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //         id: '966709913041305605',\n        //         marketCode: 'ETH-USD-SWAP-LIN',\n        //         payment: '-0.00430822',\n        //         fundingRate: '0.000014',\n        //         position: '0.001',\n        //         indexPrice: '3077.3',\n        //         createdAt: '1715086852890'\n        //     },\n        //\n        const marketId = this.safeString (income, 'marketCode');\n        const symbol = this.safeSymbol (marketId, market);\n        const amount = this.safeNumber (income, 'payment');\n        const code = this.safeCurrencyCode ('OX');\n        const id = this.safeString (income, 'id');\n        const timestamp = this.safeTimestamp (income, 'createdAt');\n        const rate = this.safeNumber (income, 'fundingRate');\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': id,\n            'amount': amount,\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market): Market",
        "line_start": 498,
        "line_end": 570,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "numericId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "isSpot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isFuture",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "isFuture",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isFuture ? true : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isFuture ? false : undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.fees['trading']['taker']",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.fees['trading']['maker']",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "isFuture ? 1 : undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': undefined",
            "comment": "todo find it out\n                'price': this.safeNumber (market, 'tickSize'),\n            }"
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSize'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'listedAt')",
            "comment": null
          },
          {
            "key": "index",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSize'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market): Market {\n        const id = this.safeString (market, 'marketCode', '');\n        const parts = id.split ('-');\n        const baseId = this.safeString (parts, 0);\n        const quoteId = this.safeString (parts, 1);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let symbol = base + '/' + quote;\n        let type = this.safeStringLower (market, 'type', 'spot'); // markets from v3/tickers are spot and have no type\n        let settleId: Str = undefined;\n        let settle: Str = undefined;\n        const isFuture = (type === 'future'); // the exchange has only perpetual futures\n        if (isFuture) {\n            type = 'swap';\n            settleId = 'OX';\n            settle = this.safeCurrencyCode ('OX');\n            symbol = symbol + ':' + settle;\n        }\n        const isSpot = type === 'spot';\n        return this.safeMarketStructure ({\n            'id': id,\n            'numericId': undefined,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': isSpot,\n            'margin': false,\n            'swap': isFuture,\n            'future': false,\n            'option': false,\n            'active': true,\n            'contract': isFuture,\n            'linear': isFuture ? true : undefined,\n            'inverse': isFuture ? false : undefined,\n            'taker': this.fees['trading']['taker'],\n            'maker': this.fees['trading']['maker'],\n            'contractSize': isFuture ? 1 : undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': undefined, // todo find it out\n                'price': this.safeNumber (market, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minSize'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': this.safeInteger (market, 'listedAt'),\n            'index': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 1334,
        "line_end": 1369,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        //\n        //     {\n        //         marketCode: 'SOL-USD-SWAP-LIN',\n        //         tiers: [\n        //             {\n        //                 tier: '1',\n        //                 leverage: '10',\n        //                 positionFloor: '0',\n        //                 positionCap: '200000000',\n        //                 initialMargin: '0.1',\n        //                 maintenanceMargin: '0.05',\n        //                 maintenanceAmount: '0'\n        //             ...\n        //         ]\n        //     },\n        //\n        const marketId = this.safeString (info, 'marketCode');\n        market = this.safeMarket (marketId, market);\n        const listOfTiers = this.safeList (info, 'tiers', []);\n        const tiers = [];\n        for (let j = 0; j < listOfTiers.length; j++) {\n            const tier = listOfTiers[j];\n            tiers.push ({\n                'tier': this.safeNumber (tier, 'tier'),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['settle'],\n                'minNotional': this.safeNumber (tier, 'positionFloor'),\n                'maxNotional': this.safeNumber (tier, 'positionCap'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintenanceMargin'),\n                'maxLeverage': this.safeNumber (tier, 'leverage'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseMarkets",
        "signature": "parseMarkets (markets): Market[]",
        "line_start": 484,
        "line_end": 496,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarkets (markets): Market[] {\n        const marketIds = [];\n        const result = [];\n        for (let i = 0; i < markets.length; i++) {\n            const market = markets[i];\n            const marketId = this.safeString (market, 'marketCode');\n            if (!(this.inArray (marketId, marketIds))) {\n                marketIds.push (marketId);\n                result.push (this.parseMarket (market));\n            }\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 944,
        "line_end": 964,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"open\": \"0.03240000\",\n         \"high\": \"0.03240000\",\n         \"low\": \"0.03240000\",\n         \"close\": \"0.03240000\",\n         \"volume\": \"0\",\n         \"currencyVolume\": \"0\",\n         \"openedAt\": \"1714906800000\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"open\": \"0.03240000\",\n        //         \"high\": \"0.03240000\",\n        //         \"low\": \"0.03240000\",\n        //         \"close\": \"0.03240000\",\n        //         \"volume\": \"0\",\n        //         \"currencyVolume\": \"0\",\n        //         \"openedAt\": \"1714906800000\"\n        //     }\n        //\n        return [\n            this.safeInteger (ohlcv, 'openedAt'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'currencyVolume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order, market: Market = undefined): Order",
        "line_start": 2736,
        "line_end": 2889,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'lastMatchedAt')",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'lastModifiedAt')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (this.safeString (order, 'orderType'))",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseOrderTimeInForce (this.safeString (order, 'timeInForce'))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeStringN (order, [ 'price', 'matchPrice', 'limitPrice' ])",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString2 (order, 'totalQuantity', 'quantity')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString2 (order, 'cumulativeMatchedQuantity', 'matchQuantity')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.safeString (order, 'remainQuantity')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.omitZero (this.safeString (order, 'amount'))",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"notice\": \"OrderMatched\",\n         \"accountId\": \"106490\",\n         \"orderId\": \"1000109901865\",\n         \"submitted\": true,\n         \"clientOrderId\": \"0\",\n         \"marketCode\": \"OX-USDT\",\n         \"status\": \"FILLED\",\n         \"side\": \"SELL\",\n         \"isTriggered\": false,\n         \"quantity\": \"150.0\",\n         \"amount\": \"0.0\",\n         \"remainQuantity\": \"0.0\",\n         \"matchId\": \"100017047880451399\",\n         \"matchPrice\": \"0.01465\",\n         \"matchQuantity\": \"150.0\",\n         \"feeInstrumentId\": \"USDT\",\n         \"fees\": \"0.0015382500\",\n         \"orderType\": \"MARKET\",\n         \"createdAt\": \"1715592472236\",\n         \"lastMatchedAt\": \"1715592472200\",\n         \"displayQuantity\": \"150.0\"\n     }",
          "{\n         \"notice\": \"OrderOpened\",\n         \"accountId\": \"106490\",\n         \"orderId\": \"1000111482406\",\n         \"submitted\": true,\n         \"clientOrderId\": \"0\",\n         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n         \"status\": \"OPEN\",\n         \"side\": \"SELL\",\n         \"price\": \"4000.0\",\n         \"isTriggered\": false,\n         \"quantity\": \"0.01\",\n         \"amount\": \"0.0\",\n         \"orderType\": \"LIMIT\",\n         \"timeInForce\": \"GTC\",\n         \"createdAt\": \"1715763507682\",\n         \"displayQuantity\": \"0.01\"\n     }",
          "{\n         \"accountId\": \"106490\",\n         \"orderId\": \"1000109892193\",\n         \"submitted\": true,\n         \"marketCode\": \"OX-USDT\",\n         \"side\": \"BUY\",\n         \"price\": \"0.01961\",\n         \"isTriggered\": false,\n         \"quantity\": \"100\",\n         \"orderType\": \"MARKET\",\n         \"timeInForce\": \"IOC\",\n         \"createdAt\": \"1715591529057\",\n         \"selfTradePreventionMode\": \"NONE\"\n     }",
          "{\n         \"code\": \"710001\",\n         \"message\": \"System failure, exception thrown -> null\",\n         \"submitted\": false,\n         \"marketCode\": \"OX-USDT\",\n         \"side\": \"BUY\",\n         \"price\": \"0.01961\",\n         \"amount\": \"100\",\n         \"orderType\": \"MARKET\",\n         \"timeInForce\": \"IOC\",\n         \"createdAt\": \"1715591678835\",\n         \"source\": 11,\n         \"selfTradePreventionMode\": \"NONE\"\n     }",
          "{\n         \"code\": \"20044\",\n         \"message\": \"Amount is not supported for this order type\",\n         \"submitted\": false,\n         \"marketCode\": \"OX-USDT\",\n         \"side\": \"SELL\",\n         \"amount\": \"200\",\n         \"orderType\": \"MARKET\",\n         \"createdAt\": \"1715592079986\",\n         \"source\": 11\n     }"
        ],
        "source": "parseOrder (order, market: Market = undefined): Order {\n        //\n        // accepted market order responseType FULL\n        //     {\n        //         \"notice\": \"OrderMatched\",\n        //         \"accountId\": \"106490\",\n        //         \"orderId\": \"1000109901865\",\n        //         \"submitted\": true,\n        //         \"clientOrderId\": \"0\",\n        //         \"marketCode\": \"OX-USDT\",\n        //         \"status\": \"FILLED\",\n        //         \"side\": \"SELL\",\n        //         \"isTriggered\": false,\n        //         \"quantity\": \"150.0\",\n        //         \"amount\": \"0.0\",\n        //         \"remainQuantity\": \"0.0\",\n        //         \"matchId\": \"100017047880451399\",\n        //         \"matchPrice\": \"0.01465\",\n        //         \"matchQuantity\": \"150.0\",\n        //         \"feeInstrumentId\": \"USDT\",\n        //         \"fees\": \"0.0015382500\",\n        //         \"orderType\": \"MARKET\",\n        //         \"createdAt\": \"1715592472236\",\n        //         \"lastMatchedAt\": \"1715592472200\",\n        //         \"displayQuantity\": \"150.0\"\n        //     }\n        //\n        // accepted limit order responseType FULL\n        //     {\n        //         \"notice\": \"OrderOpened\",\n        //         \"accountId\": \"106490\",\n        //         \"orderId\": \"1000111482406\",\n        //         \"submitted\": true,\n        //         \"clientOrderId\": \"0\",\n        //         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n        //         \"status\": \"OPEN\",\n        //         \"side\": \"SELL\",\n        //         \"price\": \"4000.0\",\n        //         \"isTriggered\": false,\n        //         \"quantity\": \"0.01\",\n        //         \"amount\": \"0.0\",\n        //         \"orderType\": \"LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"createdAt\": \"1715763507682\",\n        //         \"displayQuantity\": \"0.01\"\n        //     }\n        //\n        // accepted order responseType ACK\n        //     {\n        //         \"accountId\": \"106490\",\n        //         \"orderId\": \"1000109892193\",\n        //         \"submitted\": true,\n        //         \"marketCode\": \"OX-USDT\",\n        //         \"side\": \"BUY\",\n        //         \"price\": \"0.01961\",\n        //         \"isTriggered\": false,\n        //         \"quantity\": \"100\",\n        //         \"orderType\": \"MARKET\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"createdAt\": \"1715591529057\",\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        //  rejected order (balance insufficient)\n        //     {\n        //         \"code\": \"710001\",\n        //         \"message\": \"System failure, exception thrown -> null\",\n        //         \"submitted\": false,\n        //         \"marketCode\": \"OX-USDT\",\n        //         \"side\": \"BUY\",\n        //         \"price\": \"0.01961\",\n        //         \"amount\": \"100\",\n        //         \"orderType\": \"MARKET\",\n        //         \"timeInForce\": \"IOC\",\n        //         \"createdAt\": \"1715591678835\",\n        //         \"source\": 11,\n        //         \"selfTradePreventionMode\": \"NONE\"\n        //     }\n        //\n        // rejected order (bad request)\n        //     {\n        //         \"code\": \"20044\",\n        //         \"message\": \"Amount is not supported for this order type\",\n        //         \"submitted\": false,\n        //         \"marketCode\": \"OX-USDT\",\n        //         \"side\": \"SELL\",\n        //         \"amount\": \"200\",\n        //         \"orderType\": \"MARKET\",\n        //         \"createdAt\": \"1715592079986\",\n        //         \"source\": 11\n        //     }\n        //\n        // fetchOrder\n        //     {\n        //         \"orderId\": \"1000111762980\",\n        //         \"clientOrderId\": \"0\",\n        //         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n        //         \"status\": \"OPEN\",\n        //         \"side\": \"BUY\",\n        //         \"price\": \"2700.0\",\n        //         \"isTriggered\": false,\n        //         \"remainQuantity\": \"0.01\",\n        //         \"totalQuantity\": \"0.01\",\n        //         \"amount\": \"0\",\n        //         \"displayQuantity\": \"0.01\",\n        //         \"cumulativeMatchedQuantity\": \"0\",\n        //         \"orderType\": \"STOP_LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"source\": \"11\",\n        //         \"createdAt\": \"1715794191277\"\n        //     }\n        //\n        const marketId = this.safeString (order, 'marketCode');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (order, 'createdAt');\n        let fee = undefined;\n        const feeCurrency = this.safeString (order, 'feeInstrumentId');\n        if (feeCurrency !== undefined) {\n            fee = {\n                'currency': this.safeCurrencyCode (feeCurrency),\n                'cost': this.safeNumber (order, 'fees'),\n            };\n        }\n        let status = this.safeString (order, 'status');\n        const code = this.safeInteger (order, 'code'); // rejected orders have code of the error\n        if (code !== undefined) {\n            status = 'rejected';\n        }\n        const triggerPrice = this.safeString (order, 'stopPrice');\n        return this.safeOrder ({\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.safeInteger (order, 'lastMatchedAt'),\n            'lastUpdateTimestamp': this.safeInteger (order, 'lastModifiedAt'),\n            'status': this.parseOrderStatus (status),\n            'symbol': market['symbol'],\n            'type': this.parseOrderType (this.safeString (order, 'orderType')),\n            'timeInForce': this.parseOrderTimeInForce (this.safeString (order, 'timeInForce')), // only for limit orders\n            'side': this.safeStringLower (order, 'side'),\n            'price': this.safeStringN (order, [ 'price', 'matchPrice', 'limitPrice' ]),\n            'average': undefined,\n            'amount': this.safeString2 (order, 'totalQuantity', 'quantity'),\n            'filled': this.safeString2 (order, 'cumulativeMatchedQuantity', 'matchQuantity'),\n            'remaining': this.safeString (order, 'remainQuantity'),\n            'triggerPrice': triggerPrice,\n            'stopLossPrice': triggerPrice,\n            'cost': this.omitZero (this.safeString (order, 'amount')),\n            'trades': undefined,\n            'fee': fee,\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status)",
        "line_start": 2891,
        "line_end": 2906,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status) {\n        const statuses: Dict = {\n            'OPEN': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'PARTIAL_FILL': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'CANCELED_BY_USER': 'canceled',\n            'CANCELED_BY_MAKER_ONLY': 'rejected',\n            'CANCELED_BY_FOK': 'rejected',\n            'CANCELED_ALL_BY_IOC': 'rejected',\n            'CANCELED_PARTIAL_BY_IOC': 'canceled',\n            'CANCELED_BY_SELF_TRADE_PROTECTION': 'rejected',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderTimeInForce",
        "signature": "parseOrderTimeInForce (type)",
        "line_start": 2918,
        "line_end": 2927,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderTimeInForce (type) {\n        const types: Dict = {\n            'GTC': 'GTC',\n            'IOC': 'IOC',\n            'FOK': 'FOK',\n            'MAKER_ONLY': 'PO',\n            'MAKER_ONLY_REPRICE': 'PO',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type)",
        "line_start": 2908,
        "line_end": 2916,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'STOP_LIMIT': 'limit',\n            'MARKET': 'market',\n            'STOP_MARKET': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position, market: Market = undefined)",
        "line_start": 2232,
        "line_end": 2278,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'cross'",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'estLiquidationPrice')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'positionPnl')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'position')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (position, 'lastUpdatedAt')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n         \"baseAsset\": \"ETH\",\n         \"counterAsset\": \"USD\",\n         \"position\": \"0.001\",\n         \"entryPrice\": \"3080.5\",\n         \"markPrice\": \"3062.0\",\n         \"positionPnl\": \"-1.8500\",\n         \"estLiquidationPrice\": \"0\",\n         \"lastUpdatedAt\": \"1715089678013\"\n     }"
        ],
        "source": "parsePosition (position, market: Market = undefined) {\n        //\n        //     {\n        //         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n        //         \"baseAsset\": \"ETH\",\n        //         \"counterAsset\": \"USD\",\n        //         \"position\": \"0.001\",\n        //         \"entryPrice\": \"3080.5\",\n        //         \"markPrice\": \"3062.0\",\n        //         \"positionPnl\": \"-1.8500\",\n        //         \"estLiquidationPrice\": \"0\",\n        //         \"lastUpdatedAt\": \"1715089678013\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'marketCode');\n        market = this.safeMarket (marketId, market);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': market['symbol'],\n            'notional': undefined,\n            'marginMode': 'cross',\n            'liquidationPrice': this.safeNumber (position, 'estLiquidationPrice'),\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'unrealizedPnl': this.safeNumber (position, 'positionPnl'),\n            'realizedPnl': undefined,\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'position'),\n            'contractSize': undefined,\n            'markPrice': this.safeNumber (position, 'markPrice'),\n            'lastPrice': undefined,\n            'side': undefined,\n            'hedged': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'lastUpdateTimestamp': this.safeInteger (position, 'lastUpdatedAt'),\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'marginRatio': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker, market: Market = undefined): Ticker",
        "line_start": 832,
        "line_end": 876,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high24h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low24h')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open24h')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'currencyVolume24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marketCode\": \"BTC-USD-SWAP-LIN\",\n         \"markPrice\": \"64276\",\n         \"open24h\": \"63674\",\n         \"high24h\": \"64607\",\n         \"low24h\": \"62933\",\n         \"volume24h\": \"306317655.80000\",\n         \"currencyVolume24h\": \"48.06810\",\n         \"openInterest\": \"72.39250\",\n         \"lastTradedPrice\": \"64300.0\",\n         \"lastTradedQuantity\": \"1.0\",\n         \"lastUpdatedAt\": \"1714925196034\"\n     }"
        ],
        "source": "parseTicker (ticker, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"marketCode\": \"BTC-USD-SWAP-LIN\",\n        //         \"markPrice\": \"64276\",\n        //         \"open24h\": \"63674\",\n        //         \"high24h\": \"64607\",\n        //         \"low24h\": \"62933\",\n        //         \"volume24h\": \"306317655.80000\",\n        //         \"currencyVolume24h\": \"48.06810\",\n        //         \"openInterest\": \"72.39250\",\n        //         \"lastTradedPrice\": \"64300.0\",\n        //         \"lastTradedQuantity\": \"1.0\",\n        //         \"lastUpdatedAt\": \"1714925196034\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'lastUpdatedAt');\n        const marketId = this.safeString (ticker, 'marketCode');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const last = this.safeString (ticker, 'lastTradedPrice');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high24h'),\n            'low': this.safeString (ticker, 'low24h'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open24h'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'currencyVolume24h'),\n            'quoteVolume': undefined, // the exchange returns cost in OX\n            'markPrice': this.safeString (ticker, 'markPrice'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade, market: Market = undefined): Trade",
        "line_start": 1483,
        "line_end": 1538,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (trade, 'feeAsset'))",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (trade, 'matchId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (trade, 'side')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeStringLower2 (trade, 'matchType', 'orderMatchType')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'matchPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString2 (trade, 'matchQuantity', 'matchedQuantity')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"marketCode\": \"BTC-USD-SWAP-LIN\",\n         \"matchPrice\": \"63900\",\n         \"matchQuantity\": \"1\",\n         \"side\": \"SELL\",\n         \"matchType\": \"TAKER\",\n         \"matchedAt\": \"1714934112352\"\n     }",
          "{\n         \"orderId\": \"1000104903698\",\n         \"clientOrderId\": \"1715000260094\",\n         \"matchId\": \"400017129522773178\",\n         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n         \"side\": \"BUY\",\n         \"matchedQuantity\": \"0.001\",\n         \"matchPrice\": \"3100.2\",\n         \"total\": \"310.02\",\n         \"orderMatchType\": \"MAKER\",\n         \"feeAsset\": \"OX\",\n         \"fee\": \"0.062004\",\n         \"source\": \"0\",\n         \"matchedAt\": \"1715000267420\"\n     }"
        ],
        "source": "parseTrade (trade, market: Market = undefined): Trade {\n        //\n        // public fetchTrades\n        //\n        //     {\n        //         \"marketCode\": \"BTC-USD-SWAP-LIN\",\n        //         \"matchPrice\": \"63900\",\n        //         \"matchQuantity\": \"1\",\n        //         \"side\": \"SELL\",\n        //         \"matchType\": \"TAKER\",\n        //         \"matchedAt\": \"1714934112352\"\n        //     }\n        //\n        //\n        // private fetchMyTrades\n        //\n        //     {\n        //         \"orderId\": \"1000104903698\",\n        //         \"clientOrderId\": \"1715000260094\",\n        //         \"matchId\": \"400017129522773178\",\n        //         \"marketCode\": \"ETH-USD-SWAP-LIN\",\n        //         \"side\": \"BUY\",\n        //         \"matchedQuantity\": \"0.001\",\n        //         \"matchPrice\": \"3100.2\",\n        //         \"total\": \"310.02\",\n        //         \"orderMatchType\": \"MAKER\",\n        //         \"feeAsset\": \"OX\",\n        //         \"fee\": \"0.062004\",\n        //         \"source\": \"0\",\n        //         \"matchedAt\": \"1715000267420\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'marketCode');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (trade, 'matchedAt');\n        const fee = {\n            'cost': this.safeString (trade, 'fee'),\n            'currency': this.safeCurrencyCode (this.safeString (trade, 'feeAsset')),\n        };\n        return this.safeTrade ({\n            'id': this.safeString (trade, 'matchId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'order': this.safeString (trade, 'orderId'),\n            'side': this.safeStringLower (trade, 'side'),\n            'takerOrMaker': this.safeStringLower2 (trade, 'matchType', 'orderMatchType'),\n            'price': this.safeString (trade, 'matchPrice'),\n            'amount': this.safeString2 (trade, 'matchQuantity', 'matchedQuantity'),\n            'cost': undefined, // the exchange returns total cost in OX\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction, currency: Currency = undefined): Transaction",
        "line_start": 1990,
        "line_end": 2081,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"asset\":\"USDC\",\n         \"network\":\"Ethereum\",\n         \"address\": \"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\",\n         \"quantity\":\"50\",\n         \"id\":\"5914\",\n         \"status\": \"COMPLETED\",\n         \"txId\":\"0xf5e79663830a0c6f94d46638dcfbc134566c12facf1832396f81ecb55d3c75dc\",\n         \"creditedAt\":\"1714821645154\"\n     }",
          "{\n         id: '968163212989431811',\n         asset: 'OX',\n         network: 'Arbitrum',\n         address: '0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9',\n         quantity: '11.7444',\n         fee: '1.744400000',\n         status: 'COMPLETED',\n         txId: '0xe96b2d128b737fdbca927edf355cff42202e65b0fb960e64ffb9bd68c121f69f',\n         requestedAt: '1715530365450',\n         completedAt: '1715530527000'\n     }",
          "{\n         \"id\": \"968364664449302529\",\n         \"asset\": \"OX\",\n         \"network\": \"Arbitrum\",\n         \"address\": \"0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9\",\n         \"quantity\": \"10\",\n         \"externalFee\": false,\n         \"fee\": \"1.6728\",\n         \"status\": \"PENDING\",\n         \"requestedAt\": \"1715591843616\"\n     }"
        ],
        "source": "parseTransaction (transaction, currency: Currency = undefined): Transaction {\n        //\n        //  fetchDeposits\n        //     {\n        //         \"asset\":\"USDC\",\n        //         \"network\":\"Ethereum\",\n        //         \"address\": \"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\",\n        //         \"quantity\":\"50\",\n        //         \"id\":\"5914\",\n        //         \"status\": \"COMPLETED\",\n        //         \"txId\":\"0xf5e79663830a0c6f94d46638dcfbc134566c12facf1832396f81ecb55d3c75dc\",\n        //         \"creditedAt\":\"1714821645154\"\n        //     }\n        //\n        // fetchWithdrawals\n        //     {\n        //         id: '968163212989431811',\n        //         asset: 'OX',\n        //         network: 'Arbitrum',\n        //         address: '0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9',\n        //         quantity: '11.7444',\n        //         fee: '1.744400000',\n        //         status: 'COMPLETED',\n        //         txId: '0xe96b2d128b737fdbca927edf355cff42202e65b0fb960e64ffb9bd68c121f69f',\n        //         requestedAt: '1715530365450',\n        //         completedAt: '1715530527000'\n        //     }\n        //\n        // withdraw\n        //     {\n        //         \"id\": \"968364664449302529\",\n        //         \"asset\": \"OX\",\n        //         \"network\": \"Arbitrum\",\n        //         \"address\": \"0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9\",\n        //         \"quantity\": \"10\",\n        //         \"externalFee\": false,\n        //         \"fee\": \"1.6728\",\n        //         \"status\": \"PENDING\",\n        //         \"requestedAt\": \"1715591843616\"\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        const type = this.safeString (transaction, 'type');\n        transaction = this.omit (transaction, 'type');\n        let address: Str = undefined;\n        let addressTo: Str = undefined;\n        let status: Str = undefined;\n        if (type === 'deposit') {\n            address = this.safeString (transaction, 'address');\n            status = this.parseDepositStatus (this.safeString (transaction, 'status'));\n        } else if (type === 'withdrawal') {\n            addressTo = this.safeString (transaction, 'address');\n            status = this.parseWithdrawalStatus (this.safeString (transaction, 'status'));\n        }\n        const txid = this.safeString (transaction, 'txId');\n        const currencyId = this.safeString (transaction, 'asset');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const network = this.safeString (transaction, 'network');\n        const networkCode = this.networkIdToCode (network);\n        const timestamp = this.safeInteger2 (transaction, 'creditedAt', 'requestedAt');\n        const amount = this.safeNumber (transaction, 'quantity');\n        const feeCost = this.safeNumber (transaction, 'fee');\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': networkCode,\n            'address': address,\n            'addressTo': addressTo,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactions",
        "signature": "parseTransactions (transactions, currency: Currency = undefined, since: Int = undefined, limit: Int = undefined, params = {}): Transaction[]",
        "line_start": 1978,
        "line_end": 1988,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactions (transactions, currency: Currency = undefined, since: Int = undefined, limit: Int = undefined, params = {}): Transaction[] {\n        let result = [];\n        for (let i = 0; i < transactions.length; i++) {\n            transactions[i] = this.extend (transactions[i], params);\n            const transaction = this.parseTransaction (transactions[i], currency);\n            result.push (transaction);\n        }\n        result = this.sortBy (result, 'timestamp');\n        const code = (currency !== undefined) ? currency['code'] : undefined;\n        return this.filterByCurrencySinceLimit (result, code, since, limit);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency: Currency = undefined)",
        "line_start": 1782,
        "line_end": 1809,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'quantity')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (transfer, 'fromAccount')",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (transfer, 'toAccount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'status'))",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"asset\": \"USDT\",\n         \"quantity\": \"5\",\n         \"fromAccount\": \"106490\",\n         \"toAccount\": \"106526\",\n         \"id\": \"966706320886267905\",\n         \"status\": \"COMPLETED\",\n         \"transferredAt\": \"1715085756708\"\n     }"
        ],
        "source": "parseTransfer (transfer, currency: Currency = undefined) {\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"asset\": \"USDT\",\n        //         \"quantity\": \"5\",\n        //         \"fromAccount\": \"106490\",\n        //         \"toAccount\": \"106526\",\n        //         \"id\": \"966706320886267905\",\n        //         \"status\": \"COMPLETED\",\n        //         \"transferredAt\": \"1715085756708\"\n        //     }\n        //\n        const timestamp = this.safeInteger (transfer, 'transferredAt');\n        const currencyId = this.safeString (transfer, 'asset');\n        return {\n            'id': this.safeString (transfer, 'id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'quantity'),\n            'fromAccount': this.safeString (transfer, 'fromAccount'),\n            'toAccount': this.safeString (transfer, 'toAccount'),\n            'status': this.parseTransferStatus (this.safeString (transfer, 'status')),\n            'info': transfer,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status)",
        "line_start": 1811,
        "line_end": 1816,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status) {\n        const statuses: Dict = {\n            'COMPLETED': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseWithdrawalStatus",
        "signature": "parseWithdrawalStatus (status)",
        "line_start": 2090,
        "line_end": 2101,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseWithdrawalStatus (status) {\n        const statuses: Dict = {\n            'COMPLETED': 'ok',\n            'PROCESSING': 'pending',\n            'IN SWEEPING': 'pending',\n            'PENDING': 'pending',\n            'ON HOLD': 'pending',\n            'CANCELED': 'canceled',\n            'FAILED': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "p2b": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response)",
        "line_start": 860,
        "line_end": 890,
        "comment": null,
        "mappings": [
          {
            "key": "free",
            "value": "available",
            "comment": null
          },
          {
            "key": "used",
            "value": "used",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"USDT\": {\n            \"available\": \"71.81328046\",\n            \"freeze\": \"10.46103091\"\n        },\n        \"BTC\": {\n            \"available\": \"0.00135674\",\n            \"freeze\": \"0.00020003\"\n        }\n    }"
        ],
        "source": "parseBalance (response) {\n        //\n        //    {\n        //        \"USDT\": {\n        //            \"available\": \"71.81328046\",\n        //            \"freeze\": \"10.46103091\"\n        //        },\n        //        \"BTC\": {\n        //            \"available\": \"0.00135674\",\n        //            \"freeze\": \"0.00020003\"\n        //        }\n        //    }\n        //\n        const result: Dict = {\n            'info': response,\n        };\n        const keys = Object.keys (response);\n        for (let i = 0; i < keys.length; i++) {\n            const currencyId = keys[i];\n            const balance = response[currencyId];\n            const code = this.safeCurrencyCode (currencyId);\n            const used = this.safeString (balance, 'freeze');\n            const available = this.safeString (balance, 'available');\n            const account: Dict = {\n                'free': available,\n                'used': used,\n            };\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 378,
        "line_end": 436,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (limits, 'step_size'),\n                'price': this.safeNumber (limits, 'tick_size'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (limits, 'min_amount'),\n                    'max': this.parseNumber (this.omitZero (maxAmount)),\n                },\n                'price': {\n                    'min': this.safeNumber (limits, 'min_price'),\n                    'max': this.parseNumber (this.omitZero (maxPrice)),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (limits, 'min_amount'),\n                    'max': this.parseNumber (this.omitZero (maxAmount)),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (limits, 'min_price'),\n                    'max': this.parseNumber (this.omitZero (maxPrice)),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (limits, 'min_price')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.parseNumber (this.omitZero (maxPrice))",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const marketId = this.safeString (market, 'name');\n        const baseId = this.safeString (market, 'stock');\n        const quoteId = this.safeString (market, 'money');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const limits = this.safeValue (market, 'limits');\n        const maxAmount = this.safeString (limits, 'max_amount');\n        const maxPrice = this.safeString (limits, 'max_price');\n        return {\n            'id': marketId,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': true,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (limits, 'step_size'),\n                'price': this.safeNumber (limits, 'tick_size'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (limits, 'min_amount'),\n                    'max': this.parseNumber (this.omitZero (maxAmount)),\n                },\n                'price': {\n                    'min': this.safeNumber (limits, 'min_price'),\n                    'max': this.parseNumber (this.omitZero (maxPrice)),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined) : OHLCV",
        "line_start": 805,
        "line_end": 826,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n        1699253400,       // Kline open time\n        '0.3429',         // Open price\n        '0.3427',         // Close price\n        '0.3429',         // Highest price\n        '0.3427',         // Lowest price\n        '1900.4',         // Volume for stock currency\n        '651.46278',      // Volume for money currency\n        'ADA_USDT'        // Market name\n    ],"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined) : OHLCV {\n        //\n        //    [\n        //        1699253400,       // Kline open time\n        //        '0.3429',         // Open price\n        //        '0.3427',         // Close price\n        //        '0.3429',         // Highest price\n        //        '0.3427',         // Lowest price\n        //        '1900.4',         // Volume for stock currency\n        //        '651.46278',      // Volume for money currency\n        //        'ADA_USDT'        // Market name\n        //    ],\n        //\n        return [\n            this.safeIntegerProduct (ohlcv, 0, 1000),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1261,
        "line_end": 1328,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (order, 'id', 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (order, 'type')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (order, 'side')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'amount')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'dealStock')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.safeString (order, 'left')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': market['quote'],\n                'cost': this.safeString (order, 'dealFee'),\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'dealFee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"orderId\": 171906478744,\n        \"market\": \"ETH_BTC\",\n        \"price\": \"0.04348\",\n        \"side\": \"buy\",\n        \"type\": \"limit\",\n        \"timestamp\": 1698484861.746517,\n        \"dealMoney\": \"0\",\n        \"dealStock\": \"0\",\n        \"amount\": \"0.0277\",\n        \"takerFee\": \"0.002\",\n        \"makerFee\": \"0.002\",\n        \"left\": \"0.0277\",\n        \"dealFee\": \"0\"\n    }",
          "{\n        \"id\": 171366547790,           // Order id\n        \"amount\": \"0.00032\",          // Original amount\n        \"price\": \"34293.92\",          // Order price\n        \"type\": \"limit\",              // Order type\n        \"side\": \"sell\",               // Order side\n        \"ctime\": 1698237533.497241,   // Order creation time\n        \"ftime\": 1698237535.41196,    // Order fill time\n        \"market\": \"BTC_USDT\",         // Market name\n        \"takerFee\": \"0.0018\",         // Taker fee\n        \"makerFee\": \"0.0016\",         // Market fee\n        \"dealFee\": \"0.01755848704\",   // Deal fee\n        \"dealStock\": \"0.00032\",       // Filled amount\n        \"dealMoney\": \"10.9740544\"     // Filled total\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // cancelOrder, fetchOpenOrders, createOrder\n        //\n        //    {\n        //        \"orderId\": 171906478744,\n        //        \"market\": \"ETH_BTC\",\n        //        \"price\": \"0.04348\",\n        //        \"side\": \"buy\",\n        //        \"type\": \"limit\",\n        //        \"timestamp\": 1698484861.746517,\n        //        \"dealMoney\": \"0\",\n        //        \"dealStock\": \"0\",\n        //        \"amount\": \"0.0277\",\n        //        \"takerFee\": \"0.002\",\n        //        \"makerFee\": \"0.002\",\n        //        \"left\": \"0.0277\",\n        //        \"dealFee\": \"0\"\n        //    }\n        //\n        // fetchClosedOrders\n        //\n        //    {\n        //        \"id\": 171366547790,           // Order id\n        //        \"amount\": \"0.00032\",          // Original amount\n        //        \"price\": \"34293.92\",          // Order price\n        //        \"type\": \"limit\",              // Order type\n        //        \"side\": \"sell\",               // Order side\n        //        \"ctime\": 1698237533.497241,   // Order creation time\n        //        \"ftime\": 1698237535.41196,    // Order fill time\n        //        \"market\": \"BTC_USDT\",         // Market name\n        //        \"takerFee\": \"0.0018\",         // Taker fee\n        //        \"makerFee\": \"0.0016\",         // Market fee\n        //        \"dealFee\": \"0.01755848704\",   // Deal fee\n        //        \"dealStock\": \"0.00032\",       // Filled amount\n        //        \"dealMoney\": \"10.9740544\"     // Filled total\n        //    }\n        //\n        const timestamp = this.safeIntegerProduct2 (order, 'timestamp', 'ctime', 1000);\n        const marketId = this.safeString (order, 'market');\n        market = this.safeMarket (marketId, market);\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString2 (order, 'id', 'orderId'),\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': market['symbol'],\n            'type': this.safeString (order, 'type'),\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': this.safeString (order, 'side'),\n            'price': this.safeString (order, 'price'),\n            'triggerPrice': undefined,\n            'amount': this.safeString (order, 'amount'),\n            'cost': undefined,\n            'average': undefined,\n            'filled': this.safeString (order, 'dealStock'),\n            'remaining': this.safeString (order, 'left'),\n            'status': undefined,\n            'fee': {\n                'currency': market['quote'],\n                'cost': this.safeString (order, 'dealFee'),\n            },\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker, market: Market = undefined)",
        "line_start": 523,
        "line_end": 582,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'change')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'vol', 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'deal')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n        at: '1699252631',\n        ticker: {\n            bid: '0.0000332',\n            ask: '0.0000333',\n            low: '0.0000301',\n            high: '0.0000338',\n            last: '0.0000333',\n            vol: '15.66',\n            deal: '0.000501828',\n            change: '10.63'\n        }\n    }",
          "{\n        bid: '0.342',\n        ask: '0.3421',\n        open: '0.3317',\n        high: '0.3499',\n        low: '0.3311',\n        last: '0.3421',\n        volume: '17855383.1',\n        deal: '6107478.3423',\n        change: '3.13'\n    }"
        ],
        "source": "parseTicker (ticker, market: Market = undefined) {\n        //\n        // parseTickers\n        //\n        //    {\n        //        at: '1699252631',\n        //        ticker: {\n        //            bid: '0.0000332',\n        //            ask: '0.0000333',\n        //            low: '0.0000301',\n        //            high: '0.0000338',\n        //            last: '0.0000333',\n        //            vol: '15.66',\n        //            deal: '0.000501828',\n        //            change: '10.63'\n        //        }\n        //    }\n        //\n        // parseTicker\n        //\n        //    {\n        //        bid: '0.342',\n        //        ask: '0.3421',\n        //        open: '0.3317',\n        //        high: '0.3499',\n        //        low: '0.3311',\n        //        last: '0.3421',\n        //        volume: '17855383.1',\n        //        deal: '6107478.3423',\n        //        change: '3.13'\n        //    }\n        //\n        const timestamp = this.safeIntegerProduct (ticker, 'at', 1000);\n        if ('ticker' in ticker) {\n            ticker = this.safeValue (ticker, 'ticker');\n        }\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (ticker, 'change'),\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'vol', 'volume'),\n            'quoteVolume': this.safeString (ticker, 'deal'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined)",
        "line_start": 687,
        "line_end": 753,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'id', 'deal_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString2 (trade, 'dealOrderId', 'deal_order_id')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString2 (trade, 'type', 'side')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (trade, 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (trade, 'amount')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'deal')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': market['quote'],\n                'cost': this.safeString2 (trade, 'fee', 'deal_fee'),\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['quote']",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString2 (trade, 'fee', 'deal_fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n        id: '7495738622',\n        type: 'sell',\n        time: '1699255565.445418',\n        amount: '252.6',\n        price: '0.3422'\n    }",
          "{\n        \"deal_id\": 7450617292,              // Deal id\n        \"deal_time\": 1698506956.66224,      // Deal execution time\n        \"deal_order_id\": 171955225751,      // Deal order id\n        \"opposite_order_id\": 171955110512,  // Opposite order id\n        \"side\": \"sell\",                     // Deal side\n        \"price\": \"0.05231\",                 // Deal price\n        \"amount\": \"0.002\",                  // Deal amount\n        \"deal\": \"0.00010462\",               // Total (price * amount)\n        \"deal_fee\": \"0.000000188316\",       // Deal fee\n        \"role\": \"taker\",                    // Role. Taker or maker\n        \"isSelfTrade\": false                // is self trade\n    }",
          "{\n        \"id\": 7429883128,             // Deal id\n        \"time\": 1698237535.41196,     // Deal execution time\n        \"fee\": \"0.01755848704\",       // Deal fee\n        \"price\": \"34293.92\",          // Deal price\n        \"amount\": \"0.00032\",          // Deal amount\n        \"dealOrderId\": 171366551416,  // Deal order id\n        \"role\": 1,                    // Deal role (1 - maker, 2 - taker)\n        \"deal\": \"10.9740544\"          // Total (price * amount)\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined) {\n        //\n        // fetchTrades\n        //\n        //    {\n        //        id: '7495738622',\n        //        type: 'sell',\n        //        time: '1699255565.445418',\n        //        amount: '252.6',\n        //        price: '0.3422'\n        //    }\n        //\n        // fetchMyTrades\n        //\n        //    {\n        //        \"deal_id\": 7450617292,              // Deal id\n        //        \"deal_time\": 1698506956.66224,      // Deal execution time\n        //        \"deal_order_id\": 171955225751,      // Deal order id\n        //        \"opposite_order_id\": 171955110512,  // Opposite order id\n        //        \"side\": \"sell\",                     // Deal side\n        //        \"price\": \"0.05231\",                 // Deal price\n        //        \"amount\": \"0.002\",                  // Deal amount\n        //        \"deal\": \"0.00010462\",               // Total (price * amount)\n        //        \"deal_fee\": \"0.000000188316\",       // Deal fee\n        //        \"role\": \"taker\",                    // Role. Taker or maker\n        //        \"isSelfTrade\": false                // is self trade\n        //    }\n        //\n        // fetchOrderTrades\n        //\n        //    {\n        //        \"id\": 7429883128,             // Deal id\n        //        \"time\": 1698237535.41196,     // Deal execution time\n        //        \"fee\": \"0.01755848704\",       // Deal fee\n        //        \"price\": \"34293.92\",          // Deal price\n        //        \"amount\": \"0.00032\",          // Deal amount\n        //        \"dealOrderId\": 171366551416,  // Deal order id\n        //        \"role\": 1,                    // Deal role (1 - maker, 2 - taker)\n        //        \"deal\": \"10.9740544\"          // Total (price * amount)\n        //    }\n        //\n        const timestamp = this.safeIntegerProduct2 (trade, 'time', 'deal_time', 1000);\n        let takerOrMaker = this.safeString (trade, 'role');\n        if (takerOrMaker === '1') {\n            takerOrMaker = 'maker';\n        } else if (takerOrMaker === '2') {\n            takerOrMaker = 'taker';\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeString2 (trade, 'id', 'deal_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': this.safeString (market, 'symbol'),\n            'order': this.safeString2 (trade, 'dealOrderId', 'deal_order_id'),\n            'type': undefined,\n            'side': this.safeString2 (trade, 'type', 'side'),\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString (trade, 'price'),\n            'amount': this.safeString (trade, 'amount'),\n            'cost': this.safeString (trade, 'deal'),\n            'fee': {\n                'currency': market['quote'],\n                'cost': this.safeString2 (trade, 'fee', 'deal_fee'),\n            },\n        }, market);\n    }"
      }
    ],
    "paradex": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1819,
        "line_end": 1830,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = this.safeDict (response, i, {});\n            const currencyId = this.safeString (balance, 'token');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'size');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseGreeks",
        "signature": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks",
        "line_start": 2520,
        "line_end": 2579,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "delta",
            "value": "this.safeNumber (greeksData, 'delta')",
            "comment": null
          },
          {
            "key": "gamma",
            "value": "this.safeNumber (greeksData, 'gamma')",
            "comment": null
          },
          {
            "key": "theta",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vega",
            "value": "this.safeNumber (greeksData, 'vega')",
            "comment": null
          },
          {
            "key": "rho",
            "value": "this.safeNumber (greeksData, 'rho')",
            "comment": null
          },
          {
            "key": "vanna",
            "value": "this.safeNumber (greeksData, 'vanna')",
            "comment": null
          },
          {
            "key": "volga",
            "value": "this.safeNumber (greeksData, 'volga')",
            "comment": null
          },
          {
            "key": "bidSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidImpliedVolatility",
            "value": "this.safeNumber (greeks, 'bid_iv')",
            "comment": null
          },
          {
            "key": "askImpliedVolatility",
            "value": "this.safeNumber (greeks, 'ask_iv')",
            "comment": null
          },
          {
            "key": "markImpliedVolatility",
            "value": "this.safeNumber (greeks, 'mark_iv')",
            "comment": null
          },
          {
            "key": "bidPrice",
            "value": "this.safeNumber (greeks, 'bid')",
            "comment": null
          },
          {
            "key": "askPrice",
            "value": "this.safeNumber (greeks, 'ask')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (greeks, 'mark_price')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeNumber (greeks, 'last_traded_price')",
            "comment": null
          },
          {
            "key": "underlyingPrice",
            "value": "this.safeNumber (greeks, 'underlying_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "greeks",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USD-114000-P\",\n         \"mark_price\": \"10835.66892602\",\n         \"mark_iv\": \"0.71781855\",\n         \"delta\": \"-0.98726024\",\n         \"greeks\": {\n             \"delta\": \"-0.9872602390817709\",\n             \"gamma\": \"0.000004560958862297231\",\n             \"vega\": \"227.11344863639806\",\n             \"rho\": \"-302.0617972461581\",\n             \"vanna\": \"0.06609830491614832\",\n             \"volga\": \"925.9501532805552\"\n         },\n         \"last_traded_price\": \"10551.5\",\n         \"bid\": \"10794.9\",\n         \"bid_iv\": \"0.05\",\n         \"ask\": \"10887.3\",\n         \"ask_iv\": \"0.8783283\",\n         \"last_iv\": \"0.05\",\n         \"volume_24h\": \"0\",\n         \"total_volume\": \"195240.72672261014\",\n         \"created_at\": 1747644009995,\n         \"underlying_price\": \"103164.79162649\",\n         \"open_interest\": \"0\",\n         \"funding_rate\": \"0.000004464241170536191\",\n         \"price_change_rate_24h\": \"0.074915\",\n         \"future_funding_rate\": \"0.0001\"\n     }"
        ],
        "source": "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USD-114000-P\",\n        //         \"mark_price\": \"10835.66892602\",\n        //         \"mark_iv\": \"0.71781855\",\n        //         \"delta\": \"-0.98726024\",\n        //         \"greeks\": {\n        //             \"delta\": \"-0.9872602390817709\",\n        //             \"gamma\": \"0.000004560958862297231\",\n        //             \"vega\": \"227.11344863639806\",\n        //             \"rho\": \"-302.0617972461581\",\n        //             \"vanna\": \"0.06609830491614832\",\n        //             \"volga\": \"925.9501532805552\"\n        //         },\n        //         \"last_traded_price\": \"10551.5\",\n        //         \"bid\": \"10794.9\",\n        //         \"bid_iv\": \"0.05\",\n        //         \"ask\": \"10887.3\",\n        //         \"ask_iv\": \"0.8783283\",\n        //         \"last_iv\": \"0.05\",\n        //         \"volume_24h\": \"0\",\n        //         \"total_volume\": \"195240.72672261014\",\n        //         \"created_at\": 1747644009995,\n        //         \"underlying_price\": \"103164.79162649\",\n        //         \"open_interest\": \"0\",\n        //         \"funding_rate\": \"0.000004464241170536191\",\n        //         \"price_change_rate_24h\": \"0.074915\",\n        //         \"future_funding_rate\": \"0.0001\"\n        //     }\n        //\n        const marketId = this.safeString (greeks, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'option');\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (greeks, 'created_at');\n        const greeksData = this.safeDict (greeks, 'greeks', {});\n        return {\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'delta': this.safeNumber (greeksData, 'delta'),\n            'gamma': this.safeNumber (greeksData, 'gamma'),\n            'theta': undefined,\n            'vega': this.safeNumber (greeksData, 'vega'),\n            'rho': this.safeNumber (greeksData, 'rho'),\n            'vanna': this.safeNumber (greeksData, 'vanna'),\n            'volga': this.safeNumber (greeksData, 'volga'),\n            'bidSize': undefined,\n            'askSize': undefined,\n            'bidImpliedVolatility': this.safeNumber (greeks, 'bid_iv'),\n            'askImpliedVolatility': this.safeNumber (greeks, 'ask_iv'),\n            'markImpliedVolatility': this.safeNumber (greeks, 'mark_iv'),\n            'bidPrice': this.safeNumber (greeks, 'bid'),\n            'askPrice': this.safeNumber (greeks, 'ask'),\n            'markPrice': this.safeNumber (greeks, 'mark_price'),\n            'lastPrice': this.safeNumber (greeks, 'last_traded_price'),\n            'underlyingPrice': this.safeNumber (greeks, 'underlying_price'),\n            'info': greeks,\n        };\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2364,
        "line_end": 2375,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "this.safeInteger (leverage, 'leverage')",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "this.safeInteger (leverage, 'leverage')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'market');\n        market = this.safeMarket (marketId, market);\n        const marginMode = this.safeStringLower (leverage, 'margin_type');\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': this.safeInteger (leverage, 'leverage'),\n            'shortLeverage': this.safeInteger (leverage, 'leverage'),\n        } as Leverage;\n    }"
      },
      {
        "name": "parseLiquidation",
        "signature": "parseLiquidation (liquidation, market: Market = undefined)",
        "line_start": 2052,
        "line_end": 2072,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "liquidation",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"created_at\": 1697213130097,\n         \"id\": \"0x123456789\"\n     }"
        ],
        "source": "parseLiquidation (liquidation, market: Market = undefined) {\n        //\n        //     {\n        //         \"created_at\": 1697213130097,\n        //         \"id\": \"0x123456789\"\n        //     }\n        //\n        const timestamp = this.safeInteger (liquidation, 'created_at');\n        return this.safeLiquidation ({\n            'info': liquidation,\n            'symbol': undefined,\n            'contracts': undefined,\n            'contractSize': undefined,\n            'price': undefined,\n            'side': undefined,\n            'baseValue': undefined,\n            'quoteValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        });\n    }"
      },
      {
        "name": "parseMarginMode",
        "signature": "parseMarginMode (rawMarginMode: Dict, market = undefined): MarginMode",
        "line_start": 2294,
        "line_end": 2303,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "rawMarginMode",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginMode (rawMarginMode: Dict, market = undefined): MarginMode {\n        const marketId = this.safeString (rawMarginMode, 'market');\n        market = this.safeMarket (marketId, market);\n        const marginMode = this.safeStringLower (rawMarginMode, 'margin_type');\n        return {\n            'info': rawMarginMode,\n            'symbol': market['symbol'],\n            'marginMode': marginMode,\n        } as MarginMode;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 473,
        "line_end": 625,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isSwap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "isOption",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeBool (market, 'enableTrading')",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "taker",
            "value": "takerFee",
            "comment": null
          },
          {
            "key": "maker",
            "value": "makerFee",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "(expiry === 0) ? undefined : this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "this.parseNumber (strikePrice)",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "this.safeStringLower (market, 'option_type')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'order_size_increment'),\n                'price': this.safeNumber (market, 'price_tick_size'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'max_order_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'order_size_increment')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'price_tick_size')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'max_order_size'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BODEN-USD-PERP\",\n         \"base_currency\": \"BODEN\",\n         \"quote_currency\": \"USD\",\n         \"settlement_currency\": \"USDC\",\n         \"order_size_increment\": \"1\",\n         \"price_tick_size\": \"0.00001\",\n         \"min_notional\": \"200\",\n         \"open_at\": 1717065600000,\n         \"expiry_at\": 0,\n         \"asset_kind\": \"PERP\",\n         \"position_limit\": \"2000000\",\n         \"price_bands_width\": \"0.2\",\n         \"max_open_orders\": 50,\n         \"max_funding_rate\": \"0.05\",\n         \"delta1_cross_margin_params\": {\n             \"imf_base\": \"0.2\",\n             \"imf_shift\": \"180000\",\n             \"imf_factor\": \"0.00071\",\n             \"mmf_factor\": \"0.5\"\n         },\n         \"price_feed_id\": \"9LScEHse1ioZt2rUuhwiN6bmYnqpMqvZkQJDNUpxVHN5\",\n         \"oracle_ewma_factor\": \"0.14999987905913592\",\n         \"max_order_size\": \"520000\",\n         \"max_funding_rate_change\": \"0.0005\",\n         \"max_tob_spread\": \"0.2\"\n     }",
          "{\n     \"symbol\":\"BTC-USD-96000-C\",\n     \"base_currency\":\"BTC\",\n     \"quote_currency\":\"USD\",\n     \"settlement_currency\":\"USDC\",\n     \"order_size_increment\":\"0.001\",\n     \"price_tick_size\":\"0.01\",\n     \"min_notional\":\"100\",\n     \"open_at\":\"1736764200000\",\n     \"expiry_at\":\"0\",\n     \"asset_kind\":\"PERP_OPTION\",\n     \"market_kind\":\"cross\",\n     \"position_limit\":\"10\",\n     \"price_bands_width\":\"0.05\",\n     \"iv_bands_width\":\"0.05\",\n     \"max_open_orders\":\"100\",\n     \"max_funding_rate\":\"0.02\",\n     \"option_cross_margin_params\":{\n        \"imf\":{\n           \"long_itm\":\"0.2\",\n           \"short_itm\":\"0.15\",\n           \"short_otm\":\"0.1\",\n           \"short_put_cap\":\"0.5\",\n           \"premium_multiplier\":\"1\"\n        },\n        \"mmf\":{\n           \"long_itm\":\"0.1\",\n           \"short_itm\":\"0.075\",\n           \"short_otm\":\"0.05\",\n           \"short_put_cap\":\"0.5\",\n           \"premium_multiplier\":\"0.5\"\n        }\n     },\n     \"price_feed_id\":\"GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU\",\n     \"oracle_ewma_factor\":\"0.20000046249626113\",\n     \"max_order_size\":\"2\",\n     \"max_funding_rate_change\":\"0.02\",\n     \"max_tob_spread\":\"0.2\",\n     \"interest_rate\":\"0.0001\",\n     \"clamp_rate\":\"0.02\",\n     \"option_type\":\"CALL\",\n     \"strike_price\":\"96000\",\n     \"funding_period_hours\":\"24\",\n     \"tags\":[\n     ]\n  }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"symbol\": \"BODEN-USD-PERP\",\n        //         \"base_currency\": \"BODEN\",\n        //         \"quote_currency\": \"USD\",\n        //         \"settlement_currency\": \"USDC\",\n        //         \"order_size_increment\": \"1\",\n        //         \"price_tick_size\": \"0.00001\",\n        //         \"min_notional\": \"200\",\n        //         \"open_at\": 1717065600000,\n        //         \"expiry_at\": 0,\n        //         \"asset_kind\": \"PERP\",\n        //         \"position_limit\": \"2000000\",\n        //         \"price_bands_width\": \"0.2\",\n        //         \"max_open_orders\": 50,\n        //         \"max_funding_rate\": \"0.05\",\n        //         \"delta1_cross_margin_params\": {\n        //             \"imf_base\": \"0.2\",\n        //             \"imf_shift\": \"180000\",\n        //             \"imf_factor\": \"0.00071\",\n        //             \"mmf_factor\": \"0.5\"\n        //         },\n        //         \"price_feed_id\": \"9LScEHse1ioZt2rUuhwiN6bmYnqpMqvZkQJDNUpxVHN5\",\n        //         \"oracle_ewma_factor\": \"0.14999987905913592\",\n        //         \"max_order_size\": \"520000\",\n        //         \"max_funding_rate_change\": \"0.0005\",\n        //         \"max_tob_spread\": \"0.2\"\n        //     }\n        //\n        // {\n        //     \"symbol\":\"BTC-USD-96000-C\",\n        //     \"base_currency\":\"BTC\",\n        //     \"quote_currency\":\"USD\",\n        //     \"settlement_currency\":\"USDC\",\n        //     \"order_size_increment\":\"0.001\",\n        //     \"price_tick_size\":\"0.01\",\n        //     \"min_notional\":\"100\",\n        //     \"open_at\":\"1736764200000\",\n        //     \"expiry_at\":\"0\",\n        //     \"asset_kind\":\"PERP_OPTION\",\n        //     \"market_kind\":\"cross\",\n        //     \"position_limit\":\"10\",\n        //     \"price_bands_width\":\"0.05\",\n        //     \"iv_bands_width\":\"0.05\",\n        //     \"max_open_orders\":\"100\",\n        //     \"max_funding_rate\":\"0.02\",\n        //     \"option_cross_margin_params\":{\n        //        \"imf\":{\n        //           \"long_itm\":\"0.2\",\n        //           \"short_itm\":\"0.15\",\n        //           \"short_otm\":\"0.1\",\n        //           \"short_put_cap\":\"0.5\",\n        //           \"premium_multiplier\":\"1\"\n        //        },\n        //        \"mmf\":{\n        //           \"long_itm\":\"0.1\",\n        //           \"short_itm\":\"0.075\",\n        //           \"short_otm\":\"0.05\",\n        //           \"short_put_cap\":\"0.5\",\n        //           \"premium_multiplier\":\"0.5\"\n        //        }\n        //     },\n        //     \"price_feed_id\":\"GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU\",\n        //     \"oracle_ewma_factor\":\"0.20000046249626113\",\n        //     \"max_order_size\":\"2\",\n        //     \"max_funding_rate_change\":\"0.02\",\n        //     \"max_tob_spread\":\"0.2\",\n        //     \"interest_rate\":\"0.0001\",\n        //     \"clamp_rate\":\"0.02\",\n        //     \"option_type\":\"CALL\",\n        //     \"strike_price\":\"96000\",\n        //     \"funding_period_hours\":\"24\",\n        //     \"tags\":[\n        //     ]\n        //  }\n        //\n        const assetKind = this.safeString (market, 'asset_kind');\n        const isOption = (assetKind === 'PERP_OPTION');\n        const type = (isOption) ? 'option' : 'swap';\n        const isSwap = (type === 'swap');\n        const marketId = this.safeString (market, 'symbol');\n        const quoteId = this.safeString (market, 'quote_currency');\n        const baseId = this.safeString (market, 'base_currency');\n        const quote = this.safeCurrencyCode (quoteId);\n        const base = this.safeCurrencyCode (baseId);\n        const settleId = this.safeString (market, 'settlement_currency');\n        const settle = this.safeCurrencyCode (settleId);\n        let symbol = base + '/' + quote + ':' + settle;\n        let expiry = this.safeInteger (market, 'expiry_at');\n        const optionType = this.safeString (market, 'option_type');\n        const strikePrice = this.safeString (market, 'strike_price');\n        const takerFee = this.parseNumber ('0.0003');\n        let makerFee = this.parseNumber ('-0.00005');\n        if (isOption) {\n            const optionTypeSuffix = (optionType === 'CALL') ? 'C' : 'P';\n            symbol = symbol + '-' + strikePrice + '-' + optionTypeSuffix;\n            makerFee = this.parseNumber ('0.0003');\n        } else {\n            expiry = undefined;\n        }\n        return this.safeMarketStructure ({\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': false,\n            'margin': undefined,\n            'swap': isSwap,\n            'future': false,\n            'option': isOption,\n            'active': this.safeBool (market, 'enableTrading'),\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'taker': takerFee,\n            'maker': makerFee,\n            'contractSize': this.parseNumber ('1'),\n            'expiry': expiry,\n            'expiryDatetime': (expiry === 0) ? undefined : this.iso8601 (expiry),\n            'strike': this.parseNumber (strikePrice),\n            'optionType': this.safeStringLower (market, 'option_type'),\n            'precision': {\n                'amount': this.safeNumber (market, 'order_size_increment'),\n                'price': this.safeNumber (market, 'price_tick_size'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': this.safeNumber (market, 'max_order_size'),\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 690,
        "line_end": 709,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1720071900000,\n         58961.3,\n         58961.3,\n         58961.3,\n         58961.3,\n         1591\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1720071900000,\n        //         58961.3,\n        //         58961.3,\n        //         58961.3,\n        //         58961.3,\n        //         1591\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 1055,
        "line_end": 1085,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "openInterestAmount",
            "value": "this.safeString (interest, 'open_interest')",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "info",
            "value": "interest",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USD-PERP\",\n         \"oracle_price\": \"68465.17449904\",\n         \"mark_price\": \"68465.17449906\",\n         \"last_traded_price\": \"68495.1\",\n         \"bid\": \"68477.6\",\n         \"ask\": \"69578.2\",\n         \"volume_24h\": \"5815541.397939004\",\n         \"total_volume\": \"584031465.525259686\",\n         \"created_at\": 1718170156580,\n         \"underlying_price\": \"67367.37268422\",\n         \"open_interest\": \"162.272\",\n         \"funding_rate\": \"0.01629574927887\",\n         \"price_change_rate_24h\": \"0.009032\"\n     }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USD-PERP\",\n        //         \"oracle_price\": \"68465.17449904\",\n        //         \"mark_price\": \"68465.17449906\",\n        //         \"last_traded_price\": \"68495.1\",\n        //         \"bid\": \"68477.6\",\n        //         \"ask\": \"69578.2\",\n        //         \"volume_24h\": \"5815541.397939004\",\n        //         \"total_volume\": \"584031465.525259686\",\n        //         \"created_at\": 1718170156580,\n        //         \"underlying_price\": \"67367.37268422\",\n        //         \"open_interest\": \"162.272\",\n        //         \"funding_rate\": \"0.01629574927887\",\n        //         \"price_change_rate_24h\": \"0.009032\"\n        //     }\n        //\n        const timestamp = this.safeInteger (interest, 'created_at');\n        const marketId = this.safeString (interest, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        return this.safeOpenInterest ({\n            'symbol': symbol,\n            'openInterestAmount': this.safeString (interest, 'open_interest'),\n            'openInterestValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'info': interest,\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1253,
        "line_end": 1339,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (orderType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (this.safeString (order, 'instruction'))",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString (order, 'trigger_price')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': undefined,\n                'currency': undefined,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"account\": \"0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x\",\n     \"avg_fill_price\": \"26000\",\n     \"client_id\": \"x1234\",\n     \"cancel_reason\": \"NOT_ENOUGH_MARGIN\",\n     \"created_at\": 1681493746016,\n     \"flags\": [\n         \"REDUCE_ONLY\"\n     ],\n     \"id\": \"123456\",\n     \"instruction\": \"GTC\",\n     \"last_updated_at\": 1681493746016,\n     \"market\": \"BTC-USD-PERP\",\n     \"price\": \"26000\",\n     \"published_at\": 1681493746016,\n     \"received_at\": 1681493746016,\n     \"remaining_size\": \"0\",\n     \"seq_no\": 1681471234972000000,\n     \"side\": \"BUY\",\n     \"size\": \"0.05\",\n     \"status\": \"NEW\",\n     \"stp\": \"EXPIRE_MAKER\",\n     \"timestamp\": 1681493746016,\n     \"trigger_price\": \"26000\",\n     \"type\": \"MARKET\"\n }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // {\n        //     \"account\": \"0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x\",\n        //     \"avg_fill_price\": \"26000\",\n        //     \"client_id\": \"x1234\",\n        //     \"cancel_reason\": \"NOT_ENOUGH_MARGIN\",\n        //     \"created_at\": 1681493746016,\n        //     \"flags\": [\n        //         \"REDUCE_ONLY\"\n        //     ],\n        //     \"id\": \"123456\",\n        //     \"instruction\": \"GTC\",\n        //     \"last_updated_at\": 1681493746016,\n        //     \"market\": \"BTC-USD-PERP\",\n        //     \"price\": \"26000\",\n        //     \"published_at\": 1681493746016,\n        //     \"received_at\": 1681493746016,\n        //     \"remaining_size\": \"0\",\n        //     \"seq_no\": 1681471234972000000,\n        //     \"side\": \"BUY\",\n        //     \"size\": \"0.05\",\n        //     \"status\": \"NEW\",\n        //     \"stp\": \"EXPIRE_MAKER\",\n        //     \"timestamp\": 1681493746016,\n        //     \"trigger_price\": \"26000\",\n        //     \"type\": \"MARKET\"\n        // }\n        //\n        const timestamp = this.safeInteger (order, 'created_at');\n        const orderId = this.safeString (order, 'id');\n        const clientOrderId = this.omitZero (this.safeString (order, 'client_id'));\n        const marketId = this.safeString (order, 'market');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'size');\n        const orderType = this.safeString (order, 'type');\n        const cancelReason = this.safeString (order, 'cancel_reason');\n        let status = this.safeString (order, 'status');\n        if (cancelReason !== undefined) {\n            if (cancelReason === 'NOT_ENOUGH_MARGIN' || cancelReason === 'ORDER_EXCEEDS_POSITION_LIMIT') {\n                status = 'rejected';\n            } else {\n                status = 'canceled';\n            }\n        }\n        const side = this.safeStringLower (order, 'side');\n        const average = this.omitZero (this.safeString (order, 'avg_fill_price'));\n        const remaining = this.omitZero (this.safeString (order, 'remaining_size'));\n        const lastUpdateTimestamp = this.safeInteger (order, 'last_updated_at');\n        const flags = this.safeList (order, 'flags', []);\n        let reduceOnly = undefined;\n        if ('REDUCE_ONLY' in flags) {\n            reduceOnly = true;\n        }\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': this.parseOrderType (orderType),\n            'timeInForce': this.parseTimeInForce (this.safeString (order, 'instruction')),\n            'postOnly': undefined,\n            'reduceOnly': reduceOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString (order, 'trigger_price'),\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n            'average': average,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': remaining,\n            'cost': undefined,\n            'trades': undefined,\n            'fee': {\n                'cost': undefined,\n                'currency': undefined,\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1350,
        "line_end": 1361,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'NEW': 'open',\n                'UNTRIGGERED': 'open',\n                'OPEN': 'open',\n                'CLOSED': 'closed',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1363,
        "line_end": 1371,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n            'STOP_LIMIT': 'limit',\n            'STOP_MARKET': 'market',\n        };\n        return this.safeStringLower (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1957,
        "line_end": 2013,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeString (position, 'average_entry_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeString (position, 'cost')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeString (position, 'unrealized_pnl')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"0x49ddd7a564c978f6e4089ff8355b56a42b7e2d48ba282cb5aad60f04bea0ec3-BTC-USD-PERP\",\n         \"market\": \"BTC-USD-PERP\",\n         \"status\": \"OPEN\",\n         \"side\": \"LONG\",\n         \"size\": \"0.01\",\n         \"average_entry_price\": \"64839.96053748\",\n         \"average_entry_price_usd\": \"64852.9\",\n         \"realized_pnl\": \"0\",\n         \"unrealized_pnl\": \"-2.39677214\",\n         \"unrealized_funding_pnl\": \"-0.11214013\",\n         \"cost\": \"648.39960537\",\n         \"cost_usd\": \"648.529\",\n         \"cached_funding_index\": \"35202.1002351\",\n         \"last_updated_at\": 1718950074249,\n         \"last_fill_id\": \"1718947571560201703986670001\",\n         \"seq_no\": 1718950074249176253,\n         \"liquidation_price\": \"\"\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //     {\n        //         \"id\": \"0x49ddd7a564c978f6e4089ff8355b56a42b7e2d48ba282cb5aad60f04bea0ec3-BTC-USD-PERP\",\n        //         \"market\": \"BTC-USD-PERP\",\n        //         \"status\": \"OPEN\",\n        //         \"side\": \"LONG\",\n        //         \"size\": \"0.01\",\n        //         \"average_entry_price\": \"64839.96053748\",\n        //         \"average_entry_price_usd\": \"64852.9\",\n        //         \"realized_pnl\": \"0\",\n        //         \"unrealized_pnl\": \"-2.39677214\",\n        //         \"unrealized_funding_pnl\": \"-0.11214013\",\n        //         \"cost\": \"648.39960537\",\n        //         \"cost_usd\": \"648.529\",\n        //         \"cached_funding_index\": \"35202.1002351\",\n        //         \"last_updated_at\": 1718950074249,\n        //         \"last_fill_id\": \"1718947571560201703986670001\",\n        //         \"seq_no\": 1718950074249176253,\n        //         \"liquidation_price\": \"\"\n        //     }\n        //\n        const marketId = this.safeString (position, 'market');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (position, 'side');\n        let quantity = this.safeString (position, 'size');\n        if (side !== 'long') {\n            quantity = Precise.stringMul ('-1', quantity);\n        }\n        const timestamp = this.safeInteger (position, 'time');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'id'),\n            'symbol': symbol,\n            'entryPrice': this.safeString (position, 'average_entry_price'),\n            'markPrice': undefined,\n            'notional': undefined,\n            'collateral': this.safeString (position, 'cost'),\n            'unrealizedPnl': this.safeString (position, 'unrealized_pnl'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 794,
        "line_end": 844,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "low",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'volume_24h')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (ticker, 'mark_price')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC-USD-PERP\",\n         \"oracle_price\": \"68465.17449906\",\n         \"mark_price\": \"68465.17449906\",\n         \"last_traded_price\": \"68495.1\",\n         \"bid\": \"68477.6\",\n         \"ask\": \"69578.2\",\n         \"volume_24h\": \"5815541.397939004\",\n         \"total_volume\": \"584031465.525259686\",\n         \"created_at\": 1718170156581,\n         \"underlying_price\": \"67367.37268422\",\n         \"open_interest\": \"162.272\",\n         \"funding_rate\": \"0.01629574927887\",\n         \"price_change_rate_24h\": \"0.009032\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"symbol\": \"BTC-USD-PERP\",\n        //         \"oracle_price\": \"68465.17449906\",\n        //         \"mark_price\": \"68465.17449906\",\n        //         \"last_traded_price\": \"68495.1\",\n        //         \"bid\": \"68477.6\",\n        //         \"ask\": \"69578.2\",\n        //         \"volume_24h\": \"5815541.397939004\",\n        //         \"total_volume\": \"584031465.525259686\",\n        //         \"created_at\": 1718170156581,\n        //         \"underlying_price\": \"67367.37268422\",\n        //         \"open_interest\": \"162.272\",\n        //         \"funding_rate\": \"0.01629574927887\",\n        //         \"price_change_rate_24h\": \"0.009032\"\n        //     }\n        //\n        let percentage = this.safeString (ticker, 'price_change_rate_24h');\n        if (percentage !== undefined) {\n            percentage = Precise.stringMul (percentage, '100');\n        }\n        const last = this.safeString (ticker, 'last_traded_price');\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (ticker, 'created_at');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': undefined,\n            'low': undefined,\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': undefined,\n            'quoteVolume': this.safeString (ticker, 'volume_24h'),\n            'markPrice': this.safeString (ticker, 'mark_price'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1341,
        "line_end": 1348,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'IOC': 'IOC',\n            'GTC': 'GTC',\n            'POST_ONLY': 'PO',\n        };\n        return this.safeString (timeInForces, timeInForce, undefined);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 945,
        "line_end": 1008,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'order_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeString (trade, 'fee'),\n                'currency': code,\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1718154353750201703989430001\",\n         \"market\": \"BTC-USD-PERP\",\n         \"side\": \"BUY\",\n         \"size\": \"0.026\",\n         \"price\": \"69578.2\",\n         \"created_at\": 1718154353750,\n         \"trade_type\": \"FILL\"\n     }",
          "{\n         \"id\": \"1718947571560201703986670001\",\n         \"side\": \"BUY\",\n         \"liquidity\": \"TAKER\",\n         \"market\": \"BTC-USD-PERP\",\n         \"order_id\": \"1718947571540201703992340000\",\n         \"price\": \"64852.9\",\n         \"size\": \"0.01\",\n         \"fee\": \"0.1945587\",\n         \"fee_currency\": \"USDC\",\n         \"created_at\": 1718947571569,\n         \"remaining_size\": \"0\",\n         \"client_id\": \"\",\n         \"fill_type\": \"FILL\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"id\": \"1718154353750201703989430001\",\n        //         \"market\": \"BTC-USD-PERP\",\n        //         \"side\": \"BUY\",\n        //         \"size\": \"0.026\",\n        //         \"price\": \"69578.2\",\n        //         \"created_at\": 1718154353750,\n        //         \"trade_type\": \"FILL\"\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"id\": \"1718947571560201703986670001\",\n        //         \"side\": \"BUY\",\n        //         \"liquidity\": \"TAKER\",\n        //         \"market\": \"BTC-USD-PERP\",\n        //         \"order_id\": \"1718947571540201703992340000\",\n        //         \"price\": \"64852.9\",\n        //         \"size\": \"0.01\",\n        //         \"fee\": \"0.1945587\",\n        //         \"fee_currency\": \"USDC\",\n        //         \"created_at\": 1718947571569,\n        //         \"remaining_size\": \"0\",\n        //         \"client_id\": \"\",\n        //         \"fill_type\": \"FILL\"\n        //     }\n        //\n        const marketId = this.safeString (trade, 'market');\n        market = this.safeMarket (marketId, market);\n        const id = this.safeString (trade, 'id');\n        const timestamp = this.safeInteger (trade, 'created_at');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'size');\n        const side = this.safeStringLower (trade, 'side');\n        const liability = this.safeStringLower (trade, 'liquidity', 'taker');\n        const isTaker = liability === 'taker';\n        const takerOrMaker = (isTaker) ? 'taker' : 'maker';\n        const currencyId = this.safeString (trade, 'fee_currency');\n        const code = this.safeCurrencyCode (currencyId);\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': this.safeString (trade, 'order_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': {\n                'cost': this.safeString (trade, 'fee'),\n                'currency': code,\n                'rate': undefined,\n            },\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2198,
        "line_end": 2249,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "updated",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"1718940471200201703989430000\",\n         \"account\": \"0x49ddd7a564c978f6e4089ff8355b56a42b7e2d48ba282cb5aad60f04bea0ec3\",\n         \"kind\": \"DEPOSIT\",\n         \"status\": \"COMPLETED\",\n         \"amount\": \"100000\",\n         \"token\": \"USDC\",\n         \"created_at\": 1718940471208,\n         \"last_updated_at\": 1718941455546,\n         \"txn_hash\": \"0x73a415ca558a97bbdcd1c43e52b45f1e0486a0a84b3bb4958035ad6c59cb866\",\n         \"external_txn_hash\": \"\",\n         \"socialized_loss_factor\": \"\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits & fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"1718940471200201703989430000\",\n        //         \"account\": \"0x49ddd7a564c978f6e4089ff8355b56a42b7e2d48ba282cb5aad60f04bea0ec3\",\n        //         \"kind\": \"DEPOSIT\",\n        //         \"status\": \"COMPLETED\",\n        //         \"amount\": \"100000\",\n        //         \"token\": \"USDC\",\n        //         \"created_at\": 1718940471208,\n        //         \"last_updated_at\": 1718941455546,\n        //         \"txn_hash\": \"0x73a415ca558a97bbdcd1c43e52b45f1e0486a0a84b3bb4958035ad6c59cb866\",\n        //         \"external_txn_hash\": \"\",\n        //         \"socialized_loss_factor\": \"\"\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        const address = this.safeString (transaction, 'account');\n        const txid = this.safeString (transaction, 'txn_hash');\n        const currencyId = this.safeString (transaction, 'token');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const timestamp = this.safeInteger (transaction, 'created_at');\n        const updated = this.safeInteger (transaction, 'last_updated_at');\n        let type = this.safeString (transaction, 'kind');\n        type = (type === 'DEPOSIT') ? 'deposit' : 'withdrawal';\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        const amount = this.safeNumber (transaction, 'amount');\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': updated,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2251,
        "line_end": 2259,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'PENDING': 'pending',\n            'AVAILABLE': 'pending',\n            'COMPLETED': 'ok',\n            'FAILED': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "paymium": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 161,
        "line_end": 178,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = { 'info': response };\n        const currencies = Object.keys (this.currencies);\n        for (let i = 0; i < currencies.length; i++) {\n            const code = currencies[i];\n            const currency = this.currency (code);\n            const currencyId = currency['id'];\n            const free = 'balance_' + currencyId;\n            if (free in response) {\n                const account = this.account ();\n                const used = 'locked_' + currencyId;\n                account['free'] = this.safeString (response, free);\n                account['used'] = this.safeString (response, used);\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 420,
        "line_end": 438,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe\",\n         \"valid_until\": 1620041926,\n         \"currency\": \"BTC\",\n         \"label\": \"Savings\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe\",\n        //         \"valid_until\": 1620041926,\n        //         \"currency\": \"BTC\",\n        //         \"label\": \"Savings\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'network': undefined,\n            'address': address,\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 214,
        "line_end": 261,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'variation')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"high\":\"33740.82\",\n     \"low\":\"32185.15\",\n     \"volume\":\"4.7890433\",\n     \"bid\":\"33313.53\",\n     \"ask\":\"33497.97\",\n     \"midpoint\":\"33405.75\",\n     \"vwap\":\"32802.5263553\",\n     \"at\":1643381654,\n     \"price\":\"33143.91\",\n     \"open\":\"33116.86\",\n     \"variation\":\"0.0817\",\n     \"currency\":\"EUR\",\n     \"trade_id\":\"ce2f5152-3ac5-412d-9b24-9fa72338474c\",\n     \"size\":\"0.00041087\"\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // {\n        //     \"high\":\"33740.82\",\n        //     \"low\":\"32185.15\",\n        //     \"volume\":\"4.7890433\",\n        //     \"bid\":\"33313.53\",\n        //     \"ask\":\"33497.97\",\n        //     \"midpoint\":\"33405.75\",\n        //     \"vwap\":\"32802.5263553\",\n        //     \"at\":1643381654,\n        //     \"price\":\"33143.91\",\n        //     \"open\":\"33116.86\",\n        //     \"variation\":\"0.0817\",\n        //     \"currency\":\"EUR\",\n        //     \"trade_id\":\"ce2f5152-3ac5-412d-9b24-9fa72338474c\",\n        //     \"size\":\"0.00041087\"\n        // }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const timestamp = this.safeTimestamp (ticker, 'at');\n        const vwap = this.safeString (ticker, 'vwap');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = Precise.stringMul (baseVolume, vwap);\n        const last = this.safeString (ticker, 'price');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': vwap,\n            'open': this.safeString (ticker, 'open'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (ticker, 'variation'),\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 300,
        "line_end": 323,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        const timestamp = this.safeTimestamp (trade, 'created_at_int');\n        const id = this.safeString (trade, 'uuid');\n        market = this.safeMarket (undefined, market);\n        const side = this.safeString (trade, 'side');\n        const price = this.safeString (trade, 'price');\n        const amountField = 'traded_' + market['base'].toLowerCase ();\n        const amount = this.safeString (trade, amountField);\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'order': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': price,\n            'amount': amount,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 555,
        "line_end": 605,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'uuid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timetstamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timetstamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (firstOperation, 'address')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"uuid\": \"968f4580-e26c-4ad8-8bcd-874d23d55296\",\n         \"type\": \"Transfer\",\n         \"currency\": \"BTC\",\n         \"currency_amount\": \"string\",\n         \"created_at\": \"2013-10-24T10:34:37.000Z\",\n         \"updated_at\": \"2013-10-24T10:34:37.000Z\",\n         \"amount\": \"1.0\",\n         \"state\": \"executed\",\n         \"currency_fee\": \"0.0\",\n         \"btc_fee\": \"0.0\",\n         \"comment\": \"string\",\n         \"traded_btc\": \"string\",\n         \"traded_currency\": \"string\",\n         \"direction\": \"buy\",\n         \"price\": \"string\",\n         \"account_operations\": [\n             {\n                 \"uuid\": \"968f4580-e26c-4ad8-8bcd-874d23d55296\",\n                 \"amount\": \"1.0\",\n                 \"currency\": \"BTC\",\n                 \"created_at\": \"2013-10-24T10:34:37.000Z\",\n                 \"created_at_int\": 1389094259,\n                 \"name\": \"account_operation\",\n                 \"address\": \"1FPDBXNqSkZMsw1kSkkajcj8berxDQkUoc\",\n                 \"tx_hash\": \"string\",\n                 \"is_trading_account\": true\n             }\n         ]\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //     {\n        //         \"uuid\": \"968f4580-e26c-4ad8-8bcd-874d23d55296\",\n        //         \"type\": \"Transfer\",\n        //         \"currency\": \"BTC\",\n        //         \"currency_amount\": \"string\",\n        //         \"created_at\": \"2013-10-24T10:34:37.000Z\",\n        //         \"updated_at\": \"2013-10-24T10:34:37.000Z\",\n        //         \"amount\": \"1.0\",\n        //         \"state\": \"executed\",\n        //         \"currency_fee\": \"0.0\",\n        //         \"btc_fee\": \"0.0\",\n        //         \"comment\": \"string\",\n        //         \"traded_btc\": \"string\",\n        //         \"traded_currency\": \"string\",\n        //         \"direction\": \"buy\",\n        //         \"price\": \"string\",\n        //         \"account_operations\": [\n        //             {\n        //                 \"uuid\": \"968f4580-e26c-4ad8-8bcd-874d23d55296\",\n        //                 \"amount\": \"1.0\",\n        //                 \"currency\": \"BTC\",\n        //                 \"created_at\": \"2013-10-24T10:34:37.000Z\",\n        //                 \"created_at_int\": 1389094259,\n        //                 \"name\": \"account_operation\",\n        //                 \"address\": \"1FPDBXNqSkZMsw1kSkkajcj8berxDQkUoc\",\n        //                 \"tx_hash\": \"string\",\n        //                 \"is_trading_account\": true\n        //             }\n        //         ]\n        //     }\n        //\n        const currencyId = this.safeString (transfer, 'currency');\n        const updatedAt = this.safeString (transfer, 'updated_at');\n        const timetstamp = this.parseDate (updatedAt);\n        const accountOperations = this.safeValue (transfer, 'account_operations');\n        const firstOperation = this.safeValue (accountOperations, 0, {});\n        const status = this.safeString (transfer, 'state');\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'uuid'),\n            'timestamp': timetstamp,\n            'datetime': this.iso8601 (timetstamp),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': undefined,\n            'toAccount': this.safeString (firstOperation, 'address'),\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 607,
        "line_end": 613,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'executed': 'ok',\n            // what are the other statuses?\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "phemex": [
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 5537,
        "line_end": 5664,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber2 (info, 'deleveragePercentileRr', 'deleveragePercentileEr')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"userID\": 940666,\n         \"accountID\": 9406660003,\n         \"symbol\": \"BTCUSDT\",\n         \"currency\": \"USDT\",\n         \"side\": \"Buy\",\n         \"positionStatus\": \"Normal\",\n         \"crossMargin\": true,\n         \"leverageRr\": \"-10\",\n         \"initMarginReqRr\": \"0.1\",\n         \"maintMarginReqRr\": \"0.005\",\n         \"riskLimitRv\": \"20000000\",\n         \"size\": \"0.01\",\n         \"valueRv\": \"887.531\",\n         \"avgEntryPriceRp\": \"88753.1\",\n         \"avgEntryPrice\": \"88753.1\",\n         \"posCostRv\": \"89.22502732\",\n         \"assignedPosBalanceRv\": \"89.29802732\",\n         \"bankruptCommRv\": \"0.529812426\",\n         \"bankruptPriceRp\": \"44783.79\",\n         \"positionMarginRv\": \"88.695214894\",\n         \"liquidationPriceRp\": \"45009\",\n         \"deleveragePercentileRr\": \"0\",\n         \"buyValueToCostRr\": \"0.10114\",\n         \"sellValueToCostRr\": \"0.10126\",\n         \"markPriceRp\": \"88747.2\",\n         \"estimatedOrdLossRv\": \"0\",\n         \"usedBalanceRv\": \"89.22502732\",\n         \"cumClosedPnlRv\": \"425.97796\",\n         \"cumFundingFeeRv\": \"54.892930099379\",\n         \"cumTransactFeeRv\": \"1.288782144\",\n         \"transactTimeNs\": 1767176685241254818,\n         \"takerFeeRateRr\": \"-1\",\n         \"makerFeeRateRr\": \"-1\",\n         \"term\": 6,\n         \"lastTermEndTimeNs\": 1759835547751667598,\n         \"lastFundingTimeNs\": 1759824000000000000,\n         \"curTermRealisedPnlRv\": \"-0.5325186\",\n         \"execSeq\": 47732822790,\n         \"posSide\": \"Long\",\n         \"posMode\": \"Hedged\",\n         \"buyLeavesValueRv\": \"0\",\n         \"buyLeavesQtyRq\": \"0\",\n         \"sellLeavesValueRv\": \"0\",\n         \"sellLeavesQtyRq\": \"0\"\n     }",
          "{\n         \"userID\": 940666,\n         \"accountID\": 9406660001,\n         \"symbol\": \"BTCUSD\",\n         \"currency\": \"BTC\",\n         \"side\": \"Buy\",\n         \"positionStatus\": \"Normal\",\n         \"crossMargin\": false,\n         \"leverageEr\": -2000000000,\n         \"leverage\": -20.00000000,\n         \"initMarginReqEr\": 5000000,\n         \"initMarginReq\": 0.05000000,\n         \"maintMarginReqEr\": 500000,\n         \"maintMarginReq\": 0.00500000,\n         \"riskLimitEv\": 150000000000,\n         \"riskLimit\": 1500.00000000,\n         \"size\": 1,\n         \"value\": 0.00001128,\n         \"valueEv\": 1128,\n         \"avgEntryPriceEp\": 886524823,\n         \"avgEntryPrice\": 88652.48230000,\n         \"posCostEv\": 58,\n         \"posCost\": 5.8E-7,\n         \"assignedPosBalanceEv\": 58,\n         \"assignedPosBalance\": 5.8E-7,\n         \"bankruptCommEv\": 1,\n         \"bankruptComm\": 1E-8,\n         \"bankruptPriceEp\": 100000,\n         \"bankruptPrice\": 10.00000000,\n         \"positionMarginEv\": 57,\n         \"positionMargin\": 5.7E-7,\n         \"liquidationPriceEp\": 100000,\n         \"liquidationPrice\": 10.00000000,\n         \"deleveragePercentileEr\": 0,\n         \"deleveragePercentile\": 0E-8,\n         \"buyValueToCostEr\": 5123000,\n         \"buyValueToCost\": 0.05123000,\n         \"sellValueToCostEr\": 5117000,\n         \"sellValueToCost\": 0.05117000,\n         \"markPriceEp\": 886028000,\n         \"markPrice\": 88602.80000000,\n         \"estimatedOrdLossEv\": 0,\n         \"estimatedOrdLoss\": 0E-8,\n         \"usedBalanceEv\": 58,\n         \"usedBalance\": 5.8E-7,\n         \"cumClosedPnlEv\": 127,\n         \"cumFundingFeeEv\": -146,\n         \"cumTransactFeeEv\": 3,\n         \"transactTimeNs\": 1767177964554892106,\n         \"takerFeeRateEr\": 60000,\n         \"makerFeeRateEr\": 10000,\n         \"term\": 2,\n         \"lastTermEndTimeNs\": 1716225275381802994,\n         \"lastFundingTimeNs\": 1767168000000000000,\n         \"curTermRealisedPnlEv\": -1,\n         \"execSeq\": 1104909332,\n         \"freeQty\": -1,\n         \"freeCostEv\": 0,\n         \"buyLeavesValueEv\": 0,\n         \"sellLeavesValueEv\": 0,\n         \"buyLeavesQty\": 0,\n         \"sellLeavesQty\": 0\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionADLRank: linear\n        //\n        //     {\n        //         \"userID\": 940666,\n        //         \"accountID\": 9406660003,\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"currency\": \"USDT\",\n        //         \"side\": \"Buy\",\n        //         \"positionStatus\": \"Normal\",\n        //         \"crossMargin\": true,\n        //         \"leverageRr\": \"-10\",\n        //         \"initMarginReqRr\": \"0.1\",\n        //         \"maintMarginReqRr\": \"0.005\",\n        //         \"riskLimitRv\": \"20000000\",\n        //         \"size\": \"0.01\",\n        //         \"valueRv\": \"887.531\",\n        //         \"avgEntryPriceRp\": \"88753.1\",\n        //         \"avgEntryPrice\": \"88753.1\",\n        //         \"posCostRv\": \"89.22502732\",\n        //         \"assignedPosBalanceRv\": \"89.29802732\",\n        //         \"bankruptCommRv\": \"0.529812426\",\n        //         \"bankruptPriceRp\": \"44783.79\",\n        //         \"positionMarginRv\": \"88.695214894\",\n        //         \"liquidationPriceRp\": \"45009\",\n        //         \"deleveragePercentileRr\": \"0\",\n        //         \"buyValueToCostRr\": \"0.10114\",\n        //         \"sellValueToCostRr\": \"0.10126\",\n        //         \"markPriceRp\": \"88747.2\",\n        //         \"estimatedOrdLossRv\": \"0\",\n        //         \"usedBalanceRv\": \"89.22502732\",\n        //         \"cumClosedPnlRv\": \"425.97796\",\n        //         \"cumFundingFeeRv\": \"54.892930099379\",\n        //         \"cumTransactFeeRv\": \"1.288782144\",\n        //         \"transactTimeNs\": 1767176685241254818,\n        //         \"takerFeeRateRr\": \"-1\",\n        //         \"makerFeeRateRr\": \"-1\",\n        //         \"term\": 6,\n        //         \"lastTermEndTimeNs\": 1759835547751667598,\n        //         \"lastFundingTimeNs\": 1759824000000000000,\n        //         \"curTermRealisedPnlRv\": \"-0.5325186\",\n        //         \"execSeq\": 47732822790,\n        //         \"posSide\": \"Long\",\n        //         \"posMode\": \"Hedged\",\n        //         \"buyLeavesValueRv\": \"0\",\n        //         \"buyLeavesQtyRq\": \"0\",\n        //         \"sellLeavesValueRv\": \"0\",\n        //         \"sellLeavesQtyRq\": \"0\"\n        //     }\n        //\n        // fetchPositionADLRank: inverse\n        //\n        //     {\n        //         \"userID\": 940666,\n        //         \"accountID\": 9406660001,\n        //         \"symbol\": \"BTCUSD\",\n        //         \"currency\": \"BTC\",\n        //         \"side\": \"Buy\",\n        //         \"positionStatus\": \"Normal\",\n        //         \"crossMargin\": false,\n        //         \"leverageEr\": -2000000000,\n        //         \"leverage\": -20.00000000,\n        //         \"initMarginReqEr\": 5000000,\n        //         \"initMarginReq\": 0.05000000,\n        //         \"maintMarginReqEr\": 500000,\n        //         \"maintMarginReq\": 0.00500000,\n        //         \"riskLimitEv\": 150000000000,\n        //         \"riskLimit\": 1500.00000000,\n        //         \"size\": 1,\n        //         \"value\": 0.00001128,\n        //         \"valueEv\": 1128,\n        //         \"avgEntryPriceEp\": 886524823,\n        //         \"avgEntryPrice\": 88652.48230000,\n        //         \"posCostEv\": 58,\n        //         \"posCost\": 5.8E-7,\n        //         \"assignedPosBalanceEv\": 58,\n        //         \"assignedPosBalance\": 5.8E-7,\n        //         \"bankruptCommEv\": 1,\n        //         \"bankruptComm\": 1E-8,\n        //         \"bankruptPriceEp\": 100000,\n        //         \"bankruptPrice\": 10.00000000,\n        //         \"positionMarginEv\": 57,\n        //         \"positionMargin\": 5.7E-7,\n        //         \"liquidationPriceEp\": 100000,\n        //         \"liquidationPrice\": 10.00000000,\n        //         \"deleveragePercentileEr\": 0,\n        //         \"deleveragePercentile\": 0E-8,\n        //         \"buyValueToCostEr\": 5123000,\n        //         \"buyValueToCost\": 0.05123000,\n        //         \"sellValueToCostEr\": 5117000,\n        //         \"sellValueToCost\": 0.05117000,\n        //         \"markPriceEp\": 886028000,\n        //         \"markPrice\": 88602.80000000,\n        //         \"estimatedOrdLossEv\": 0,\n        //         \"estimatedOrdLoss\": 0E-8,\n        //         \"usedBalanceEv\": 58,\n        //         \"usedBalance\": 5.8E-7,\n        //         \"cumClosedPnlEv\": 127,\n        //         \"cumFundingFeeEv\": -146,\n        //         \"cumTransactFeeEv\": 3,\n        //         \"transactTimeNs\": 1767177964554892106,\n        //         \"takerFeeRateEr\": 60000,\n        //         \"makerFeeRateEr\": 10000,\n        //         \"term\": 2,\n        //         \"lastTermEndTimeNs\": 1716225275381802994,\n        //         \"lastFundingTimeNs\": 1767168000000000000,\n        //         \"curTermRealisedPnlEv\": -1,\n        //         \"execSeq\": 1104909332,\n        //         \"freeQty\": -1,\n        //         \"freeCostEv\": 0,\n        //         \"buyLeavesValueEv\": 0,\n        //         \"sellLeavesValueEv\": 0,\n        //         \"buyLeavesQty\": 0,\n        //         \"sellLeavesQty\": 0\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': undefined,\n            'rating': undefined,\n            'percentage': this.safeNumber2 (info, 'deleveragePercentileRr', 'deleveragePercentileEr'),\n            'timestamp': undefined,\n            'datetime': undefined,\n        } as ADL;\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 5252,
        "line_end": 5324,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (conversion, 'code')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.parseNumber (fromAmount)",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.parseNumber (toAmount)",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (quoteArgs, 'price')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": \"GIF...AAA\",\n         \"quoteArgs\": {\n             \"origin\": 10,\n             \"price\": \"0.00000939\",\n             \"proceeds\": \"0.00000000\",\n             \"ttlMs\": 7000,\n             \"expireAt\": 1739875826009,\n             \"requestAt\": 1739875818009,\n             \"quoteAt\": 1739875816594\n         }\n     }",
          "{\n         \"moveOp\": 0,\n         \"fromCurrency\": \"USDT\",\n         \"toCurrency\": \"BTC\",\n         \"fromAmountEv\": 4000000000,\n         \"toAmountEv\": 41511,\n         \"linkKey\": \"45c8ed8e-d3f4-472d-8262-e464e8c46247\",\n         \"status\": 10\n     }",
          "{\n         \"linkKey\": \"45c8ed8e-d3f4-472d-8262-e464e8c46247\",\n         \"createTime\": 1739882294000,\n         \"fromCurrency\": \"USDT\",\n         \"toCurrency\": \"BTC\",\n         \"fromAmountEv\": 4000000000,\n         \"toAmountEv\": 41511,\n         \"status\": 10,\n         \"conversionRate\": 1037,\n         \"errorCode\": 0\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"code\": \"GIF...AAA\",\n        //         \"quoteArgs\": {\n        //             \"origin\": 10,\n        //             \"price\": \"0.00000939\",\n        //             \"proceeds\": \"0.00000000\",\n        //             \"ttlMs\": 7000,\n        //             \"expireAt\": 1739875826009,\n        //             \"requestAt\": 1739875818009,\n        //             \"quoteAt\": 1739875816594\n        //         }\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"moveOp\": 0,\n        //         \"fromCurrency\": \"USDT\",\n        //         \"toCurrency\": \"BTC\",\n        //         \"fromAmountEv\": 4000000000,\n        //         \"toAmountEv\": 41511,\n        //         \"linkKey\": \"45c8ed8e-d3f4-472d-8262-e464e8c46247\",\n        //         \"status\": 10\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"linkKey\": \"45c8ed8e-d3f4-472d-8262-e464e8c46247\",\n        //         \"createTime\": 1739882294000,\n        //         \"fromCurrency\": \"USDT\",\n        //         \"toCurrency\": \"BTC\",\n        //         \"fromAmountEv\": 4000000000,\n        //         \"toAmountEv\": 41511,\n        //         \"status\": 10,\n        //         \"conversionRate\": 1037,\n        //         \"errorCode\": 0\n        //     }\n        //\n        const quoteArgs = this.safeDict (conversion, 'quoteArgs', {});\n        const requestTime = this.safeInteger (quoteArgs, 'requestAt');\n        const timestamp = this.safeInteger (conversion, 'createTime', requestTime);\n        const fromCoin = this.safeString (conversion, 'fromCurrency', this.safeString (fromCurrency, 'code'));\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const toCoin = this.safeString (conversion, 'toCurrency', this.safeString (toCurrency, 'code'));\n        const toCode = this.safeCurrencyCode (toCoin, toCurrency);\n        const fromValueScale = this.safeInteger (fromCurrency, 'valueScale');\n        const toValueScale = this.safeInteger (toCurrency, 'valueScale');\n        let fromAmount = this.fromEn (this.safeString (conversion, 'fromAmountEv'), fromValueScale);\n        if (fromAmount === undefined && quoteArgs !== undefined) {\n            fromAmount = this.fromEn (this.safeString (quoteArgs, 'origin'), fromValueScale);\n        }\n        let toAmount = this.fromEn (this.safeString (conversion, 'toAmountEv'), toValueScale);\n        if (toAmount === undefined && quoteArgs !== undefined) {\n            toAmount = this.fromEn (this.safeString (quoteArgs, 'proceeds'), toValueScale);\n        }\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (conversion, 'code'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.parseNumber (fromAmount),\n            'toCurrency': toCode,\n            'toAmount': this.parseNumber (toAmount),\n            'price': this.safeNumber (quoteArgs, 'price'),\n            'fee': undefined,\n        } as Conversion;\n    }"
      },
      {
        "name": "parseFundingFeeToPrecision",
        "signature": "parseFundingFeeToPrecision (value, market: Market = undefined, currencyCode: Str = undefined)",
        "line_start": 4168,
        "line_end": 4181,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingFeeToPrecision (value, market: Market = undefined, currencyCode: Str = undefined) {\n        if (value === undefined || currencyCode === undefined) {\n            return value;\n        }\n        // it was confirmed by phemex support, that USDT contracts use direct amounts in funding fees, while USD & INVERSE needs 'valueScale'\n        const isStableSettled = market['settle'] === 'USDT' || market['settle'] === 'USDC';\n        if (!isStableSettled) {\n            const currency = this.safeCurrency (currencyCode);\n            const scale = this.safeString (currency['info'], 'valueScale');\n            const tickPrecision = this.parsePrecision (scale);\n            value = Precise.stringMul (value, tickPrecision);\n        }\n        return value;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 4233,
        "line_end": 4298,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (contract, 'markPriceRp', markEp)",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeNumber (contract, 'indexPriceRp', indexEp)",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRateRr', fundingRateEr)",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "this.safeNumber (contract, 'predFundingRateRr', nextFundingRateEr)",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"askEp\": 2332500,\n         \"bidEp\": 2331000,\n         \"fundingRateEr\": 10000,\n         \"highEp\": 2380000,\n         \"indexEp\": 2329057,\n         \"lastEp\": 2331500,\n         \"lowEp\": 2274000,\n         \"markEp\": 2329232,\n         \"openEp\": 2337500,\n         \"openInterest\": 1298050,\n         \"predFundingRateEr\": 19921,\n         \"symbol\": \"ETHUSD\",\n         \"timestamp\": 1592474241582701416,\n         \"turnoverEv\": 47228362330,\n         \"volume\": 4053863\n     }",
          "{\n         \"closeRp\":\"16820.5\",\n         \"fundingRateRr\":\"0.0001\",\n         \"highRp\":\"16962.1\",\n         \"indexPriceRp\":\"16830.15651565\",\n         \"lowRp\":\"16785\",\n         \"markPriceRp\":\"16830.97534951\",\n         \"openInterestRv\":\"1323.596\",\n         \"openRp\":\"16851.7\",\n         \"predFundingRateRr\":\"0.0001\",\n         \"symbol\":\"BTCUSDT\",\n         \"timestamp\":\"1672142789065593096\",\n         \"turnoverRv\":\"124835296.0538\",\n         \"volumeRq\":\"7406.95\"\n     }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"askEp\": 2332500,\n        //         \"bidEp\": 2331000,\n        //         \"fundingRateEr\": 10000,\n        //         \"highEp\": 2380000,\n        //         \"indexEp\": 2329057,\n        //         \"lastEp\": 2331500,\n        //         \"lowEp\": 2274000,\n        //         \"markEp\": 2329232,\n        //         \"openEp\": 2337500,\n        //         \"openInterest\": 1298050,\n        //         \"predFundingRateEr\": 19921,\n        //         \"symbol\": \"ETHUSD\",\n        //         \"timestamp\": 1592474241582701416,\n        //         \"turnoverEv\": 47228362330,\n        //         \"volume\": 4053863\n        //     }\n        //\n        // linear swap v2\n        //\n        //     {\n        //         \"closeRp\":\"16820.5\",\n        //         \"fundingRateRr\":\"0.0001\",\n        //         \"highRp\":\"16962.1\",\n        //         \"indexPriceRp\":\"16830.15651565\",\n        //         \"lowRp\":\"16785\",\n        //         \"markPriceRp\":\"16830.97534951\",\n        //         \"openInterestRv\":\"1323.596\",\n        //         \"openRp\":\"16851.7\",\n        //         \"predFundingRateRr\":\"0.0001\",\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"timestamp\":\"1672142789065593096\",\n        //         \"turnoverRv\":\"124835296.0538\",\n        //         \"volumeRq\":\"7406.95\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.safeIntegerProduct (contract, 'timestamp', 0.000001);\n        const markEp = this.fromEp (this.safeString (contract, 'markEp'), market);\n        const indexEp = this.fromEp (this.safeString (contract, 'indexEp'), market);\n        const fundingRateEr = this.fromEr (this.safeString (contract, 'fundingRateEr'), market);\n        const nextFundingRateEr = this.fromEr (this.safeString (contract, 'predFundingRateEr'), market);\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': this.safeNumber (contract, 'markPriceRp', markEp),\n            'indexPrice': this.safeNumber (contract, 'indexPriceRp', indexEp),\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fundingRate': this.safeNumber (contract, 'fundingRateRr', fundingRateEr),\n            'fundingTimestamp': undefined,\n            'fundingDatetime': undefined,\n            'nextFundingRate': this.safeNumber (contract, 'predFundingRateRr', nextFundingRateEr),\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 4337,
        "line_end": 4360,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "type",
            "value": "'set'",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "market[codeCurrency]",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseMarginStatus (this.safeString (data, 'code'))",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"code\": 0,\n         \"msg\": \"\",\n         \"data\": \"OK\"\n     }"
        ],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"msg\": \"\",\n        //         \"data\": \"OK\"\n        //     }\n        //\n        market = this.safeMarket (undefined, market);\n        const inverse = this.safeValue (market, 'inverse');\n        const codeCurrency = inverse ? 'base' : 'quote';\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (undefined, market),\n            'type': 'set',\n            'marginMode': 'isolated',\n            'amount': undefined,\n            'total': undefined,\n            'code': market[codeCurrency],\n            'status': this.parseMarginStatus (this.safeString (data, 'code')),\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarginStatus",
        "signature": "parseMarginStatus (status)",
        "line_start": 4330,
        "line_end": 4335,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarginStatus (status) {\n        const statuses: Dict = {\n            '0': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]",
        "line_start": 4537,
        "line_end": 4574,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.sum (i, 1)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "minNotional",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "maxNotional",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeString (tier, 'maintenanceMargin')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "@param {object} info Exchange market response for 1 market",
          "@param {object} market CCXT market",
          "{\n         \"symbol\":\"BTCUSD\",\n         \"steps\":\"50\",\n         \"riskLimits\":[\n             {\"limit\":100,\"initialMargin\":\"1.0%\",\"initialMarginEr\":1000000,\"maintenanceMargin\":\"0.5%\",\"maintenanceMarginEr\":500000},\n             {\"limit\":150,\"initialMargin\":\"1.5%\",\"initialMarginEr\":1500000,\"maintenanceMargin\":\"1.0%\",\"maintenanceMarginEr\":1000000},\n             {\"limit\":200,\"initialMargin\":\"2.0%\",\"initialMarginEr\":2000000,\"maintenanceMargin\":\"1.5%\",\"maintenanceMarginEr\":1500000},\n         ]\n     },"
        ],
        "source": "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n        /**\n         * @param {object} info Exchange market response for 1 market\n         * @param {object} market CCXT market\n         */\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD\",\n        //         \"steps\":\"50\",\n        //         \"riskLimits\":[\n        //             {\"limit\":100,\"initialMargin\":\"1.0%\",\"initialMarginEr\":1000000,\"maintenanceMargin\":\"0.5%\",\"maintenanceMarginEr\":500000},\n        //             {\"limit\":150,\"initialMargin\":\"1.5%\",\"initialMarginEr\":1500000,\"maintenanceMargin\":\"1.0%\",\"maintenanceMarginEr\":1000000},\n        //             {\"limit\":200,\"initialMargin\":\"2.0%\",\"initialMarginEr\":2000000,\"maintenanceMargin\":\"1.5%\",\"maintenanceMarginEr\":1500000},\n        //         ]\n        //     },\n        //\n        const marketId = this.safeString (info, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const riskLimits = (market['info']['riskLimits']);\n        const tiers = [];\n        let minNotional = 0;\n        for (let i = 0; i < riskLimits.length; i++) {\n            const tier = riskLimits[i];\n            const maxNotional = this.safeInteger (tier, 'limit');\n            tiers.push ({\n                'tier': this.sum (i, 1),\n                'symbol': this.safeSymbol (marketId, market),\n                'currency': market['settle'],\n                'minNotional': minNotional,\n                'maxNotional': maxNotional,\n                'maintenanceMarginRate': this.safeString (tier, 'maintenanceMargin'),\n                'maxLeverage': undefined,\n                'info': tier,\n            });\n            minNotional = maxNotional;\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1344,
        "line_end": 1372,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1592467200, // timestamp\n         300, // interval\n         23376000000, // last\n         23322000000, // open\n         23381000000, // high\n         23315000000, // low\n         23367000000, // close\n         208671000, // base volume\n         48759063370, // quote volume\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1592467200, // timestamp\n        //         300, // interval\n        //         23376000000, // last\n        //         23322000000, // open\n        //         23381000000, // high\n        //         23315000000, // low\n        //         23367000000, // close\n        //         208671000, // base volume\n        //         48759063370, // quote volume\n        //     ]\n        //\n        let baseVolume: Num;\n        if ((market !== undefined) && market['spot']) {\n            baseVolume = this.parseNumber (this.fromEv (this.safeString (ohlcv, 7), market));\n        } else {\n            baseVolume = this.safeNumber (ohlcv, 7);\n        }\n        return [\n            this.safeTimestamp (ohlcv, 0),\n            this.parseNumber (this.fromEp (this.safeString (ohlcv, 3), market)),\n            this.parseNumber (this.fromEp (this.safeString (ohlcv, 4), market)),\n            this.parseNumber (this.fromEp (this.safeString (ohlcv, 5), market)),\n            this.parseNumber (this.fromEp (this.safeString (ohlcv, 6), market)),\n            baseVolume,\n        ];\n    }"
      },
      {
        "name": "parseOpenInterest",
        "signature": "parseOpenInterest (interest, market: Market = undefined)",
        "line_start": 5072,
        "line_end": 5102,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "interest",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (id, market)",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (interest, 'volumeRq')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "openInterestValue",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n        closeRp: '67550.1',\n        fundingRateRr: '0.0001',\n        highRp: '68400',\n        indexPriceRp: '67567.15389794',\n        lowRp: '66096.4',\n        markPriceRp: '67550.1',\n        openInterestRv: '1848.1144186',\n        openRp: '66330',\n        predFundingRateRr: '0.0001',\n        symbol: 'BTCUSDT',\n        timestamp: '1729114315443343001',\n        turnoverRv: '228863389.3237532',\n        volumeRq: '3388.5600312'\n    }"
        ],
        "source": "parseOpenInterest (interest, market: Market = undefined) {\n        //\n        //    {\n        //        closeRp: '67550.1',\n        //        fundingRateRr: '0.0001',\n        //        highRp: '68400',\n        //        indexPriceRp: '67567.15389794',\n        //        lowRp: '66096.4',\n        //        markPriceRp: '67550.1',\n        //        openInterestRv: '1848.1144186',\n        //        openRp: '66330',\n        //        predFundingRateRr: '0.0001',\n        //        symbol: 'BTCUSDT',\n        //        timestamp: '1729114315443343001',\n        //        turnoverRv: '228863389.3237532',\n        //        volumeRq: '3388.5600312'\n        //    }\n        //\n        const timestamp = this.safeInteger (interest, 'timestamp') / 1000000;\n        const id = this.safeString (interest, 'symbol');\n        return this.safeOpenInterest ({\n            'info': interest,\n            'symbol': this.safeSymbol (id, market),\n            'baseVolume': this.safeString (interest, 'volumeRq'),\n            'quoteVolume': undefined,  // deprecated\n            'openInterestAmount': this.safeString (interest, 'openInterestRv'),\n            'openInterestValue': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        }, market);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2632,
        "line_end": 2639,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        const isSwap = this.safeBool (market, 'swap', false);\n        const hasPnl = ('closedPnl' in order) || ('closedPnlRv' in order) || ('totalPnlRv' in order);\n        if (isSwap || hasPnl) {\n            return this.parseSwapOrder (order, market);\n        }\n        return this.parseSpotOrder (order, market);\n    }"
      },
      {
        "name": "parseOrderSide",
        "signature": "parseOrderSide (side)",
        "line_start": 2443,
        "line_end": 2449,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderSide (side) {\n        const sides: Dict = {\n            '1': 'buy',\n            '2': 'sell',\n        };\n        return this.safeString (sides, side, side);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2280,
        "line_end": 2302,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Created': 'open',\n            'Untriggered': 'open',\n            'Deactivated': 'closed',\n            'Triggered': 'open',\n            'Rejected': 'rejected',\n            'New': 'open',\n            'PartiallyFilled': 'open',\n            'Filled': 'closed',\n            'Canceled': 'canceled',\n            'Suspended': 'canceled',\n            '1': 'open',\n            '2': 'canceled',\n            '3': 'closed',\n            '4': 'canceled',\n            '5': 'open',\n            '6': 'open',\n            '7': 'closed',\n            '8': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 2304,
        "line_end": 2320,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            '1': 'market',\n            '2': 'limit',\n            '3': 'stop',\n            '4': 'stopLimit',\n            '5': 'market',\n            '6': 'limit',\n            '7': 'market',\n            '8': 'market',\n            '9': 'stopLimit',\n            '10': 'market',\n            'Limit': 'limit',\n            'Market': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3941,
        "line_end": 4088,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'execSeq')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (contracts)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (position, 'curTermRealisedPnlRv')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (apiUnrealizedPnl)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "liquidationPrice",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.parseNumber (collateral)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notionalString)",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPriceString)",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPriceString)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeIntegerProduct (position, 'transactTimeNs', 0.000001)",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.parseNumber (initialMarginString)",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "this.parseNumber (initialMarginPercentageString)",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.parseNumber (maintenanceMarginString)",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "this.parseNumber (maintenanceMarginPercentageString)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.parseNumber (marginRatio)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "isCross ? 'cross' : 'isolated'",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "this.safeString (position, 'posMode') === 'Hedged'",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"userID\": \"811370\",\n        \"accountID\": \"8113700002\",\n        \"symbol\": \"ETHUSD\",\n        \"currency\": \"USD\",\n        \"side\": \"Buy\",\n        \"positionStatus\": \"Normal\",\n        \"crossMargin\": false,\n        \"leverageEr\": \"200000000\",\n        \"leverage\": \"2.00000000\",\n        \"initMarginReqEr\": \"50000000\",\n        \"initMarginReq\": \"0.50000000\",\n        \"maintMarginReqEr\": \"1000000\",\n        \"maintMarginReq\": \"0.01000000\",\n        \"riskLimitEv\": \"5000000000\",\n        \"riskLimit\": \"500000.00000000\",\n        \"size\": \"1\",\n        \"value\": \"22.22370000\",\n        \"valueEv\": \"222237\",\n        \"avgEntryPriceEp\": \"44447400\",\n        \"avgEntryPrice\": \"4444.74000000\",\n        \"posCostEv\": \"111202\",\n        \"posCost\": \"11.12020000\",\n        \"assignedPosBalanceEv\": \"111202\",\n        \"assignedPosBalance\": \"11.12020000\",\n        \"bankruptCommEv\": \"84\",\n        \"bankruptComm\": \"0.00840000\",\n        \"bankruptPriceEp\": \"22224000\",\n        \"bankruptPrice\": \"2222.40000000\",\n        \"positionMarginEv\": \"111118\",\n        \"positionMargin\": \"11.11180000\",\n        \"liquidationPriceEp\": \"22669000\",\n        \"liquidationPrice\": \"2266.90000000\",\n        \"deleveragePercentileEr\": \"0\",\n        \"deleveragePercentile\": \"0E-8\",\n        \"buyValueToCostEr\": \"50112500\",\n        \"buyValueToCost\": \"0.50112500\",\n        \"sellValueToCostEr\": \"50187500\",\n        \"sellValueToCost\": \"0.50187500\",\n        \"markPriceEp\": \"31332499\",\n        \"markPrice\": \"3133.24990000\",\n        \"markValueEv\": \"0\",\n        \"markValue\": null,\n        \"unRealisedPosLossEv\": \"0\",\n        \"unRealisedPosLoss\": null,\n        \"estimatedOrdLossEv\": \"0\",\n        \"estimatedOrdLoss\": \"0E-8\",\n        \"usedBalanceEv\": \"111202\",\n        \"usedBalance\": \"11.12020000\",\n        \"takeProfitEp\": \"0\",\n        \"takeProfit\": null,\n        \"stopLossEp\": \"0\",\n        \"stopLoss\": null,\n        \"cumClosedPnlEv\": \"-1546\",\n        \"cumFundingFeeEv\": \"1605\",\n        \"cumTransactFeeEv\": \"8438\",\n        \"realisedPnlEv\": \"0\",\n        \"realisedPnl\": null,\n        \"cumRealisedPnlEv\": \"0\",\n        \"cumRealisedPnl\": null,\n        \"transactTimeNs\": \"1641571200001885324\",\n        \"takerFeeRateEr\": \"0\",\n        \"makerFeeRateEr\": \"0\",\n        \"term\": \"6\",\n        \"lastTermEndTimeNs\": \"1607711882505745356\",\n        \"lastFundingTimeNs\": \"1641571200000000000\",\n        \"curTermRealisedPnlEv\": \"-1567\",\n        \"execSeq\": \"12112761561\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //    {\n        //        \"userID\": \"811370\",\n        //        \"accountID\": \"8113700002\",\n        //        \"symbol\": \"ETHUSD\",\n        //        \"currency\": \"USD\",\n        //        \"side\": \"Buy\",\n        //        \"positionStatus\": \"Normal\",\n        //        \"crossMargin\": false,\n        //        \"leverageEr\": \"200000000\",\n        //        \"leverage\": \"2.00000000\",\n        //        \"initMarginReqEr\": \"50000000\",\n        //        \"initMarginReq\": \"0.50000000\",\n        //        \"maintMarginReqEr\": \"1000000\",\n        //        \"maintMarginReq\": \"0.01000000\",\n        //        \"riskLimitEv\": \"5000000000\",\n        //        \"riskLimit\": \"500000.00000000\",\n        //        \"size\": \"1\",\n        //        \"value\": \"22.22370000\",\n        //        \"valueEv\": \"222237\",\n        //        \"avgEntryPriceEp\": \"44447400\",\n        //        \"avgEntryPrice\": \"4444.74000000\",\n        //        \"posCostEv\": \"111202\",\n        //        \"posCost\": \"11.12020000\",\n        //        \"assignedPosBalanceEv\": \"111202\",\n        //        \"assignedPosBalance\": \"11.12020000\",\n        //        \"bankruptCommEv\": \"84\",\n        //        \"bankruptComm\": \"0.00840000\",\n        //        \"bankruptPriceEp\": \"22224000\",\n        //        \"bankruptPrice\": \"2222.40000000\",\n        //        \"positionMarginEv\": \"111118\",\n        //        \"positionMargin\": \"11.11180000\",\n        //        \"liquidationPriceEp\": \"22669000\",\n        //        \"liquidationPrice\": \"2266.90000000\",\n        //        \"deleveragePercentileEr\": \"0\",\n        //        \"deleveragePercentile\": \"0E-8\",\n        //        \"buyValueToCostEr\": \"50112500\",\n        //        \"buyValueToCost\": \"0.50112500\",\n        //        \"sellValueToCostEr\": \"50187500\",\n        //        \"sellValueToCost\": \"0.50187500\",\n        //        \"markPriceEp\": \"31332499\",\n        //        \"markPrice\": \"3133.24990000\",\n        //        \"markValueEv\": \"0\",\n        //        \"markValue\": null,\n        //        \"unRealisedPosLossEv\": \"0\",\n        //        \"unRealisedPosLoss\": null,\n        //        \"estimatedOrdLossEv\": \"0\",\n        //        \"estimatedOrdLoss\": \"0E-8\",\n        //        \"usedBalanceEv\": \"111202\",\n        //        \"usedBalance\": \"11.12020000\",\n        //        \"takeProfitEp\": \"0\",\n        //        \"takeProfit\": null,\n        //        \"stopLossEp\": \"0\",\n        //        \"stopLoss\": null,\n        //        \"cumClosedPnlEv\": \"-1546\",\n        //        \"cumFundingFeeEv\": \"1605\",\n        //        \"cumTransactFeeEv\": \"8438\",\n        //        \"realisedPnlEv\": \"0\",\n        //        \"realisedPnl\": null,\n        //        \"cumRealisedPnlEv\": \"0\",\n        //        \"cumRealisedPnl\": null,\n        //        \"transactTimeNs\": \"1641571200001885324\",\n        //        \"takerFeeRateEr\": \"0\",\n        //        \"makerFeeRateEr\": \"0\",\n        //        \"term\": \"6\",\n        //        \"lastTermEndTimeNs\": \"1607711882505745356\",\n        //        \"lastFundingTimeNs\": \"1641571200000000000\",\n        //        \"curTermRealisedPnlEv\": \"-1567\",\n        //        \"execSeq\": \"12112761561\"\n        //    }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const collateral = this.safeString2 (position, 'positionMargin', 'positionMarginRv');\n        const notionalString = this.safeString2 (position, 'value', 'valueRv');\n        const maintenanceMarginPercentageString = this.safeString2 (position, 'maintMarginReq', 'maintMarginReqRr');\n        const maintenanceMarginString = Precise.stringMul (notionalString, maintenanceMarginPercentageString);\n        const initialMarginString = this.safeString2 (position, 'assignedPosBalance', 'assignedPosBalanceRv');\n        const initialMarginPercentageString = Precise.stringDiv (initialMarginString, notionalString);\n        const liquidationPrice = this.safeNumber2 (position, 'liquidationPrice', 'liquidationPriceRp');\n        const markPriceString = this.safeString2 (position, 'markPrice', 'markPriceRp');\n        const contracts = this.safeString2 (position, 'size', 'sizeRq');\n        const contractSize = this.safeValue (market, 'contractSize');\n        const contractSizeString = this.numberToString (contractSize);\n        const leverage = this.parseNumber (Precise.stringAbs ((this.safeString2 (position, 'leverage', 'leverageRr'))));\n        const entryPriceString = this.safeString2 (position, 'avgEntryPrice', 'avgEntryPriceRp');\n        const rawSide = this.safeString (position, 'side');\n        let side = undefined;\n        if (rawSide !== undefined) {\n            side = (rawSide === 'Buy') ? 'long' : 'short';\n        }\n        // Inverse long contract: unRealizedPnl = (posSize * contractSize) / avgEntryPrice - (posSize * contractSize) / markPrice\n        // Inverse short contract: unRealizedPnl =  (posSize *contractSize) / markPrice - (posSize * contractSize) / avgEntryPrice\n        // Linear long contract:  unRealizedPnl = (posSize * contractSize) * markPrice - (posSize * contractSize) * avgEntryPrice\n        // Linear short contract:  unRealizedPnl = (posSize * contractSize) * avgEntryPrice - (posSize * contractSize) * markPrice\n        let priceDiff = undefined;\n        if (market['linear']) {\n            if (side === 'long') {\n                priceDiff = Precise.stringSub (markPriceString, entryPriceString);\n            } else {\n                priceDiff = Precise.stringSub (entryPriceString, markPriceString);\n            }\n        } else {\n            // inverse\n            if (side === 'long') {\n                priceDiff = Precise.stringSub (Precise.stringDiv ('1', entryPriceString), Precise.stringDiv ('1', markPriceString));\n            } else {\n                priceDiff = Precise.stringSub (Precise.stringDiv ('1', markPriceString), Precise.stringDiv ('1', entryPriceString));\n            }\n        }\n        const unrealizedPnl = Precise.stringMul (Precise.stringMul (priceDiff, contracts), contractSizeString);\n        // the unrealizedPnl is only available in a specific endpoint which much higher RL limits\n        const apiUnrealizedPnl = this.safeString (position, 'unRealisedPnlRv', unrealizedPnl);\n        const marginRatio = Precise.stringDiv (maintenanceMarginString, collateral);\n        const isCross = this.safeValue (position, 'crossMargin');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'execSeq'),\n            'symbol': symbol,\n            'contracts': this.parseNumber (contracts),\n            'contractSize': contractSize,\n            'realizedPnl': this.safeNumber (position, 'curTermRealisedPnlRv'),\n            'unrealizedPnl': this.parseNumber (apiUnrealizedPnl),\n            'leverage': leverage,\n            'liquidationPrice': liquidationPrice,\n            'collateral': this.parseNumber (collateral),\n            'notional': this.parseNumber (notionalString),\n            'markPrice': this.parseNumber (markPriceString), // markPrice lags a bit ¯\\_(ツ)_/¯\n            'lastPrice': undefined,\n            'entryPrice': this.parseNumber (entryPriceString),\n            'timestamp': undefined,\n            'lastUpdateTimestamp': this.safeIntegerProduct (position, 'transactTimeNs', 0.000001),\n            'initialMargin': this.parseNumber (initialMarginString),\n            'initialMarginPercentage': this.parseNumber (initialMarginPercentageString),\n            'maintenanceMargin': this.parseNumber (maintenanceMarginString),\n            'maintenanceMarginPercentage': this.parseNumber (maintenanceMarginPercentageString),\n            'marginRatio': this.parseNumber (marginRatio),\n            'datetime': undefined,\n            'marginMode': isCross ? 'cross' : 'isolated',\n            'side': side,\n            'hedged': this.safeString (position, 'posMode') === 'Hedged',\n            'percentage': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseSafeNumber",
        "signature": "parseSafeNumber (value = undefined)",
        "line_start": 635,
        "line_end": 643,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSafeNumber (value = undefined) {\n        if (value === undefined) {\n            return value;\n        }\n        let parts = value.split (',');\n        value = parts.join ('');\n        parts = value.split (' ');\n        return this.safeNumber (parts, 0);\n    }"
      },
      {
        "name": "parseSpotBalance",
        "signature": "parseSpotBalance (response)",
        "line_start": 2006,
        "line_end": 2057,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"code\":0,\n         \"msg\":\"\",\n         \"data\":[\n             {\n                 \"currency\":\"USDT\",\n                 \"balanceEv\":0,\n                 \"lockedTradingBalanceEv\":0,\n                 \"lockedWithdrawEv\":0,\n                 \"lastUpdateTimeNs\":1592065834511322514,\n                 \"walletVid\":0\n             },\n             {\n                 \"currency\":\"ETH\",\n                 \"balanceEv\":0,\n                 \"lockedTradingBalanceEv\":0,\n                 \"lockedWithdrawEv\":0,\n                 \"lastUpdateTimeNs\":1592065834511322514,\n                 \"walletVid\":0\n             }\n         ]\n     }"
        ],
        "source": "parseSpotBalance (response) {\n        //\n        //     {\n        //         \"code\":0,\n        //         \"msg\":\"\",\n        //         \"data\":[\n        //             {\n        //                 \"currency\":\"USDT\",\n        //                 \"balanceEv\":0,\n        //                 \"lockedTradingBalanceEv\":0,\n        //                 \"lockedWithdrawEv\":0,\n        //                 \"lastUpdateTimeNs\":1592065834511322514,\n        //                 \"walletVid\":0\n        //             },\n        //             {\n        //                 \"currency\":\"ETH\",\n        //                 \"balanceEv\":0,\n        //                 \"lockedTradingBalanceEv\":0,\n        //                 \"lockedWithdrawEv\":0,\n        //                 \"lastUpdateTimeNs\":1592065834511322514,\n        //                 \"walletVid\":0\n        //             }\n        //         ]\n        //     }\n        //\n        let timestamp = undefined;\n        const result: Dict = { 'info': response };\n        const data = this.safeValue (response, 'data', []);\n        for (let i = 0; i < data.length; i++) {\n            const balance = data[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const currency = this.safeValue (this.currencies, code, {});\n            const scale = this.safeInteger (currency, 'valueScale', 8);\n            const account = this.account ();\n            const balanceEv = this.safeString (balance, 'balanceEv');\n            const lockedTradingBalanceEv = this.safeString (balance, 'lockedTradingBalanceEv');\n            const lockedWithdrawEv = this.safeString (balance, 'lockedWithdrawEv');\n            const total = this.fromEn (balanceEv, scale);\n            const lockedTradingBalance = this.fromEn (lockedTradingBalanceEv, scale);\n            const lockedWithdraw = this.fromEn (lockedWithdrawEv, scale);\n            const used = Precise.stringAdd (lockedTradingBalance, lockedWithdraw);\n            const lastUpdateTimeNs = this.safeIntegerProduct (balance, 'lastUpdateTimeNs', 0.000001);\n            timestamp = (timestamp === undefined) ? lastUpdateTimeNs : Math.max (timestamp, lastUpdateTimeNs);\n            account['total'] = total;\n            account['used'] = used;\n            result[code] = account;\n        }\n        result['timestamp'] = timestamp;\n        result['datetime'] = this.iso8601 (timestamp);\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseSpotMarket",
        "signature": "parseSpotMarket (market: Dict)",
        "line_start": 789,
        "line_end": 889,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "status === 'Listed'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (market, 'defaultTakerFee')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (market, 'defaultMakerFee')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "priceScale",
            "value": "this.safeInteger (market, 'priceScale')",
            "comment": null
          },
          {
            "key": "valueScale",
            "value": "this.safeInteger (market, 'valueScale')",
            "comment": null
          },
          {
            "key": "ratioScale",
            "value": "this.safeInteger (market, 'ratioScale')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': precisionAmount,\n                'price': precisionPrice,\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': precisionAmount,\n                    'max': this.parseSafeNumber (this.safeString (market, 'maxBaseOrderSize')),\n                },\n                'price': {\n                    'min': precisionPrice,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.parseSafeNumber (this.safeString (market, 'minOrderValue')),\n                    'max': this.parseSafeNumber (this.safeString (market, 'maxOrderValue')),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'listTime')",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "precisionAmount",
            "comment": null
          },
          {
            "key": "price",
            "value": "precisionPrice",
            "comment": null
          },
          {
            "key": "min",
            "value": "precisionPrice",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"sBTCUSDT\",\n         \"code\":1001,\n         \"type\":\"Spot\",\n         \"displaySymbol\":\"BTC / USDT\",\n         \"quoteCurrency\":\"USDT\",\n         \"priceScale\":8,\n         \"ratioScale\":8,\n         \"pricePrecision\":2,\n         \"baseCurrency\":\"BTC\",\n         \"baseTickSize\":\"0.000001 BTC\",\n         \"baseTickSizeEv\":100,\n         \"quoteTickSize\":\"0.01 USDT\",\n         \"quoteTickSizeEv\":1000000,\n         \"baseQtyPrecision\":6,\n         \"quoteQtyPrecision\":2,\n         \"minOrderValue\":\"10 USDT\",\n         \"minOrderValueEv\":1000000000,\n         \"maxBaseOrderSize\":\"1000 BTC\",\n         \"maxBaseOrderSizeEv\":100000000000,\n         \"maxOrderValue\":\"5,000,000 USDT\",\n         \"maxOrderValueEv\":500000000000000,\n         \"defaultTakerFee\":\"0.001\",\n         \"defaultTakerFeeEr\":100000,\n         \"defaultMakerFee\":\"0.001\",\n         \"defaultMakerFeeEr\":100000,\n         \"description\":\"BTCUSDT is a BTC/USDT spot trading pair. Minimum order value is 1 USDT\",\n         \"status\":\"Listed\",\n         \"tipOrderQty\":2,\n         \"listTime\":1589338800000,\n         \"buyPriceUpperLimitPct\":110,\n         \"sellPriceLowerLimitPct\":90,\n         \"leverage\":5\n     },"
        ],
        "source": "parseSpotMarket (market: Dict) {\n        //\n        //     {\n        //         \"symbol\":\"sBTCUSDT\",\n        //         \"code\":1001,\n        //         \"type\":\"Spot\",\n        //         \"displaySymbol\":\"BTC / USDT\",\n        //         \"quoteCurrency\":\"USDT\",\n        //         \"priceScale\":8,\n        //         \"ratioScale\":8,\n        //         \"pricePrecision\":2,\n        //         \"baseCurrency\":\"BTC\",\n        //         \"baseTickSize\":\"0.000001 BTC\",\n        //         \"baseTickSizeEv\":100,\n        //         \"quoteTickSize\":\"0.01 USDT\",\n        //         \"quoteTickSizeEv\":1000000,\n        //         \"baseQtyPrecision\":6,\n        //         \"quoteQtyPrecision\":2,\n        //         \"minOrderValue\":\"10 USDT\",\n        //         \"minOrderValueEv\":1000000000,\n        //         \"maxBaseOrderSize\":\"1000 BTC\",\n        //         \"maxBaseOrderSizeEv\":100000000000,\n        //         \"maxOrderValue\":\"5,000,000 USDT\",\n        //         \"maxOrderValueEv\":500000000000000,\n        //         \"defaultTakerFee\":\"0.001\",\n        //         \"defaultTakerFeeEr\":100000,\n        //         \"defaultMakerFee\":\"0.001\",\n        //         \"defaultMakerFeeEr\":100000,\n        //         \"description\":\"BTCUSDT is a BTC/USDT spot trading pair. Minimum order value is 1 USDT\",\n        //         \"status\":\"Listed\",\n        //         \"tipOrderQty\":2,\n        //         \"listTime\":1589338800000,\n        //         \"buyPriceUpperLimitPct\":110,\n        //         \"sellPriceLowerLimitPct\":90,\n        //         \"leverage\":5\n        //     },\n        //\n        const type = this.safeStringLower (market, 'type');\n        const id = this.safeString (market, 'symbol');\n        const quoteId = this.safeString (market, 'quoteCurrency');\n        const baseId = this.safeString (market, 'baseCurrency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const status = this.safeString (market, 'status');\n        const precisionAmount = this.parseSafeNumber (this.safeString (market, 'baseTickSize'));\n        const precisionPrice = this.parseSafeNumber (this.safeString (market, 'quoteTickSize'));\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': type,\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': status === 'Listed',\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (market, 'defaultTakerFee'),\n            'maker': this.safeNumber (market, 'defaultMakerFee'),\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'priceScale': this.safeInteger (market, 'priceScale'),\n            'valueScale': this.safeInteger (market, 'valueScale'),\n            'ratioScale': this.safeInteger (market, 'ratioScale'),\n            'precision': {\n                'amount': precisionAmount,\n                'price': precisionPrice,\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': precisionAmount,\n                    'max': this.parseSafeNumber (this.safeString (market, 'maxBaseOrderSize')),\n                },\n                'price': {\n                    'min': precisionPrice,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.parseSafeNumber (this.safeString (market, 'minOrderValue')),\n                    'max': this.parseSafeNumber (this.safeString (market, 'maxOrderValue')),\n                },\n            },\n            'created': this.safeInteger (market, 'listTime'),\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseSpotOrder",
        "signature": "parseSpotOrder (order: Dict, market: Market = undefined)",
        "line_start": 2332,
        "line_end": 2441,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderID\": \"d1d09454-cabc-4a23-89a7-59d43363f16d\",\n         \"clOrdID\": \"309bcd5c-9f6e-4a68-b775-4494542eb5cb\",\n         \"priceEp\": 0,\n         \"action\": \"New\",\n         \"trigger\": \"UNSPECIFIED\",\n         \"pegPriceType\": \"UNSPECIFIED\",\n         \"stopDirection\": \"UNSPECIFIED\",\n         \"bizError\": 0,\n         \"symbol\": \"sBTCUSDT\",\n         \"side\": \"Buy\",\n         \"baseQtyEv\": 0,\n         \"ordType\": \"Limit\",\n         \"timeInForce\": \"GoodTillCancel\",\n         \"ordStatus\": \"Created\",\n         \"cumFeeEv\": 0,\n         \"cumBaseQtyEv\": 0,\n         \"cumQuoteQtyEv\": 0,\n         \"leavesBaseQtyEv\": 0,\n         \"leavesQuoteQtyEv\": 0,\n         \"avgPriceEp\": 0,\n         \"cumBaseAmountEv\": 0,\n         \"cumQuoteAmountEv\": 0,\n         \"quoteQtyEv\": 0,\n         \"qtyType\": \"ByBase\",\n         \"stopPxEp\": 0,\n         \"pegOffsetValueEp\": 0\n     }",
          "{\n         \"orderID\":\"99232c3e-3d6a-455f-98cc-2061cdfe91bc\",\n         \"stopPxEp\":0,\n         \"avgPriceEp\":0,\n         \"qtyType\":\"ByBase\",\n         \"leavesBaseQtyEv\":0,\n         \"leavesQuoteQtyEv\":0,\n         \"baseQtyEv\":\"1000000000\",\n         \"feeCurrency\":\"4\",\n         \"stopDirection\":\"UNSPECIFIED\",\n         \"symbol\":\"sETHUSDT\",\n         \"side\":\"Buy\",\n         \"quoteQtyEv\":250000000000,\n         \"priceEp\":25000000000,\n         \"ordType\":\"Limit\",\n         \"timeInForce\":\"GoodTillCancel\",\n         \"ordStatus\":\"Rejected\",\n         \"execStatus\":\"NewRejected\",\n         \"createTimeNs\":1592675305266037130,\n         \"cumFeeEv\":0,\n         \"cumBaseValueEv\":0,\n         \"cumQuoteValueEv\":0\n     }"
        ],
        "source": "parseSpotOrder (order: Dict, market: Market = undefined) {\n        //\n        // spot\n        //\n        //     {\n        //         \"orderID\": \"d1d09454-cabc-4a23-89a7-59d43363f16d\",\n        //         \"clOrdID\": \"309bcd5c-9f6e-4a68-b775-4494542eb5cb\",\n        //         \"priceEp\": 0,\n        //         \"action\": \"New\",\n        //         \"trigger\": \"UNSPECIFIED\",\n        //         \"pegPriceType\": \"UNSPECIFIED\",\n        //         \"stopDirection\": \"UNSPECIFIED\",\n        //         \"bizError\": 0,\n        //         \"symbol\": \"sBTCUSDT\",\n        //         \"side\": \"Buy\",\n        //         \"baseQtyEv\": 0,\n        //         \"ordType\": \"Limit\",\n        //         \"timeInForce\": \"GoodTillCancel\",\n        //         \"ordStatus\": \"Created\",\n        //         \"cumFeeEv\": 0,\n        //         \"cumBaseQtyEv\": 0,\n        //         \"cumQuoteQtyEv\": 0,\n        //         \"leavesBaseQtyEv\": 0,\n        //         \"leavesQuoteQtyEv\": 0,\n        //         \"avgPriceEp\": 0,\n        //         \"cumBaseAmountEv\": 0,\n        //         \"cumQuoteAmountEv\": 0,\n        //         \"quoteQtyEv\": 0,\n        //         \"qtyType\": \"ByBase\",\n        //         \"stopPxEp\": 0,\n        //         \"pegOffsetValueEp\": 0\n        //     }\n        //\n        //     {\n        //         \"orderID\":\"99232c3e-3d6a-455f-98cc-2061cdfe91bc\",\n        //         \"stopPxEp\":0,\n        //         \"avgPriceEp\":0,\n        //         \"qtyType\":\"ByBase\",\n        //         \"leavesBaseQtyEv\":0,\n        //         \"leavesQuoteQtyEv\":0,\n        //         \"baseQtyEv\":\"1000000000\",\n        //         \"feeCurrency\":\"4\",\n        //         \"stopDirection\":\"UNSPECIFIED\",\n        //         \"symbol\":\"sETHUSDT\",\n        //         \"side\":\"Buy\",\n        //         \"quoteQtyEv\":250000000000,\n        //         \"priceEp\":25000000000,\n        //         \"ordType\":\"Limit\",\n        //         \"timeInForce\":\"GoodTillCancel\",\n        //         \"ordStatus\":\"Rejected\",\n        //         \"execStatus\":\"NewRejected\",\n        //         \"createTimeNs\":1592675305266037130,\n        //         \"cumFeeEv\":0,\n        //         \"cumBaseValueEv\":0,\n        //         \"cumQuoteValueEv\":0\n        //     }\n        //\n        const id = this.safeString (order, 'orderID');\n        let clientOrderId = this.safeString (order, 'clOrdID');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined;\n        }\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.fromEp (this.safeString (order, 'priceEp'), market);\n        const amount = this.fromEv (this.safeString (order, 'baseQtyEv'), market);\n        const remaining = this.omitZero (this.fromEv (this.safeString (order, 'leavesBaseQtyEv'), market));\n        const filled = this.fromEv (this.safeString2 (order, 'cumBaseQtyEv', 'cumBaseValueEv'), market);\n        const cost = this.fromEr (this.safeString2 (order, 'cumQuoteValueEv', 'quoteQtyEv'), market);\n        const average = this.fromEp (this.safeString (order, 'avgPriceEp'), market);\n        const status = this.parseOrderStatus (this.safeString (order, 'ordStatus'));\n        const side = this.safeStringLower (order, 'side');\n        const type = this.parseOrderType (this.safeString (order, 'ordType'));\n        const timestamp = this.safeIntegerProduct2 (order, 'actionTimeNs', 'createTimeNs', 0.000001);\n        let fee = undefined;\n        const feeCost = this.fromEv (this.safeString (order, 'cumFeeEv'), market);\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (this.safeString (order, 'feeCurrency')),\n            };\n        }\n        const timeInForce = this.parseTimeInForce (this.safeString (order, 'timeInForce'));\n        const triggerPrice = this.parseNumber (this.omitZero (this.fromEp (this.safeString (order, 'stopPxEp'))));\n        const postOnly = (timeInForce === 'PO');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseSwapBalance",
        "signature": "parseSwapBalance (response)",
        "line_start": 2059,
        "line_end": 2105,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseSwapBalance (response) {\n        // usdt\n        //   {\n        //       \"info\": {\n        //         \"code\": \"0\",\n        //         \"msg\": '',\n        //         \"data\": {\n        //           \"account\": {\n        //             \"userID\": \"940666\",\n        //             \"accountId\": \"9406660003\",\n        //             \"currency\": \"USDT\",\n        //             \"accountBalanceRv\": \"99.93143972\",\n        //             \"totalUsedBalanceRv\": \"0.40456\",\n        //             \"bonusBalanceRv\": \"0\"\n        //           },\n        //   }\n        //\n        //     {\n        //         \"code\":0,\n        //         \"msg\":\"\",\n        //         \"data\":{\n        //             \"account\":{\n        //                 \"accountId\":6192120001,\n        //                 \"currency\":\"BTC\",\n        //                 \"accountBalanceEv\":1254744,\n        //                 \"totalUsedBalanceEv\":0,\n        //                 \"bonusBalanceEv\":1254744\n        //             }\n        //         }\n        //     }\n        //\n        const result: Dict = { 'info': response };\n        const data = this.safeValue (response, 'data', {});\n        const balance = this.safeValue (data, 'account', {});\n        const currencyId = this.safeString (balance, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const currency = this.currency (code);\n        const valueScale = this.safeInteger (currency, 'valueScale', 8);\n        const account = this.account ();\n        const accountBalanceEv = this.safeString2 (balance, 'accountBalanceEv', 'accountBalanceRv');\n        const totalUsedBalanceEv = this.safeString2 (balance, 'totalUsedBalanceEv', 'totalUsedBalanceRv');\n        const needsConversion = (code !== 'USDT');\n        account['total'] = needsConversion ? this.fromEn (accountBalanceEv, valueScale) : accountBalanceEv;\n        account['used'] = needsConversion ? this.fromEn (totalUsedBalanceEv, valueScale) : totalUsedBalanceEv;\n        result[code] = account;\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseSwapMarket",
        "signature": "parseSwapMarket (market: Dict)",
        "line_start": 645,
        "line_end": 787,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote + ':' + settle",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "status === 'Listed'",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "!inverse",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (this.fromEn (takerFeeRateEr, ratioScale))",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.parseNumber (this.fromEn (makerFeeRateEr, ratioScale))",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "priceScale",
            "value": "priceScale",
            "comment": null
          },
          {
            "key": "valueScale",
            "value": "valueScale",
            "comment": null
          },
          {
            "key": "ratioScale",
            "value": "ratioScale",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber2 (market, 'lotSize', 'qtyStepSize'),\n                'price': this.safeNumber (market, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.safeNumber (market, 'maxLeverage'),\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.parseNumber (this.fromEn (minPriceEp, priceScale)),\n                    'max': this.parseNumber (this.fromEn (maxPriceEp, priceScale)),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': this.parseNumber (this.safeString (market, 'maxOrderQty')),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': this.safeNumber (market, 'maxLeverage'),\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.parseNumber (this.fromEn (minPriceEp, priceScale)),\n                    'max': this.parseNumber (this.fromEn (maxPriceEp, priceScale)),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': this.parseNumber (this.safeString (market, 'maxOrderQty')),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\":\"BTCUSD\", //\n         \"code\":\"1\",\n         \"type\":\"Perpetual\",\n         \"displaySymbol\":\"BTC / USD\",\n         \"indexSymbol\":\".BTC\",\n         \"markSymbol\":\".MBTC\",\n         \"fundingRateSymbol\":\".BTCFR\",\n         \"fundingRate8hSymbol\":\".BTCFR8H\",\n         \"contractUnderlyingAssets\":\"USD\", // or eg. `1000 SHIB`\n         \"settleCurrency\":\"BTC\",\n         \"quoteCurrency\":\"USD\",\n         \"contractSize\":\"1 USD\",\n         \"lotSize\":1,\n         \"tickSize\":0.5,\n         \"priceScale\":4,\n         \"ratioScale\":8,\n         \"pricePrecision\":1,\n         \"minPriceEp\":5000,\n         \"maxPriceEp\":10000000000,\n         \"maxOrderQty\":1000000,\n         \"status\":\"Listed\",\n         \"tipOrderQty\":1000000,\n         \"listTime\":\"1574650800000\",\n         \"majorSymbol\":true,\n         \"steps\":\"50\",\n         \"riskLimits\":[\n             {\"limit\":100,\"initialMargin\":\"1.0%\",\"initialMarginEr\":1000000,\"maintenanceMargin\":\"0.5%\",\"maintenanceMarginEr\":500000},\n             {\"limit\":150,\"initialMargin\":\"1.5%\",\"initialMarginEr\":1500000,\"maintenanceMargin\":\"1.0%\",\"maintenanceMarginEr\":1000000},\n             {\"limit\":200,\"initialMargin\":\"2.0%\",\"initialMarginEr\":2000000,\"maintenanceMargin\":\"1.5%\",\"maintenanceMarginEr\":1500000},\n         ],\n         \"underlyingSymbol\":\".BTC\",\n         \"baseCurrency\":\"BTC\",\n         \"settlementCurrency\":\"BTC\",\n         \"valueScale\":8,\n         \"defaultLeverage\":0,\n         \"maxLeverage\":100,\n         \"initMarginEr\":\"1000000\",\n         \"maintMarginEr\":\"500000\",\n         \"defaultRiskLimitEv\":10000000000,\n         \"deleverage\":true,\n         \"makerFeeRateEr\":-250000,\n         \"takerFeeRateEr\":750000,\n         \"fundingInterval\":8,\n         \"marketUrl\":\"https://phemex.com/trade/BTCUSD\",\n         \"description\":\"BTCUSD is a BTC/USD perpetual contract priced on the .BTC Index. Each contract is worth 1 USD of Bitcoin. Funding is paid and received every 8 hours. At UTC time: 00:00, 08:00, 16:00.\",\n     }"
        ],
        "source": "parseSwapMarket (market: Dict) {\n        //\n        //     {\n        //         \"symbol\":\"BTCUSD\", //\n        //         \"code\":\"1\",\n        //         \"type\":\"Perpetual\",\n        //         \"displaySymbol\":\"BTC / USD\",\n        //         \"indexSymbol\":\".BTC\",\n        //         \"markSymbol\":\".MBTC\",\n        //         \"fundingRateSymbol\":\".BTCFR\",\n        //         \"fundingRate8hSymbol\":\".BTCFR8H\",\n        //         \"contractUnderlyingAssets\":\"USD\", // or eg. `1000 SHIB`\n        //         \"settleCurrency\":\"BTC\",\n        //         \"quoteCurrency\":\"USD\",\n        //         \"contractSize\":\"1 USD\",\n        //         \"lotSize\":1,\n        //         \"tickSize\":0.5,\n        //         \"priceScale\":4,\n        //         \"ratioScale\":8,\n        //         \"pricePrecision\":1,\n        //         \"minPriceEp\":5000,\n        //         \"maxPriceEp\":10000000000,\n        //         \"maxOrderQty\":1000000,\n        //         \"status\":\"Listed\",\n        //         \"tipOrderQty\":1000000,\n        //         \"listTime\":\"1574650800000\",\n        //         \"majorSymbol\":true,\n        //         \"steps\":\"50\",\n        //         \"riskLimits\":[\n        //             {\"limit\":100,\"initialMargin\":\"1.0%\",\"initialMarginEr\":1000000,\"maintenanceMargin\":\"0.5%\",\"maintenanceMarginEr\":500000},\n        //             {\"limit\":150,\"initialMargin\":\"1.5%\",\"initialMarginEr\":1500000,\"maintenanceMargin\":\"1.0%\",\"maintenanceMarginEr\":1000000},\n        //             {\"limit\":200,\"initialMargin\":\"2.0%\",\"initialMarginEr\":2000000,\"maintenanceMargin\":\"1.5%\",\"maintenanceMarginEr\":1500000},\n        //         ],\n        //         \"underlyingSymbol\":\".BTC\",\n        //         \"baseCurrency\":\"BTC\",\n        //         \"settlementCurrency\":\"BTC\",\n        //         \"valueScale\":8,\n        //         \"defaultLeverage\":0,\n        //         \"maxLeverage\":100,\n        //         \"initMarginEr\":\"1000000\",\n        //         \"maintMarginEr\":\"500000\",\n        //         \"defaultRiskLimitEv\":10000000000,\n        //         \"deleverage\":true,\n        //         \"makerFeeRateEr\":-250000,\n        //         \"takerFeeRateEr\":750000,\n        //         \"fundingInterval\":8,\n        //         \"marketUrl\":\"https://phemex.com/trade/BTCUSD\",\n        //         \"description\":\"BTCUSD is a BTC/USD perpetual contract priced on the .BTC Index. Each contract is worth 1 USD of Bitcoin. Funding is paid and received every 8 hours. At UTC time: 00:00, 08:00, 16:00.\",\n        //     }\n        //\n        const id = this.safeString (market, 'symbol');\n        const contractUnderlyingAssets = this.safeString (market, 'contractUnderlyingAssets');\n        const baseId = this.safeString (market, 'baseCurrency', contractUnderlyingAssets);\n        const quoteId = this.safeString (market, 'quoteCurrency');\n        const settleId = this.safeString (market, 'settleCurrency');\n        let base = this.safeCurrencyCode (baseId);\n        base = base.replace (' ', ''); // replace space for junction codes, eg. `1000 SHIB`\n        const quote = this.safeCurrencyCode (quoteId);\n        const settle = this.safeCurrencyCode (settleId);\n        let inverse = false;\n        if (settleId !== quoteId) {\n            inverse = true;\n            // some unhandled cases\n            if (!('baseCurrency' in market) && base === quote) {\n                base = settle;\n            }\n        }\n        const priceScale = this.safeInteger (market, 'priceScale');\n        const ratioScale = this.safeInteger (market, 'ratioScale');\n        const valueScale = this.safeInteger (market, 'valueScale');\n        const minPriceEp = this.safeString (market, 'minPriceEp');\n        const maxPriceEp = this.safeString (market, 'maxPriceEp');\n        const makerFeeRateEr = this.safeString (market, 'makerFeeRateEr');\n        const takerFeeRateEr = this.safeString (market, 'takerFeeRateEr');\n        const status = this.safeString (market, 'status');\n        const contractSizeString = this.safeString (market, 'contractSize', ' ');\n        let contractSize: Num = undefined;\n        if (settle === 'USDT') {\n            contractSize = this.parseNumber ('1');\n        } else if (contractSizeString.indexOf (' ')) {\n            // \"1 USD\"\n            // \"0.005 ETH\"\n            const parts = contractSizeString.split (' ');\n            contractSize = this.parseNumber (parts[0]);\n        } else {\n            // \"1.0\"\n            contractSize = this.parseNumber (contractSizeString);\n        }\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': base + '/' + quote + ':' + settle,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': 'swap',\n            'spot': false,\n            'margin': false,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': status === 'Listed',\n            'contract': true,\n            'linear': !inverse,\n            'inverse': inverse,\n            'taker': this.parseNumber (this.fromEn (takerFeeRateEr, ratioScale)),\n            'maker': this.parseNumber (this.fromEn (makerFeeRateEr, ratioScale)),\n            'contractSize': contractSize,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'priceScale': priceScale,\n            'valueScale': valueScale,\n            'ratioScale': ratioScale,\n            'precision': {\n                'amount': this.safeNumber2 (market, 'lotSize', 'qtyStepSize'),\n                'price': this.safeNumber (market, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': this.safeNumber (market, 'maxLeverage'),\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.parseNumber (this.fromEn (minPriceEp, priceScale)),\n                    'max': this.parseNumber (this.fromEn (maxPriceEp, priceScale)),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': this.parseNumber (this.safeString (market, 'maxOrderQty')),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseSwapOrder",
        "signature": "parseSwapOrder (order, market: Market = undefined)",
        "line_start": 2451,
        "line_end": 2630,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfit",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLoss",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"bizError\":0,\n         \"orderID\":\"7a1ad384-44a3-4e54-a102-de4195a29e32\",\n         \"clOrdID\":\"\",\n         \"symbol\":\"ETHUSD\",\n         \"side\":\"Buy\",\n         \"actionTimeNs\":1592668973945065381,\n         \"transactTimeNs\":0,\n         \"orderType\":\"Market\",\n         \"priceEp\":2267500,\n         \"price\":226.75000000,\n         \"orderQty\":1,\n         \"displayQty\":0,\n         \"timeInForce\":\"ImmediateOrCancel\",\n         \"reduceOnly\":false,\n         \"closedPnlEv\":0,\n         \"closedPnl\":0E-8,\n         \"closedSize\":0,\n         \"cumQty\":0,\n         \"cumValueEv\":0,\n         \"cumValue\":0E-8,\n         \"leavesQty\":1,\n         \"leavesValueEv\":11337,\n         \"leavesValue\":1.13370000,\n         \"stopDirection\":\"UNSPECIFIED\",\n         \"stopPxEp\":0,\n         \"stopPx\":0E-8,\n         \"trigger\":\"UNSPECIFIED\",\n         \"pegOffsetValueEp\":0,\n         \"execStatus\":\"PendingNew\",\n         \"pegPriceType\":\"UNSPECIFIED\",\n         \"ordStatus\":\"Created\",\n         \"execInst\": \"ReduceOnly\"\n     }",
          "{\n        \"bizError\":\"0\",\n        \"orderID\":\"bd720dff-5647-4596-aa4e-656bac87aaad\",\n        \"clOrdID\":\"ccxt2022843dffac9477b497\",\n        \"symbol\":\"LTCUSDT\",\n        \"side\":\"Buy\",\n        \"actionTimeNs\":\"1677667878751724052\",\n        \"transactTimeNs\":\"1677667878754017434\",\n        \"orderType\":\"Limit\",\n        \"priceRp\":\"40\",\n        \"orderQtyRq\":\"0.1\",\n        \"displayQtyRq\":\"0.1\",\n        \"timeInForce\":\"GoodTillCancel\",\n        \"reduceOnly\":false,\n        \"closedPnlRv\":\"0\",\n        \"closedSizeRq\":\"0\",\n        \"cumQtyRq\":\"0\",\n        \"cumValueRv\":\"0\",\n        \"leavesQtyRq\":\"0.1\",\n        \"leavesValueRv\":\"4\",\n        \"stopDirection\":\"UNSPECIFIED\",\n        \"stopPxRp\":\"0\",\n        \"trigger\":\"UNSPECIFIED\",\n        \"pegOffsetValueRp\":\"0\",\n        \"pegOffsetProportionRr\":\"0\",\n        \"execStatus\":\"New\",\n        \"pegPriceType\":\"UNSPECIFIED\",\n        \"ordStatus\":\"New\",\n        \"execInst\":\"None\",\n        \"takeProfitRp\":\"0\",\n        \"stopLossRp\":\"0\"\n     }",
          "{\n        \"createdAt\":\"1677686231301\",\n        \"symbol\":\"LTCUSDT\",\n        \"orderQtyRq\":\"0.2\",\n        \"side\":\"1\",\n        \"posSide\":\"3\",\n        \"priceRp\":\"50\",\n        \"execQtyRq\":\"0\",\n        \"leavesQtyRq\":\"0.2\",\n        \"execPriceRp\":\"0\",\n        \"orderValueRv\":\"10\",\n        \"leavesValueRv\":\"10\",\n        \"cumValueRv\":\"0\",\n        \"stopDirection\":\"0\",\n        \"stopPxRp\":\"0\",\n        \"trigger\":\"0\",\n        \"actionBy\":\"1\",\n        \"execFeeRv\":\"0\",\n        \"ordType\":\"2\",\n        \"ordStatus\":\"5\",\n        \"clOrdId\":\"4b3b188\",\n        \"orderId\":\"4b3b1884-87cf-4897-b596-6693b7ed84d1\",\n        \"execStatus\":\"5\",\n        \"bizError\":\"0\",\n        \"totalPnlRv\":null,\n        \"avgTransactPriceRp\":null,\n        \"orderDetailsVos\":null,\n        \"tradeType\":\"0\"\n    }"
        ],
        "source": "parseSwapOrder (order, market: Market = undefined) {\n        //\n        //     {\n        //         \"bizError\":0,\n        //         \"orderID\":\"7a1ad384-44a3-4e54-a102-de4195a29e32\",\n        //         \"clOrdID\":\"\",\n        //         \"symbol\":\"ETHUSD\",\n        //         \"side\":\"Buy\",\n        //         \"actionTimeNs\":1592668973945065381,\n        //         \"transactTimeNs\":0,\n        //         \"orderType\":\"Market\",\n        //         \"priceEp\":2267500,\n        //         \"price\":226.75000000,\n        //         \"orderQty\":1,\n        //         \"displayQty\":0,\n        //         \"timeInForce\":\"ImmediateOrCancel\",\n        //         \"reduceOnly\":false,\n        //         \"closedPnlEv\":0,\n        //         \"closedPnl\":0E-8,\n        //         \"closedSize\":0,\n        //         \"cumQty\":0,\n        //         \"cumValueEv\":0,\n        //         \"cumValue\":0E-8,\n        //         \"leavesQty\":1,\n        //         \"leavesValueEv\":11337,\n        //         \"leavesValue\":1.13370000,\n        //         \"stopDirection\":\"UNSPECIFIED\",\n        //         \"stopPxEp\":0,\n        //         \"stopPx\":0E-8,\n        //         \"trigger\":\"UNSPECIFIED\",\n        //         \"pegOffsetValueEp\":0,\n        //         \"execStatus\":\"PendingNew\",\n        //         \"pegPriceType\":\"UNSPECIFIED\",\n        //         \"ordStatus\":\"Created\",\n        //         \"execInst\": \"ReduceOnly\"\n        //     }\n        //\n        // usdt\n        // {\n        //        \"bizError\":\"0\",\n        //        \"orderID\":\"bd720dff-5647-4596-aa4e-656bac87aaad\",\n        //        \"clOrdID\":\"ccxt2022843dffac9477b497\",\n        //        \"symbol\":\"LTCUSDT\",\n        //        \"side\":\"Buy\",\n        //        \"actionTimeNs\":\"1677667878751724052\",\n        //        \"transactTimeNs\":\"1677667878754017434\",\n        //        \"orderType\":\"Limit\",\n        //        \"priceRp\":\"40\",\n        //        \"orderQtyRq\":\"0.1\",\n        //        \"displayQtyRq\":\"0.1\",\n        //        \"timeInForce\":\"GoodTillCancel\",\n        //        \"reduceOnly\":false,\n        //        \"closedPnlRv\":\"0\",\n        //        \"closedSizeRq\":\"0\",\n        //        \"cumQtyRq\":\"0\",\n        //        \"cumValueRv\":\"0\",\n        //        \"leavesQtyRq\":\"0.1\",\n        //        \"leavesValueRv\":\"4\",\n        //        \"stopDirection\":\"UNSPECIFIED\",\n        //        \"stopPxRp\":\"0\",\n        //        \"trigger\":\"UNSPECIFIED\",\n        //        \"pegOffsetValueRp\":\"0\",\n        //        \"pegOffsetProportionRr\":\"0\",\n        //        \"execStatus\":\"New\",\n        //        \"pegPriceType\":\"UNSPECIFIED\",\n        //        \"ordStatus\":\"New\",\n        //        \"execInst\":\"None\",\n        //        \"takeProfitRp\":\"0\",\n        //        \"stopLossRp\":\"0\"\n        //     }\n        //\n        // v2 orderList\n        //    {\n        //        \"createdAt\":\"1677686231301\",\n        //        \"symbol\":\"LTCUSDT\",\n        //        \"orderQtyRq\":\"0.2\",\n        //        \"side\":\"1\",\n        //        \"posSide\":\"3\",\n        //        \"priceRp\":\"50\",\n        //        \"execQtyRq\":\"0\",\n        //        \"leavesQtyRq\":\"0.2\",\n        //        \"execPriceRp\":\"0\",\n        //        \"orderValueRv\":\"10\",\n        //        \"leavesValueRv\":\"10\",\n        //        \"cumValueRv\":\"0\",\n        //        \"stopDirection\":\"0\",\n        //        \"stopPxRp\":\"0\",\n        //        \"trigger\":\"0\",\n        //        \"actionBy\":\"1\",\n        //        \"execFeeRv\":\"0\",\n        //        \"ordType\":\"2\",\n        //        \"ordStatus\":\"5\",\n        //        \"clOrdId\":\"4b3b188\",\n        //        \"orderId\":\"4b3b1884-87cf-4897-b596-6693b7ed84d1\",\n        //        \"execStatus\":\"5\",\n        //        \"bizError\":\"0\",\n        //        \"totalPnlRv\":null,\n        //        \"avgTransactPriceRp\":null,\n        //        \"orderDetailsVos\":null,\n        //        \"tradeType\":\"0\"\n        //    }\n        //\n        const id = this.safeString2 (order, 'orderID', 'orderId');\n        let clientOrderId = this.safeString2 (order, 'clOrdID', 'clOrdId');\n        if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {\n            clientOrderId = undefined;\n        }\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        market = this.safeMarket (marketId, market);\n        const status = this.parseOrderStatus (this.safeString (order, 'ordStatus'));\n        const side = this.parseOrderSide (this.safeStringLower (order, 'side'));\n        const type = this.parseOrderType (this.safeString (order, 'orderType'));\n        let price = this.safeString (order, 'priceRp');\n        if (price === undefined) {\n            price = this.fromEp (this.safeString (order, 'priceEp'), market);\n        }\n        const amount = this.safeNumber2 (order, 'orderQty', 'orderQtyRq');\n        const filled = this.safeNumber2 (order, 'cumQty', 'cumQtyRq');\n        const remaining = this.safeNumber2 (order, 'leavesQty', 'leavesQtyRq');\n        let timestamp = this.safeIntegerProduct (order, 'actionTimeNs', 0.000001);\n        if (timestamp === undefined) {\n            timestamp = this.safeInteger (order, 'createdAt');\n        }\n        const cost = this.safeNumber2 (order, 'cumValue', 'cumValueRv');\n        let lastTradeTimestamp = this.safeIntegerProduct (order, 'transactTimeNs', 0.000001);\n        if (lastTradeTimestamp === 0) {\n            lastTradeTimestamp = undefined;\n        }\n        const timeInForce = this.parseTimeInForce (this.safeString (order, 'timeInForce'));\n        const triggerPrice = this.omitZero (this.safeString2 (order, 'stopPx', 'stopPxRp'));\n        const postOnly = (timeInForce === 'PO');\n        let reduceOnly = this.safeValue (order, 'reduceOnly');\n        const execInst = this.safeString (order, 'execInst');\n        if (execInst === 'ReduceOnly') {\n            reduceOnly = true;\n        }\n        const takeProfit = this.safeString (order, 'takeProfitRp');\n        const stopLoss = this.safeString (order, 'stopLossRp');\n        const feeValue = this.omitZero (this.safeString (order, 'execFeeRv'));\n        const ptFeeRv = this.omitZero (this.safeString (order, 'ptFeeRv'));\n        let fee = undefined;\n        if (feeValue !== undefined) {\n            fee = {\n                'cost': feeValue,\n                'currency': market['quote'],\n            };\n        } else if (ptFeeRv !== undefined) {\n            fee = {\n                'cost': ptFeeRv,\n                'currency': 'PT',\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'datetime': this.iso8601 (timestamp),\n            'timestamp': timestamp,\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': reduceOnly,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfit,\n            'stopLossPrice': stopLoss,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'cost': cost,\n            'average': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1463,
        "line_end": 1550,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.fromEp (this.safeString2 (ticker, 'highEp', 'highRp'), market)",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.fromEp (this.safeString2 (ticker, 'lowEp', 'lowRp'), market)",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.fromEp (this.safeString (ticker, 'bidEp'), market)",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.fromEp (this.safeString (ticker, 'askEp'), market)",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"askEp\": 943836000000,\n         \"bidEp\": 943601000000,\n         \"highEp\": 955946000000,\n         \"lastEp\": 943803000000,\n         \"lowEp\": 924973000000,\n         \"openEp\": 948693000000,\n         \"symbol\": \"sBTCUSDT\",\n         \"timestamp\": 1592471203505728630,\n         \"turnoverEv\": 111822826123103,\n         \"volumeEv\": 11880532281\n     }",
          "{\n         \"askEp\": 2332500,\n         \"bidEp\": 2331000,\n         \"fundingRateEr\": 10000,\n         \"highEp\": 2380000,\n         \"indexEp\": 2329057,\n         \"lastEp\": 2331500,\n         \"lowEp\": 2274000,\n         \"markEp\": 2329232,\n         \"openEp\": 2337500,\n         \"openInterest\": 1298050,\n         \"predFundingRateEr\": 19921,\n         \"symbol\": \"ETHUSD\",\n         \"timestamp\": 1592474241582701416,\n         \"turnoverEv\": 47228362330,\n         \"volume\": 4053863\n     }",
          "{\n         \"closeRp\":\"16820.5\",\n         \"fundingRateRr\":\"0.0001\",\n         \"highRp\":\"16962.1\",\n         \"indexPriceRp\":\"16830.15651565\",\n         \"lowRp\":\"16785\",\n         \"markPriceRp\":\"16830.97534951\",\n         \"openInterestRv\":\"1323.596\",\n         \"openRp\":\"16851.7\",\n         \"predFundingRateRr\":\"0.0001\",\n         \"symbol\":\"BTCUSDT\",\n         \"timestamp\":\"1672142789065593096\",\n         \"turnoverRv\":\"124835296.0538\",\n         \"volumeRq\":\"7406.95\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // spot\n        //\n        //     {\n        //         \"askEp\": 943836000000,\n        //         \"bidEp\": 943601000000,\n        //         \"highEp\": 955946000000,\n        //         \"lastEp\": 943803000000,\n        //         \"lowEp\": 924973000000,\n        //         \"openEp\": 948693000000,\n        //         \"symbol\": \"sBTCUSDT\",\n        //         \"timestamp\": 1592471203505728630,\n        //         \"turnoverEv\": 111822826123103,\n        //         \"volumeEv\": 11880532281\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"askEp\": 2332500,\n        //         \"bidEp\": 2331000,\n        //         \"fundingRateEr\": 10000,\n        //         \"highEp\": 2380000,\n        //         \"indexEp\": 2329057,\n        //         \"lastEp\": 2331500,\n        //         \"lowEp\": 2274000,\n        //         \"markEp\": 2329232,\n        //         \"openEp\": 2337500,\n        //         \"openInterest\": 1298050,\n        //         \"predFundingRateEr\": 19921,\n        //         \"symbol\": \"ETHUSD\",\n        //         \"timestamp\": 1592474241582701416,\n        //         \"turnoverEv\": 47228362330,\n        //         \"volume\": 4053863\n        //     }\n        // linear swap v2\n        //\n        //     {\n        //         \"closeRp\":\"16820.5\",\n        //         \"fundingRateRr\":\"0.0001\",\n        //         \"highRp\":\"16962.1\",\n        //         \"indexPriceRp\":\"16830.15651565\",\n        //         \"lowRp\":\"16785\",\n        //         \"markPriceRp\":\"16830.97534951\",\n        //         \"openInterestRv\":\"1323.596\",\n        //         \"openRp\":\"16851.7\",\n        //         \"predFundingRateRr\":\"0.0001\",\n        //         \"symbol\":\"BTCUSDT\",\n        //         \"timestamp\":\"1672142789065593096\",\n        //         \"turnoverRv\":\"124835296.0538\",\n        //         \"volumeRq\":\"7406.95\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const timestamp = this.safeIntegerProduct (ticker, 'timestamp', 0.000001);\n        const last = this.fromEp (this.safeString2 (ticker, 'lastEp', 'closeRp'), market);\n        const quoteVolume = this.fromEr (this.safeString2 (ticker, 'turnoverEv', 'turnoverRv'), market);\n        let baseVolume = this.safeString (ticker, 'volume');\n        if (baseVolume === undefined) {\n            baseVolume = this.fromEv (this.safeString2 (ticker, 'volumeEv', 'volumeRq'), market);\n        }\n        const open = this.fromEp (this.safeString (ticker, 'openEp'), market);\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.fromEp (this.safeString2 (ticker, 'highEp', 'highRp'), market),\n            'low': this.fromEp (this.safeString2 (ticker, 'lowEp', 'lowRp'), market),\n            'bid': this.fromEp (this.safeString (ticker, 'bidEp'), market),\n            'bidVolume': undefined,\n            'ask': this.fromEp (this.safeString (ticker, 'askEp'), market),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined, // previous day close\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 2322,
        "line_end": 2330,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'GoodTillCancel': 'GTC',\n            'PostOnly': 'PO',\n            'ImmediateOrCancel': 'IOC',\n            'FillOrKill': 'FOK',\n        };\n        return this.safeString (timeInForces, timeInForce, timeInForce);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1707,
        "line_end": 2004,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "[\n         1592541746712239749,\n         13156448570000,\n         \"Buy\",\n         93070000,\n         40173\n     ]",
          "[\n         1675690986063435800,\n         \"Sell\",\n         \"22857.4\",\n         \"0.269\"\n     ]",
          "{\n         \"qtyType\": \"ByQuote\",\n         \"transactTimeNs\": 1589450974800550100,\n         \"clOrdID\": \"8ba59d40-df25-d4b0-14cf-0703f44e9690\",\n         \"orderID\": \"b2b7018d-f02f-4c59-b4cf-051b9c2d2e83\",\n         \"symbol\": \"sBTCUSDT\",\n         \"side\": \"Buy\",\n         \"priceEP\": 970056000000,\n         \"baseQtyEv\": 0,\n         \"quoteQtyEv\": 1000000000,\n         \"action\": \"New\",\n         \"execStatus\": \"MakerFill\",\n         \"ordStatus\": \"Filled\",\n         \"ordType\": \"Limit\",\n         \"execInst\": \"None\",\n         \"timeInForce\": \"GoodTillCancel\",\n         \"stopDirection\": \"UNSPECIFIED\",\n         \"tradeType\": \"Trade\",\n         \"stopPxEp\": 0,\n         \"execId\": \"c6bd8979-07ba-5946-b07e-f8b65135dbb1\",\n         \"execPriceEp\": 970056000000,\n         \"execBaseQtyEv\": 103000,\n         \"execQuoteQtyEv\": 999157680,\n         \"leavesBaseQtyEv\": 0,\n         \"leavesQuoteQtyEv\": 0,\n         \"execFeeEv\": 0,\n         \"feeRateEr\": 0\n         \"baseCurrency\": \"BTC\",\n         \"quoteCurrency\": \"USDT\",\n         \"feeCurrency\": \"BTC\"\n     }",
          "{\n         \"transactTimeNs\": 1578026629824704800,\n         \"symbol\": \"BTCUSD\",\n         \"currency\": \"BTC\",\n         \"action\": \"Replace\",\n         \"side\": \"Sell\",\n         \"tradeType\": \"Trade\",\n         \"execQty\": 700,\n         \"execPriceEp\": 71500000,\n         \"orderQty\": 700,\n         \"priceEp\": 71500000,\n         \"execValueEv\": 9790209,\n         \"feeRateEr\": -25000,\n         \"execFeeEv\": -2447,\n         \"ordType\": \"Limit\",\n         \"execID\": \"b01671a1-5ddc-5def-b80a-5311522fd4bf\",\n         \"orderID\": \"b63bc982-be3a-45e0-8974-43d6375fb626\",\n         \"clOrdID\": \"uuid-1577463487504\",\n         \"execStatus\": \"MakerFill\"\n     }",
          "{\n         \"accountID\": 9328670003,\n         \"action\": \"New\",\n         \"actionBy\": \"ByUser\",\n         \"actionTimeNs\": 1666858780876924611,\n         \"addedSeq\": 77751555,\n         \"apRp\": \"0\",\n         \"bonusChangedAmountRv\": \"0\",\n         \"bpRp\": \"0\",\n         \"clOrdID\": \"c0327a7d-9064-62a9-28f6-2db9aaaa04e0\",\n         \"closedPnlRv\": \"0\",\n         \"closedSize\": \"0\",\n         \"code\": 0,\n         \"cumFeeRv\": \"0\",\n         \"cumQty\": \"0\",\n         \"cumValueRv\": \"0\",\n         \"curAccBalanceRv\": \"1508.489893982237\",\n         \"curAssignedPosBalanceRv\": \"24.62786650928\",\n         \"curBonusBalanceRv\": \"0\",\n         \"curLeverageRr\": \"-10\",\n         \"curPosSide\": \"Buy\",\n         \"curPosSize\": \"0.043\",\n         \"curPosTerm\": 1,\n         \"curPosValueRv\": \"894.0689\",\n         \"curRiskLimitRv\": \"1000000\",\n         \"currency\": \"USDT\",\n         \"cxlRejReason\": 0,\n         \"displayQty\": \"0.003\",\n         \"execFeeRv\": \"0\",\n         \"execID\": \"00000000-0000-0000-0000-000000000000\",\n         \"execPriceRp\": \"20723.7\",\n         \"execQty\": \"0\",\n         \"execSeq\": 77751555,\n         \"execStatus\": \"New\",\n         \"execValueRv\": \"0\",\n         \"feeRateRr\": \"0\",\n         \"leavesQty\": \"0.003\",\n         \"leavesValueRv\": \"63.4503\",\n         \"message\": \"No error\",\n         \"ordStatus\": \"New\",\n         \"ordType\": \"Market\",\n         \"orderID\": \"fa64c6f2-47a4-4929-aab4-b7fa9bbc4323\",\n         \"orderQty\": \"0.003\",\n         \"pegOffsetValueRp\": \"0\",\n         \"posSide\": \"Long\",\n         \"priceRp\": \"21150.1\",\n         \"relatedPosTerm\": 1,\n         \"relatedReqNum\": 11,\n         \"side\": \"Buy\",\n         \"slTrigger\": \"ByMarkPrice\",\n         \"stopLossRp\": \"0\",\n         \"stopPxRp\": \"0\",\n         \"symbol\": \"BTCUSDT\",\n         \"takeProfitRp\": \"0\",\n         \"timeInForce\": \"ImmediateOrCancel\",\n         \"tpTrigger\": \"ByLastPrice\",\n         \"tradeType\": \"Amend\",\n         \"transactTimeNs\": 1666858780881545305,\n         \"userID\": 932867\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public) spot & contract\n        //\n        //     [\n        //         1592541746712239749,\n        //         13156448570000,\n        //         \"Buy\",\n        //         93070000,\n        //         40173\n        //     ]\n        //\n        // fetchTrades (public) perp\n        //\n        //     [\n        //         1675690986063435800,\n        //         \"Sell\",\n        //         \"22857.4\",\n        //         \"0.269\"\n        //     ]\n        //\n        // fetchMyTrades (private)\n        //\n        // spot\n        //\n        //     {\n        //         \"qtyType\": \"ByQuote\",\n        //         \"transactTimeNs\": 1589450974800550100,\n        //         \"clOrdID\": \"8ba59d40-df25-d4b0-14cf-0703f44e9690\",\n        //         \"orderID\": \"b2b7018d-f02f-4c59-b4cf-051b9c2d2e83\",\n        //         \"symbol\": \"sBTCUSDT\",\n        //         \"side\": \"Buy\",\n        //         \"priceEP\": 970056000000,\n        //         \"baseQtyEv\": 0,\n        //         \"quoteQtyEv\": 1000000000,\n        //         \"action\": \"New\",\n        //         \"execStatus\": \"MakerFill\",\n        //         \"ordStatus\": \"Filled\",\n        //         \"ordType\": \"Limit\",\n        //         \"execInst\": \"None\",\n        //         \"timeInForce\": \"GoodTillCancel\",\n        //         \"stopDirection\": \"UNSPECIFIED\",\n        //         \"tradeType\": \"Trade\",\n        //         \"stopPxEp\": 0,\n        //         \"execId\": \"c6bd8979-07ba-5946-b07e-f8b65135dbb1\",\n        //         \"execPriceEp\": 970056000000,\n        //         \"execBaseQtyEv\": 103000,\n        //         \"execQuoteQtyEv\": 999157680,\n        //         \"leavesBaseQtyEv\": 0,\n        //         \"leavesQuoteQtyEv\": 0,\n        //         \"execFeeEv\": 0,\n        //         \"feeRateEr\": 0\n        //         \"baseCurrency\": \"BTC\",\n        //         \"quoteCurrency\": \"USDT\",\n        //         \"feeCurrency\": \"BTC\"\n        //     }\n        //\n        // swap\n        //\n        //     {\n        //         \"transactTimeNs\": 1578026629824704800,\n        //         \"symbol\": \"BTCUSD\",\n        //         \"currency\": \"BTC\",\n        //         \"action\": \"Replace\",\n        //         \"side\": \"Sell\",\n        //         \"tradeType\": \"Trade\",\n        //         \"execQty\": 700,\n        //         \"execPriceEp\": 71500000,\n        //         \"orderQty\": 700,\n        //         \"priceEp\": 71500000,\n        //         \"execValueEv\": 9790209,\n        //         \"feeRateEr\": -25000,\n        //         \"execFeeEv\": -2447,\n        //         \"ordType\": \"Limit\",\n        //         \"execID\": \"b01671a1-5ddc-5def-b80a-5311522fd4bf\",\n        //         \"orderID\": \"b63bc982-be3a-45e0-8974-43d6375fb626\",\n        //         \"clOrdID\": \"uuid-1577463487504\",\n        //         \"execStatus\": \"MakerFill\"\n        //     }\n        // perpetual\n        //     {\n        //         \"accountID\": 9328670003,\n        //         \"action\": \"New\",\n        //         \"actionBy\": \"ByUser\",\n        //         \"actionTimeNs\": 1666858780876924611,\n        //         \"addedSeq\": 77751555,\n        //         \"apRp\": \"0\",\n        //         \"bonusChangedAmountRv\": \"0\",\n        //         \"bpRp\": \"0\",\n        //         \"clOrdID\": \"c0327a7d-9064-62a9-28f6-2db9aaaa04e0\",\n        //         \"closedPnlRv\": \"0\",\n        //         \"closedSize\": \"0\",\n        //         \"code\": 0,\n        //         \"cumFeeRv\": \"0\",\n        //         \"cumQty\": \"0\",\n        //         \"cumValueRv\": \"0\",\n        //         \"curAccBalanceRv\": \"1508.489893982237\",\n        //         \"curAssignedPosBalanceRv\": \"24.62786650928\",\n        //         \"curBonusBalanceRv\": \"0\",\n        //         \"curLeverageRr\": \"-10\",\n        //         \"curPosSide\": \"Buy\",\n        //         \"curPosSize\": \"0.043\",\n        //         \"curPosTerm\": 1,\n        //         \"curPosValueRv\": \"894.0689\",\n        //         \"curRiskLimitRv\": \"1000000\",\n        //         \"currency\": \"USDT\",\n        //         \"cxlRejReason\": 0,\n        //         \"displayQty\": \"0.003\",\n        //         \"execFeeRv\": \"0\",\n        //         \"execID\": \"00000000-0000-0000-0000-000000000000\",\n        //         \"execPriceRp\": \"20723.7\",\n        //         \"execQty\": \"0\",\n        //         \"execSeq\": 77751555,\n        //         \"execStatus\": \"New\",\n        //         \"execValueRv\": \"0\",\n        //         \"feeRateRr\": \"0\",\n        //         \"leavesQty\": \"0.003\",\n        //         \"leavesValueRv\": \"63.4503\",\n        //         \"message\": \"No error\",\n        //         \"ordStatus\": \"New\",\n        //         \"ordType\": \"Market\",\n        //         \"orderID\": \"fa64c6f2-47a4-4929-aab4-b7fa9bbc4323\",\n        //         \"orderQty\": \"0.003\",\n        //         \"pegOffsetValueRp\": \"0\",\n        //         \"posSide\": \"Long\",\n        //         \"priceRp\": \"21150.1\",\n        //         \"relatedPosTerm\": 1,\n        //         \"relatedReqNum\": 11,\n        //         \"side\": \"Buy\",\n        //         \"slTrigger\": \"ByMarkPrice\",\n        //         \"stopLossRp\": \"0\",\n        //         \"stopPxRp\": \"0\",\n        //         \"symbol\": \"BTCUSDT\",\n        //         \"takeProfitRp\": \"0\",\n        //         \"timeInForce\": \"ImmediateOrCancel\",\n        //         \"tpTrigger\": \"ByLastPrice\",\n        //         \"tradeType\": \"Amend\",\n        //         \"transactTimeNs\": 1666858780881545305,\n        //         \"userID\": 932867\n        //     }\n        //\n        // swap - USDT\n        //\n        //     {\n        //         \"createdAt\": 1666226932259,\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"currency\": \"USDT\",\n        //         \"action\": 1,\n        //         \"tradeType\": 1,\n        //         \"execQtyRq\": \"0.01\",\n        //         \"execPriceRp\": \"1271.9\",\n        //         \"side\": 1,\n        //         \"orderQtyRq\": \"0.78\",\n        //         \"priceRp\": \"1271.9\",\n        //         \"execValueRv\": \"12.719\",\n        //         \"feeRateRr\": \"0.0001\",\n        //         \"execFeeRv\": \"0.0012719\",\n        //         \"ordType\": 2,\n        //         \"execId\": \"8718cae\",\n        //         \"execStatus\": 6\n        //     }\n        // spot with fees paid using PT token\n        //     \"createdAt\": \"1714990724076\",\n        //     \"symbol\": \"BTCUSDT\",\n        //     \"currency\": \"USDT\",\n        //     \"action\": \"1\",\n        //     \"tradeType\": \"1\",\n        //     \"execQtyRq\": \"0.003\",\n        //     \"execPriceRp\": \"64935\",\n        //     \"side\": \"2\",\n        //     \"orderQtyRq\": \"0.003\",\n        //     \"priceRp\": \"51600\",\n        //     \"execValueRv\": \"194.805\",\n        //     \"feeRateRr\": \"0.000495\",\n        //     \"execFeeRv\": \"0\",\n        //     \"ordType\": \"3\",\n        //     \"execId\": \"XXXXXX\",\n        //     \"execStatus\": \"7\",\n        //     \"posSide\": \"1\",\n        //     \"ptFeeRv\": \"0.110012249248\",\n        //     \"ptPriceRp\": \"0.876524893\"\n        //\n        let priceString: Str;\n        let amountString: Str;\n        let timestamp: Int;\n        let id: Str = undefined;\n        let side: Str = undefined;\n        let costString: Str = undefined;\n        let type: Str = undefined;\n        let fee = undefined;\n        let feeCostString: Str = undefined;\n        let feeRateString: Str = undefined;\n        let feeCurrencyCode: Str = undefined;\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        let orderId: Str = undefined;\n        let takerOrMaker: Str = undefined;\n        if (Array.isArray (trade)) {\n            const tradeLength = trade.length;\n            timestamp = this.safeIntegerProduct (trade, 0, 0.000001);\n            if (tradeLength > 4) {\n                id = this.safeString (trade, tradeLength - 4);\n            }\n            side = this.safeStringLower (trade, tradeLength - 3);\n            priceString = this.safeString (trade, tradeLength - 2);\n            amountString = this.safeString (trade, tradeLength - 1);\n            if (typeof trade[tradeLength - 2] === 'number') {\n                priceString = this.fromEp (priceString, market);\n                amountString = this.fromEv (amountString, market);\n            }\n        } else {\n            timestamp = this.safeIntegerProduct (trade, 'transactTimeNs', 0.000001);\n            if (timestamp === undefined) {\n                timestamp = this.safeInteger (trade, 'createdAt');\n            }\n            id = this.safeString2 (trade, 'execId', 'execID');\n            orderId = this.safeString (trade, 'orderID');\n            if (market['settle'] === 'USDT' || market['settle'] === 'USDC') {\n                const sideId = this.safeStringLower (trade, 'side');\n                if ((sideId === 'buy') || (sideId === 'sell')) {\n                    side = sideId;\n                } else if (sideId !== undefined) {\n                    side = (sideId === '1') ? 'buy' : 'sell';\n                }\n                const ordType = this.safeString (trade, 'ordType');\n                if (ordType === '1') {\n                    type = 'market';\n                } else if (ordType === '2') {\n                    type = 'limit';\n                }\n                priceString = this.safeString (trade, 'execPriceRp');\n                amountString = this.safeString (trade, 'execQtyRq');\n                costString = this.safeString (trade, 'execValueRv');\n                feeCostString = this.omitZero (this.safeString (trade, 'execFeeRv'));\n                feeRateString = this.safeString (trade, 'feeRateRr');\n                if (feeCostString !== undefined) {\n                    const currencyId = this.safeString (trade, 'currency');\n                    feeCurrencyCode = this.safeCurrencyCode (currencyId);\n                } else {\n                    const ptFeeRv = this.omitZero (this.safeString (trade, 'ptFeeRv'));\n                    if (ptFeeRv !== undefined) {\n                        feeCostString = ptFeeRv;\n                        feeCurrencyCode = 'PT';\n                    }\n                }\n            } else {\n                side = this.safeStringLower (trade, 'side');\n                type = this.parseOrderType (this.safeString (trade, 'ordType'));\n                const execStatus = this.safeString (trade, 'execStatus');\n                if (execStatus === 'MakerFill') {\n                    takerOrMaker = 'maker';\n                }\n                priceString = this.fromEp (this.safeString (trade, 'execPriceEp'), market);\n                amountString = this.fromEv (this.safeString (trade, 'execBaseQtyEv'), market);\n                amountString = this.safeString (trade, 'execQty', amountString);\n                costString = this.fromEr (this.safeString2 (trade, 'execQuoteQtyEv', 'execValueEv'), market);\n                feeCostString = this.fromEr (this.omitZero (this.safeString (trade, 'execFeeEv')), market);\n                if (feeCostString !== undefined) {\n                    feeRateString = this.fromEr (this.safeString (trade, 'feeRateEr'), market);\n                    if (market['spot']) {\n                        feeCurrencyCode = this.safeCurrencyCode (this.safeString (trade, 'feeCurrency'));\n                    } else {\n                        const info = this.safeValue (market, 'info');\n                        if (info !== undefined) {\n                            const settlementCurrencyId = this.safeString (info, 'settlementCurrency');\n                            feeCurrencyCode = this.safeCurrencyCode (settlementCurrencyId);\n                        }\n                    }\n                } else {\n                    feeCostString = this.safeString (trade, 'ptFeeRv');\n                    if (feeCostString !== undefined) {\n                        feeCurrencyCode = 'PT';\n                    }\n                }\n            }\n            fee = {\n                'cost': feeCostString,\n                'rate': feeRateString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'order': orderId,\n            'type': type,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 3682,
        "line_end": 3799,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": \"10000001\",\n        //         \"freezeId\": null,\n        //         \"address\": \"44exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n        //         \"amountRv\": \"100\",\n        //         \"chainCode\": \"11\",\n        //         \"chainName\": \"TRX\",\n        //         \"currency\": \"USDT\",\n        //         \"currencyCode\": 3,\n        //         \"email\": \"abc@gmail.com\",\n        //         \"expiredTime\": \"0\",\n        //         \"feeRv\": \"1\",\n        //         \"nickName\": null,\n        //         \"phone\": null,\n        //         \"rejectReason\": \"\",\n        //         \"submitedAt\": \"1670000000000\",\n        //         \"submittedAt\": \"1670000000000\",\n        //         \"txHash\": null,\n        //         \"userId\": \"10000001\",\n        //         \"status\": \"Success\"\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": \"29200\",\n        //         \"currency\": \"USDT\",\n        //         \"currencyCode\": \"3\",\n        //         \"chainName\": \"ETH\",\n        //         \"chainCode\": \"4\",\n        //         \"txHash\": \"0x0bdbdc47807769a03b158d5753f54dfc58b92993d2f5e818db21863e01238e5d\",\n        //         \"address\": \"0x5bfbf60e0fa7f63598e6cfd8a7fd3ffac4ccc6ad\",\n        //         \"amountEv\": \"3000000000\",\n        //         \"confirmations\": \"13\",\n        //         \"type\": \"Deposit\",\n        //         \"status\": \"Success\",\n        //         \"createdAt\": \"1592722565000\",\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": \"10000001\",\n        //         \"userId\": \"10000001\",\n        //         \"freezeId\": \"10000002\",\n        //         \"phone\": null,\n        //         \"email\": \"abc@gmail.com\",\n        //         \"nickName\": null,\n        //         \"currency\": \"USDT\",\n        //         \"currencyCode\": \"3\",\n        //         \"status\": \"Succeed\",\n        //         \"withdrawStatus\": \"Succeed\",\n        //         \"amountEv\": \"8800000000\",\n        //         \"feeEv\": \"1200000000\",\n        //         \"address\": \"0x5xxxad\",\n        //         \"txHash: \"0x0xxxx5d\",\n        //         \"submitedAt\": \"1702571922000\",\n        //         \"submittedAt\": \"1702571922000\",\n        //         \"expiredTime\": \"0\",\n        //         \"rejectReason\": null,\n        //         \"chainName\": \"ETH\",\n        //         \"chainCode\": \"4\",\n        //         \"proxyAddress\": null\n        //     }\n        //\n        const id = this.safeString (transaction, 'id');\n        const address = this.safeString (transaction, 'address');\n        const tag = undefined;\n        const txid = this.safeString (transaction, 'txHash');\n        const currencyId = this.safeString (transaction, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const code = currency['code'];\n        const networkId = this.safeString (transaction, 'chainName');\n        const timestamp = this.safeIntegerN (transaction, [ 'createdAt', 'submitedAt', 'submittedAt' ]);\n        let type = this.safeStringLower (transaction, 'type');\n        let feeCost = this.parseNumber (this.fromEn (this.safeString (transaction, 'feeEv'), currency['valueScale']));\n        if (feeCost === undefined) {\n            feeCost = this.safeNumber (transaction, 'feeRv');\n        }\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            type = 'withdrawal';\n            fee = {\n                'cost': feeCost,\n                'currency': code,\n            };\n        }\n        const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n        let amount = this.parseNumber (this.fromEn (this.safeString (transaction, 'amountEv'), currency['valueScale']));\n        if (amount === undefined) {\n            amount = this.safeNumber (transaction, 'amountRv');\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'addressTo': address,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': tag,\n            'tagFrom': undefined,\n            'type': type,\n            'amount': amount,\n            'currency': code,\n            'status': status,\n            'updated': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 3661,
        "line_end": 3680,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'Success': 'ok',\n            'Succeed': 'ok',\n            'Rejected': 'failed',\n            'Security check failed': 'failed',\n            'SecurityCheckFailed': 'failed',\n            'Expired': 'failed',\n            'Address Risk': 'failed',\n            'Security Checking': 'pending',\n            'SecurityChecking': 'pending',\n            'Pending Review': 'pending',\n            'Pending Transfer': 'pending',\n            'AmlCsApporve': 'pending',\n            'New': 'pending',\n            'Confirmed': 'pending',\n            'Cancelled': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 4805,
        "line_end": 4859,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountTransfered",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromId",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toId",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"linkKey\": \"8564eba4-c9ec-49d6-9b8c-2ec5001a0fb9\",\n         \"userId\": \"4018340\",\n         \"currency\": \"USD\",\n         \"amountEv\": \"10\",\n         \"side\": \"2\",\n         \"status\": \"10\"\n     }",
          "{\n         \"linkKey\": \"87c071a3-8628-4ac2-aca1-6ce0d1fad66c\",\n         \"userId\": 4148428,\n         \"currency\": \"BTC\",\n         \"amountEv\": 67932,\n         \"side\": 2,\n         \"status\": 10,\n         \"createTime\": 1652832467000,\n         \"bizType\": 10\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        // transfer\n        //\n        //     {\n        //         \"linkKey\": \"8564eba4-c9ec-49d6-9b8c-2ec5001a0fb9\",\n        //         \"userId\": \"4018340\",\n        //         \"currency\": \"USD\",\n        //         \"amountEv\": \"10\",\n        //         \"side\": \"2\",\n        //         \"status\": \"10\"\n        //     }\n        //\n        // fetchTransfers\n        //\n        //     {\n        //         \"linkKey\": \"87c071a3-8628-4ac2-aca1-6ce0d1fad66c\",\n        //         \"userId\": 4148428,\n        //         \"currency\": \"BTC\",\n        //         \"amountEv\": 67932,\n        //         \"side\": 2,\n        //         \"status\": 10,\n        //         \"createTime\": 1652832467000,\n        //         \"bizType\": 10\n        //     }\n        //\n        const id = this.safeString (transfer, 'linkKey');\n        const status = this.safeString (transfer, 'status');\n        const amountEv = this.safeString (transfer, 'amountEv');\n        const amountTransfered = this.fromEv (amountEv);\n        const currencyId = this.safeString (transfer, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const side = this.safeInteger (transfer, 'side');\n        let fromId = undefined;\n        let toId = undefined;\n        if (side === 1) {\n            fromId = 'swap';\n            toId = 'spot';\n        } else if (side === 2) {\n            fromId = 'spot';\n            toId = 'swap';\n        }\n        const timestamp = this.safeInteger (transfer, 'createTime');\n        return {\n            'info': transfer,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': amountTransfered,\n            'fromAccount': fromId,\n            'toAccount': toId,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 4861,
        "line_end": 4869,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            '3': 'rejected', // 'Rejected',\n            '6': 'canceled', // 'Got error and wait for recovery',\n            '10': 'ok', // 'Success',\n            '11': 'failed', // 'Failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "poloniex": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2474,
        "line_end": 2512,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        // for swap\n        if (!Array.isArray (response)) {\n            const ts = this.safeInteger (response, 'uTime');\n            result['timestamp'] = ts;\n            result['datetime'] = this.iso8601 (ts);\n            const details = this.safeList (response, 'details', []);\n            for (let i = 0; i < details.length; i++) {\n                const balance = details[i];\n                const currencyId = this.safeString (balance, 'ccy');\n                const code = this.safeCurrencyCode (currencyId);\n                const account = this.account ();\n                account['total'] = this.safeString (balance, 'avail');\n                account['used'] = this.safeString (balance, 'im');\n                result[code] = account;\n            }\n            return this.safeBalance (result);\n        }\n        // for spot\n        for (let i = 0; i < response.length; i++) {\n            const account = this.safeValue (response, i, {});\n            const balances = this.safeValue (account, 'balances');\n            for (let j = 0; j < balances.length; j++) {\n                const balance = this.safeValue (balances, j);\n                const currencyId = this.safeString (balance, 'currency');\n                const code = this.safeCurrencyCode (currencyId);\n                const newAccount = this.account ();\n                newAccount['free'] = this.safeString (balance, 'available');\n                newAccount['used'] = this.safeString (balance, 'hold');\n                result[code] = newAccount;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddressSpecial",
        "signature": "parseDepositAddressSpecial (response, currency, networkEntry): DepositAddress",
        "line_start": 2780,
        "line_end": 2801,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (networkEntry, 'network')",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddressSpecial (response, currency, networkEntry): DepositAddress {\n        let address = this.safeString (response, 'address');\n        if (address === undefined) {\n            address = this.safeString (response, networkEntry['id']);\n        }\n        let tag: Str = undefined;\n        this.checkAddress (address);\n        if (networkEntry !== undefined) {\n            const depositAddress = this.safeString (networkEntry['info'], 'depositAddress');\n            if (depositAddress !== undefined) {\n                tag = address;\n                address = depositAddress;\n            }\n        }\n        return {\n            'info': response,\n            'currency': currency['code'],\n            'network': this.safeString (networkEntry, 'network'),\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFee",
        "signature": "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
        "line_start": 3129,
        "line_end": 3150,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n        const depositWithdrawFee = this.depositWithdrawFee ({});\n        depositWithdrawFee['info'][currency['code']] = fee;\n        const networkId = this.safeString (fee, 'blockchain');\n        const withdrawFee = this.safeNumber (fee, 'withdrawalFee');\n        const withdrawResult: Dict = {\n            'fee': withdrawFee,\n            'percentage': (withdrawFee !== undefined) ? false : undefined,\n        };\n        const depositResult: Dict = {\n            'fee': undefined,\n            'percentage': undefined,\n        };\n        depositWithdrawFee['withdraw'] = withdrawResult;\n        depositWithdrawFee['deposit'] = depositResult;\n        const networkCode = this.networkIdToCode (networkId);\n        depositWithdrawFee['networks'][networkCode] = {\n            'withdraw': withdrawResult,\n            'deposit': depositResult,\n        };\n        return depositWithdrawFee;\n    }"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 3069,
        "line_end": 3127,
        "comment": null,
        "mappings": [
          {
            "key": "withdraw",
            "value": "{\n                                'fee': withdrawFee,\n                                'percentage': (withdrawFee !== undefined) ? false : undefined,\n                            }",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                                'fee': undefined,\n                                'percentage': undefined,\n                            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"1CR\": {\n                 \"id\": 1,\n                 \"name\": \"1CRedit\",\n                 \"description\": \"BTC Clone\",\n                 \"type\": \"address\",\n                 \"withdrawalFee\": \"0.01000000\",\n                 \"minConf\": 10000,\n                 \"depositAddress\": null,\n                 \"blockchain\": \"1CR\",\n                 \"delisted\": false,\n                 \"tradingState\": \"NORMAL\",\n                 \"walletState\": \"DISABLED\",\n                 \"parentChain\": null,\n                 \"isMultiChain\": false,\n                 \"isChildChain\": false,\n                 \"childChains\": []\n             },\n         }"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        //         {\n        //             \"1CR\": {\n        //                 \"id\": 1,\n        //                 \"name\": \"1CRedit\",\n        //                 \"description\": \"BTC Clone\",\n        //                 \"type\": \"address\",\n        //                 \"withdrawalFee\": \"0.01000000\",\n        //                 \"minConf\": 10000,\n        //                 \"depositAddress\": null,\n        //                 \"blockchain\": \"1CR\",\n        //                 \"delisted\": false,\n        //                 \"tradingState\": \"NORMAL\",\n        //                 \"walletState\": \"DISABLED\",\n        //                 \"parentChain\": null,\n        //                 \"isMultiChain\": false,\n        //                 \"isChildChain\": false,\n        //                 \"childChains\": []\n        //             },\n        //         }\n        //\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        const responseKeys = Object.keys (response);\n        for (let i = 0; i < responseKeys.length; i++) {\n            const currencyId = responseKeys[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const feeInfo = response[currencyId];\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                const currency = this.currency (code);\n                depositWithdrawFees[code] = this.parseDepositWithdrawFee (feeInfo, currency);\n                const childChains = this.safeValue (feeInfo, 'childChains');\n                const chainsLength = childChains.length;\n                if (chainsLength > 0) {\n                    for (let j = 0; j < childChains.length; j++) {\n                        let networkId = childChains[j];\n                        networkId = networkId.replace (code, '');\n                        const networkCode = this.networkIdToCode (networkId);\n                        const networkInfo = this.safeValue (response, networkId);\n                        const networkObject: Dict = {};\n                        const withdrawFee = this.safeNumber (networkInfo, 'withdrawalFee');\n                        networkObject[networkCode] = {\n                            'withdraw': {\n                                'fee': withdrawFee,\n                                'percentage': (withdrawFee !== undefined) ? false : undefined,\n                            },\n                            'deposit': {\n                                'fee': undefined,\n                                'percentage': undefined,\n                            },\n                        };\n                        depositWithdrawFees[code]['networks'] = this.extend (depositWithdrawFees[code]['networks'], networkObject);\n                    }\n                }\n            }\n        }\n        return depositWithdrawFees;\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3371,
        "line_end": 3399,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        let shortLeverage: Int = undefined;\n        let longLeverage: Int = undefined;\n        let marketId: Str = undefined;\n        let marginMode: Str = undefined;\n        const data = this.safeList (leverage, 'data');\n        for (let i = 0; i < data.length; i++) {\n            const entry = data[i];\n            marketId = this.safeString (entry, 'symbol');\n            marginMode = this.safeString (entry, 'mgnMode');\n            const lever = this.safeInteger (entry, 'lever');\n            const posSide = this.safeString (entry, 'posSide');\n            if (posSide === 'LONG') {\n                longLeverage = lever;\n            } else if (posSide === 'SHORT') {\n                shortLeverage = lever;\n            } else {\n                longLeverage = lever;\n                shortLeverage = lever;\n            }\n        }\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification",
        "line_start": 3615,
        "line_end": 3632,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (data, 'amt')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n        const marketId = this.safeString (data, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const rawType = this.safeString (data, 'type');\n        const type = (rawType === 'ADD') ? 'add' : 'reduce';\n        return {\n            'info': data,\n            'symbol': market['symbol'],\n            'type': type,\n            'marginMode': undefined,\n            'amount': this.safeNumber (data, 'amt'),\n            'total': undefined,\n            'code': undefined,\n            'status': 'ok',\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 811,
        "line_end": 817,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        if ('ctType' in market) {\n            return this.parseSwapMarket (market);\n        } else {\n            return this.parseSpotMarket (market);\n        }\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 569,
        "line_end": 626,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         [\n             \"22814.01\",\n             \"22937.42\",\n             \"22832.57\",\n             \"22937.42\",\n             \"3916.58764051\",\n             \"0.171199\",\n             \"2982.64647063\",\n             \"0.130295\",\n             33,\n             0,\n             \"22877.449915304470460711\",\n             \"MINUTE_5\",\n             1659664800000,\n             1659665099999\n         ]\n     ]",
          "[\n             \"84207.02\",\n             \"84320.85\",\n             \"84207.02\",\n             \"84253.83\",\n             \"3707.5395\",\n             \"44\",\n             \"14\",\n             \"1740770040000\",\n             \"1740770099999\",\n           ],"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // spot:\n        //\n        //     [\n        //         [\n        //             \"22814.01\",\n        //             \"22937.42\",\n        //             \"22832.57\",\n        //             \"22937.42\",\n        //             \"3916.58764051\",\n        //             \"0.171199\",\n        //             \"2982.64647063\",\n        //             \"0.130295\",\n        //             33,\n        //             0,\n        //             \"22877.449915304470460711\",\n        //             \"MINUTE_5\",\n        //             1659664800000,\n        //             1659665099999\n        //         ]\n        //     ]\n        //\n        // contract:\n        //\n        //           [\n        //             \"84207.02\",\n        //             \"84320.85\",\n        //             \"84207.02\",\n        //             \"84253.83\",\n        //             \"3707.5395\",\n        //             \"44\",\n        //             \"14\",\n        //             \"1740770040000\",\n        //             \"1740770099999\",\n        //           ],\n        //\n        const ohlcvLength = ohlcv.length;\n        const isContract = ohlcvLength === 9;\n        if (isContract) {\n            return [\n                this.safeInteger (ohlcv, 7),\n                this.safeNumber (ohlcv, 2),\n                this.safeNumber (ohlcv, 1),\n                this.safeNumber (ohlcv, 0),\n                this.safeNumber (ohlcv, 3),\n                this.safeNumber (ohlcv, 5),\n            ];\n        }\n        return [\n            this.safeInteger (ohlcv, 12),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 0),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOpenOrders",
        "signature": "parseOpenOrders (orders, market, result)",
        "line_start": 1859,
        "line_end": 1871,
        "comment": null,
        "mappings": [
          {
            "key": "status",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "side",
            "value": "order['type']",
            "comment": null
          },
          {
            "key": "price",
            "value": "order['rate']",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOpenOrders (orders, market, result) {\n        for (let i = 0; i < orders.length; i++) {\n            const order = orders[i];\n            const extended = this.extend (order, {\n                'status': 'open',\n                'type': 'limit',\n                'side': order['type'],\n                'price': order['rate'],\n            });\n            result.push (this.parseOrder (extended, market));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1675,
        "line_end": 1846,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "this.safeInteger (order, 'updateTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "rawType === 'LIMIT_MAKER'",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeString2 (order, 'triggerPrice', 'stopPrice')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (order, 'execAmt')",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString2 (order, 'avgPrice', 'avgPx')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "resultingTrades",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "reduceOnly",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "hedged",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\" : \"7xxxxxxxxxxxxxxx6\",\n         \"clientOrderId\" : \"\",\n         \"symbol\" : \"ETH_USDT\",\n         \"state\" : \"NEW\",\n         \"accountType\" : \"SPOT\",\n         \"side\" : \"BUY\",\n         \"type\" : \"LIMIT\",\n         \"timeInForce\" : \"GTC\",\n         \"quantity\" : \"0.001\",\n         \"price\" : \"1600\",\n         \"avgPrice\" : \"0\",\n         \"amount\" : \"0\",\n         \"filledQuantity\" : \"0\",\n         \"filledAmount\" : \"0\",\n         \"createTime\" : 16xxxxxxxxx26,\n         \"updateTime\" : 16xxxxxxxxx36\n     }",
          "{\n         \"id\": \"24993088082542592\",\n         \"clientOrderId\": \"\",\n         \"symbol\": \"ELON_USDC\",\n         \"state\": \"NEW\",\n         \"accountType\": \"SPOT\",\n         \"side\": \"SELL\",\n         \"type\": \"MARKET\",\n         \"timeInForce\": \"GTC\",\n         \"quantity\": \"1.00\",\n         \"price\": \"0.00\",\n         \"avgPrice\": \"0.00\",\n         \"amount\": \"0.00\",\n         \"filledQuantity\": \"0.00\",\n         \"filledAmount\": \"0.00\",\n         \"createTime\": 1646925216548,\n         \"updateTime\": 1646925216548\n     }",
          "{\n         \"symbol\": \"BTC_USDT_PERP\",\n         \"side\": \"BUY\",\n         \"type\": \"LIMIT\",\n         \"ordId\": \"418890767248232148\",\n         \"clOrdId\": \"polo418890767248232148\",\n         \"mgnMode\": \"CROSS\",\n         \"px\": \"81130.13\",\n         \"reduceOnly\": false,\n         \"lever\": \"20\",\n         \"state\": \"NEW\",\n         \"source\": \"WEB\",\n         \"timeInForce\": \"GTC\",\n         \"tpTrgPx\": \"\",\n         \"tpPx\": \"\",\n         \"tpTrgPxType\": \"\",\n         \"slTrgPx\": \"\",\n         \"slPx\": \"\",\n         \"slTrgPxType\": \"\",\n         \"avgPx\": \"0\",\n         \"execQty\": \"0\",\n         \"execAmt\": \"0\",\n         \"feeCcy\": \"\",\n         \"feeAmt\": \"0\",\n         \"deductCcy\": \"0\",\n         \"deductAmt\": \"0\",\n         \"stpMode\": \"NONE\", // todo: selfTradePrevention\n         \"cTime\": \"1740837741523\",\n         \"uTime\": \"1740840846882\",\n         \"sz\": \"1\",\n         \"posSide\": \"BOTH\",\n         \"qCcy\": \"USDT\"\n         \"cancelReason\": \"\", // this field can only be in closed orders\n     },",
          "{\n         \"id\": \"29772698821328896\",\n         \"clientOrderId\": \"1234Abc\"\n     }",
          "{\n        \"ordId\":\"418876147745775616\",\n        \"clOrdId\":\"polo418876147745775616\"\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOpenOrder\n        //\n        //     {\n        //         \"id\" : \"7xxxxxxxxxxxxxxx6\",\n        //         \"clientOrderId\" : \"\",\n        //         \"symbol\" : \"ETH_USDT\",\n        //         \"state\" : \"NEW\",\n        //         \"accountType\" : \"SPOT\",\n        //         \"side\" : \"BUY\",\n        //         \"type\" : \"LIMIT\",\n        //         \"timeInForce\" : \"GTC\",\n        //         \"quantity\" : \"0.001\",\n        //         \"price\" : \"1600\",\n        //         \"avgPrice\" : \"0\",\n        //         \"amount\" : \"0\",\n        //         \"filledQuantity\" : \"0\",\n        //         \"filledAmount\" : \"0\",\n        //         \"createTime\" : 16xxxxxxxxx26,\n        //         \"updateTime\" : 16xxxxxxxxx36\n        //     }\n        //\n        // fetchOpenOrders (and fetchClosedOrders same for contracts)\n        //\n        //  spot:\n        //\n        //     {\n        //         \"id\": \"24993088082542592\",\n        //         \"clientOrderId\": \"\",\n        //         \"symbol\": \"ELON_USDC\",\n        //         \"state\": \"NEW\",\n        //         \"accountType\": \"SPOT\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"MARKET\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"quantity\": \"1.00\",\n        //         \"price\": \"0.00\",\n        //         \"avgPrice\": \"0.00\",\n        //         \"amount\": \"0.00\",\n        //         \"filledQuantity\": \"0.00\",\n        //         \"filledAmount\": \"0.00\",\n        //         \"createTime\": 1646925216548,\n        //         \"updateTime\": 1646925216548\n        //     }\n        //\n        //  contract:\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT_PERP\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"ordId\": \"418890767248232148\",\n        //         \"clOrdId\": \"polo418890767248232148\",\n        //         \"mgnMode\": \"CROSS\",\n        //         \"px\": \"81130.13\",\n        //         \"reduceOnly\": false,\n        //         \"lever\": \"20\",\n        //         \"state\": \"NEW\",\n        //         \"source\": \"WEB\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"tpTrgPx\": \"\",\n        //         \"tpPx\": \"\",\n        //         \"tpTrgPxType\": \"\",\n        //         \"slTrgPx\": \"\",\n        //         \"slPx\": \"\",\n        //         \"slTrgPxType\": \"\",\n        //         \"avgPx\": \"0\",\n        //         \"execQty\": \"0\",\n        //         \"execAmt\": \"0\",\n        //         \"feeCcy\": \"\",\n        //         \"feeAmt\": \"0\",\n        //         \"deductCcy\": \"0\",\n        //         \"deductAmt\": \"0\",\n        //         \"stpMode\": \"NONE\", // todo: selfTradePrevention\n        //         \"cTime\": \"1740837741523\",\n        //         \"uTime\": \"1740840846882\",\n        //         \"sz\": \"1\",\n        //         \"posSide\": \"BOTH\",\n        //         \"qCcy\": \"USDT\"\n        //         \"cancelReason\": \"\", // this field can only be in closed orders\n        //     },\n        //\n        // createOrder, editOrder\n        //\n        //  spot:\n        //\n        //     {\n        //         \"id\": \"29772698821328896\",\n        //         \"clientOrderId\": \"1234Abc\"\n        //     }\n        //\n        //  contract:\n        //\n        //    {\n        //        \"ordId\":\"418876147745775616\",\n        //        \"clOrdId\":\"polo418876147745775616\"\n        //    }\n        //\n        let timestamp = this.safeIntegerN (order, [ 'timestamp', 'createTime', 'cTime' ]);\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (order, 'date'));\n        }\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = market['symbol'];\n        let resultingTrades = this.safeValue (order, 'resultingTrades');\n        if (resultingTrades !== undefined) {\n            if (!Array.isArray (resultingTrades)) {\n                resultingTrades = this.safeValue (resultingTrades, this.safeString (market, 'id', marketId));\n            }\n        }\n        const price = this.safeStringN (order, [ 'price', 'rate', 'px' ]);\n        const amount = this.safeString2 (order, 'quantity', 'sz');\n        const filled = this.safeString2 (order, 'filledQuantity', 'execQty');\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        const side = this.safeStringLower (order, 'side');\n        const rawType = this.safeString (order, 'type');\n        const type = this.parseOrderType (rawType);\n        const id = this.safeStringN (order, [ 'orderNumber', 'id', 'orderId', 'ordId' ]);\n        let fee = undefined;\n        const feeCurrency = this.safeString2 (order, 'tokenFeeCurrency', 'feeCcy');\n        let feeCost: Str = undefined;\n        let feeCurrencyCode: Str = undefined;\n        const rate = this.safeString (order, 'fee');\n        if (feeCurrency === undefined) {\n            feeCurrencyCode = (side === 'buy') ? market['base'] : market['quote'];\n        } else {\n            // poloniex accepts a 30% discount to pay fees in TRX\n            feeCurrencyCode = this.safeCurrencyCode (feeCurrency);\n            feeCost = this.safeString2 (order, 'tokenFee', 'feeAmt');\n        }\n        if (feeCost !== undefined) {\n            fee = {\n                'rate': rate,\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const clientOrderId = this.safeString2 (order, 'clientOrderId', 'clOrdId');\n        const marginMode = this.safeStringLower (order, 'mgnMode');\n        const reduceOnly = this.safeBool (order, 'reduceOnly');\n        const leverage = this.safeInteger (order, 'lever');\n        const hedged = this.safeString (order, 'posSide') !== 'BOTH';\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': this.safeInteger (order, 'updateTime'),\n            'status': status,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': rawType === 'LIMIT_MAKER',\n            'side': side,\n            'price': price,\n            'triggerPrice': this.safeString2 (order, 'triggerPrice', 'stopPrice'),\n            'cost': this.safeString (order, 'execAmt'),\n            'average': this.safeString2 (order, 'avgPrice', 'avgPx'),\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined,\n            'trades': resultingTrades,\n            'fee': fee,\n            'marginMode': marginMode,\n            'reduceOnly': reduceOnly,\n            'leverage': leverage,\n            'hedged': hedged,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1662,
        "line_end": 1673,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'PENDING_CANCEL': 'canceled',\n            'PARTIALLY_CANCELED': 'canceled',\n            'CANCELED': 'canceled',\n            'FAILED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1848,
        "line_end": 1857,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'LIMIT_MAKER': 'limit',\n            'STOP-LIMIT': 'limit',\n            'STOP-MARKET': 'market',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3509,
        "line_end": 3579,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "notional",
            "value": "notional",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liqPx')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'openAvgPx')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'upl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'qty')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeNumber (position, 'markPx')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (position, 'posSide')",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "this.safeNumber (position, 'mm')",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "initialMargin",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "parseInt (leverage)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "this.safeNumber (position, 'mgnRatio')",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeNumber (position, 'slTrgPx')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeNumber (position, 'tpTrgPx')",
            "comment": null
          }
        ],
        "examples": [
          "{\n                \"symbol\": \"BTC_USDT_PERP\",\n                \"posSide\": \"LONG\",\n                \"side\": \"BUY\",\n                \"mgnMode\": \"CROSS\",\n                \"openAvgPx\": \"94193.42\",\n                \"qty\": \"1\",\n                \"availQty\": \"1\",\n                \"lever\": \"20\",\n                \"adl\": \"0.3007\",\n                \"liqPx\": \"84918.201844064386317906\",\n                \"im\": \"4.7047795\",\n                \"mm\": \"0.56457354\",\n                \"upl\": \"-0.09783\",\n                \"uplRatio\": \"-0.0207\",\n                \"pnl\": \"0\",\n                \"markPx\": \"94095.59\",\n                \"mgnRatio\": \"0.0582\",\n                \"state\": \"NORMAL\",\n                \"cTime\": \"1740950344401\",\n                \"uTime\": \"1740950344401\",\n                \"mgn\": \"4.7047795\",\n                \"actType\": \"TRADING\",\n                \"maxWAmt\": \"0\",\n                \"tpTrgPx\": \"\",\n                \"slTrgPx\": \"\"\n            }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        //            {\n        //                \"symbol\": \"BTC_USDT_PERP\",\n        //                \"posSide\": \"LONG\",\n        //                \"side\": \"BUY\",\n        //                \"mgnMode\": \"CROSS\",\n        //                \"openAvgPx\": \"94193.42\",\n        //                \"qty\": \"1\",\n        //                \"availQty\": \"1\",\n        //                \"lever\": \"20\",\n        //                \"adl\": \"0.3007\",\n        //                \"liqPx\": \"84918.201844064386317906\",\n        //                \"im\": \"4.7047795\",\n        //                \"mm\": \"0.56457354\",\n        //                \"upl\": \"-0.09783\",\n        //                \"uplRatio\": \"-0.0207\",\n        //                \"pnl\": \"0\",\n        //                \"markPx\": \"94095.59\",\n        //                \"mgnRatio\": \"0.0582\",\n        //                \"state\": \"NORMAL\",\n        //                \"cTime\": \"1740950344401\",\n        //                \"uTime\": \"1740950344401\",\n        //                \"mgn\": \"4.7047795\",\n        //                \"actType\": \"TRADING\",\n        //                \"maxWAmt\": \"0\",\n        //                \"tpTrgPx\": \"\",\n        //                \"slTrgPx\": \"\"\n        //            }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (position, 'cTime');\n        const marginMode = this.safeStringLower (position, 'mgnMode');\n        const leverage = this.safeString (position, 'lever');\n        const initialMargin = this.safeString (position, 'im');\n        const notional = Precise.stringMul (leverage, initialMargin);\n        const qty = this.safeString (position, 'qty');\n        const avgPrice = this.safeString (position, 'openAvgPx');\n        const collateral = Precise.stringMul (qty, avgPrice);\n        // todo: some more fields\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': market['symbol'],\n            'notional': notional,\n            'marginMode': marginMode,\n            'liquidationPrice': this.safeNumber (position, 'liqPx'),\n            'entryPrice': this.safeNumber (position, 'openAvgPx'),\n            'unrealizedPnl': this.safeNumber (position, 'upl'),\n            'percentage': undefined,\n            'contracts': this.safeNumber (position, 'qty'),\n            'contractSize': undefined,\n            'markPrice': this.safeNumber (position, 'markPx'),\n            'lastPrice': undefined,\n            'side': this.safeStringLower (position, 'posSide'),\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'maintenanceMargin': this.safeNumber (position, 'mm'),\n            'maintenanceMarginPercentage': undefined,\n            'collateral': collateral,\n            'initialMargin': initialMargin,\n            'initialMarginPercentage': undefined,\n            'leverage': parseInt (leverage),\n            'marginRatio': this.safeNumber (position, 'mgnRatio'),\n            'stopLossPrice': this.safeNumber (position, 'slTrgPx'),\n            'takeProfitPrice': this.safeNumber (position, 'tpTrgPx'),\n        });\n    }"
      },
      {
        "name": "parseSpotMarket",
        "signature": "parseSpotMarket (market: Dict): Market",
        "line_start": 819,
        "line_end": 874,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (symbolTradeLimit, 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (symbolTradeLimit, 'priceScale'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (symbolTradeLimit, 'minQuantity'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (symbolTradeLimit, 'minAmount'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'tradableStartTime')",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (symbolTradeLimit, 'minQuantity'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (symbolTradeLimit, 'minAmount'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseSpotMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'baseCurrencyName');\n        const quoteId = this.safeString (market, 'quoteCurrencyName');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const state = this.safeString (market, 'state');\n        const active = state === 'NORMAL';\n        const symbolTradeLimit = this.safeValue (market, 'symbolTradeLimit');\n        // these are known defaults\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (symbolTradeLimit, 'quantityScale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (symbolTradeLimit, 'priceScale'))),\n            },\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (symbolTradeLimit, 'minQuantity'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (symbolTradeLimit, 'minAmount'),\n                    'max': undefined,\n                },\n            },\n            'created': this.safeInteger (market, 'tradableStartTime'),\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseSwapMarket",
        "signature": "parseSwapMarket (market: Dict): Market",
        "line_start": 876,
        "line_end": 984,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "(type === 'future') ? 'future' : 'swap'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "type === 'swap'",
            "comment": null
          },
          {
            "key": "future",
            "value": "type === 'future'",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "!linear",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'ctVal')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (market, 'tFee')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (market, 'mFee')",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tSz'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': this.safeNumber (market, 'limitMaxQty'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'minPx'),\n                    'max': this.safeNumber (market, 'maxPx'),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'max': this.safeNumber (market, 'maxLever'),\n                    'min': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'oDate')",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'lotSz')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tSz')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': this.safeNumber (market, 'limitMaxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'minPx'),\n                    'max': this.safeNumber (market, 'maxPx'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'max': this.safeNumber (market, 'maxLever'),\n                    'min': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'minPx')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'maxPx')",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n                \"symbol\": \"BNB_USDT_PERP\",\n                \"bAsset\": \".PBNBUSDT\",\n                \"bCcy\": \"BNB\",\n                \"qCcy\": \"USDT\",\n                \"visibleStartTime\": \"1620390600000\",\n                \"tradableStartTime\": \"1620390600000\",\n                \"sCcy\": \"USDT\",\n                \"tSz\": \"0.001\",\n                \"pxScale\": \"0.001,0.01,0.1,1,10\",\n                \"lotSz\": \"1\",\n                \"minSz\": \"1\",\n                \"ctVal\": \"0.1\",\n                \"status\": \"OPEN\",\n                \"oDate\": \"1620287590000\",\n                \"maxPx\": \"1000000\",\n                \"minPx\": \"0.001\",\n                \"maxQty\": \"1000000\",\n                \"minQty\": \"1\",\n                \"maxLever\": \"50\",\n                \"lever\": \"10\",\n                \"ctType\": \"LINEAR\",\n                \"alias\": \"\",\n                \"iM\": \"0.02\",\n                \"mM\": \"0.0115\",\n                \"mR\": \"2000\",\n                \"buyLmt\": \"\",\n                \"sellLmt\": \"\",\n                \"ordPxRange\": \"0.05\",\n                \"marketMaxQty\": \"2800\",\n                \"limitMaxQty\": \"1000000\"\n            },"
        ],
        "source": "parseSwapMarket (market: Dict): Market {\n        //\n        //            {\n        //                \"symbol\": \"BNB_USDT_PERP\",\n        //                \"bAsset\": \".PBNBUSDT\",\n        //                \"bCcy\": \"BNB\",\n        //                \"qCcy\": \"USDT\",\n        //                \"visibleStartTime\": \"1620390600000\",\n        //                \"tradableStartTime\": \"1620390600000\",\n        //                \"sCcy\": \"USDT\",\n        //                \"tSz\": \"0.001\",\n        //                \"pxScale\": \"0.001,0.01,0.1,1,10\",\n        //                \"lotSz\": \"1\",\n        //                \"minSz\": \"1\",\n        //                \"ctVal\": \"0.1\",\n        //                \"status\": \"OPEN\",\n        //                \"oDate\": \"1620287590000\",\n        //                \"maxPx\": \"1000000\",\n        //                \"minPx\": \"0.001\",\n        //                \"maxQty\": \"1000000\",\n        //                \"minQty\": \"1\",\n        //                \"maxLever\": \"50\",\n        //                \"lever\": \"10\",\n        //                \"ctType\": \"LINEAR\",\n        //                \"alias\": \"\",\n        //                \"iM\": \"0.02\",\n        //                \"mM\": \"0.0115\",\n        //                \"mR\": \"2000\",\n        //                \"buyLmt\": \"\",\n        //                \"sellLmt\": \"\",\n        //                \"ordPxRange\": \"0.05\",\n        //                \"marketMaxQty\": \"2800\",\n        //                \"limitMaxQty\": \"1000000\"\n        //            },\n        //\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'bCcy');\n        const quoteId = this.safeString (market, 'qCcy');\n        const settleId = this.safeString (market, 'sCcy');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settle = this.safeCurrencyCode (settleId);\n        const status = this.safeString (market, 'status');\n        const active = status === 'OPEN';\n        const linear = market['ctType'] === 'LINEAR';\n        let symbol = base + '/' + quote;\n        if (linear) {\n            symbol += ':' + settle;\n        } else {\n            // actually, exchange does not have any inverse future now\n            symbol += ':' + base;\n        }\n        const alias = this.safeString (market, 'alias');\n        let type = 'swap';\n        if (alias !== undefined) {\n            type = 'future';\n        }\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': (type === 'future') ? 'future' : 'swap',\n            'spot': false,\n            'margin': false,\n            'swap': type === 'swap',\n            'future': type === 'future',\n            'option': false,\n            'active': active,\n            'contract': true,\n            'linear': linear,\n            'inverse': !linear,\n            'contractSize': this.safeNumber (market, 'ctVal'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'taker': this.safeNumber (market, 'tFee'),\n            'maker': this.safeNumber (market, 'mFee'),\n            'precision': {\n                'amount': this.safeNumber (market, 'lotSz'),\n                'price': this.safeNumber (market, 'tSz'),\n            },\n            'limits': {\n                'amount': {\n                    'min': this.safeNumber (market, 'minSz'),\n                    'max': this.safeNumber (market, 'limitMaxQty'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'minPx'),\n                    'max': this.safeNumber (market, 'maxPx'),\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'leverage': {\n                    'max': this.safeNumber (market, 'maxLever'),\n                    'min': undefined,\n                },\n            },\n            'created': this.safeInteger (market, 'oDate'),\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 999,
        "line_end": 1076,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString2 (ticker, 'high', 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString2 (ticker, 'low', 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'bid', 'bPx')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString2 (ticker, 'bidQuantity', 'bSz')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'ask', 'aPx')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString2 (ticker, 'askQuantity', 'aSz')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString2 (ticker, 'open', 'o')",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString2 (ticker, 'close', 'c')",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString2 (ticker, 'quantity', 'qty')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString2 (ticker, 'amount', 'amt')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString2 (ticker, 'markPrice', 'mPx')",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "this.safeString (ticker, 'iPx')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\" : \"BTC_USDT\",\n         \"open\" : \"26053.33\",\n         \"low\" : \"26053.33\",\n         \"high\" : \"26798.02\",\n         \"close\" : \"26447.58\",\n         \"quantity\" : \"6116.210188\",\n         \"amount\" : \"161082122.88450926\",\n         \"tradeCount\" : \"134709\",\n         \"startTime\" : \"1692784440000\",\n         \"closeTime\" : \"1692870839630\",\n         \"displayName\" : \"BTC/USDT\",\n         \"dailyChange\" : \"0.0151\",\n         \"bid\" : \"26447.57\",\n         \"bidQuantity\" : \"0.016313\",\n         \"ask\" : \"26447.58\",\n         \"askQuantity\" : \"0.068307\",\n         \"ts\" : \"1692870845446\",\n         \"markPrice\" : \"26444.11\"\n     }",
          "{\n                \"s\": \"XRP_USDT_PERP\",\n                \"o\": \"2.0503\",\n                \"l\": \"2.0066\",\n                \"h\": \"2.216\",\n                \"c\": \"2.1798\",\n                \"qty\": \"21090\",\n                \"amt\": \"451339.65\",\n                \"tC\": \"3267\",\n                \"sT\": \"1740736380000\",\n                \"cT\": \"1740822777559\",\n                \"dN\": \"XRP/USDT/PERP\",\n                \"dC\": \"0.0632\",\n                \"bPx\": \"2.175\",\n                \"bSz\": \"3\",\n                \"aPx\": \"2.1831\",\n                \"aSz\": \"111\",\n                \"mPx\": \"2.1798\",\n                \"iPx\": \"2.1834\"\n            },"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //  spot:\n        //\n        //     {\n        //         \"symbol\" : \"BTC_USDT\",\n        //         \"open\" : \"26053.33\",\n        //         \"low\" : \"26053.33\",\n        //         \"high\" : \"26798.02\",\n        //         \"close\" : \"26447.58\",\n        //         \"quantity\" : \"6116.210188\",\n        //         \"amount\" : \"161082122.88450926\",\n        //         \"tradeCount\" : \"134709\",\n        //         \"startTime\" : \"1692784440000\",\n        //         \"closeTime\" : \"1692870839630\",\n        //         \"displayName\" : \"BTC/USDT\",\n        //         \"dailyChange\" : \"0.0151\",\n        //         \"bid\" : \"26447.57\",\n        //         \"bidQuantity\" : \"0.016313\",\n        //         \"ask\" : \"26447.58\",\n        //         \"askQuantity\" : \"0.068307\",\n        //         \"ts\" : \"1692870845446\",\n        //         \"markPrice\" : \"26444.11\"\n        //     }\n        //\n        //  swap:\n        //\n        //            {\n        //                \"s\": \"XRP_USDT_PERP\",\n        //                \"o\": \"2.0503\",\n        //                \"l\": \"2.0066\",\n        //                \"h\": \"2.216\",\n        //                \"c\": \"2.1798\",\n        //                \"qty\": \"21090\",\n        //                \"amt\": \"451339.65\",\n        //                \"tC\": \"3267\",\n        //                \"sT\": \"1740736380000\",\n        //                \"cT\": \"1740822777559\",\n        //                \"dN\": \"XRP/USDT/PERP\",\n        //                \"dC\": \"0.0632\",\n        //                \"bPx\": \"2.175\",\n        //                \"bSz\": \"3\",\n        //                \"aPx\": \"2.1831\",\n        //                \"aSz\": \"111\",\n        //                \"mPx\": \"2.1798\",\n        //                \"iPx\": \"2.1834\"\n        //            },\n        //\n        const timestamp = this.safeInteger2 (ticker, 'ts', 'cT');\n        const marketId = this.safeString2 (ticker, 'symbol', 's');\n        market = this.safeMarket (marketId);\n        const relativeChange = this.safeString2 (ticker, 'dailyChange', 'dc');\n        const percentage = Precise.stringMul (relativeChange, '100');\n        return this.safeTicker ({\n            'id': marketId,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString2 (ticker, 'high', 'h'),\n            'low': this.safeString2 (ticker, 'low', 'l'),\n            'bid': this.safeString2 (ticker, 'bid', 'bPx'),\n            'bidVolume': this.safeString2 (ticker, 'bidQuantity', 'bSz'),\n            'ask': this.safeString2 (ticker, 'ask', 'aPx'),\n            'askVolume': this.safeString2 (ticker, 'askQuantity', 'aSz'),\n            'vwap': undefined,\n            'open': this.safeString2 (ticker, 'open', 'o'),\n            'close': this.safeString2 (ticker, 'close', 'c'),\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': percentage,\n            'average': undefined,\n            'baseVolume': this.safeString2 (ticker, 'quantity', 'qty'),\n            'quoteVolume': this.safeString2 (ticker, 'amount', 'amt'),\n            'markPrice': this.safeString2 (ticker, 'markPrice', 'mPx'),\n            'indexPrice': this.safeString (ticker, 'iPx'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1365,
        "line_end": 1497,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower2 (trade, 'ordType', 'type')",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "this.safeStringLower2 (trade, 'matchRole', 'role')",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "costString",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\" : \"60014521\",\n         \"price\" : \"23162.94\",\n         \"quantity\" : \"0.00009\",\n         \"amount\" : \"2.0846646\",\n         \"takerSide\" : \"SELL\",\n         \"ts\" : 1659684602042,\n         \"createTime\" : 1659684602036\n     }",
          "{\n         \"id\": \"105807376\",\n         \"side\": \"buy\",\n         \"px\": \"84410.57\",\n         \"qty\": \"1\",\n         \"amt\": \"84.41057\",\n         \"cT\": \"1740777563557\",\n     }",
          "{\n         \"id\": \"32164924331503616\",\n         \"symbol\": \"LINK_USDT\",\n         \"accountType\": \"SPOT\",\n         \"orderId\": \"32164923987566592\",\n         \"side\": \"SELL\",\n         \"type\": \"MARKET\",\n         \"matchRole\": \"TAKER\",\n         \"createTime\": 1648635115525,\n         \"price\": \"11\",\n         \"quantity\": \"0.5\",\n         \"amount\": \"5.5\",\n         \"feeCurrency\": \"USDT\",\n         \"feeAmount\": \"0.007975\",\n         \"pageId\": \"32164924331503616\",\n         \"clientOrderId\": \"myOwnId-321\"\n     }",
          "{\n         \"symbol\": \"BTC_USDT_PERP\",\n         \"trdId\": \"105813553\",\n         \"side\": \"SELL\",\n         \"type\": \"TRADE\",\n         \"mgnMode\": \"CROSS\",\n         \"ordType\": \"MARKET\",\n         \"clOrdId\": \"polo418912106147315112\",\n         \"role\": \"TAKER\",\n         \"px\": \"84704.9\",\n         \"qty\": \"1\",\n         \"cTime\": \"1740842829430\",\n         \"uTime\": \"1740842829450\",\n         \"feeCcy\": \"USDT\",\n         \"feeAmt\": \"0.04235245\",\n         \"deductCcy\": \"\",\n         \"deductAmt\": \"0\",\n         \"feeRate\": \"0.0005\",\n         \"id\": \"418912106342654592\",\n         \"posSide\": \"BOTH\",\n         \"ordId\": \"418912106147315112\",\n         \"qCcy\": \"USDT\",\n         \"value\": \"84.7049\",\n         \"actType\": \"TRADING\"\n     },",
          "{\n         \"id\": \"30341456333942784\",\n         \"symbol\": \"LINK_USDT\",\n         \"accountType\": \"SPOT\",\n         \"orderId\": \"30249408733945856\",\n         \"side\": \"BUY\",\n         \"type\": \"LIMIT\",\n         \"matchRole\": \"MAKER\",\n         \"createTime\": 1648200366864,\n         \"price\": \"3.1\",\n         \"quantity\": \"1\",\n         \"amount\": \"3.1\",\n         \"feeCurrency\": \"LINK\",\n         \"feeAmount\": \"0.00145\",\n         \"pageId\": \"30341456333942784\",\n         \"clientOrderId\": \"\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //  spot:\n        //\n        //     {\n        //         \"id\" : \"60014521\",\n        //         \"price\" : \"23162.94\",\n        //         \"quantity\" : \"0.00009\",\n        //         \"amount\" : \"2.0846646\",\n        //         \"takerSide\" : \"SELL\",\n        //         \"ts\" : 1659684602042,\n        //         \"createTime\" : 1659684602036\n        //     }\n        //\n        //   swap:\n        //\n        //     {\n        //         \"id\": \"105807376\",\n        //         \"side\": \"buy\",\n        //         \"px\": \"84410.57\",\n        //         \"qty\": \"1\",\n        //         \"amt\": \"84.41057\",\n        //         \"cT\": \"1740777563557\",\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //  spot:\n        //\n        //     {\n        //         \"id\": \"32164924331503616\",\n        //         \"symbol\": \"LINK_USDT\",\n        //         \"accountType\": \"SPOT\",\n        //         \"orderId\": \"32164923987566592\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"MARKET\",\n        //         \"matchRole\": \"TAKER\",\n        //         \"createTime\": 1648635115525,\n        //         \"price\": \"11\",\n        //         \"quantity\": \"0.5\",\n        //         \"amount\": \"5.5\",\n        //         \"feeCurrency\": \"USDT\",\n        //         \"feeAmount\": \"0.007975\",\n        //         \"pageId\": \"32164924331503616\",\n        //         \"clientOrderId\": \"myOwnId-321\"\n        //     }\n        //\n        //  swap:\n        //\n        //     {\n        //         \"symbol\": \"BTC_USDT_PERP\",\n        //         \"trdId\": \"105813553\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"TRADE\",\n        //         \"mgnMode\": \"CROSS\",\n        //         \"ordType\": \"MARKET\",\n        //         \"clOrdId\": \"polo418912106147315112\",\n        //         \"role\": \"TAKER\",\n        //         \"px\": \"84704.9\",\n        //         \"qty\": \"1\",\n        //         \"cTime\": \"1740842829430\",\n        //         \"uTime\": \"1740842829450\",\n        //         \"feeCcy\": \"USDT\",\n        //         \"feeAmt\": \"0.04235245\",\n        //         \"deductCcy\": \"\",\n        //         \"deductAmt\": \"0\",\n        //         \"feeRate\": \"0.0005\",\n        //         \"id\": \"418912106342654592\",\n        //         \"posSide\": \"BOTH\",\n        //         \"ordId\": \"418912106147315112\",\n        //         \"qCcy\": \"USDT\",\n        //         \"value\": \"84.7049\",\n        //         \"actType\": \"TRADING\"\n        //     },\n        //\n        // fetchOrderTrades (taker trades)\n        //\n        //     {\n        //         \"id\": \"30341456333942784\",\n        //         \"symbol\": \"LINK_USDT\",\n        //         \"accountType\": \"SPOT\",\n        //         \"orderId\": \"30249408733945856\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"matchRole\": \"MAKER\",\n        //         \"createTime\": 1648200366864,\n        //         \"price\": \"3.1\",\n        //         \"quantity\": \"1\",\n        //         \"amount\": \"3.1\",\n        //         \"feeCurrency\": \"LINK\",\n        //         \"feeAmount\": \"0.00145\",\n        //         \"pageId\": \"30341456333942784\",\n        //         \"clientOrderId\": \"\"\n        //     }\n        //\n        const id = this.safeStringN (trade, [ 'id', 'tradeID', 'trdId' ]);\n        const orderId = this.safeString2 (trade, 'orderId', 'ordId');\n        const timestamp = this.safeIntegerN (trade, [ 'ts', 'createTime', 'cT', 'cTime' ]);\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = market['symbol'];\n        const side = this.safeStringLower2 (trade, 'side', 'takerSide');\n        let fee = undefined;\n        const priceString = this.safeString2 (trade, 'price', 'px');\n        const amountString = this.safeString2 (trade, 'quantity', 'qty');\n        const costString = this.safeString2 (trade, 'amount', 'amt');\n        const feeCurrencyId = this.safeString2 (trade, 'feeCurrency', 'feeCcy');\n        const feeCostString = this.safeString2 (trade, 'feeAmount', 'feeAmt');\n        if (feeCostString !== undefined) {\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': this.safeStringLower2 (trade, 'ordType', 'type'), // ordType should take precedence\n            'side': side,\n            'takerOrMaker': this.safeStringLower2 (trade, 'matchRole', 'role'),\n            'price': priceString,\n            'amount': amountString,\n            'cost': costString,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 3188,
        "line_end": 3269,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amountString)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n                'rate': undefined,\n            }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"txid\": \"f49d489616911db44b740612d19464521179c76ebe9021af85b6de1e2f8d68cd\",\n         \"amount\": \"49798.01987021\",\n         \"status\": \"COMPLETE\",\n         \"address\": \"DJVJZ58tJC8UeUv9Tqcdtn6uhWobouxFLT\",\n         \"currency\": \"DOGE\",\n         \"timestamp\": 1524321838,\n         \"confirmations\": 3371,\n         \"depositNumber\": 134587098\n     }",
          "{\n         \"withdrawalRequestsId\": 7397527,\n         \"currency\": \"ETC\",\n         \"address\": \"0x26419a62055af459d2cd69bb7392f5100b75e304\",\n         \"amount\": \"13.19951600\",\n         \"fee\": \"0.01000000\",\n         \"timestamp\": 1506010932,\n         \"status\": \"COMPLETED\",\n         \"txid\": \"343346392f82ac16e8c2604f2a604b7b2382d0e9d8030f673821f8de4b5f5bk\",\n         \"ipAddress\": \"1.2.3.4\",\n         \"paymentID\": null\n     }",
          "{\n         \"withdrawalRequestsId\": 33485231\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // deposits\n        //\n        //     {\n        //         \"txid\": \"f49d489616911db44b740612d19464521179c76ebe9021af85b6de1e2f8d68cd\",\n        //         \"amount\": \"49798.01987021\",\n        //         \"status\": \"COMPLETE\",\n        //         \"address\": \"DJVJZ58tJC8UeUv9Tqcdtn6uhWobouxFLT\",\n        //         \"currency\": \"DOGE\",\n        //         \"timestamp\": 1524321838,\n        //         \"confirmations\": 3371,\n        //         \"depositNumber\": 134587098\n        //     }\n        //\n        // withdrawals\n        //\n        //     {\n        //         \"withdrawalRequestsId\": 7397527,\n        //         \"currency\": \"ETC\",\n        //         \"address\": \"0x26419a62055af459d2cd69bb7392f5100b75e304\",\n        //         \"amount\": \"13.19951600\",\n        //         \"fee\": \"0.01000000\",\n        //         \"timestamp\": 1506010932,\n        //         \"status\": \"COMPLETED\",\n        //         \"txid\": \"343346392f82ac16e8c2604f2a604b7b2382d0e9d8030f673821f8de4b5f5bk\",\n        //         \"ipAddress\": \"1.2.3.4\",\n        //         \"paymentID\": null\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"withdrawalRequestsId\": 33485231\n        //     }\n        //\n        // if it's being parsed from \"withdraw()\" method, get the original response\n        if ('withdrawNetworkEntry' in transaction) {\n            transaction = transaction['response'];\n        }\n        const timestamp = this.safeTimestamp (transaction, 'timestamp');\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        let status = this.safeString (transaction, 'status', 'pending');\n        status = this.parseTransactionStatus (status);\n        const txid = this.safeString (transaction, 'txid');\n        const type = ('withdrawalRequestsId' in transaction) ? 'withdrawal' : 'deposit';\n        const id = this.safeString2 (transaction, 'withdrawalRequestsId', 'depositNumber');\n        const address = this.safeString (transaction, 'address');\n        const tag = this.safeString (transaction, 'paymentID');\n        let amountString = this.safeString (transaction, 'amount');\n        const feeCostString = this.safeString (transaction, 'fee');\n        if (type === 'withdrawal') {\n            amountString = Precise.stringSub (amountString, feeCostString);\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'currency': code,\n            'amount': this.parseNumber (amountString),\n            'network': undefined,\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'status': status,\n            'type': type,\n            'updated': undefined,\n            'txid': txid,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.parseNumber (feeCostString),\n                'rate': undefined,\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 3174,
        "line_end": 3186,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'COMPLETE': 'ok',\n            'COMPLETED': 'ok',\n            'AWAITING APPROVAL': 'pending',\n            'AWAITING_APPROVAL': 'pending',\n            'PENDING': 'pending',\n            'PROCESSING': 'pending',\n            'COMPLETE ERROR': 'failed',\n            'COMPLETE_ERROR': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2836,
        "line_end": 2853,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'transferId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'id')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"transferId\" : \"168041074\"\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    {\n        //        \"transferId\" : \"168041074\"\n        //    }\n        //\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'transferId'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeString (currency, 'id'),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "timex": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 822,
        "line_end": 838,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'totalBalance');\n            account['used'] = this.safeString (balance, 'lockedBalance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseCurrency",
        "signature": "parseCurrency (currency: Dict): Currency",
        "line_start": 1431,
        "line_end": 1507,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "code",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "info",
            "value": "currency",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "name",
            "value": "this.safeString (currency, 'name')",
            "comment": null
          },
          {
            "key": "active",
            "value": "this.safeBool (currency, 'active')",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "this.safeBool (currency, 'depositEnabled')",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "this.safeBool (currency, 'withdrawalEnabled')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "precision",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (currency, 'decimals')))",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'withdraw': { 'min': undefined, 'max': undefined },\n                'amount': { 'min': undefined, 'max': undefined },\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "{}",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{ 'min': undefined, 'max': undefined }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{ 'min': undefined, 'max': undefined }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTC\",\n         \"name\": \"Bitcoin\",\n         \"address\": \"0x8370fbc6ddec1e18b4e41e72ed943e238458487c\",\n         \"icon\": \"data:image/svg+xml;base64,PHN2ZyB3aWR...mc+Cg==\",\n         \"background\": \"transparent\",\n         \"fiatSymbol\": \"BTC\",\n         \"decimals\": 8,\n         \"tradeDecimals\": 20,\n         \"displayDecimals\": 4,\n         \"crypto\": true,\n         \"depositEnabled\": true,\n         \"withdrawalEnabled\": true,\n         \"transferEnabled\": true,\n         \"buyEnabled\": false,\n         \"purchaseEnabled\": false,\n         \"redeemEnabled\": false,\n         \"active\": true,\n         \"withdrawalFee\": \"50000000000000000\",\n         \"purchaseCommissions\": []\n     }",
          "{\n         \"symbol\":\"XRP\",\n         \"name\":\"Ripple\",\n         \"address\":\"0x0dc8882914f3ddeebf4cec6dc20edb99df3def6c\",\n         \"decimals\":6,\n         \"tradeDecimals\":16,\n         \"depositEnabled\":true,\n         \"withdrawalEnabled\":true,\n         \"transferEnabled\":true,\n         \"active\":true\n     }"
        ],
        "source": "parseCurrency (currency: Dict): Currency {\n        //\n        //     {\n        //         \"symbol\": \"BTC\",\n        //         \"name\": \"Bitcoin\",\n        //         \"address\": \"0x8370fbc6ddec1e18b4e41e72ed943e238458487c\",\n        //         \"icon\": \"data:image/svg+xml;base64,PHN2ZyB3aWR...mc+Cg==\",\n        //         \"background\": \"transparent\",\n        //         \"fiatSymbol\": \"BTC\",\n        //         \"decimals\": 8,\n        //         \"tradeDecimals\": 20,\n        //         \"displayDecimals\": 4,\n        //         \"crypto\": true,\n        //         \"depositEnabled\": true,\n        //         \"withdrawalEnabled\": true,\n        //         \"transferEnabled\": true,\n        //         \"buyEnabled\": false,\n        //         \"purchaseEnabled\": false,\n        //         \"redeemEnabled\": false,\n        //         \"active\": true,\n        //         \"withdrawalFee\": \"50000000000000000\",\n        //         \"purchaseCommissions\": []\n        //     }\n        //\n        // https://github.com/ccxt/ccxt/issues/6878\n        //\n        //     {\n        //         \"symbol\":\"XRP\",\n        //         \"name\":\"Ripple\",\n        //         \"address\":\"0x0dc8882914f3ddeebf4cec6dc20edb99df3def6c\",\n        //         \"decimals\":6,\n        //         \"tradeDecimals\":16,\n        //         \"depositEnabled\":true,\n        //         \"withdrawalEnabled\":true,\n        //         \"transferEnabled\":true,\n        //         \"active\":true\n        //     }\n        //\n        const id = this.safeString (currency, 'symbol');\n        const code = this.safeCurrencyCode (id);\n        // const fee = this.safeNumber (currency, 'withdrawalFee');\n        const feeString = this.safeString (currency, 'withdrawalFee');\n        const tradeDecimals = this.safeInteger (currency, 'tradeDecimals');\n        let fee = undefined;\n        if ((feeString !== undefined) && (tradeDecimals !== undefined)) {\n            const feeStringLen = feeString.length;\n            const dotIndex = feeStringLen - tradeDecimals;\n            if (dotIndex > 0) {\n                const whole = feeString.slice (0, dotIndex);\n                const fraction = feeString.slice (-dotIndex);\n                fee = this.parseNumber (whole + '.' + fraction);\n            } else {\n                let fraction = '.';\n                for (let i = 0; i < -dotIndex; i++) {\n                    fraction += '0';\n                }\n                fee = this.parseNumber (fraction + feeString);\n            }\n        }\n        return this.safeCurrencyStructure ({\n            'id': code,\n            'code': code,\n            'info': currency,\n            'type': undefined,\n            'name': this.safeString (currency, 'name'),\n            'active': this.safeBool (currency, 'active'),\n            'deposit': this.safeBool (currency, 'depositEnabled'),\n            'withdraw': this.safeBool (currency, 'withdrawalEnabled'),\n            'fee': fee,\n            'precision': this.parseNumber (this.parsePrecision (this.safeString (currency, 'decimals'))),\n            'limits': {\n                'withdraw': { 'min': undefined, 'max': undefined },\n                'amount': { 'min': undefined, 'max': undefined },\n            },\n            'networks': {},\n        });\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1748,
        "line_end": 1771,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        symbol: 'BTC',\n        name: 'Bitcoin',\n        address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',\n        decimals: '8',\n        tradeDecimals: '20',\n        fiatSymbol: 'BTC',\n        depositEnabled: true,\n        withdrawalEnabled: true,\n        transferEnabled: true,\n        active: true\n    }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        symbol: 'BTC',\n        //        name: 'Bitcoin',\n        //        address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',\n        //        decimals: '8',\n        //        tradeDecimals: '20',\n        //        fiatSymbol: 'BTC',\n        //        depositEnabled: true,\n        //        withdrawalEnabled: true,\n        //        transferEnabled: true,\n        //        active: true\n        //    }\n        //\n        const currencyId = this.safeString (depositAddress, 'symbol');\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'network': undefined,\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': undefined,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1347,
        "line_end": 1429,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "!locked",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (market, 'takerFee')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (market, 'makerFee')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'quantityIncrement'),\n                'price': this.safeNumber (market, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.parseNumber (minAmount),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.parseNumber (priceIncrement),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (market, 'quantityIncrement')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (market, 'tickSize')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.parseNumber (minAmount),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.parseNumber (priceIncrement),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': minCost,\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHBTC\",\n         \"name\": \"ETH/BTC\",\n         \"baseCurrency\": \"ETH\",\n         \"baseTokenAddress\": \"0x45932db54b38af1f5a57136302eeba66a5975c15\",\n         \"quoteCurrency\": \"BTC\",\n         \"quoteTokenAddress\": \"0x8370fbc6ddec1e18b4e41e72ed943e238458487c\",\n         \"feeCurrency\": \"BTC\",\n         \"feeTokenAddress\": \"0x8370fbc6ddec1e18b4e41e72ed943e238458487c\",\n         \"quantityIncrement\": \"0.0000001\",\n         \"takerFee\": \"0.005\",\n         \"makerFee\": \"0.0025\",\n         \"tickSize\": \"0.00000001\",\n         \"baseMinSize\": \"0.0001\",\n         \"quoteMinSize\": \"0.00001\",\n         \"locked\": false\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //     {\n        //         \"symbol\": \"ETHBTC\",\n        //         \"name\": \"ETH/BTC\",\n        //         \"baseCurrency\": \"ETH\",\n        //         \"baseTokenAddress\": \"0x45932db54b38af1f5a57136302eeba66a5975c15\",\n        //         \"quoteCurrency\": \"BTC\",\n        //         \"quoteTokenAddress\": \"0x8370fbc6ddec1e18b4e41e72ed943e238458487c\",\n        //         \"feeCurrency\": \"BTC\",\n        //         \"feeTokenAddress\": \"0x8370fbc6ddec1e18b4e41e72ed943e238458487c\",\n        //         \"quantityIncrement\": \"0.0000001\",\n        //         \"takerFee\": \"0.005\",\n        //         \"makerFee\": \"0.0025\",\n        //         \"tickSize\": \"0.00000001\",\n        //         \"baseMinSize\": \"0.0001\",\n        //         \"quoteMinSize\": \"0.00001\",\n        //         \"locked\": false\n        //     }\n        //\n        const locked = this.safeValue (market, 'locked');\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'baseCurrency');\n        const quoteId = this.safeString (market, 'quoteCurrency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const amountIncrement = this.safeString (market, 'quantityIncrement');\n        const minBase = this.safeString (market, 'baseMinSize');\n        const minAmount = Precise.stringMax (amountIncrement, minBase);\n        const priceIncrement = this.safeString (market, 'tickSize');\n        const minCost = this.safeNumber (market, 'quoteMinSize');\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': !locked,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (market, 'takerFee'),\n            'maker': this.safeNumber (market, 'makerFee'),\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'quantityIncrement'),\n                'price': this.safeNumber (market, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.parseNumber (minAmount),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.parseNumber (priceIncrement),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1623,
        "line_end": 1643,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"timestamp\":\"2019-12-04T23:00:00\",\n         \"open\":\"0.02024009\",\n         \"high\":\"0.02024009\",\n         \"low\":\"0.02024009\",\n         \"close\":\"0.02024009\",\n         \"volume\":\"0.00008096036\",\n         \"volumeQuote\":\"0.004\",\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"timestamp\":\"2019-12-04T23:00:00\",\n        //         \"open\":\"0.02024009\",\n        //         \"high\":\"0.02024009\",\n        //         \"low\":\"0.02024009\",\n        //         \"close\":\"0.02024009\",\n        //         \"volume\":\"0.00008096036\",\n        //         \"volumeQuote\":\"0.004\",\n        //     }\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'timestamp')),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1645,
        "line_end": 1709,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "rawTrades",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"cancelledQuantity\": \"0.3\",\n         \"clientOrderId\": \"my-order-1\",\n         \"createdAt\": \"1970-01-01T00:00:00\",\n         \"cursorId\": 50,\n         \"expireTime\": \"1970-01-01T00:00:00\",\n         \"filledQuantity\": \"0.3\",\n         \"id\": \"string\",\n         \"price\": \"0.017\",\n         \"quantity\": \"0.3\",\n         \"side\": \"BUY\",\n         \"symbol\": \"TIMEETH\",\n         \"type\": \"LIMIT\",\n         \"updatedAt\": \"1970-01-01T00:00:00\"\n         \"trades\": [], // injected from the outside\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // fetchOrder, createOrder, cancelOrder, cancelOrders, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"cancelledQuantity\": \"0.3\",\n        //         \"clientOrderId\": \"my-order-1\",\n        //         \"createdAt\": \"1970-01-01T00:00:00\",\n        //         \"cursorId\": 50,\n        //         \"expireTime\": \"1970-01-01T00:00:00\",\n        //         \"filledQuantity\": \"0.3\",\n        //         \"id\": \"string\",\n        //         \"price\": \"0.017\",\n        //         \"quantity\": \"0.3\",\n        //         \"side\": \"BUY\",\n        //         \"symbol\": \"TIMEETH\",\n        //         \"type\": \"LIMIT\",\n        //         \"updatedAt\": \"1970-01-01T00:00:00\"\n        //         \"trades\": [], // injected from the outside\n        //     }\n        //\n        const id = this.safeString (order, 'id');\n        const type = this.safeStringLower (order, 'type');\n        const side = this.safeStringLower (order, 'side');\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.parse8601 (this.safeString (order, 'createdAt'));\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'quantity');\n        const filled = this.safeString (order, 'filledQuantity');\n        const canceledQuantity = this.omitZero (this.safeString (order, 'cancelledQuantity'));\n        let status: string;\n        if (Precise.stringEquals (filled, amount)) {\n            status = 'closed';\n        } else if (canceledQuantity !== undefined) {\n            status = 'canceled';\n        } else {\n            status = 'open';\n        }\n        const rawTrades = this.safeValue (order, 'trades', []);\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'average': undefined,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': undefined,\n            'trades': rawTrades,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1509,
        "line_end": 1552,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'volume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'volumeQuote')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"ask\": 0.017,\n         \"bid\": 0.016,\n         \"high\": 0.019,\n         \"last\": 0.017,\n         \"low\": 0.015,\n         \"market\": \"TIME/ETH\",\n         \"open\": 0.016,\n         \"period\": \"H1\",\n         \"timestamp\": \"2018-12-14T20:50:36.134Z\",\n         \"volume\": 4.57,\n         \"volumeQuote\": 0.07312\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"ask\": 0.017,\n        //         \"bid\": 0.016,\n        //         \"high\": 0.019,\n        //         \"last\": 0.017,\n        //         \"low\": 0.015,\n        //         \"market\": \"TIME/ETH\",\n        //         \"open\": 0.016,\n        //         \"period\": \"H1\",\n        //         \"timestamp\": \"2018-12-14T20:50:36.134Z\",\n        //         \"volume\": 4.57,\n        //         \"volumeQuote\": 0.07312\n        //     }\n        //\n        const marketId = this.safeString (ticker, 'market');\n        const symbol = this.safeSymbol (marketId, market, '/');\n        const timestamp = this.parse8601 (this.safeString (ticker, 'timestamp'));\n        const last = this.safeString (ticker, 'last');\n        const open = this.safeString (ticker, 'open');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'info': ticker,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'volume'),\n            'quoteVolume': this.safeString (ticker, 'volumeQuote'),\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1554,
        "line_end": 1621,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\":1,\n         \"timestamp\":\"2019-06-25T17:01:50.309\",\n         \"direction\":\"BUY\",\n         \"price\":\"0.027\",\n         \"quantity\":\"0.001\"\n     }",
          "{\n         \"id\": \"7613414\",\n         \"makerOrderId\": \"0x8420af060722f560098f786a2894d4358079b6ea5d14b395969ed77bc87a623a\",\n         \"takerOrderId\": \"0x1235ef158a361815b54c9988b6241c85aedcbc1fe81caf8df8587d5ab0373d1a\",\n         \"symbol\": \"LTCUSDT\",\n         \"side\": \"BUY\",\n         \"quantity\": \"0.2\",\n         \"fee\": \"0.22685\",\n         \"feeToken\": \"USDT\",\n         \"price\": \"226.85\",\n         \"makerOrTaker\": \"TAKER\",\n         \"timestamp\": \"2021-04-09T15:39:45.608\"\n    }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //         \"id\":1,\n        //         \"timestamp\":\"2019-06-25T17:01:50.309\",\n        //         \"direction\":\"BUY\",\n        //         \"price\":\"0.027\",\n        //         \"quantity\":\"0.001\"\n        //     }\n        //\n        // fetchMyTrades, fetchOrder (private)\n        //\n        //     {\n        //         \"id\": \"7613414\",\n        //         \"makerOrderId\": \"0x8420af060722f560098f786a2894d4358079b6ea5d14b395969ed77bc87a623a\",\n        //         \"takerOrderId\": \"0x1235ef158a361815b54c9988b6241c85aedcbc1fe81caf8df8587d5ab0373d1a\",\n        //         \"symbol\": \"LTCUSDT\",\n        //         \"side\": \"BUY\",\n        //         \"quantity\": \"0.2\",\n        //         \"fee\": \"0.22685\",\n        //         \"feeToken\": \"USDT\",\n        //         \"price\": \"226.85\",\n        //         \"makerOrTaker\": \"TAKER\",\n        //         \"timestamp\": \"2021-04-09T15:39:45.608\"\n        //    }\n        //\n        const marketId = this.safeString (trade, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const timestamp = this.parse8601 (this.safeString (trade, 'timestamp'));\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'quantity');\n        const price = this.parseNumber (priceString);\n        const amount = this.parseNumber (amountString);\n        const cost = this.parseNumber (Precise.stringMul (priceString, amountString));\n        const id = this.safeString (trade, 'id');\n        const side = this.safeStringLower2 (trade, 'direction', 'side');\n        const takerOrMaker = this.safeStringLower (trade, 'makerOrTaker');\n        let orderId: Str = undefined;\n        if (takerOrMaker !== undefined) {\n            orderId = this.safeString (trade, takerOrMaker + 'OrderId');\n        }\n        let fee = undefined;\n        const feeCost = this.safeNumber (trade, 'fee');\n        const feeCurrency = this.safeCurrencyCode (this.safeString (trade, 'feeToken'));\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrency,\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n        });\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1300,
        "line_end": 1317,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "rate",
            "comment": null
          },
          {
            "key": "taker",
            "value": "rate",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"fee\": 0.0075,\n         \"market\": \"ETHBTC\"\n     }"
        ],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        //\n        //     {\n        //         \"fee\": 0.0075,\n        //         \"market\": \"ETHBTC\"\n        //     }\n        //\n        const marketId = this.safeString (fee, 'market');\n        const rate = this.safeNumber (fee, 'fee');\n        return {\n            'info': fee,\n            'symbol': this.safeSymbol (marketId, market),\n            'maker': rate,\n            'taker': rate,\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 552,
        "line_end": 588,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'transferHash')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "this.safeString (transaction, 'to')",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (transaction, 'from')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'value')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"from\": \"0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed\",\n         \"timestamp\": \"2022-01-01T00:00:00Z\",\n         \"to\": \"0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed\",\n         \"token\": \"0x6baad3fe5d0fd4be604420e728adbd68d67e119e\",\n         \"transferHash\": \"0x5464cdff35448314e178b8677ea41e670ea0f2533f4e52bfbd4e4a6cfcdef4c2\",\n         \"value\": \"100\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"from\": \"0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed\",\n        //         \"timestamp\": \"2022-01-01T00:00:00Z\",\n        //         \"to\": \"0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed\",\n        //         \"token\": \"0x6baad3fe5d0fd4be604420e728adbd68d67e119e\",\n        //         \"transferHash\": \"0x5464cdff35448314e178b8677ea41e670ea0f2533f4e52bfbd4e4a6cfcdef4c2\",\n        //         \"value\": \"100\"\n        //     }\n        //\n        const datetime = this.safeString (transaction, 'timestamp');\n        const currencyAddresss = this.safeString (transaction, 'token', '');\n        currency = this.getCurrencyByAddress (currencyAddresss);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'transferHash'),\n            'txid': this.safeString (transaction, 'txid'),\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'network': undefined,\n            'address': undefined,\n            'addressTo': this.safeString (transaction, 'to'),\n            'addressFrom': this.safeString (transaction, 'from'),\n            'tag': undefined,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'type': undefined,\n            'amount': this.safeNumber (transaction, 'value'),\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'status': 'ok',\n            'updated': undefined,\n            'internal': undefined,\n            'comment': undefined,\n            'fee': undefined,\n        };\n    }"
      }
    ],
    "tokocrypto": [
      {
        "name": "parseBalanceCustom",
        "signature": "parseBalanceCustom (response, type = undefined, marginMode = undefined)",
        "line_start": 1500,
        "line_end": 1519,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalanceCustom (response, type = undefined, marginMode = undefined) {\n        const timestamp = this.safeInteger (response, 'updateTime');\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const data = this.safeValue (response, 'data', {});\n        const balances = this.safeValue (data, 'accountAssets', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'asset');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'free');\n            account['used'] = this.safeString (balance, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1351,
        "line_end": 1394,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591478520000, // open time\n         \"0.02501300\",  // open\n         \"0.02501800\",  // high\n         \"0.02500000\",  // low\n         \"0.02500000\",  // close\n         \"22.19000000\", // volume\n         1591478579999, // close time\n         \"0.55490906\",  // quote asset volume\n         40,            // number of trades\n         \"10.92900000\", // taker buy base asset volume\n         \"0.27336462\",  // taker buy quote asset volume\n         \"0\"            // ignore\n     ]",
          "[\n         [\n         1591256460000,          // Open time\n         \"9653.29201333\",        // Open\n         \"9654.56401333\",        // High\n         \"9653.07367333\",        // Low\n         \"9653.07367333\",        // Close (or latest price)\n         \"0\",                    // Ignore\n         1591256519999,          // Close time\n         \"0\",                    // Ignore\n         60,                     // Number of bisic data\n         \"0\",                    // Ignore\n         \"0\",                    // Ignore\n         \"0\"                     // Ignore\n         ]\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        // when api method = publicGetKlines || fapiPublicGetKlines || dapiPublicGetKlines\n        //     [\n        //         1591478520000, // open time\n        //         \"0.02501300\",  // open\n        //         \"0.02501800\",  // high\n        //         \"0.02500000\",  // low\n        //         \"0.02500000\",  // close\n        //         \"22.19000000\", // volume\n        //         1591478579999, // close time\n        //         \"0.55490906\",  // quote asset volume\n        //         40,            // number of trades\n        //         \"10.92900000\", // taker buy base asset volume\n        //         \"0.27336462\",  // taker buy quote asset volume\n        //         \"0\"            // ignore\n        //     ]\n        //\n        //  when api method = fapiPublicGetMarkPriceKlines || fapiPublicGetIndexPriceKlines\n        //     [\n        //         [\n        //         1591256460000,          // Open time\n        //         \"9653.29201333\",        // Open\n        //         \"9654.56401333\",        // High\n        //         \"9653.07367333\",        // Low\n        //         \"9653.07367333\",        // Close (or latest price)\n        //         \"0\",                    // Ignore\n        //         1591256519999,          // Close time\n        //         \"0\",                    // Ignore\n        //         60,                     // Number of bisic data\n        //         \"0\",                    // Ignore\n        //         \"0\",                    // Ignore\n        //         \"0\"                     // Ignore\n        //         ]\n        //     ]\n        //\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (ohlcv, 1),\n            this.safeNumber (ohlcv, 2),\n            this.safeNumber (ohlcv, 3),\n            this.safeNumber (ohlcv, 4),\n            this.safeNumber (ohlcv, 5),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1542,
        "line_end": 1692,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "this.safeValue (order, 'reduceOnly')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.parseNumber (this.omitZero (this.safeString (order, 'stopPrice')))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "fills",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"LTCBTC\",\n         \"orderId\": 1,\n         \"clientOrderId\": \"myOrder1\",\n         \"price\": \"0.1\",\n         \"origQty\": \"1.0\",\n         \"executedQty\": \"0.0\",\n         \"cummulativeQuoteQty\": \"0.0\",\n         \"status\": \"NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"LIMIT\",\n         \"side\": \"BUY\",\n         \"stopPrice\": \"0.0\",\n         \"icebergQty\": \"0.0\",\n         \"time\": 1499827319559,\n         \"updateTime\": 1499827319559,\n         \"isWorking\": true\n     }",
          "{\n         \"orderId\": \"145265071\",\n         \"bOrderListId\": \"0\",\n         \"clientId\": \"49c09c3c2cd54419a59c05441f517b3c\",\n         \"bOrderId\": \"35247529\",\n         \"symbol\": \"USDT_BIDR\",\n         \"symbolType\": \"1\",\n         \"side\": \"0\",\n         \"type\": \"1\",\n         \"price\": \"11915\",\n         \"origQty\": \"2\",\n         \"origQuoteQty\": \"23830.00\",\n         \"executedQty\": \"0.00000000\",\n         \"executedPrice\": \"0\",\n         \"executedQuoteQty\": \"0.00\",\n         \"timeInForce\": \"1\",\n         \"stopPrice\": \"0\",\n         \"icebergQty\": \"0\",\n         \"status\": \"0\",\n         \"createTime\": \"1662711074372\"\n     }",
          "createOrder with { \"newOrderRespType\": \"FULL\" }",
          "{\n       \"symbol\": \"BTCUSDT\",\n       \"orderId\": 5403233939,\n       \"orderListId\": -1,\n       \"clientOrderId\": \"x-R4BD3S825e669e75b6c14f69a2c43e\",\n       \"transactTime\": 1617151923742,\n       \"price\": \"0.00000000\",\n       \"origQty\": \"0.00050000\",\n       \"executedQty\": \"0.00050000\",\n       \"cummulativeQuoteQty\": \"29.47081500\",\n       \"status\": \"FILLED\",\n       \"timeInForce\": \"GTC\",\n       \"type\": \"MARKET\",\n       \"side\": \"BUY\",\n       \"fills\": [\n         {\n           \"price\": \"58941.63000000\",\n           \"qty\": \"0.00050000\",\n           \"commission\": \"0.00007050\",\n           \"commissionAsset\": \"BNB\",\n           \"tradeId\": 737466631\n         }\n       ]\n     }",
          "{\n       \"orderId\": \"18742727411\",\n       \"symbol\": \"ETHUSD_PERP\",\n       \"pair\": \"ETHUSD\",\n       \"status\": \"FILLED\",\n       \"clientOrderId\": \"x-xcKtGhcu3e2d1503fdd543b3b02419\",\n       \"price\": \"0\",\n       \"avgPrice\": \"4522.14\",\n       \"origQty\": \"1\",\n       \"executedQty\": \"1\",\n       \"cumBase\": \"0.00221134\",\n       \"timeInForce\": \"GTC\",\n       \"type\": \"MARKET\",\n       \"reduceOnly\": false,\n       \"closePosition\": false,\n       \"side\": \"SELL\",\n       \"positionSide\": \"BOTH\",\n       \"stopPrice\": \"0\",\n       \"workingType\": \"CONTRACT_PRICE\",\n       \"priceProtect\": false,\n       \"origType\": \"MARKET\",\n       \"time\": \"1636061952660\",\n       \"updateTime\": \"1636061952660\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // spot\n        //\n        //     {\n        //         \"symbol\": \"LTCBTC\",\n        //         \"orderId\": 1,\n        //         \"clientOrderId\": \"myOrder1\",\n        //         \"price\": \"0.1\",\n        //         \"origQty\": \"1.0\",\n        //         \"executedQty\": \"0.0\",\n        //         \"cummulativeQuoteQty\": \"0.0\",\n        //         \"status\": \"NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"LIMIT\",\n        //         \"side\": \"BUY\",\n        //         \"stopPrice\": \"0.0\",\n        //         \"icebergQty\": \"0.0\",\n        //         \"time\": 1499827319559,\n        //         \"updateTime\": 1499827319559,\n        //         \"isWorking\": true\n        //     }\n        // createOrder\n        //     {\n        //         \"orderId\": \"145265071\",\n        //         \"bOrderListId\": \"0\",\n        //         \"clientId\": \"49c09c3c2cd54419a59c05441f517b3c\",\n        //         \"bOrderId\": \"35247529\",\n        //         \"symbol\": \"USDT_BIDR\",\n        //         \"symbolType\": \"1\",\n        //         \"side\": \"0\",\n        //         \"type\": \"1\",\n        //         \"price\": \"11915\",\n        //         \"origQty\": \"2\",\n        //         \"origQuoteQty\": \"23830.00\",\n        //         \"executedQty\": \"0.00000000\",\n        //         \"executedPrice\": \"0\",\n        //         \"executedQuoteQty\": \"0.00\",\n        //         \"timeInForce\": \"1\",\n        //         \"stopPrice\": \"0\",\n        //         \"icebergQty\": \"0\",\n        //         \"status\": \"0\",\n        //         \"createTime\": \"1662711074372\"\n        //     }\n        //\n        // createOrder with { \"newOrderRespType\": \"FULL\" }\n        //\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"orderId\": 5403233939,\n        //       \"orderListId\": -1,\n        //       \"clientOrderId\": \"x-R4BD3S825e669e75b6c14f69a2c43e\",\n        //       \"transactTime\": 1617151923742,\n        //       \"price\": \"0.00000000\",\n        //       \"origQty\": \"0.00050000\",\n        //       \"executedQty\": \"0.00050000\",\n        //       \"cummulativeQuoteQty\": \"29.47081500\",\n        //       \"status\": \"FILLED\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"side\": \"BUY\",\n        //       \"fills\": [\n        //         {\n        //           \"price\": \"58941.63000000\",\n        //           \"qty\": \"0.00050000\",\n        //           \"commission\": \"0.00007050\",\n        //           \"commissionAsset\": \"BNB\",\n        //           \"tradeId\": 737466631\n        //         }\n        //       ]\n        //     }\n        //\n        // delivery\n        //\n        //     {\n        //       \"orderId\": \"18742727411\",\n        //       \"symbol\": \"ETHUSD_PERP\",\n        //       \"pair\": \"ETHUSD\",\n        //       \"status\": \"FILLED\",\n        //       \"clientOrderId\": \"x-xcKtGhcu3e2d1503fdd543b3b02419\",\n        //       \"price\": \"0\",\n        //       \"avgPrice\": \"4522.14\",\n        //       \"origQty\": \"1\",\n        //       \"executedQty\": \"1\",\n        //       \"cumBase\": \"0.00221134\",\n        //       \"timeInForce\": \"GTC\",\n        //       \"type\": \"MARKET\",\n        //       \"reduceOnly\": false,\n        //       \"closePosition\": false,\n        //       \"side\": \"SELL\",\n        //       \"positionSide\": \"BOTH\",\n        //       \"stopPrice\": \"0\",\n        //       \"workingType\": \"CONTRACT_PRICE\",\n        //       \"priceProtect\": false,\n        //       \"origType\": \"MARKET\",\n        //       \"time\": \"1636061952660\",\n        //       \"updateTime\": \"1636061952660\"\n        //     }\n        //\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        const marketId = this.safeString (order, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const filled = this.safeString (order, 'executedQty', '0');\n        const timestamp = this.safeInteger (order, 'createTime');\n        const average = this.safeString (order, 'avgPrice');\n        const price = this.safeString2 (order, 'price', 'executedPrice');\n        const amount = this.safeString (order, 'origQty');\n        // - Spot/Margin market: cummulativeQuoteQty\n        //   Note this is not the actual cost, since Binance futures uses leverage to calculate margins.\n        const cost = this.safeStringN (order, [ 'cummulativeQuoteQty', 'cumQuote', 'executedQuoteQty', 'cumBase' ]);\n        const id = this.safeString (order, 'orderId');\n        const type = this.parseOrderType (this.safeStringLower (order, 'type'));\n        let side = this.safeStringLower (order, 'side');\n        if (side === '0') {\n            side = 'buy';\n        } else if (side === '1') {\n            side = 'sell';\n        }\n        const fills = this.safeValue (order, 'fills', []);\n        const clientOrderId = this.safeString2 (order, 'clientOrderId', 'clientId');\n        let timeInForce = this.safeString (order, 'timeInForce');\n        if (timeInForce === 'GTX') {\n            // GTX means \"Good Till Crossing\" and is an equivalent way of saying Post Only\n            timeInForce = 'PO';\n        }\n        const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': postOnly,\n            'reduceOnly': this.safeValue (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': this.parseNumber (this.omitZero (this.safeString (order, 'stopPrice'))),\n            'amount': amount,\n            'cost': cost,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': undefined,\n            'trades': fills,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1521,
        "line_end": 1540,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '-2': 'open',\n            '0': 'open', // NEW\n            '1': 'open', // PARTIALLY_FILLED\n            '2': 'closed', // FILLED\n            '3': 'canceled', // CANCELED\n            '4': 'canceling', // PENDING_CANCEL (currently unused)\n            '5': 'rejected', // REJECTED\n            '6': 'expired', // EXPIRED\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'PENDING_CANCEL': 'canceling', // currently unused\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1694,
        "line_end": 1702,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            '2': 'market',\n            '1': 'limit',\n            '4': 'limit',\n            '7': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1206,
        "line_end": 1289,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'highPrice')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'lowPrice')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bidPrice')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeString (ticker, 'bidQty')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'askPrice')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeString (ticker, 'askQty')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "this.safeString (ticker, 'weightedAvgPrice')",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'openPrice')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'prevClosePrice')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'priceChangePercent')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHBTC\",\n         \"priceChange\": \"0.00068700\",\n         \"priceChangePercent\": \"2.075\",\n         \"weightedAvgPrice\": \"0.03342681\",\n         \"prevClosePrice\": \"0.03310300\",\n         \"lastPrice\": \"0.03378900\",\n         \"lastQty\": \"0.07700000\",\n         \"bidPrice\": \"0.03378900\",\n         \"bidQty\": \"7.16800000\",\n         \"askPrice\": \"0.03379000\",\n         \"askQty\": \"24.00000000\",\n         \"openPrice\": \"0.03310200\",\n         \"highPrice\": \"0.03388900\",\n         \"lowPrice\": \"0.03306900\",\n         \"volume\": \"205478.41000000\",\n         \"quoteVolume\": \"6868.48826294\",\n         \"openTime\": 1601469986932,\n         \"closeTime\": 1601556386932,\n         \"firstId\": 196098772,\n         \"lastId\": 196186315,\n         \"count\": 87544\n     }",
          "{\n         \"baseVolume\": \"214549.95171161\",\n         \"closeTime\": \"1621965286847\",\n         \"count\": \"1283779\",\n         \"firstId\": \"152560106\",\n         \"highPrice\": \"39938.3\",\n         \"lastId\": \"153843955\",\n         \"lastPrice\": \"37993.4\",\n         \"lastQty\": \"1\",\n         \"lowPrice\": \"36457.2\",\n         \"openPrice\": \"37783.4\",\n         \"openTime\": \"1621878840000\",\n         \"pair\": \"BTCUSD\",\n         \"priceChange\": \"210.0\",\n         \"priceChangePercent\": \"0.556\",\n         \"symbol\": \"BTCUSD_PERP\",\n         \"volume\": \"81990451\",\n         \"weightedAvgPrice\": \"38215.08713747\"\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"symbol\": \"ETHBTC\",\n        //         \"priceChange\": \"0.00068700\",\n        //         \"priceChangePercent\": \"2.075\",\n        //         \"weightedAvgPrice\": \"0.03342681\",\n        //         \"prevClosePrice\": \"0.03310300\",\n        //         \"lastPrice\": \"0.03378900\",\n        //         \"lastQty\": \"0.07700000\",\n        //         \"bidPrice\": \"0.03378900\",\n        //         \"bidQty\": \"7.16800000\",\n        //         \"askPrice\": \"0.03379000\",\n        //         \"askQty\": \"24.00000000\",\n        //         \"openPrice\": \"0.03310200\",\n        //         \"highPrice\": \"0.03388900\",\n        //         \"lowPrice\": \"0.03306900\",\n        //         \"volume\": \"205478.41000000\",\n        //         \"quoteVolume\": \"6868.48826294\",\n        //         \"openTime\": 1601469986932,\n        //         \"closeTime\": 1601556386932,\n        //         \"firstId\": 196098772,\n        //         \"lastId\": 196186315,\n        //         \"count\": 87544\n        //     }\n        //\n        // coinm\n        //     {\n        //         \"baseVolume\": \"214549.95171161\",\n        //         \"closeTime\": \"1621965286847\",\n        //         \"count\": \"1283779\",\n        //         \"firstId\": \"152560106\",\n        //         \"highPrice\": \"39938.3\",\n        //         \"lastId\": \"153843955\",\n        //         \"lastPrice\": \"37993.4\",\n        //         \"lastQty\": \"1\",\n        //         \"lowPrice\": \"36457.2\",\n        //         \"openPrice\": \"37783.4\",\n        //         \"openTime\": \"1621878840000\",\n        //         \"pair\": \"BTCUSD\",\n        //         \"priceChange\": \"210.0\",\n        //         \"priceChangePercent\": \"0.556\",\n        //         \"symbol\": \"BTCUSD_PERP\",\n        //         \"volume\": \"81990451\",\n        //         \"weightedAvgPrice\": \"38215.08713747\"\n        //     }\n        //\n        const timestamp = this.safeInteger (ticker, 'closeTime');\n        const marketId = this.safeString (ticker, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const last = this.safeString (ticker, 'lastPrice');\n        const isCoinm = ('baseVolume' in ticker);\n        let baseVolume = undefined;\n        let quoteVolume = undefined;\n        if (isCoinm) {\n            baseVolume = this.safeString (ticker, 'baseVolume');\n            quoteVolume = this.safeString (ticker, 'volume');\n        } else {\n            baseVolume = this.safeString (ticker, 'volume');\n            quoteVolume = this.safeString (ticker, 'quoteVolume');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'highPrice'),\n            'low': this.safeString (ticker, 'lowPrice'),\n            'bid': this.safeString (ticker, 'bidPrice'),\n            'bidVolume': this.safeString (ticker, 'bidQty'),\n            'ask': this.safeString (ticker, 'askPrice'),\n            'askVolume': this.safeString (ticker, 'askQty'),\n            'vwap': this.safeString (ticker, 'weightedAvgPrice'),\n            'open': this.safeString (ticker, 'openPrice'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'prevClosePrice'), // previous day close\n            'change': this.safeString (ticker, 'priceChange'),\n            'percentage': this.safeString (ticker, 'priceChangePercent'),\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 954,
        "line_end": 1098,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"a\": 26129,         // Aggregate tradeId\n         \"p\": \"0.01633102\",  // Price\n         \"q\": \"4.70443515\",  // Quantity\n         \"f\": 27781,         // First tradeId\n         \"l\": 27781,         // Last tradeId\n         \"T\": 1498793709153, // Timestamp\n         \"m\": true,          // Was the buyer the maker?\n         \"M\": true           // Was the trade the best price match?\n     }",
          "{\n         \"id\": 28457,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"time\": 1499865549590,\n         \"isBuyerMaker\": true,\n         \"isBestMatch\": true\n     }",
          "{\n         \"symbol\": \"BNBBTC\",\n         \"id\": 28457,\n         \"orderId\": 100234,\n         \"price\": \"4.00000100\",\n         \"qty\": \"12.00000000\",\n         \"commission\": \"10.10000000\",\n         \"commissionAsset\": \"BNB\",\n         \"time\": 1499865549590,\n         \"isBuyer\": true,\n         \"isMaker\": false,\n         \"isBestMatch\": true\n     }",
          "{\n       \"accountId\": 20,\n       \"buyer\": False,\n       \"commission\": \"-0.07819010\",\n       \"commissionAsset\": \"USDT\",\n       \"counterPartyId\": 653,\n       \"id\": 698759,\n       \"maker\": False,\n       \"orderId\": 25851813,\n       \"price\": \"7819.01\",\n       \"qty\": \"0.002\",\n       \"quoteQty\": \"0.01563\",\n       \"realizedPnl\": \"-0.91539999\",\n       \"side\": \"SELL\",\n       \"symbol\": \"BTCUSDT\",\n       \"time\": 1569514978020\n     }",
          "{\n       \"symbol\": \"BTCUSDT\",\n       \"id\": 477128891,\n       \"orderId\": 13809777875,\n       \"side\": \"SELL\",\n       \"price\": \"38479.55\",\n       \"qty\": \"0.001\",\n       \"realizedPnl\": \"-0.00009534\",\n       \"marginAsset\": \"USDT\",\n       \"quoteQty\": \"38.47955\",\n       \"commission\": \"-0.00076959\",\n       \"commissionAsset\": \"USDT\",\n       \"time\": 1612733566708,\n       \"positionSide\": \"BOTH\",\n       \"maker\": true,\n       \"buyer\": false\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // aggregate trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list\n        //\n        //     {\n        //         \"a\": 26129,         // Aggregate tradeId\n        //         \"p\": \"0.01633102\",  // Price\n        //         \"q\": \"4.70443515\",  // Quantity\n        //         \"f\": 27781,         // First tradeId\n        //         \"l\": 27781,         // Last tradeId\n        //         \"T\": 1498793709153, // Timestamp\n        //         \"m\": true,          // Was the buyer the maker?\n        //         \"M\": true           // Was the trade the best price match?\n        //     }\n        //\n        // recent public trades and old public trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#recent-trades-list\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data\n        //\n        //     {\n        //         \"id\": 28457,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyerMaker\": true,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // private trades\n        // https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-trade-list-user_data\n        //\n        //     {\n        //         \"symbol\": \"BNBBTC\",\n        //         \"id\": 28457,\n        //         \"orderId\": 100234,\n        //         \"price\": \"4.00000100\",\n        //         \"qty\": \"12.00000000\",\n        //         \"commission\": \"10.10000000\",\n        //         \"commissionAsset\": \"BNB\",\n        //         \"time\": 1499865549590,\n        //         \"isBuyer\": true,\n        //         \"isMaker\": false,\n        //         \"isBestMatch\": true\n        //     }\n        //\n        // futures trades\n        // https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data\n        //\n        //     {\n        //       \"accountId\": 20,\n        //       \"buyer\": False,\n        //       \"commission\": \"-0.07819010\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"counterPartyId\": 653,\n        //       \"id\": 698759,\n        //       \"maker\": False,\n        //       \"orderId\": 25851813,\n        //       \"price\": \"7819.01\",\n        //       \"qty\": \"0.002\",\n        //       \"quoteQty\": \"0.01563\",\n        //       \"realizedPnl\": \"-0.91539999\",\n        //       \"side\": \"SELL\",\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"time\": 1569514978020\n        //     }\n        //     {\n        //       \"symbol\": \"BTCUSDT\",\n        //       \"id\": 477128891,\n        //       \"orderId\": 13809777875,\n        //       \"side\": \"SELL\",\n        //       \"price\": \"38479.55\",\n        //       \"qty\": \"0.001\",\n        //       \"realizedPnl\": \"-0.00009534\",\n        //       \"marginAsset\": \"USDT\",\n        //       \"quoteQty\": \"38.47955\",\n        //       \"commission\": \"-0.00076959\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"time\": 1612733566708,\n        //       \"positionSide\": \"BOTH\",\n        //       \"maker\": true,\n        //       \"buyer\": false\n        //     }\n        //\n        // { respType: FULL }\n        //\n        //     {\n        //       \"price\": \"4000.00000000\",\n        //       \"qty\": \"1.00000000\",\n        //       \"commission\": \"4.00000000\",\n        //       \"commissionAsset\": \"USDT\",\n        //       \"tradeId\": \"1234\",\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'T', 'time');\n        const price = this.safeString2 (trade, 'p', 'price');\n        const amount = this.safeString2 (trade, 'q', 'qty');\n        const cost = this.safeString2 (trade, 'quoteQty', 'baseQty');  // inverse futures\n        const marketId = this.safeString (trade, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        let id = this.safeString2 (trade, 't', 'a');\n        id = this.safeString2 (trade, 'id', 'tradeId', id);\n        let side: Str = undefined;\n        const orderId = this.safeString (trade, 'orderId');\n        const buyerMaker = this.safeValue2 (trade, 'm', 'isBuyerMaker');\n        let takerOrMaker: Str = undefined;\n        if (buyerMaker !== undefined) {\n            side = buyerMaker ? 'sell' : 'buy'; // this is reversed intentionally\n            takerOrMaker = 'taker';\n        } else if ('side' in trade) {\n            side = this.safeStringLower (trade, 'side');\n        } else {\n            if ('isBuyer' in trade) {\n                side = trade['isBuyer'] ? 'buy' : 'sell'; // this is a true side\n            }\n        }\n        let fee = undefined;\n        if ('commission' in trade) {\n            fee = {\n                'cost': this.safeString (trade, 'commission'),\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'commissionAsset')),\n            };\n        }\n        if ('isMaker' in trade) {\n            takerOrMaker = trade['isMaker'] ? 'maker' : 'taker';\n        }\n        if ('maker' in trade) {\n            takerOrMaker = trade['maker'] ? 'maker' : 'taker';\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2343,
        "line_end": 2457,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "txid",
            "value": "txid",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (transaction, 'network')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tag",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger2 (transaction, 'successTime', 'updateTime')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "internal",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 5167969,\n         \"asset\": \"BIDR\",\n         \"network\": \"BSC\",\n         \"address\": \"0x101a925704f6ff13295ab8dd7a60988d116aaedf\",\n         \"addressTag\": \"\",\n         \"txId\": \"113409337867\",\n         \"amount\": \"15000\",\n         \"transferType\": 1,\n         \"status\": 1,\n         \"insertTime\": \"1659429390000\"\n     }",
          "{\n         \"id\": 4245859,\n         \"clientId\": \"198\",\n         \"asset\": \"BIDR\",\n         \"network\": \"BSC\",\n         \"address\": \"0xff1c75149cc492e7d5566145b859fcafc900b6e9\",\n         \"addressTag\": \"\",\n         \"amount\": \"10000\",\n         \"fee\": \"0\",\n         \"txId\": \"113501794501\",\n         \"transferType\": 1,\n         \"status\": 10,\n         \"createTime\": 1659521314413\n     }",
          "{\n         \"code\": 0,\n         \"msg\": \"成功\",\n         \"data\": {\n             \"withdrawId\":\"12\"\n         },\n         \"timestamp\": 1571745049095\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": 5167969,\n        //         \"asset\": \"BIDR\",\n        //         \"network\": \"BSC\",\n        //         \"address\": \"0x101a925704f6ff13295ab8dd7a60988d116aaedf\",\n        //         \"addressTag\": \"\",\n        //         \"txId\": \"113409337867\",\n        //         \"amount\": \"15000\",\n        //         \"transferType\": 1,\n        //         \"status\": 1,\n        //         \"insertTime\": \"1659429390000\"\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": 4245859,\n        //         \"clientId\": \"198\",\n        //         \"asset\": \"BIDR\",\n        //         \"network\": \"BSC\",\n        //         \"address\": \"0xff1c75149cc492e7d5566145b859fcafc900b6e9\",\n        //         \"addressTag\": \"\",\n        //         \"amount\": \"10000\",\n        //         \"fee\": \"0\",\n        //         \"txId\": \"113501794501\",\n        //         \"transferType\": 1,\n        //         \"status\": 10,\n        //         \"createTime\": 1659521314413\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"code\": 0,\n        //         \"msg\": \"成功\",\n        //         \"data\": {\n        //             \"withdrawId\":\"12\"\n        //         },\n        //         \"timestamp\": 1571745049095\n        //     }\n        //\n        const address = this.safeString (transaction, 'address');\n        let tag = this.safeString (transaction, 'addressTag'); // set but unused\n        if (tag !== undefined) {\n            if (tag.length < 1) {\n                tag = undefined;\n            }\n        }\n        let txid = this.safeString (transaction, 'txId');\n        if ((txid !== undefined) && (txid.indexOf ('Internal transfer ') >= 0)) {\n            txid = txid.slice (18);\n        }\n        const currencyId = this.safeString2 (transaction, 'coin', 'fiatCurrency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        let timestamp = undefined;\n        const insertTime = this.safeInteger (transaction, 'insertTime');\n        const createTime = this.safeInteger2 (transaction, 'createTime', 'timestamp');\n        let type = this.safeString (transaction, 'type');\n        if (type === undefined) {\n            if ((insertTime !== undefined) && (createTime === undefined)) {\n                type = 'deposit';\n                timestamp = insertTime;\n            } else if ((insertTime === undefined) && (createTime !== undefined)) {\n                type = 'withdrawal';\n                timestamp = createTime;\n            }\n        }\n        const feeCost = this.safeNumber2 (transaction, 'transactionFee', 'totalFee');\n        const fee = {\n            'currency': undefined,\n            'cost': undefined,\n            'rate': undefined,\n        };\n        if (feeCost !== undefined) {\n            fee['currency'] = code;\n            fee['cost'] = feeCost;\n        }\n        const internalRaw = this.safeInteger (transaction, 'transferType');\n        let internal = false;\n        if (internalRaw !== undefined) {\n            internal = true;\n        }\n        let id = this.safeString (transaction, 'id');\n        if (id === undefined) {\n            const data = this.safeValue (transaction, 'data', {});\n            id = this.safeString (data, 'withdrawId');\n            type = 'withdrawal';\n        }\n        return {\n            'info': transaction,\n            'id': id,\n            'txid': txid,\n            'type': type,\n            'currency': code,\n            'network': this.safeString (transaction, 'network'),\n            'amount': this.safeNumber (transaction, 'amount'),\n            'status': this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': address,\n            'addressFrom': undefined,\n            'addressTo': address,\n            'tag': tag,\n            'tagFrom': undefined,\n            'tagTo': tag,\n            'updated': this.safeInteger2 (transaction, 'successTime', 'updateTime'),\n            'comment': undefined,\n            'internal': internal,\n            'fee': fee,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatusByType",
        "signature": "parseTransactionStatusByType (status, type = undefined)",
        "line_start": 2323,
        "line_end": 2341,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatusByType (status, type = undefined) {\n        const statusesByType: Dict = {\n            'deposit': {\n                '0': 'pending',\n                '1': 'ok',\n            },\n            'withdrawal': {\n                '0': 'pending', // Email Sent\n                '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n                '2': 'pending', // Awaiting Approval\n                '3': 'failed', // Rejected\n                '4': 'pending', // Processing\n                '5': 'failed', // Failure\n                '10': 'ok', // Completed\n            },\n        };\n        const statuses = this.safeValue (statusesByType, type, {});\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "toobit": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1543,
        "line_end": 1560,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const balances = this.safeList (response, 'balances', response);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n            const account = this.account ();\n            account['free'] = this.safeString2 (balance, 'free', 'availableBalance');\n            account['total'] = this.safeString2 (balance, 'total', 'balance');\n            account['used'] = this.safeString (balance, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBidAskCustom",
        "signature": "parseBidAskCustom (ticker)",
        "line_start": 1371,
        "line_end": 1381,
        "comment": null,
        "mappings": [
          {
            "key": "timestamp",
            "value": "this.safeString (ticker, 't')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (ticker, 's')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'b')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeNumber (ticker, 'bq')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'a')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeNumber (ticker, 'aq')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBidAskCustom (ticker) {\n        return {\n            'timestamp': this.safeString (ticker, 't'),\n            'symbol': this.safeString (ticker, 's'),\n            'bid': this.safeNumber (ticker, 'b'),\n            'bidVolume': this.safeNumber (ticker, 'bq'),\n            'ask': this.safeNumber (ticker, 'a'),\n            'askVolume': this.safeNumber (ticker, 'aq'),\n            'info': ticker,\n        };\n    }"
      },
      {
        "name": "parseBidsAsksCustom",
        "signature": "parseBidsAsksCustom (tickers, symbols: Strings = undefined, params = {}): Tickers",
        "line_start": 1360,
        "line_end": 1369,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBidsAsksCustom (tickers, symbols: Strings = undefined, params = {}): Tickers {\n        const results = [];\n        for (let i = 0; i < tickers.length; i++) {\n            const parsedTicker = this.parseBidAskCustom (tickers[i]);\n            const ticker = this.extend (parsedTicker, params);\n            results.push (ticker);\n        }\n        symbols = this.marketSymbols (symbols);\n        return this.filterByArray (results, 'symbol', symbols);\n    }"
      },
      {
        "name": "parseCurrency",
        "signature": "parseCurrency (rawCurrency: Dict): Currency",
        "line_start": 610,
        "line_end": 664,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "name",
            "value": "this.safeString (rawCurrency, 'coinFullName')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "this.safeBool (rawCurrency, 'allowDeposit')",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "this.safeBool (rawCurrency, 'allowWithdraw')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'withdraw': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "networks",
            "value": "networks",
            "comment": null
          },
          {
            "key": "info",
            "value": "rawCurrency",
            "comment": null
          },
          {
            "key": "id",
            "value": "networkId",
            "comment": null
          },
          {
            "key": "network",
            "value": "networkCode",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "this.safeBool (rawNetwork, 'allowDeposit')",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "this.safeBool (rawNetwork, 'allowWithdraw')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeNumber (rawNetwork, 'withdrawFee')",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                    'deposit': {\n                        'min': this.safeNumber (rawNetwork, 'minDepositQuantity'),\n                        'max': undefined,\n                    },\n                    'withdraw': {\n                        'min': this.safeNumber (rawNetwork, 'minWithdrawQuantity'),\n                        'max': this.safeNumber (rawNetwork, 'maxWithdrawQuantity'),\n                    },\n                }",
            "comment": null
          },
          {
            "key": "info",
            "value": "rawNetwork",
            "comment": null
          },
          {
            "key": "deposit",
            "value": "{\n                        'min': this.safeNumber (rawNetwork, 'minDepositQuantity'),\n                        'max': undefined,\n                    }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                        'min': this.safeNumber (rawNetwork, 'minWithdrawQuantity'),\n                        'max': this.safeNumber (rawNetwork, 'maxWithdrawQuantity'),\n                    }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (rawNetwork, 'minWithdrawQuantity')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (rawNetwork, 'maxWithdrawQuantity')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "withdraw",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseCurrency (rawCurrency: Dict): Currency {\n        const id = this.safeString (rawCurrency, 'coinId');\n        const code = this.safeCurrencyCode (id);\n        const networks: Dict = {};\n        const rawNetworks = this.safeList (rawCurrency, 'chainTypes');\n        for (let j = 0; j < rawNetworks.length; j++) {\n            const rawNetwork = rawNetworks[j];\n            const networkId = this.safeString (rawNetwork, 'chainType');\n            const networkCode = this.networkIdToCode (networkId);\n            networks[networkCode] = {\n                'id': networkId,\n                'network': networkCode,\n                'margin': undefined,\n                'deposit': this.safeBool (rawNetwork, 'allowDeposit'),\n                'withdraw': this.safeBool (rawNetwork, 'allowWithdraw'),\n                'active': undefined,\n                'fee': this.safeNumber (rawNetwork, 'withdrawFee'),\n                'precision': undefined,\n                'limits': {\n                    'deposit': {\n                        'min': this.safeNumber (rawNetwork, 'minDepositQuantity'),\n                        'max': undefined,\n                    },\n                    'withdraw': {\n                        'min': this.safeNumber (rawNetwork, 'minWithdrawQuantity'),\n                        'max': this.safeNumber (rawNetwork, 'maxWithdrawQuantity'),\n                    },\n                },\n                'info': rawNetwork,\n            };\n        }\n        return this.safeCurrencyStructure ({\n            'id': id,\n            'code': code,\n            'name': this.safeString (rawCurrency, 'coinFullName'),\n            'type': undefined,\n            'active': undefined,\n            'deposit': this.safeBool (rawCurrency, 'allowDeposit'),\n            'withdraw': this.safeBool (rawCurrency, 'allowWithdraw'),\n            'fee': undefined,\n            'precision': undefined,\n            'limits': {\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'withdraw': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'networks': networks,\n            'info': rawCurrency,\n        });\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2744,
        "line_end": 2754,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'addressExt')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeString (currency, 'code'),\n            'network': undefined,\n            'address': address,\n            'tag': this.safeString (depositAddress, 'addressExt'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 1415,
        "line_end": 1440,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "nextFundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        const nextFundingRate = this.safeNumber (contract, 'rate');\n        const nextFundingRateTimestamp = this.safeInteger (contract, 'nextFundingTime');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'previousFundingRate': undefined,\n            'nextFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'nextFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'nextFundingDatetime': undefined,\n            'fundingRate': nextFundingRate,\n            'fundingTimestamp': nextFundingRateTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseFundingRateHistory",
        "signature": "parseFundingRateHistory (contract, market: Market = undefined)",
        "line_start": 1482,
        "line_end": 1492,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'settleRate')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseFundingRateHistory (contract, market: Market = undefined) {\n        const timestamp = this.safeInteger (contract, 'settleTime');\n        const marketId = this.safeString (contract, 'symbol');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market),\n            'fundingRate': this.safeNumber (contract, 'settleRate'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseLastPrice",
        "signature": "parseLastPrice (entry, market: Market = undefined)",
        "line_start": 1311,
        "line_end": 1322,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumberOmitZero (entry, 'price')",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "entry",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLastPrice (entry, market: Market = undefined) {\n        const marketId = this.safeString (entry, 's');\n        market = this.safeMarket (marketId, market);\n        return {\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'price': this.safeNumberOmitZero (entry, 'price'),\n            'side': undefined,\n            'info': entry,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2419,
        "line_end": 2447,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerType (this.safeString (item, 'flowType'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "after",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        const currencyId = this.safeString (item, 'coinId');\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'created');\n        const after = this.safeNumber (item, 'total');\n        const amountRaw = this.safeString (item, 'change');\n        const amount = this.parseNumber (Precise.stringAbs (amountRaw));\n        let direction = 'in';\n        if (amountRaw.startsWith ('-')) {\n            direction = 'out';\n        }\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'direction': direction,\n            'account': undefined,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': this.parseLedgerType (this.safeString (item, 'flowType')),\n            'currency': currency['code'],\n            'amount': amount,\n            'before': undefined,\n            'after': after,\n            'status': undefined,\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerType",
        "signature": "parseLedgerType (type)",
        "line_start": 2449,
        "line_end": 2455,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerType (type) {\n        const types: Dict = {\n            'USER_ACCOUNT_TRANSFER': 'transfer',\n            'AIRDROP': 'rebate',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 2887,
        "line_end": 2899,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const leverageValue = this.safeInteger (leverage, 'leverage');\n        const marginType = this.safeString (leverage, 'marginType');\n        const marginMode = (marginType === 'crossed') ? 'cross' : 'isolated';\n        return {\n            'info': leverage,\n            'symbol': this.safeSymbol (marketId, market),\n            'marginMode': marginMode,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 822,
        "line_end": 894,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "isContract ? 'swap' : 'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "!isContract",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "isContract",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "isContract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "isContract ? !inverse : undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "isContract ? inverse : undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractMultiplier')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (lotSizeFilter, 'stepSize'),\n                'price': this.safeNumber (priceFilter, 'tickSize'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (lotSizeFilter, 'minQty'),\n                    'max': this.safeNumber (lotSizeFilter, 'maxQty'),\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'cost': {\n                    'min': this.safeNumber (minNotionalFilter, 'minNotional'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (lotSizeFilter, 'stepSize')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (priceFilter, 'tickSize')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (lotSizeFilter, 'minQty'),\n                    'max': this.safeNumber (lotSizeFilter, 'maxQty'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (minNotionalFilter, 'minNotional'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (priceFilter, 'minPrice')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (priceFilter, 'maxPrice')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (minNotionalFilter, 'minNotional')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString (market, 'baseAsset');\n        const quoteId = this.safeString (market, 'quoteAsset');\n        const baseParts = baseId.split ('-');\n        const baseIdClean = baseParts[0];\n        const base = this.safeCurrencyCode (baseIdClean);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settleId = this.safeString (market, 'marginToken');\n        const settle = this.safeCurrencyCode (settleId);\n        const status = this.safeString (market, 'status');\n        const active = (status === 'TRADING');\n        const filters = this.safeList (market, 'filters', []);\n        const filtersByType = this.indexBy (filters, 'filterType');\n        const priceFilter = this.safeDict (filtersByType, 'PRICE_FILTER', {});\n        const lotSizeFilter = this.safeDict (filtersByType, 'LOT_SIZE', {});\n        const minNotionalFilter = this.safeDict (filtersByType, 'MIN_NOTIONAL', {});\n        let symbol = base + '/' + quote;\n        const isContract = ('contractMultiplier' in market);\n        const inverse = this.safeBool2 (market, 'isInverse', 'inverse');\n        if (isContract) {\n            symbol += ':' + settle;\n        }\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': isContract ? 'swap' : 'spot',\n            'spot': !isContract,\n            'margin': false,\n            'swap': isContract,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': isContract,\n            'linear': isContract ? !inverse : undefined,\n            'inverse': isContract ? inverse : undefined,\n            'contractSize': this.safeNumber (market, 'contractMultiplier'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (lotSizeFilter, 'stepSize'),\n                'price': this.safeNumber (priceFilter, 'tickSize'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (lotSizeFilter, 'minQty'),\n                    'max': this.safeNumber (lotSizeFilter, 'maxQty'),\n                },\n                'price': {\n                    'min': this.safeNumber (priceFilter, 'minPrice'),\n                    'max': this.safeNumber (priceFilter, 'maxPrice'),\n                },\n                'cost': {\n                    'min': this.safeNumber (minNotionalFilter, 'minNotional'),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1188,
        "line_end": 1197,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeIntegerN (ohlcv, [ 0, 'time', 't' ]),\n            this.safeNumberN (ohlcv, [ 1, 'open', 'o' ]),\n            this.safeNumberN (ohlcv, [ 2, 'high', 'h' ]),\n            this.safeNumberN (ohlcv, [ 3, 'low', 'l' ]),\n            this.safeNumberN (ohlcv, [ 4, 'close', 'c' ]),\n            this.safeNumberN (ohlcv, [ 5, 'volume', 'v' ]),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1720,
        "line_end": 1816,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (order, 'orderId')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString (order, 'clientOrderId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeInteger (order, 'updateTime')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (rawType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "(rawType === 'LIMIT_MAKER')",
            "comment": null
          },
          {
            "key": "side",
            "value": "rawSideLower",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.omitZero (this.safeString (order, 'price'))",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.omitZero (this.safeString (order, 'cumulativeQuoteQty'))",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (order, 'avgPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeString (order, 'origQty')",
            "comment": null
          },
          {
            "key": "filled",
            "value": "this.safeString (order, 'executedQty')",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"ETHUSDT\",\n         \"price\": \"0\",\n         \"origQty\": \"0.001\",\n         \"orderId\": \"2024837825254460160\",\n         \"clientOrderId\": \"1756115478113679\",\n         \"executedQty\": \"0\",\n         \"status\": \"PENDING_NEW\",\n         \"timeInForce\": \"GTC\",\n         \"type\": \"MARKET\",\n         \"side\": \"SELL\"\n         \"accountId\": \"1783404067076253952\",    // only in spot\n         \"symbolName\": \"ETHUSDT\",               // only in spot\n         \"transactTime\": \"1756115478604\",       // only in spot\n         \"time\": \"1668418485058\",               // only in contract\n         \"updateTime\": \"1668418485058\",         // only in contract\n         \"leverage\": \"2\",                       // only in contract\n         \"avgPrice\": \"0\",                       // only in contract\n         \"marginLocked\": \"9.5\",                 // only in contract\n         \"priceType\": \"INPUT\"                   // only in contract\n     }",
          "{\n        \"time\": \"1756140208069\",\n        \"updateTime\": \"1756140208078\",\n        \"orderId\": \"2025045271033977089\",\n        \"clientOrderId\": \"17561402075722006\",\n        \"symbol\": \"ETHUSDT\",\n        \"price\": \"3000\",\n        \"origQty\": \"0.002\",\n        \"executedQty\": \"0\",\n        \"avgPrice\": \"0\",\n        \"type\": \"LIMIT\",\n        \"side\": \"BUY\",\n        \"timeInForce\": \"GTC\",\n        \"status\": \"NEW\",\n        \"accountId\": \"1783404067076253952\",  // only in SPOT\n        \"exchangeId\": \"301\",                 // only in SPOT\n        \"symbolName\": \"ETHUSDT\",             // only in SPOT\n        \"cummulativeQuoteQty\": \"0\",          // only in SPOT\n        \"cumulativeQuoteQty\": \"0\",           // only in SPOT\n        \"stopPrice\": \"0.0\",                  // only in SPOT\n        \"icebergQty\": \"0.0\",                 // only in SPOT\n        \"isWorking\": true                    // only in SPOT\n        \"leverage\": \"2\",                     // only in CONTRACT\n        \"marginLocked\": \"9.5\",               // only in CONTRACT\n        \"priceType\": \"INPUT\"                 // only in CONTRACT\n        \"triggerType\": \"0\",                  // only in CONTRACT fetchClosedOrders\n        \"fallType\": \"0\",                     // only in CONTRACT fetchClosedOrders\n        \"activeStatus\": \"0\"                  // only in CONTRACT fetchClosedOrders\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, cancelOrder\n        //\n        //     {\n        //         \"symbol\": \"ETHUSDT\",\n        //         \"price\": \"0\",\n        //         \"origQty\": \"0.001\",\n        //         \"orderId\": \"2024837825254460160\",\n        //         \"clientOrderId\": \"1756115478113679\",\n        //         \"executedQty\": \"0\",\n        //         \"status\": \"PENDING_NEW\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"type\": \"MARKET\",\n        //         \"side\": \"SELL\"\n        //         \"accountId\": \"1783404067076253952\",    // only in spot\n        //         \"symbolName\": \"ETHUSDT\",               // only in spot\n        //         \"transactTime\": \"1756115478604\",       // only in spot\n        //         \"time\": \"1668418485058\",               // only in contract\n        //         \"updateTime\": \"1668418485058\",         // only in contract\n        //         \"leverage\": \"2\",                       // only in contract\n        //         \"avgPrice\": \"0\",                       // only in contract\n        //         \"marginLocked\": \"9.5\",                 // only in contract\n        //         \"priceType\": \"INPUT\"                   // only in contract\n        //     }\n        //\n        //\n        // fetchOrder, fetchOrders, fetchOpenOrders\n        //\n        //    {\n        //        \"time\": \"1756140208069\",\n        //        \"updateTime\": \"1756140208078\",\n        //        \"orderId\": \"2025045271033977089\",\n        //        \"clientOrderId\": \"17561402075722006\",\n        //        \"symbol\": \"ETHUSDT\",\n        //        \"price\": \"3000\",\n        //        \"origQty\": \"0.002\",\n        //        \"executedQty\": \"0\",\n        //        \"avgPrice\": \"0\",\n        //        \"type\": \"LIMIT\",\n        //        \"side\": \"BUY\",\n        //        \"timeInForce\": \"GTC\",\n        //        \"status\": \"NEW\",\n        //        \"accountId\": \"1783404067076253952\",  // only in SPOT\n        //        \"exchangeId\": \"301\",                 // only in SPOT\n        //        \"symbolName\": \"ETHUSDT\",             // only in SPOT\n        //        \"cummulativeQuoteQty\": \"0\",          // only in SPOT\n        //        \"cumulativeQuoteQty\": \"0\",           // only in SPOT\n        //        \"stopPrice\": \"0.0\",                  // only in SPOT\n        //        \"icebergQty\": \"0.0\",                 // only in SPOT\n        //        \"isWorking\": true                    // only in SPOT\n        //        \"leverage\": \"2\",                     // only in CONTRACT\n        //        \"marginLocked\": \"9.5\",               // only in CONTRACT\n        //        \"priceType\": \"INPUT\"                 // only in CONTRACT\n        //        \"triggerType\": \"0\",                  // only in CONTRACT fetchClosedOrders\n        //        \"fallType\": \"0\",                     // only in CONTRACT fetchClosedOrders\n        //        \"activeStatus\": \"0\"                  // only in CONTRACT fetchClosedOrders\n        //    }\n        //\n        const timestamp = this.safeInteger2 (order, 'transactTime', 'time');\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const rawType = this.safeString (order, 'type');\n        const rawSideLower = this.safeStringLower (order, 'side');\n        let triggerPrice = this.omitZero (this.safeString (order, 'stopPrice'));\n        if (triggerPrice === '0.0') {\n            triggerPrice = undefined;\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeString (order, 'orderId'),\n            'clientOrderId': this.safeString (order, 'clientOrderId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': this.safeInteger (order, 'updateTime'),\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'symbol': market['symbol'],\n            'type': this.parseOrderType (rawType),\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': (rawType === 'LIMIT_MAKER'),\n            'side': rawSideLower,\n            'price': this.omitZero (this.safeString (order, 'price')),\n            'triggerPrice': triggerPrice,\n            'cost': this.omitZero (this.safeString (order, 'cumulativeQuoteQty')),\n            'average': this.safeString (order, 'avgPrice'),\n            'amount': this.safeString (order, 'origQty'),\n            'filled': this.safeString (order, 'executedQty'),\n            'remaining': undefined,\n            'trades': undefined,\n            'fee': undefined,\n            'marginMode': undefined,\n            'reduceOnly': undefined,\n            'leverage': undefined,\n            'hedged': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1818,
        "line_end": 1829,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'PENDING_NEW': 'open',\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'PENDING_CANCEL': 'canceled',\n            'CANCELED': 'canceled',\n            'REJECTED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (status)",
        "line_start": 1831,
        "line_end": 1838,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (status) {\n        const statuses: Dict = {\n            'MARKET': 'market',\n            'LIMIT': 'limit',\n            'LIMIT_MAKER': 'limit',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2952,
        "line_end": 2984,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'id')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeString (position, 'avgPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.safeString (position, 'markPrice')",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "this.safeString (position, 'lastPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeString (position, 'positionValue')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeString (position, 'unrealizedPnL')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (quantity)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeString (position, 'margin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const side = this.safeStringLower (position, 'side');\n        const quantity = this.safeString (position, 'position');\n        const leverage = this.safeInteger (position, 'leverage');\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'id'),\n            'symbol': market['symbol'],\n            'entryPrice': this.safeString (position, 'avgPrice'),\n            'markPrice': this.safeString (position, 'markPrice'),\n            'lastPrice': this.safeString (position, 'lastPrice'),\n            'notional': this.safeString (position, 'positionValue'),\n            'collateral': undefined,\n            'unrealizedPnl': this.safeString (position, 'unrealizedPnL'),\n            'side': side,\n            'contracts': this.parseNumber (quantity),\n            'contractSize': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'hedged': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'initialMargin': this.safeString (position, 'margin'),\n            'initialMarginPercentage': undefined,\n            'leverage': leverage,\n            'liquidationPrice': undefined,\n            'marginRatio': undefined,\n            'marginMode': undefined,\n            'percentage': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1249,
        "line_end": 1276,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'o')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'pc')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'pcp')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'v')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'qv')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        const marketId = this.safeString (ticker, 's');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (ticker, 't');\n        const last = this.safeString (ticker, 'c');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'h'),\n            'low': this.safeString (ticker, 'l'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'o'),\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': this.safeString (ticker, 'pc'),\n            'percentage': this.safeString (ticker, 'pcp'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'v'),\n            'quoteVolume': this.safeString (ticker, 'qv'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 983,
        "line_end": 1081,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (trade, 'id', 'v')",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString (trade, 'orderId')",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n            \"t\": \"1755594277287\",\n            \"p\": \"115276.99\",\n            \"q\": \"0.001508\",\n            \"ibm\": true\n        },",
          "{\n            \"id\": \"2024934575206059008\",\n            \"symbol\": \"ETHUSDT\",\n            \"orderId\": \"2024934575097029888\",\n            \"ticketId\": \"4864450547563401875\",\n            \"price\": \"4641.21\",\n            \"qty\": \"0.001\",\n            \"time\": \"1756127012094\",\n            \"isMaker\": false,\n            \"commission\": \"0.00464121\",\n            \"commissionAsset\": \"USDT\",\n            \"makerRebate\": \"0\",\n            \"symbolName\": \"ETHUSDT\",                 // only in SPOT\n            \"isBuyer\": false,                        // only in SPOT\n            \"feeAmount\": \"0.00464121\",               // only in SPOT\n            \"feeCoinId\": \"USDT\",                     // only in SPOT\n            \"fee\": {                                 // only in SPOT\n                \"feeCoinId\": \"USDT\",\n                \"feeCoinName\": \"USDT\",\n                \"fee\": \"0.00464121\"\n            },\n            \"type\": \"LIMIT\",                         // only in CONTRACT\n            \"side\": \"BUY_OPEN\",                      // only in CONTRACT\n            \"realizedPnl\": \"0\",                      // only in CONTRACT\n        },"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //        {\n        //            \"t\": \"1755594277287\",\n        //            \"p\": \"115276.99\",\n        //            \"q\": \"0.001508\",\n        //            \"ibm\": true\n        //        },\n        //        // watchTrades have also an additional fields:\n        //             \"v\": \"4864732022868004630\",   // trade id\n        //             \"m\": true,                    // is the buyer taker\n        //\n        // fetchMyTrades\n        //\n        //        {\n        //            \"id\": \"2024934575206059008\",\n        //            \"symbol\": \"ETHUSDT\",\n        //            \"orderId\": \"2024934575097029888\",\n        //            \"ticketId\": \"4864450547563401875\",\n        //            \"price\": \"4641.21\",\n        //            \"qty\": \"0.001\",\n        //            \"time\": \"1756127012094\",\n        //            \"isMaker\": false,\n        //            \"commission\": \"0.00464121\",\n        //            \"commissionAsset\": \"USDT\",\n        //            \"makerRebate\": \"0\",\n        //            \"symbolName\": \"ETHUSDT\",                 // only in SPOT\n        //            \"isBuyer\": false,                        // only in SPOT\n        //            \"feeAmount\": \"0.00464121\",               // only in SPOT\n        //            \"feeCoinId\": \"USDT\",                     // only in SPOT\n        //            \"fee\": {                                 // only in SPOT\n        //                \"feeCoinId\": \"USDT\",\n        //                \"feeCoinName\": \"USDT\",\n        //                \"fee\": \"0.00464121\"\n        //            },\n        //            \"type\": \"LIMIT\",                         // only in CONTRACT\n        //            \"side\": \"BUY_OPEN\",                      // only in CONTRACT\n        //            \"realizedPnl\": \"0\",                      // only in CONTRACT\n        //        },\n        //\n        const timestamp = this.safeInteger2 (trade, 't', 'time');\n        const priceString = this.safeString2 (trade, 'p', 'price');\n        const amountString = this.safeString2 (trade, 'q', 'qty');\n        const isBuyer = this.safeBool (trade, 'isBuyer');\n        let side = undefined;\n        let isBuyerMaker = this.safeBool (trade, 'ibm');\n        if (isBuyerMaker === undefined) {\n            const isBuyerTaker = this.safeBool (trade, 'm');\n            if (isBuyerTaker !== undefined) {\n                isBuyerMaker = !isBuyerTaker;\n            }\n        }\n        if (isBuyerMaker !== undefined) {\n            if (isBuyerMaker) {\n                side = 'sell';\n            } else {\n                side = 'buy';\n            }\n        } else {\n            if (isBuyer) {\n                side = 'buy';\n            } else {\n                side = 'sell';\n            }\n        }\n        const feeCurrencyId = this.safeString (trade, 'feeCoinId');\n        const feeAmount = this.safeString (trade, 'feeAmount');\n        let fee = undefined;\n        if (feeAmount !== undefined) {\n            fee = {\n                'currency': this.safeCurrencyCode (feeCurrencyId),\n                'cost': feeAmount,\n            };\n        }\n        const isMaker = this.safeBool (trade, 'isMaker');\n        let takerOrMaker = undefined;\n        if (isMaker !== undefined) {\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        market = this.safeMarket (undefined, market);\n        const symbol = market['symbol'];\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': this.safeString2 (trade, 'id', 'v'),\n            'order': this.safeString (trade, 'orderId'),\n            'type': undefined,\n            'side': side,\n            'amount': amountString,\n            'price': priceString,\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (data, market: Market = undefined)",
        "line_start": 2502,
        "line_end": 2512,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (data, 'closeMakerFee')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (data, 'closeTakerFee')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (data, market: Market = undefined) {\n        const marketId = this.safeString (data, 'symbol');\n        return {\n            'info': data,\n            'symbol': this.safeSymbol (marketId, market),\n            'maker': this.safeNumber (data, 'closeMakerFee'),\n            'taker': this.safeNumber (data, 'closeTakerFee'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2616,
        "line_end": 2697,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "tagTo",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "tagFrom",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'quantity')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"time\": 1499865549590,\n         \"id\": 100234,\n         \"coinName\": \"EOS\",\n         \"statusCode\": \"DEPOSIT_CAN_WITHDRAW\",\n         \"status\": \"2\", // 2=SUCCESS, 11=REJECT, 12=AUDIT\n         \"address\": \"deposit2bb\",\n         \"txId\": \"98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC\",\n         \"txIdUrl\": \"\",\n         \"requiredConfirmTimes\": \"5\",\n         \"confirmTimes\": \"5\",\n         \"quantity\": \"1.01\",\n         \"coin\": \"EOS\",                     // present in \"fetchDeposits\"\n         \"coinId \":\"BHC\",                   // present in \"fetchWithdrawals\"\n         \"addressTag\": \"19012584\",          // present in \"fetchDeposits\"\n         \"addressExt\":\"address tag\",        // present in \"fetchWithdrawals\"\n         \"fromAddress\": \"clarkkent\",        // present in \"fetchDeposits\"\n         \"fromAddressTag\": \"19029901\"       // present in \"fetchDeposits\"\n         \"arriveQuantity\":\"14\",             // present in \"fetchWithdrawals\"\n         \"walletHandleTime\":\"1536232111669\",// present in \"fetchWithdrawals\"\n         \"feeCoinId \":\"BHC\",                // present in \"fetchWithdrawals\"\n         \"feeCoinName \":\"BHC\",              // present in \"fetchWithdrawals\"\n         \"fee\":\"0.1\",                       // present in \"fetchWithdrawals\"\n         \"kernelId\":\"\",                     // present in \"fetchWithdrawals\"\n         \"isInternalTransfer\": false        // present in \"fetchWithdrawals\"\n     }",
          "{\n         \"status\": 0,\n         \"success\": true,\n         \"needBrokerAudit\": false, // Do you need a brokerage review?\n         \"id\": \"423885103582776064\",\n         \"refuseReason\":\"\" // failure rejection reason\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits & fetchWithdrawals\n        //\n        //     {\n        //         \"time\": 1499865549590,\n        //         \"id\": 100234,\n        //         \"coinName\": \"EOS\",\n        //         \"statusCode\": \"DEPOSIT_CAN_WITHDRAW\",\n        //         \"status\": \"2\", // 2=SUCCESS, 11=REJECT, 12=AUDIT\n        //         \"address\": \"deposit2bb\",\n        //         \"txId\": \"98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC\",\n        //         \"txIdUrl\": \"\",\n        //         \"requiredConfirmTimes\": \"5\",\n        //         \"confirmTimes\": \"5\",\n        //         \"quantity\": \"1.01\",\n        //         \"coin\": \"EOS\",                     // present in \"fetchDeposits\"\n        //         \"coinId \":\"BHC\",                   // present in \"fetchWithdrawals\"\n        //         \"addressTag\": \"19012584\",          // present in \"fetchDeposits\"\n        //         \"addressExt\":\"address tag\",        // present in \"fetchWithdrawals\"\n        //         \"fromAddress\": \"clarkkent\",        // present in \"fetchDeposits\"\n        //         \"fromAddressTag\": \"19029901\"       // present in \"fetchDeposits\"\n        //         \"arriveQuantity\":\"14\",             // present in \"fetchWithdrawals\"\n        //         \"walletHandleTime\":\"1536232111669\",// present in \"fetchWithdrawals\"\n        //         \"feeCoinId \":\"BHC\",                // present in \"fetchWithdrawals\"\n        //         \"feeCoinName \":\"BHC\",              // present in \"fetchWithdrawals\"\n        //         \"fee\":\"0.1\",                       // present in \"fetchWithdrawals\"\n        //         \"kernelId\":\"\",                     // present in \"fetchWithdrawals\"\n        //         \"isInternalTransfer\": false        // present in \"fetchWithdrawals\"\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"status\": 0,\n        //         \"success\": true,\n        //         \"needBrokerAudit\": false, // Do you need a brokerage review?\n        //         \"id\": \"423885103582776064\",\n        //         \"refuseReason\":\"\" // failure rejection reason\n        //     }\n        //\n        const timestamp = this.safeInteger (transaction, 'time');\n        const currencyId = this.safeString2 (transaction, 'coin', 'coinId');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        const feeString = this.safeString (transaction, 'fee');\n        const feeCoin = this.safeString (transaction, 'feeCoinName');\n        let fee = undefined;\n        if (feeString !== undefined) {\n            fee = {\n                'cost': this.parseNumber (feeString),\n                'currency': this.safeCurrencyCode (feeCoin),\n            };\n        }\n        const tagTo = this.safeString2 (transaction, 'addressTag', 'addressExt');\n        const tagFrom = this.safeString (transaction, 'fromAddressTag');\n        const addressTo = this.safeString (transaction, 'address');\n        const addressFrom = this.safeString (transaction, 'fromAddress');\n        const isWithdraw = ('arriveQuantity' in transaction);\n        const type = isWithdraw ? 'withdrawal' : 'deposit';\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'txId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'address': undefined,\n            'addressTo': addressTo,\n            'addressFrom': addressFrom,\n            'tag': undefined,\n            'tagTo': tagTo,\n            'tagFrom': tagFrom,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'quantity'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': undefined,\n            'fee': fee,\n            'comment': undefined,\n            'internal': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2699,
        "line_end": 2707,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            '2': 'pending',\n            '12': 'pending',\n            '11': 'failed',\n            '3': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2342,
        "line_end": 2360,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"code\": 200, // 200 = success\n     \"msg\": \"success\" // response message\n    }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    {\n        //     \"code\": 200, // 200 = success\n        //     \"msg\": \"success\" // response message\n        //    }\n        //\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': undefined,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "upbit": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 578,
        "line_end": 594,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (balance, 'balance');\n            account['used'] = this.safeString (balance, 'locked');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2158,
        "line_end": 2180,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId)",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          }
        ],
        "examples": [
          "{\n        currency: 'XRP',\n        net_type: 'XRP',\n        deposit_address: 'raQwCVAJVqjrVm1Nj5SFRcX8i22BhdC9WA',\n        secondary_address: '167029435'\n    }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //    {\n        //        currency: 'XRP',\n        //        net_type: 'XRP',\n        //        deposit_address: 'raQwCVAJVqjrVm1Nj5SFRcX8i22BhdC9WA',\n        //        secondary_address: '167029435'\n        //    }\n        //\n        const address = this.safeString (depositAddress, 'deposit_address');\n        const tag = this.safeString (depositAddress, 'secondary_address');\n        const currencyId = this.safeString (depositAddress, 'currency');\n        const code = this.safeCurrencyCode (currencyId);\n        const networkId = this.safeString (depositAddress, 'net_type');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': code,\n            'network': this.networkIdToCode (networkId),\n            'address': address,\n            'tag': tag,\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 520,
        "line_end": 576,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "true",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['taker'])",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['maker'])",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'price': this.parseNumber ('1e-8'),\n                'amount': this.parseNumber ('1e-8'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber ('1e-8')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber ('1e-8')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'market');\n        const [ quoteId, baseId ] = id.split ('-');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': true,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['taker']),\n            'maker': this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['maker']),\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'price': this.parseNumber ('1e-8'),\n                'amount': this.parseNumber ('1e-8'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1057,
        "line_end": 1081,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"market\": \"BTC-ETH\",\n         \"candle_date_time_utc\": \"2018-11-22T13:47:00\",\n         \"candle_date_time_kst\": \"2018-11-22T22:47:00\",\n         \"opening_price\": 0.02915963,\n         \"high_price\": 0.02915963,\n         \"low_price\": 0.02915448,\n         \"trade_price\": 0.02915448,\n         \"timestamp\": 1542894473674,\n         \"candle_acc_trade_price\": 0.0981629437535248,\n         \"candle_acc_trade_volume\": 3.36693173,\n         \"unit\": 1\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"market\": \"BTC-ETH\",\n        //         \"candle_date_time_utc\": \"2018-11-22T13:47:00\",\n        //         \"candle_date_time_kst\": \"2018-11-22T22:47:00\",\n        //         \"opening_price\": 0.02915963,\n        //         \"high_price\": 0.02915963,\n        //         \"low_price\": 0.02915448,\n        //         \"trade_price\": 0.02915448,\n        //         \"timestamp\": 1542894473674,\n        //         \"candle_acc_trade_price\": 0.0981629437535248,\n        //         \"candle_acc_trade_volume\": 3.36693173,\n        //         \"unit\": 1\n        //     }\n        //\n        return [\n            this.parse8601 (this.safeString (ohlcv, 'candle_date_time_utc')),\n            this.safeNumber (ohlcv, 'opening_price'),\n            this.safeNumber (ohlcv, 'high_price'),\n            this.safeNumber (ohlcv, 'low_price'),\n            this.safeNumber (ohlcv, 'trade_price'),\n            this.safeNumber (ohlcv, 'candle_acc_trade_volume'), // base volume\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1736,
        "line_end": 1894,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "identifier",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeStringUpper (order, 'time_in_force')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.parseNumber (cost)",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.parseNumber (average)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "trades",
            "comment": null
          },
          {
            "key": "order",
            "value": "id",
            "comment": null
          }
        ],
        "examples": [
          "{\n   \"market\": \"KRW-USDT\",\n   \"uuid\": \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n   \"side\": \"ask\",\n   \"ord_type\": \"market\",\n   \"state\": \"done\",\n   \"created_at\": \"2025-08-09T16:44:00+09:00\",\n   \"volume\": \"5.377594\",\n   \"remaining_volume\": \"0\",\n   \"executed_volume\": \"5.377594\",\n   \"reserved_fee\": \"0\",\n   \"remaining_fee\": \"0\",\n   \"paid_fee\": \"3.697095875\",\n   \"locked\": \"0\",\n   \"prevented_volume\": \"0\",\n   \"prevented_locked\": \"0\",\n   \"trades_count\": 1,\n   \"trades\": [\n     {\n       \"market\": \"KRW-USDT\",\n       \"uuid\": \"795dff29-bba6-49b2-baab-63473ab7931c\",\n       \"price\": \"1375\",\n       \"volume\": \"5.377594\",\n       \"funds\": \"7394.19175\",\n       \"trend\": \"down\",\n       \"created_at\": \"2025-08-09T16:44:00.597751+09:00\",\n       \"side\": \"ask\"\n     }\n   ]\n }",
          "{\n         \"uuid\": \"637fd66-d019-4d77-bee6-8e0cff28edd9\",\n         \"side\": \"ask\",\n         \"ord_type\": \"limit\",\n         \"price\": \"1.5\",\n         \"state\": \"wait\",\n         \"market\": \"SGD-XRP\",\n         \"created_at\": \"2024-06-05T09:37:10Z\",\n         \"volume\": \"10\",\n         \"remaining_volume\": \"10\",\n         \"reserved_fee\": \"0\",\n         \"remaining_fee\": \"0\",\n         \"paid_fee\": \"0\",\n         \"locked\": \"10\",\n         \"executed_volume\": \"0\",\n         \"executed_funds\": \"0\",\n         \"trades_count\": 0,\n         \"time_in_force\": \"ioc\"\n     }",
          "{\n        uuid: '63b38774-27db-4439-ac20-1be16a24d18e',\n        side: 'bid',\n        ord_type: 'limit',\n        price: '100000000',\n        state: 'wait',\n        market: 'KRW-BTC',\n        created_at: '2025-04-01T15:30:47+09:00',\n        volume: '0.00008',\n        remaining_volume: '0.00008',\n        reserved_fee: '4',\n        remaining_fee: '4',\n        paid_fee: '0',\n        locked: '8004',\n        executed_volume: '0',\n        trades_count: '0',\n        identifier: '21',\n        new_order_uuid: 'cb1cce56-6237-4a78-bc11-4cfffc1bb4c2',\n        new_order_identifier: '22'\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        // {\n        //   \"market\": \"KRW-USDT\",\n        //   \"uuid\": \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n        //   \"side\": \"ask\",\n        //   \"ord_type\": \"market\",\n        //   \"state\": \"done\",\n        //   \"created_at\": \"2025-08-09T16:44:00+09:00\",\n        //   \"volume\": \"5.377594\",\n        //   \"remaining_volume\": \"0\",\n        //   \"executed_volume\": \"5.377594\",\n        //   \"reserved_fee\": \"0\",\n        //   \"remaining_fee\": \"0\",\n        //   \"paid_fee\": \"3.697095875\",\n        //   \"locked\": \"0\",\n        //   \"prevented_volume\": \"0\",\n        //   \"prevented_locked\": \"0\",\n        //   \"trades_count\": 1,\n        //   \"trades\": [\n        //     {\n        //       \"market\": \"KRW-USDT\",\n        //       \"uuid\": \"795dff29-bba6-49b2-baab-63473ab7931c\",\n        //       \"price\": \"1375\",\n        //       \"volume\": \"5.377594\",\n        //       \"funds\": \"7394.19175\",\n        //       \"trend\": \"down\",\n        //       \"created_at\": \"2025-08-09T16:44:00.597751+09:00\",\n        //       \"side\": \"ask\"\n        //     }\n        //   ]\n        // }\n        //\n        // fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n        //\n        //     {\n        //         \"uuid\": \"637fd66-d019-4d77-bee6-8e0cff28edd9\",\n        //         \"side\": \"ask\",\n        //         \"ord_type\": \"limit\",\n        //         \"price\": \"1.5\",\n        //         \"state\": \"wait\",\n        //         \"market\": \"SGD-XRP\",\n        //         \"created_at\": \"2024-06-05T09:37:10Z\",\n        //         \"volume\": \"10\",\n        //         \"remaining_volume\": \"10\",\n        //         \"reserved_fee\": \"0\",\n        //         \"remaining_fee\": \"0\",\n        //         \"paid_fee\": \"0\",\n        //         \"locked\": \"10\",\n        //         \"executed_volume\": \"0\",\n        //         \"executed_funds\": \"0\",\n        //         \"trades_count\": 0,\n        //         \"time_in_force\": \"ioc\"\n        //     }\n        //\n        //     {\n        //        uuid: '63b38774-27db-4439-ac20-1be16a24d18e',\n        //        side: 'bid',\n        //        ord_type: 'limit',\n        //        price: '100000000',\n        //        state: 'wait',\n        //        market: 'KRW-BTC',\n        //        created_at: '2025-04-01T15:30:47+09:00',\n        //        volume: '0.00008',\n        //        remaining_volume: '0.00008',\n        //        reserved_fee: '4',\n        //        remaining_fee: '4',\n        //        paid_fee: '0',\n        //        locked: '8004',\n        //        executed_volume: '0',\n        //        trades_count: '0',\n        //        identifier: '21',\n        //        new_order_uuid: 'cb1cce56-6237-4a78-bc11-4cfffc1bb4c2',\n        //        new_order_identifier: '22'\n        //      }\n        const id = this.safeString (order, 'uuid');\n        let side = this.safeString (order, 'side');\n        if (side === 'bid') {\n            side = 'buy';\n        } else {\n            side = 'sell';\n        }\n        const identifier = this.safeString (order, 'identifier');\n        let type = this.safeString (order, 'ord_type');\n        const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n        const status = this.parseOrderStatus (this.safeString (order, 'state'));\n        let lastTradeTimestamp = undefined;\n        let price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'volume');\n        const remaining = this.safeString (order, 'remaining_volume');\n        const filled = this.safeString (order, 'executed_volume');\n        let cost = undefined;\n        if (type === 'price') {\n            type = 'market';\n            cost = price;\n            price = undefined;\n        }\n        let average = undefined;\n        let fee = undefined;\n        let feeCost = this.safeString (order, 'paid_fee');\n        const marketId = this.safeString (order, 'market');\n        market = this.safeMarket (marketId, market);\n        let trades = this.safeValue (order, 'trades', []);\n        trades = this.parseTrades (trades, market, undefined, undefined, {\n            'order': id,\n            'type': type,\n        });\n        const numTrades = trades.length;\n        if (numTrades > 0) {\n            // the timestamp in fetchOrder trades is missing\n            lastTradeTimestamp = trades[numTrades - 1]['timestamp'];\n            let getFeesFromTrades = false;\n            if (feeCost === undefined) {\n                getFeesFromTrades = true;\n                feeCost = '0';\n            }\n            cost = '0';\n            for (let i = 0; i < numTrades; i++) {\n                const trade = trades[i];\n                cost = Precise.stringAdd (cost, this.safeString (trade, 'cost'));\n                if (getFeesFromTrades) {\n                    const tradeFee = this.safeValue (trades[i], 'fee', {});\n                    const tradeFeeCost = this.safeString (tradeFee, 'cost');\n                    if (tradeFeeCost !== undefined) {\n                        feeCost = Precise.stringAdd (feeCost, tradeFeeCost);\n                    }\n                }\n            }\n            average = Precise.stringDiv (cost, filled);\n        }\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': market['quote'],\n                'cost': feeCost,\n            };\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': identifier,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'symbol': market['symbol'],\n            'type': type,\n            'timeInForce': this.safeStringUpper (order, 'time_in_force'),\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': this.parseNumber (cost),\n            'average': this.parseNumber (average),\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'status': status,\n            'fee': fee,\n            'trades': trades,\n        });\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1727,
        "line_end": 1734,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'wait': 'open',\n            'done': 'closed',\n            'cancel': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 713,
        "line_end": 768,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high_price')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low_price')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'opening_price')",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'prev_closing_price')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'signed_change_price')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'signed_change_rate')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'acc_trade_volume_24h')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'acc_trade_price_24h')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{                market: \"BTC-ETH\",\n                    \"trade_date\": \"20181122\",\n                    \"trade_time\": \"104543\",\n                \"trade_date_kst\": \"20181122\",\n                \"trade_time_kst\": \"194543\",\n               \"trade_timestamp\":  1542883543096,\n                 \"opening_price\":  0.02976455,\n                    \"high_price\":  0.02992577,\n                     \"low_price\":  0.02934283,\n                   \"trade_price\":  0.02947773,\n            \"prev_closing_price\":  0.02966,\n                        \"change\": \"FALL\",\n                  \"change_price\":  0.00018227,\n                   \"change_rate\":  0.0061453136,\n           \"signed_change_price\":  -0.00018227,\n            \"signed_change_rate\":  -0.0061453136,\n                  \"trade_volume\":  1.00000005,\n               \"acc_trade_price\":  100.95825586,\n           \"acc_trade_price_24h\":  289.58650166,\n              \"acc_trade_volume\":  3409.85311036,\n          \"acc_trade_volume_24h\":  9754.40510513,\n         \"highest_52_week_price\":  0.12345678,\n          \"highest_52_week_date\": \"2018-02-01\",\n          \"lowest_52_week_price\":  0.023936,\n           \"lowest_52_week_date\": \"2017-12-08\",\n                     \"timestamp\":  1542883543813  }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //       {                market: \"BTC-ETH\",\n        //                    \"trade_date\": \"20181122\",\n        //                    \"trade_time\": \"104543\",\n        //                \"trade_date_kst\": \"20181122\",\n        //                \"trade_time_kst\": \"194543\",\n        //               \"trade_timestamp\":  1542883543096,\n        //                 \"opening_price\":  0.02976455,\n        //                    \"high_price\":  0.02992577,\n        //                     \"low_price\":  0.02934283,\n        //                   \"trade_price\":  0.02947773,\n        //            \"prev_closing_price\":  0.02966,\n        //                        \"change\": \"FALL\",\n        //                  \"change_price\":  0.00018227,\n        //                   \"change_rate\":  0.0061453136,\n        //           \"signed_change_price\":  -0.00018227,\n        //            \"signed_change_rate\":  -0.0061453136,\n        //                  \"trade_volume\":  1.00000005,\n        //               \"acc_trade_price\":  100.95825586,\n        //           \"acc_trade_price_24h\":  289.58650166,\n        //              \"acc_trade_volume\":  3409.85311036,\n        //          \"acc_trade_volume_24h\":  9754.40510513,\n        //         \"highest_52_week_price\":  0.12345678,\n        //          \"highest_52_week_date\": \"2018-02-01\",\n        //          \"lowest_52_week_price\":  0.023936,\n        //           \"lowest_52_week_date\": \"2017-12-08\",\n        //                     \"timestamp\":  1542883543813  }\n        //\n        const timestamp = this.safeInteger (ticker, 'trade_timestamp');\n        const marketId = this.safeString2 (ticker, 'market', 'code');\n        market = this.safeMarket (marketId, market, '-');\n        const last = this.safeString (ticker, 'trade_price');\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high_price'),\n            'low': this.safeString (ticker, 'low_price'),\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'opening_price'),\n            'close': last,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'prev_closing_price'),\n            'change': this.safeString (ticker, 'signed_change_price'),\n            'percentage': this.safeString (ticker, 'signed_change_rate'),\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'acc_trade_volume_24h'),\n            'quoteVolume': this.safeString (ticker, 'acc_trade_price_24h'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 846,
        "line_end": 916,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{             market: \"BTC-ETH\",\n             \"trade_date_utc\": \"2018-11-22\",\n             \"trade_time_utc\": \"13:55:24\",\n                  \"timestamp\":  1542894924397,\n                \"trade_price\":  0.02914289,\n               \"trade_volume\":  0.20074397,\n         \"prev_closing_price\":  0.02966,\n               \"change_price\":  -0.00051711,\n                    \"ask_bid\": \"ASK\",\n              \"sequential_id\":  15428949259430000 }",
          "{\n             \"market\": \"KRW-BTC\",\n             \"uuid\": \"78162304-1a4d-4524-b9e6-c9a9e14d76c3\",\n             \"price\": \"101000.0\",\n             \"volume\": \"0.77368323\",\n             \"funds\": \"78142.00623\",\n             \"ask_fee\": \"117.213009345\",\n             \"bid_fee\": \"117.213009345\",\n             \"created_at\": \"2018-04-05T14:09:15+09:00\",\n             \"side\": \"bid\",\n         }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades\n        //\n        //       {             market: \"BTC-ETH\",\n        //             \"trade_date_utc\": \"2018-11-22\",\n        //             \"trade_time_utc\": \"13:55:24\",\n        //                  \"timestamp\":  1542894924397,\n        //                \"trade_price\":  0.02914289,\n        //               \"trade_volume\":  0.20074397,\n        //         \"prev_closing_price\":  0.02966,\n        //               \"change_price\":  -0.00051711,\n        //                    \"ask_bid\": \"ASK\",\n        //              \"sequential_id\":  15428949259430000 }\n        //\n        // fetchOrder trades\n        //\n        //         {\n        //             \"market\": \"KRW-BTC\",\n        //             \"uuid\": \"78162304-1a4d-4524-b9e6-c9a9e14d76c3\",\n        //             \"price\": \"101000.0\",\n        //             \"volume\": \"0.77368323\",\n        //             \"funds\": \"78142.00623\",\n        //             \"ask_fee\": \"117.213009345\",\n        //             \"bid_fee\": \"117.213009345\",\n        //             \"created_at\": \"2018-04-05T14:09:15+09:00\",\n        //             \"side\": \"bid\",\n        //         }\n        //\n        const id = this.safeString2 (trade, 'sequential_id', 'uuid');\n        const orderId = undefined;\n        let timestamp = this.safeInteger (trade, 'timestamp');\n        if (timestamp === undefined) {\n            timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n        }\n        let side = undefined;\n        const askOrBid = this.safeStringLower2 (trade, 'ask_bid', 'side');\n        if (askOrBid === 'ask') {\n            side = 'sell';\n        } else if (askOrBid === 'bid') {\n            side = 'buy';\n        }\n        const cost = this.safeString (trade, 'funds');\n        const price = this.safeString2 (trade, 'trade_price', 'price');\n        const amount = this.safeString2 (trade, 'trade_volume', 'volume');\n        const marketId = this.safeString2 (trade, 'market', 'code');\n        market = this.safeMarket (marketId, market, '-');\n        let fee = undefined;\n        const feeCost = this.safeString (trade, askOrBid + '_fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'currency': market['quote'],\n                'cost': feeCost,\n            };\n        }\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'order': orderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1659,
        "line_end": 1725,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'uuid')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "tag",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeStringLower (transaction, 'state'))",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.parse8601 (updatedRaw)",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (transaction, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"type\": \"deposit\",\n         \"uuid\": \"94332e99-3a87-4a35-ad98-28b0c969f830\",\n         \"currency\": \"KRW\",\n         \"txid\": \"9e37c537-6849-4c8b-a134-57313f5dfc5a\",\n         \"state\": \"ACCEPTED\",\n         \"created_at\": \"2017-12-08T15:38:02+09:00\",\n         \"done_at\": \"2017-12-08T15:38:02+09:00\",\n         \"amount\": \"100000.0\",\n         \"fee\": \"0.0\"\n     }",
          "{\n         \"type\": \"withdraw\",\n         \"uuid\": \"9f432943-54e0-40b7-825f-b6fec8b42b79\",\n         \"currency\": \"BTC\",\n         \"txid\": \"cd81e9b45df8da29f936836e58c907a106057e454a45767a7b06fcb19b966bba\",\n         \"state\": \"processing\",\n         \"created_at\": \"2018-04-13T11:24:01+09:00\",\n         \"done_at\": null,\n         \"amount\": \"0.01\",\n         \"fee\": \"0.0\",\n         \"krw_amount\": \"80420.0\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits, fetchDeposit\n        //\n        //     {\n        //         \"type\": \"deposit\",\n        //         \"uuid\": \"94332e99-3a87-4a35-ad98-28b0c969f830\",\n        //         \"currency\": \"KRW\",\n        //         \"txid\": \"9e37c537-6849-4c8b-a134-57313f5dfc5a\",\n        //         \"state\": \"ACCEPTED\",\n        //         \"created_at\": \"2017-12-08T15:38:02+09:00\",\n        //         \"done_at\": \"2017-12-08T15:38:02+09:00\",\n        //         \"amount\": \"100000.0\",\n        //         \"fee\": \"0.0\"\n        //     }\n        //\n        // fetchWithdrawals, fetchWithdrawal\n        //\n        //     {\n        //         \"type\": \"withdraw\",\n        //         \"uuid\": \"9f432943-54e0-40b7-825f-b6fec8b42b79\",\n        //         \"currency\": \"BTC\",\n        //         \"txid\": \"cd81e9b45df8da29f936836e58c907a106057e454a45767a7b06fcb19b966bba\",\n        //         \"state\": \"processing\",\n        //         \"created_at\": \"2018-04-13T11:24:01+09:00\",\n        //         \"done_at\": null,\n        //         \"amount\": \"0.01\",\n        //         \"fee\": \"0.0\",\n        //         \"krw_amount\": \"80420.0\"\n        //     }\n        //\n        const address = undefined; // not present in the data structure received from the exchange\n        const tag = undefined; // not present in the data structure received from the exchange\n        const updatedRaw = this.safeString (transaction, 'done_at');\n        const timestamp = this.parse8601 (this.safeString (transaction, 'created_at', updatedRaw));\n        let type = this.safeString (transaction, 'type');\n        if (type === 'withdraw') {\n            type = 'withdrawal';\n        }\n        const currencyId = this.safeString (transaction, 'currency');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'uuid'),\n            'currency': code,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'network': undefined,\n            'address': address,\n            'addressTo': undefined,\n            'addressFrom': undefined,\n            'tag': tag,\n            'tagTo': undefined,\n            'tagFrom': undefined,\n            'status': this.parseTransactionStatus (this.safeStringLower (transaction, 'state')),\n            'type': type,\n            'updated': this.parse8601 (updatedRaw),\n            'txid': this.safeString (transaction, 'txid'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'internal': undefined,\n            'comment': undefined,\n            'fee': {\n                'currency': code,\n                'cost': this.safeNumber (transaction, 'fee'),\n            },\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 1645,
        "line_end": 1657,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'submitting': 'pending', // 처리 중\n            'submitted': 'pending', // 처리 완료\n            'almost_accepted': 'pending', // 출금대기중\n            'rejected': 'failed', // 거부\n            'accepted': 'ok', // 승인됨\n            'processing': 'pending', // 처리 중\n            'done': 'ok', // 완료\n            'canceled': 'canceled', // 취소됨\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "wavesexchange": [
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes: Strings = undefined, currencyIdKey = undefined): any",
        "line_start": 2426,
        "line_end": 2495,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseDepositWithdrawFees (response, codes: Strings = undefined, currencyIdKey = undefined): any {\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const dictionary = entry;\n            const currencyId = this.safeString (dictionary, currencyIdKey);\n            const currency = this.safeValue (this.currencies_by_id, currencyId);\n            const code = this.safeString (currency, 'code', currencyId);\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                let depositWithdrawFee = this.safeValue (depositWithdrawFees, code);\n                if (depositWithdrawFee === undefined) {\n                    depositWithdrawFee = {\n                        'info': [ dictionary ],\n                        'withdraw': {\n                            'fee': undefined,\n                            'percentage': undefined,\n                        },\n                        'deposit': {\n                            'fee': undefined,\n                            'percentage': undefined,\n                        },\n                        'networks': {},\n                    };\n                } else {\n                    depositWithdrawFee = depositWithdrawFees[code];\n                    depositWithdrawFee['info'] = this.arrayConcat (depositWithdrawFee['info'], [ dictionary ]);\n                }\n                const networkId = this.safeString (dictionary, 'platform_id');\n                const currencyCode = this.safeString (currency, 'code');\n                const networkCode = this.networkIdToCode (networkId, currencyCode);\n                let network = this.safeValue (depositWithdrawFee['networks'], networkCode);\n                if (network === undefined) {\n                    network = {\n                        'withdraw': {\n                            'fee': undefined,\n                            'percentage': undefined,\n                        },\n                        'deposit': {\n                            'fee': undefined,\n                            'percentage': undefined,\n                        },\n                    };\n                }\n                const feeType = this.safeString (dictionary, 'type');\n                const fees = this.safeValue (dictionary, 'fees');\n                let networkKey = 'deposit';\n                if (feeType === 'withdrawal_currency') {\n                    networkKey = 'withdraw';\n                }\n                network[networkKey] = { 'fee': this.safeNumber (fees, 'flat'), 'percentage': false };\n                depositWithdrawFee['networks'][networkCode] = network;\n                depositWithdrawFees[code] = depositWithdrawFee;\n            }\n        }\n        const depositWithdrawFeesKeys = Object.keys (depositWithdrawFees);\n        for (let i = 0; i < depositWithdrawFeesKeys.length; i++) {\n            const code = depositWithdrawFeesKeys[i];\n            const entry = depositWithdrawFees[code];\n            const networks = this.safeValue (entry, 'networks');\n            const networkKeys = Object.keys (networks);\n            const networkKeysLength = networkKeys.length;\n            if (networkKeysLength === 1) {\n                const network = this.safeValue (networks, networkKeys[0]);\n                depositWithdrawFees[code]['withdraw'] = this.safeValue (network, 'withdraw');\n                depositWithdrawFees[code]['deposit'] = this.safeValue (network, 'deposit');\n            }\n        }\n        return depositWithdrawFees;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1177,
        "line_end": 1205,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"__type\": \"candle\",\n         \"data\": {\n             \"time\": \"2020-06-05T20:46:00.000Z\",\n             \"open\": 240.573975,\n             \"close\": 240.573975,\n             \"high\": 240.573975,\n             \"low\": 240.573975,\n             \"volume\": 0.01278413,\n             \"quoteVolume\": 3.075528,\n             \"weightedAveragePrice\": 240.573975,\n             \"maxHeight\": 2093895,\n             \"txsCount\": 5,\n             \"timeClose\": \"2020-06-05T20:46:59.999Z\"\n         }\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     {\n        //         \"__type\": \"candle\",\n        //         \"data\": {\n        //             \"time\": \"2020-06-05T20:46:00.000Z\",\n        //             \"open\": 240.573975,\n        //             \"close\": 240.573975,\n        //             \"high\": 240.573975,\n        //             \"low\": 240.573975,\n        //             \"volume\": 0.01278413,\n        //             \"quoteVolume\": 3.075528,\n        //             \"weightedAveragePrice\": 240.573975,\n        //             \"maxHeight\": 2093895,\n        //             \"txsCount\": 5,\n        //             \"timeClose\": \"2020-06-05T20:46:59.999Z\"\n        //         }\n        //     }\n        //\n        const data = this.safeValue (ohlcv, 'data', {});\n        return [\n            this.parse8601 (this.safeString (data, 'time')),\n            this.safeNumber (data, 'open'),\n            this.safeNumber (data, 'high'),\n            this.safeNumber (data, 'low'),\n            this.safeNumber (data, 'close'),\n            this.safeNumber (data, 'volume', 0),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1841,
        "line_end": 1969,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.parseNumber (this.fromRealCurrencyAmount (code, this.safeString (order, 'filledFee')))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.parseNumber (this.fromRealCurrencyAmount (code, this.safeString (order, 'matcherFee')))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"version\": 4,\n         \"id\": \"BshyeHXDfJmTnjTdBYt371jD4yWaT3JTP6KpjpsiZepS\",\n         \"sender\": \"3P8VzLSa23EW5CVckHbV7d5BoN75fF1hhFH\",\n         \"senderPublicKey\": \"AHXn8nBA4SfLQF7hLQiSn16kxyehjizBGW1TdrmSZ1gF\",\n         \"matcherPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n         \"assetPair\": {\n             \"amountAsset\": \"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\n             \"priceAsset\": \"DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p\",\n         },\n         \"orderType\": \"buy\",\n         \"amount\": 10000,\n         \"price\": 400000000,\n         \"timestamp\": 1599848586891,\n         \"expiration\": 1602267786891,\n         \"matcherFee\": 3008,\n         \"matcherFeeAssetId\": \"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\n         \"signature\": \"3D2h8ubrhuWkXbVn4qJ3dvjmZQxLoRNfjTqb9uNpnLxUuwm4fGW2qGH6yKFe2SQPrcbgkS3bDVe7SNtMuatEJ7qy\",\n         \"proofs\": [\n             \"3D2h8ubrhuWkXbVn4qJ3dvjmZQxLoRNfjTqb9uNpnLxUuwm4fGW2qGH6yKFe2SQPrcbgkS3bDVe7SNtMuatEJ7qy\",\n         ],\n         \"attachment\":\"77rnoyFX5BDr15hqZiUtgXKSN46zsbHHQjVNrTMLZcLz62mmFKr39FJ\"\n     }",
          "{\n         \"id\": \"81D9uKk2NfmZzfG7uaJsDtxqWFbJXZmjYvrL88h15fk8\",\n         \"type\": \"buy\",\n         \"orderType\": \"limit\",\n         \"amount\": 30000000000,\n         \"filled\": 0,\n         \"price\": 1000000,\n         \"fee\": 300000,\n         \"filledFee\": 0,\n         \"feeAsset\": \"WAVES\",\n         \"timestamp\": 1594303779322,\n         \"status\": \"Cancelled\",\n         \"assetPair\": {\n             \"amountAsset\": \"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\n             \"priceAsset\": \"WAVES\"\n         },\n         \"avgWeighedPrice\": 0,\n         \"version\": 4,\n         \"totalExecutedPriceAssets\": 0,  // in fetchOpenOrder/s\n         \"attachment\":\"77rnoyFX5BDr15hqZiUtgXKSN46zsbHHQjVNrTMLZcLz62mmFKr39FJ\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //\n        //     {\n        //         \"version\": 4,\n        //         \"id\": \"BshyeHXDfJmTnjTdBYt371jD4yWaT3JTP6KpjpsiZepS\",\n        //         \"sender\": \"3P8VzLSa23EW5CVckHbV7d5BoN75fF1hhFH\",\n        //         \"senderPublicKey\": \"AHXn8nBA4SfLQF7hLQiSn16kxyehjizBGW1TdrmSZ1gF\",\n        //         \"matcherPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n        //         \"assetPair\": {\n        //             \"amountAsset\": \"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\n        //             \"priceAsset\": \"DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p\",\n        //         },\n        //         \"orderType\": \"buy\",\n        //         \"amount\": 10000,\n        //         \"price\": 400000000,\n        //         \"timestamp\": 1599848586891,\n        //         \"expiration\": 1602267786891,\n        //         \"matcherFee\": 3008,\n        //         \"matcherFeeAssetId\": \"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\n        //         \"signature\": \"3D2h8ubrhuWkXbVn4qJ3dvjmZQxLoRNfjTqb9uNpnLxUuwm4fGW2qGH6yKFe2SQPrcbgkS3bDVe7SNtMuatEJ7qy\",\n        //         \"proofs\": [\n        //             \"3D2h8ubrhuWkXbVn4qJ3dvjmZQxLoRNfjTqb9uNpnLxUuwm4fGW2qGH6yKFe2SQPrcbgkS3bDVe7SNtMuatEJ7qy\",\n        //         ],\n        //         \"attachment\":\"77rnoyFX5BDr15hqZiUtgXKSN46zsbHHQjVNrTMLZcLz62mmFKr39FJ\"\n        //     }\n        //\n        //\n        // fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders\n        //\n        //     {\n        //         \"id\": \"81D9uKk2NfmZzfG7uaJsDtxqWFbJXZmjYvrL88h15fk8\",\n        //         \"type\": \"buy\",\n        //         \"orderType\": \"limit\",\n        //         \"amount\": 30000000000,\n        //         \"filled\": 0,\n        //         \"price\": 1000000,\n        //         \"fee\": 300000,\n        //         \"filledFee\": 0,\n        //         \"feeAsset\": \"WAVES\",\n        //         \"timestamp\": 1594303779322,\n        //         \"status\": \"Cancelled\",\n        //         \"assetPair\": {\n        //             \"amountAsset\": \"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\n        //             \"priceAsset\": \"WAVES\"\n        //         },\n        //         \"avgWeighedPrice\": 0,\n        //         \"version\": 4,\n        //         \"totalExecutedPriceAssets\": 0,  // in fetchOpenOrder/s\n        //         \"attachment\":\"77rnoyFX5BDr15hqZiUtgXKSN46zsbHHQjVNrTMLZcLz62mmFKr39FJ\"\n        //     }\n        //\n        const timestamp = this.safeInteger (order, 'timestamp');\n        const side = this.safeString2 (order, 'type', 'orderType');\n        let type = 'limit';\n        if ('type' in order) {\n            // fetchOrders\n            type = this.safeString (order, 'orderType', type);\n        }\n        const id = this.safeString (order, 'id');\n        const filledString = this.safeString (order, 'filled');\n        const priceString = this.safeString (order, 'price');\n        const amountString = this.safeString (order, 'amount');\n        const assetPair = this.safeValue (order, 'assetPair');\n        let symbol = undefined;\n        if (assetPair !== undefined) {\n            symbol = this.getSymbolFromAssetPair (assetPair);\n        } else if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        const amountCurrency = this.safeCurrencyCode (this.safeString (assetPair, 'amountAsset', 'WAVES'));\n        const price = this.fromRealSymbolPrice (symbol, priceString);\n        const amount = this.fromRealCurrencyAmount (amountCurrency, amountString);\n        const filled = this.fromRealCurrencyAmount (amountCurrency, filledString);\n        const average = this.fromRealSymbolPrice (symbol, this.safeString (order, 'avgWeighedPrice'));\n        const status = this.parseOrderStatus (this.safeString (order, 'status'));\n        let fee = undefined;\n        if ('type' in order) {\n            const code = this.safeCurrencyCode (this.safeString (order, 'feeAsset'));\n            fee = {\n                'currency': code,\n                'fee': this.parseNumber (this.fromRealCurrencyAmount (code, this.safeString (order, 'filledFee'))),\n            };\n        } else {\n            const code = this.safeCurrencyCode (this.safeString (order, 'matcherFeeAssetId', 'WAVES'));\n            fee = {\n                'currency': code,\n                'fee': this.parseNumber (this.fromRealCurrencyAmount (code, this.safeString (order, 'matcherFee'))),\n            };\n        }\n        let triggerPrice = undefined;\n        const attachment = this.safeString (order, 'attachment');\n        if (attachment !== undefined) {\n            const decodedAttachment = this.parseJson (this.decode (this.base58ToBinary (attachment)));\n            if (decodedAttachment !== undefined) {\n                const c = this.safeValue (decodedAttachment, 'c');\n                if (c !== undefined) {\n                    const v = this.safeValue (c, 'v');\n                    if (v !== undefined) {\n                        triggerPrice = this.safeString (v, 'p');\n                    }\n                }\n            }\n        }\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'cost': undefined,\n            'average': average,\n            'filled': filled,\n            'remaining': undefined,\n            'status': status,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderBookSide",
        "signature": "parseOrderBookSide (bookSide, market = undefined, limit: Int = undefined)",
        "line_start": 752,
        "line_end": 781,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderBookSide (bookSide, market = undefined, limit: Int = undefined) {\n        const precision = market['precision'];\n        const wavesPrecision = this.safeString (this.options, 'wavesPrecision', '1e-8');\n        const amountPrecisionString = this.safeString (precision, 'amount');\n        const pricePrecisionString = this.safeString (precision, 'price');\n        const difference = Precise.stringDiv (amountPrecisionString, pricePrecisionString);\n        const pricePrecision = Precise.stringDiv (wavesPrecision, difference);\n        const result = [];\n        for (let i = 0; i < bookSide.length; i++) {\n            const entry = bookSide[i];\n            const entryPrice = this.safeString (entry, 'price', '0');\n            const entryAmount = this.safeString (entry, 'amount', '0');\n            let price = undefined;\n            let amount = undefined;\n            if ((pricePrecision !== undefined) && (entryPrice !== undefined)) {\n                price = Precise.stringMul (entryPrice, pricePrecision);\n            }\n            if ((amountPrecisionString !== undefined) && (entryAmount !== undefined)) {\n                amount = Precise.stringMul (entryAmount, amountPrecisionString);\n            }\n            if ((limit !== undefined) && (i > limit)) {\n                break;\n            }\n            result.push ([\n                this.parseNumber (price),\n                this.parseNumber (amount),\n            ]);\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1824,
        "line_end": 1832,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'Cancelled': 'canceled',\n            'Accepted': 'open',\n            'Filled': 'closed',\n            'PartiallyFilled': 'open',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 908,
        "line_end": 981,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "high",
            "comment": null
          },
          {
            "key": "low",
            "value": "low",
            "comment": null
          },
          {
            "key": "bid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "open",
            "value": "open",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n           \"symbol\": \"WAVES/BTC\",\n           \"amountAssetID\": \"WAVES\",\n           \"amountAssetName\": \"Waves\",\n           \"amountAssetDecimals\": 8,\n           \"amountAssetTotalSupply\": \"106908766.00000000\",\n           \"amountAssetMaxSupply\": \"106908766.00000000\",\n           \"amountAssetCirculatingSupply\": \"106908766.00000000\",\n           \"priceAssetID\": \"8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS\",\n           \"priceAssetName\": \"WBTC\",\n           \"priceAssetDecimals\": 8,\n           \"priceAssetTotalSupply\": \"20999999.96007507\",\n           \"priceAssetMaxSupply\": \"20999999.96007507\",\n           \"priceAssetCirculatingSupply\": \"20999999.66019601\",\n           \"24h_open\": \"0.00032688\",\n           \"24h_high\": \"0.00033508\",\n           \"24h_low\": \"0.00032443\",\n           \"24h_close\": \"0.00032806\",\n           \"24h_vwap\": \"0.00032988\",\n           \"24h_volume\": \"42349.69440104\",\n           \"24h_priceVolume\": \"13.97037207\",\n           \"timestamp\":1640232379124\n       }",
          "{\n           \"firstPrice\": \"21749\",\n           \"lastPrice\": \"22000\",\n           \"volume\": \"0.73747149\",\n           \"quoteVolume\": \"16409.44564928645471\",\n           \"high\": \"23589.999941\",\n           \"low\": \"21010.000845\",\n           \"weightedAveragePrice\": \"22250.955964\",\n           \"txsCount\": \"148\",\n           \"volumeWaves\": \"0.0000000000680511203072\"\n       }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //       {\n        //           \"symbol\": \"WAVES/BTC\",\n        //           \"amountAssetID\": \"WAVES\",\n        //           \"amountAssetName\": \"Waves\",\n        //           \"amountAssetDecimals\": 8,\n        //           \"amountAssetTotalSupply\": \"106908766.00000000\",\n        //           \"amountAssetMaxSupply\": \"106908766.00000000\",\n        //           \"amountAssetCirculatingSupply\": \"106908766.00000000\",\n        //           \"priceAssetID\": \"8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS\",\n        //           \"priceAssetName\": \"WBTC\",\n        //           \"priceAssetDecimals\": 8,\n        //           \"priceAssetTotalSupply\": \"20999999.96007507\",\n        //           \"priceAssetMaxSupply\": \"20999999.96007507\",\n        //           \"priceAssetCirculatingSupply\": \"20999999.66019601\",\n        //           \"24h_open\": \"0.00032688\",\n        //           \"24h_high\": \"0.00033508\",\n        //           \"24h_low\": \"0.00032443\",\n        //           \"24h_close\": \"0.00032806\",\n        //           \"24h_vwap\": \"0.00032988\",\n        //           \"24h_volume\": \"42349.69440104\",\n        //           \"24h_priceVolume\": \"13.97037207\",\n        //           \"timestamp\":1640232379124\n        //       }\n        //\n        //  fetch ticker\n        //\n        //       {\n        //           \"firstPrice\": \"21749\",\n        //           \"lastPrice\": \"22000\",\n        //           \"volume\": \"0.73747149\",\n        //           \"quoteVolume\": \"16409.44564928645471\",\n        //           \"high\": \"23589.999941\",\n        //           \"low\": \"21010.000845\",\n        //           \"weightedAveragePrice\": \"22250.955964\",\n        //           \"txsCount\": \"148\",\n        //           \"volumeWaves\": \"0.0000000000680511203072\"\n        //       }\n        //\n        const timestamp = this.safeInteger (ticker, 'timestamp');\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId, market, '/');\n        const symbol = market['symbol'];\n        const last = this.safeString2 (ticker, '24h_close', 'lastPrice');\n        const low = this.safeString2 (ticker, '24h_low', 'low');\n        const high = this.safeString2 (ticker, '24h_high', 'high');\n        const vwap = this.safeString2 (ticker, '24h_vwap', 'weightedAveragePrice');\n        const baseVolume = this.safeString2 (ticker, '24h_volume', 'volume');\n        const quoteVolume = this.safeString2 (ticker, '24h_priceVolume', 'quoteVolume');\n        const open = this.safeString2 (ticker, '24h_open', 'firstPrice');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': high,\n            'low': low,\n            'bid': undefined,\n            'bidVolume': undefined,\n            'ask': undefined,\n            'askVolume': undefined,\n            'vwap': vwap,\n            'open': open,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 2323,
        "line_end": 2424,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "this.safeString (order, 'matcherFee')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (order, 'matcherFeeAssetId', 'WAVES'))",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{ __type: \"transaction\",\n   \"data\":\n    { id: \"HSdruioHqvYHeyn9hhyoHdRWPB2bFA8ujeCPZMK6992c\",\n      \"timestamp\": \"2020-06-09T19:34:51.897Z\",\n      \"height\": 2099684,\n      \"type\": 7,\n      \"version\": 2,\n      \"proofs\":\n       [ \"26teDHERQgwjjHqEn4REcDotNG8M21xjou3X42XuDuCvrRkQo6aPyrswByH3UrkWG8v27ZAaVNzoxDg4teNcLtde\" ],\n      \"fee\": 0.003,\n      \"sender\": \"3PEjHv3JGjcWNpYEEkif2w8NXV4kbhnoGgu\",\n      \"senderPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n      \"buyMatcherFee\": 0.00299999,\n      \"sellMatcherFee\": 0.00299999,\n      \"price\": 0.00012003,\n      \"amount\": 60.80421562,\n      \"order1\":\n       { id: \"CBRwP3ar4oMvvpUiGyfxc1syh41488SDi2GkrjuBDegv\",\n         \"senderPublicKey\": \"DBXSHBz96NFsMu7xh4fi2eT9ZnyxefAHXsMxUayzgC6a\",\n         \"matcherPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n         \"assetPair\": [Object],\n         \"orderType\": \"buy\",\n         \"price\": 0.00012003,\n         \"sender\": \"3PJfFRgVuJ47UY4ckb74EGzEBzkHXtmG1LA\",\n         \"amount\": 60.80424773,\n         \"timestamp\": \"2020-06-09T19:34:51.885Z\",\n         \"expiration\": \"2020-06-10T12:31:31.885Z\",\n         \"matcherFee\": 0.003,\n         \"signature\": \"4cA3ZAb3XAEEXaFG7caqpto5TRbpR5PkhZpxoNQZ9ZReNvjuJQs5a3THnumv7rcqmVUiVtuHAgk2f67ANcqtKyJ8\",\n         \"matcherFeeAssetId\": null },\n      \"order2\":\n       { id: \"CHJSLQ6dfSPs6gu2mAegrMUcRiDEDqaj2GKfvptMjS3M\",\n         \"senderPublicKey\": \"3RUC4NGFZm9H8VJhSSjJyFLdiE42qNiUagDcZPwjgDf8\",\n         \"matcherPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n         \"assetPair\": [Object],\n         \"orderType\": \"sell\",\n         \"price\": 0.00012003,\n         \"sender\": \"3P9vKoQpMZtaSkHKpNh977YY9ZPzTuntLAq\",\n         \"amount\": 60.80424773,\n         \"timestamp\": \"2020-06-09T19:34:51.887Z\",\n         \"expiration\": \"2020-06-10T12:31:31.887Z\",\n         \"matcherFee\": 0.003,\n         \"signature\": \"3SFyrcqzou2ddZyNisnLYaGhLt5qRjKxH8Nw3s4T5U7CEKGX9DDo8dS27RgThPVGbYF1rYET1FwrWoQ2UFZ6SMTR\",\n         \"matcherFeeAssetId\": null } } }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // { __type: \"transaction\",\n        //   \"data\":\n        //    { id: \"HSdruioHqvYHeyn9hhyoHdRWPB2bFA8ujeCPZMK6992c\",\n        //      \"timestamp\": \"2020-06-09T19:34:51.897Z\",\n        //      \"height\": 2099684,\n        //      \"type\": 7,\n        //      \"version\": 2,\n        //      \"proofs\":\n        //       [ \"26teDHERQgwjjHqEn4REcDotNG8M21xjou3X42XuDuCvrRkQo6aPyrswByH3UrkWG8v27ZAaVNzoxDg4teNcLtde\" ],\n        //      \"fee\": 0.003,\n        //      \"sender\": \"3PEjHv3JGjcWNpYEEkif2w8NXV4kbhnoGgu\",\n        //      \"senderPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n        //      \"buyMatcherFee\": 0.00299999,\n        //      \"sellMatcherFee\": 0.00299999,\n        //      \"price\": 0.00012003,\n        //      \"amount\": 60.80421562,\n        //      \"order1\":\n        //       { id: \"CBRwP3ar4oMvvpUiGyfxc1syh41488SDi2GkrjuBDegv\",\n        //         \"senderPublicKey\": \"DBXSHBz96NFsMu7xh4fi2eT9ZnyxefAHXsMxUayzgC6a\",\n        //         \"matcherPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n        //         \"assetPair\": [Object],\n        //         \"orderType\": \"buy\",\n        //         \"price\": 0.00012003,\n        //         \"sender\": \"3PJfFRgVuJ47UY4ckb74EGzEBzkHXtmG1LA\",\n        //         \"amount\": 60.80424773,\n        //         \"timestamp\": \"2020-06-09T19:34:51.885Z\",\n        //         \"expiration\": \"2020-06-10T12:31:31.885Z\",\n        //         \"matcherFee\": 0.003,\n        //         \"signature\": \"4cA3ZAb3XAEEXaFG7caqpto5TRbpR5PkhZpxoNQZ9ZReNvjuJQs5a3THnumv7rcqmVUiVtuHAgk2f67ANcqtKyJ8\",\n        //         \"matcherFeeAssetId\": null },\n        //      \"order2\":\n        //       { id: \"CHJSLQ6dfSPs6gu2mAegrMUcRiDEDqaj2GKfvptMjS3M\",\n        //         \"senderPublicKey\": \"3RUC4NGFZm9H8VJhSSjJyFLdiE42qNiUagDcZPwjgDf8\",\n        //         \"matcherPublicKey\": \"9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5\",\n        //         \"assetPair\": [Object],\n        //         \"orderType\": \"sell\",\n        //         \"price\": 0.00012003,\n        //         \"sender\": \"3P9vKoQpMZtaSkHKpNh977YY9ZPzTuntLAq\",\n        //         \"amount\": 60.80424773,\n        //         \"timestamp\": \"2020-06-09T19:34:51.887Z\",\n        //         \"expiration\": \"2020-06-10T12:31:31.887Z\",\n        //         \"matcherFee\": 0.003,\n        //         \"signature\": \"3SFyrcqzou2ddZyNisnLYaGhLt5qRjKxH8Nw3s4T5U7CEKGX9DDo8dS27RgThPVGbYF1rYET1FwrWoQ2UFZ6SMTR\",\n        //         \"matcherFeeAssetId\": null } } }\n        //\n        const data = this.safeValue (trade, 'data');\n        const datetime = this.safeString (data, 'timestamp');\n        const timestamp = this.parse8601 (datetime);\n        const id = this.safeString (data, 'id');\n        const priceString = this.safeString (data, 'price');\n        const amountString = this.safeString (data, 'amount');\n        const order1 = this.safeValue (data, 'order1');\n        const order2 = this.safeValue (data, 'order2');\n        let order = undefined;\n        // at first, detect if response is from `fetch_my_trades`\n        if (this.safeString (order1, 'senderPublicKey') === this.apiKey) {\n            order = order1;\n        } else if (this.safeString (order2, 'senderPublicKey') === this.apiKey) {\n            order = order2;\n        } else {\n            // response is from `fetch_trades`, so find only taker order\n            const date1 = this.safeString (order1, 'timestamp');\n            const date2 = this.safeString (order2, 'timestamp');\n            const ts1 = this.parse8601 (date1);\n            const ts2 = this.parse8601 (date2);\n            if (ts1 > ts2) {\n                order = order1;\n            } else {\n                order = order2;\n            }\n        }\n        let symbol = undefined;\n        const assetPair = this.safeValue (order, 'assetPair');\n        if (assetPair !== undefined) {\n            symbol = this.getSymbolFromAssetPair (assetPair);\n        } else if (market !== undefined) {\n            symbol = market['symbol'];\n        }\n        const side = this.safeString (order, 'orderType');\n        const orderId = this.safeString (order, 'id');\n        const fee = {\n            'cost': this.safeString (order, 'matcherFee'),\n            'currency': this.safeCurrencyCode (this.safeString (order, 'matcherFeeAssetId', 'WAVES')),\n        };\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2733,
        "line_end": 2799,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (transaction, 'sender')",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "this.safeString (transaction, 'recipient')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCode,\n                'cost': feeAmount,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCode",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeAmount",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"string\",\n         \"signature\": \"string\",\n         \"fee\": 0,\n         \"timestamp\": 1460678400000,\n         \"recipient\": \"3P274YB5qseSE9DTTL3bpSjosZrYBPDpJ8k\",\n         \"amount\": 0\n     }",
          "{\n         type: \"4\",\n         id: \"2xnWTqG9ar7jEDrLxfbVyyspPZ6XZNrrw9ai9sQ81Eya\",\n         fee: \"100000\",\n         feeAssetId: null,\n         timestamp: \"1715786263807\",\n         version: \"2\",\n         sender: \"3P81LLX1kk2CSJC9L8C2enxdHB7XvnSGAEE\",\n         senderPublicKey: \"DdmzmXf9mty1FBE8AdVGnrncVLEAzP4gR4nWoTFAJoXz\",\n         proofs: [ \"RyoKwdSYv3EqotJCYftfFM9JE2j1ZpDRxKwYfiRhLAFeyNp6VfJUXNDS884XfeCeHeNypNmTCZt5NYR1ekyjCX3\", ],\n         recipient: \"3P9tXxu38a8tgewNEKFzourVxeqHd11ppOc\",\n         assetId: null,\n         feeAsset: null,\n         amount: \"2000000\",\n         attachment: \"\",\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": \"string\",\n        //         \"signature\": \"string\",\n        //         \"fee\": 0,\n        //         \"timestamp\": 1460678400000,\n        //         \"recipient\": \"3P274YB5qseSE9DTTL3bpSjosZrYBPDpJ8k\",\n        //         \"amount\": 0\n        //     }\n        //\n        // withdraw new:\n        //     {\n        //         type: \"4\",\n        //         id: \"2xnWTqG9ar7jEDrLxfbVyyspPZ6XZNrrw9ai9sQ81Eya\",\n        //         fee: \"100000\",\n        //         feeAssetId: null,\n        //         timestamp: \"1715786263807\",\n        //         version: \"2\",\n        //         sender: \"3P81LLX1kk2CSJC9L8C2enxdHB7XvnSGAEE\",\n        //         senderPublicKey: \"DdmzmXf9mty1FBE8AdVGnrncVLEAzP4gR4nWoTFAJoXz\",\n        //         proofs: [ \"RyoKwdSYv3EqotJCYftfFM9JE2j1ZpDRxKwYfiRhLAFeyNp6VfJUXNDS884XfeCeHeNypNmTCZt5NYR1ekyjCX3\", ],\n        //         recipient: \"3P9tXxu38a8tgewNEKFzourVxeqHd11ppOc\",\n        //         assetId: null,\n        //         feeAsset: null,\n        //         amount: \"2000000\",\n        //         attachment: \"\",\n        //     }\n        //\n        currency = this.safeCurrency (undefined, currency);\n        const code = currency['code'];\n        const typeRaw = this.safeString (transaction, 'type');\n        const type = (typeRaw === '4') ? 'withdraw' : 'deposit';\n        const amount = this.parseNumber (this.fromRealCurrencyAmount (code, this.safeString (transaction, 'amount')));\n        const feeString = this.safeString (transaction, 'fee');\n        const feeAssetId = this.safeString (transaction, 'feeAssetId', 'WAVES');\n        const feeCode = this.safeCurrencyCode (feeAssetId);\n        const feeAmount = this.parseNumber (this.fromRealCurrencyAmount (feeCode, feeString));\n        const timestamp = this.safeInteger (transaction, 'timestamp');\n        return {\n            'id': this.safeString (transaction, 'id'),\n            'txid': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': undefined,\n            'addressFrom': this.safeString (transaction, 'sender'),\n            'address': undefined,\n            'addressTo': this.safeString (transaction, 'recipient'),\n            'amount': amount,\n            'type': type,\n            'currency': currency['code'],\n            'status': undefined,\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': {\n                'currency': feeCode,\n                'cost': feeAmount,\n            },\n            'info': transaction,\n        } as Transaction;\n    }"
      }
    ],
    "whitebit": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2176,
        "line_end": 2196,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balanceKeys = Object.keys (response);\n        const result: Dict = {};\n        for (let i = 0; i < balanceKeys.length; i++) {\n            const id = balanceKeys[i];\n            const code = this.safeCurrencyCode (id);\n            const balance = response[id];\n            if (typeof balance === 'object' && balance !== undefined) {\n                const account = this.account ();\n                account['free'] = this.safeString2 (balance, 'available', 'main_balance');\n                account['used'] = this.safeString (balance, 'freeze');\n                account['total'] = this.safeString (balance, 'main_balance');\n                result[code] = account;\n            } else {\n                const account = this.account ();\n                account['total'] = balance;\n                result[code] = account;\n            }\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseBorrowInterest",
        "signature": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest",
        "line_start": 3190,
        "line_end": 3224,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "currency",
            "value": "'USDT'",
            "comment": null
          },
          {
            "key": "interest",
            "value": "this.safeNumber (info, 'unrealizedFunding')",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "0.00098",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'cross'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"positionId\": 191823,\n         \"market\": \"BTC_USDT\",\n         \"openDate\": 1660340344.027163,\n         \"modifyDate\": 1660340344.027163,\n         \"amount\": \"0.003075\",\n         \"basePrice\": \"24149.24512\",\n         \"liquidationPrice\": \"7059.02\",\n         \"leverage\": \"5\",\n         \"pnl\": \"-0.15\",\n         \"pnlPercent\": \"-0.20\",\n         \"margin\": \"14.86\",\n         \"freeMargin\": \"44.99\",\n         \"funding\": \"0\",\n         \"unrealizedFunding\": \"0.0000307828284903\",\n         \"liquidationState\": null\n     }"
        ],
        "source": "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest {\n        //\n        //     {\n        //         \"positionId\": 191823,\n        //         \"market\": \"BTC_USDT\",\n        //         \"openDate\": 1660340344.027163,\n        //         \"modifyDate\": 1660340344.027163,\n        //         \"amount\": \"0.003075\",\n        //         \"basePrice\": \"24149.24512\",\n        //         \"liquidationPrice\": \"7059.02\",\n        //         \"leverage\": \"5\",\n        //         \"pnl\": \"-0.15\",\n        //         \"pnlPercent\": \"-0.20\",\n        //         \"margin\": \"14.86\",\n        //         \"freeMargin\": \"44.99\",\n        //         \"funding\": \"0\",\n        //         \"unrealizedFunding\": \"0.0000307828284903\",\n        //         \"liquidationState\": null\n        //     }\n        //\n        const marketId = this.safeString (info, 'market');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const timestamp = this.safeTimestamp (info, 'modifyDate');\n        return {\n            'info': info,\n            'symbol': symbol,\n            'currency': 'USDT',\n            'interest': this.safeNumber (info, 'unrealizedFunding'),\n            'interestRate': 0.00098, // https://whitebit.com/fees\n            'amountBorrowed': this.safeNumber (info, 'amount'),\n            'marginMode': 'cross',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as BorrowInterest;\n    }"
      },
      {
        "name": "parseBorrowRate",
        "signature": "parseBorrowRate (info, currency: Currency = undefined)",
        "line_start": 3938,
        "line_end": 3951,
        "comment": null,
        "mappings": [
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "this.parseNumber (Precise.stringDiv (percent, '100'))",
            "comment": null
          },
          {
            "key": "period",
            "value": "this.safeInteger (info, 'duration')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBorrowRate (info, currency: Currency = undefined) {\n        //\n        //\n        const currencyId = this.safeString (info, 'ticker');\n        const percent = this.safeString (info, 'percent');\n        return {\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'rate': this.parseNumber (Precise.stringDiv (percent, '100')),\n            'period': this.safeInteger (info, 'duration'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 3644,
        "line_end": 3703,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (conversion, 'id')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'give', 'finalGive')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'receive', 'finalReceive')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (conversion, 'rate')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"give\": \"4\",\n         \"receive\": \"0.00004762\",\n         \"rate\": \"0.0000119\",\n         \"id\": \"1740889\",\n         \"expireAt\": 1741090147,\n         \"from\": \"USDT\",\n         \"to\": \"BTC\"\n     }",
          "{\n         \"finalGive\": \"4\",\n         \"finalReceive\": \"0.00004772\"\n     }",
          "{\n         \"id\": \"1741105\",\n         \"path\": [\n             {\n                 \"from\": \"USDT\",\n                 \"to\": \"BTC\",\n                 \"rate\": \"0.00001193\"\n             }\n         ],\n         \"date\": 1741090757,\n         \"give\": \"4\",\n         \"receive\": \"0.00004772\",\n         \"rate\": \"0.00001193\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"give\": \"4\",\n        //         \"receive\": \"0.00004762\",\n        //         \"rate\": \"0.0000119\",\n        //         \"id\": \"1740889\",\n        //         \"expireAt\": 1741090147,\n        //         \"from\": \"USDT\",\n        //         \"to\": \"BTC\"\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"finalGive\": \"4\",\n        //         \"finalReceive\": \"0.00004772\"\n        //     }\n        //\n        // fetchConvertTradeHistory\n        //\n        //     {\n        //         \"id\": \"1741105\",\n        //         \"path\": [\n        //             {\n        //                 \"from\": \"USDT\",\n        //                 \"to\": \"BTC\",\n        //                 \"rate\": \"0.00001193\"\n        //             }\n        //         ],\n        //         \"date\": 1741090757,\n        //         \"give\": \"4\",\n        //         \"receive\": \"0.00004772\",\n        //         \"rate\": \"0.00001193\"\n        //     }\n        //\n        const path = this.safeList (conversion, 'path', []);\n        const first = this.safeDict (path, 0, {});\n        const fromPath = this.safeString (first, 'from');\n        const toPath = this.safeString (first, 'to');\n        const timestamp = this.safeTimestamp2 (conversion, 'date', 'expireAt');\n        const fromCoin = this.safeString (conversion, 'from', fromPath);\n        const fromCode = this.safeCurrencyCode (fromCoin, fromCurrency);\n        const toCoin = this.safeString (conversion, 'to', toPath);\n        const toCode = this.safeCurrencyCode (toCoin, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (conversion, 'id'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'give', 'finalGive'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'receive', 'finalReceive'),\n            'price': this.safeNumber (conversion, 'rate'),\n            'fee': undefined,\n        } as Conversion;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 2744,
        "line_end": 2758,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "this.safeString (depositAddress, 'address')",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"GDTSOI56XNVAKJNJBLJGRNZIVOCIZJRBIDKTWSCYEYNFAZEMBLN75RMN\",\n         \"memo\": \"48565488244493\"\n     },"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"GDTSOI56XNVAKJNJBLJGRNZIVOCIZJRBIDKTWSCYEYNFAZEMBLN75RMN\",\n        //         \"memo\": \"48565488244493\"\n        //     },\n        //\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'network': undefined,\n            'address': this.safeString (depositAddress, 'address'),\n            'tag': this.safeString (depositAddress, 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseDepositWithdrawFees",
        "signature": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
        "line_start": 831,
        "line_end": 923,
        "comment": null,
        "mappings": [
          {
            "key": "fee",
            "value": "withdrawFee",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "(withdrawFee !== undefined) ? false : undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"1INCH\": {\n            \"is_depositable\": true,\n            \"is_withdrawal\": true,\n            \"ticker\": \"1INCH\",\n            \"name\": \"1inch\",\n            \"providers\": [],\n            \"withdraw\": {\n                \"max_amount\": \"0\",\n                \"min_amount\": \"21.5\",\n                \"fixed\": \"17.5\",\n                \"flex\": null\n            },\n            \"deposit\": {\n                \"max_amount\": \"0\",\n                \"min_amount\": \"19.5\",\n                \"fixed\": null,\n                \"flex\": null\n            }\n        },\n        \"WBT (ERC20)\": {\n            \"is_depositable\": true,\n            \"is_withdrawal\": true,\n            \"ticker\": \"WBT\",\n            \"name\": \"WhiteBIT Token\",\n            \"providers\": [],\n            \"withdraw\": { max_amount: \"0\", min_amount: \"0.7\", fixed: \"0.253\", flex: null },\n            \"deposit\": { max_amount: \"0\", min_amount: \"0.35\", fixed: null, flex: null }\n        },\n        \"WBT (TRC20)\": {\n            \"is_depositable\": true,\n            \"is_withdrawal\": true,\n            \"ticker\": \"WBT\",\n            \"name\": \"WhiteBIT Token\",\n            \"providers\": [],\n            \"withdraw\": { max_amount: \"0\", min_amount: \"1.5\", fixed: \"0.075\", flex: null },\n            \"deposit\": { max_amount: \"0\", min_amount: \"0.75\", fixed: null, flex: null }\n        },\n        ...\n    }"
        ],
        "source": "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n        //\n        //    {\n        //        \"1INCH\": {\n        //            \"is_depositable\": true,\n        //            \"is_withdrawal\": true,\n        //            \"ticker\": \"1INCH\",\n        //            \"name\": \"1inch\",\n        //            \"providers\": [],\n        //            \"withdraw\": {\n        //                \"max_amount\": \"0\",\n        //                \"min_amount\": \"21.5\",\n        //                \"fixed\": \"17.5\",\n        //                \"flex\": null\n        //            },\n        //            \"deposit\": {\n        //                \"max_amount\": \"0\",\n        //                \"min_amount\": \"19.5\",\n        //                \"fixed\": null,\n        //                \"flex\": null\n        //            }\n        //        },\n        //        \"WBT (ERC20)\": {\n        //            \"is_depositable\": true,\n        //            \"is_withdrawal\": true,\n        //            \"ticker\": \"WBT\",\n        //            \"name\": \"WhiteBIT Token\",\n        //            \"providers\": [],\n        //            \"withdraw\": { max_amount: \"0\", min_amount: \"0.7\", fixed: \"0.253\", flex: null },\n        //            \"deposit\": { max_amount: \"0\", min_amount: \"0.35\", fixed: null, flex: null }\n        //        },\n        //        \"WBT (TRC20)\": {\n        //            \"is_depositable\": true,\n        //            \"is_withdrawal\": true,\n        //            \"ticker\": \"WBT\",\n        //            \"name\": \"WhiteBIT Token\",\n        //            \"providers\": [],\n        //            \"withdraw\": { max_amount: \"0\", min_amount: \"1.5\", fixed: \"0.075\", flex: null },\n        //            \"deposit\": { max_amount: \"0\", min_amount: \"0.75\", fixed: null, flex: null }\n        //        },\n        //        ...\n        //    }\n        //\n        const depositWithdrawFees: Dict = {};\n        codes = this.marketCodes (codes);\n        const currencyIds = Object.keys (response);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const entry = currencyIds[i];\n            const splitEntry = entry.split (' ');\n            const currencyId = splitEntry[0];\n            const feeInfo = response[entry];\n            const code = this.safeCurrencyCode (currencyId);\n            if ((codes === undefined) || (this.inArray (code, codes))) {\n                const depositWithdrawFee = this.safeValue (depositWithdrawFees, code);\n                if (depositWithdrawFee === undefined) {\n                    depositWithdrawFees[code] = this.depositWithdrawFee ({});\n                }\n                depositWithdrawFees[code]['info'][entry] = feeInfo;\n                let networkId = this.safeString (splitEntry, 1);\n                const withdraw = this.safeValue (feeInfo, 'withdraw');\n                const deposit = this.safeValue (feeInfo, 'deposit');\n                const withdrawFee = this.safeNumber (withdraw, 'fixed');\n                const depositFee = this.safeNumber (deposit, 'fixed');\n                const withdrawResult: Dict = {\n                    'fee': withdrawFee,\n                    'percentage': (withdrawFee !== undefined) ? false : undefined,\n                };\n                const depositResult: Dict = {\n                    'fee': depositFee,\n                    'percentage': (depositFee !== undefined) ? false : undefined,\n                };\n                if (networkId !== undefined) {\n                    const networkLength = networkId.length;\n                    networkId = networkId.slice (1, networkLength - 1);\n                    const networkCode = this.networkIdToCode (networkId);\n                    depositWithdrawFees[code]['networks'][networkCode] = {\n                        'withdraw': withdrawResult,\n                        'deposit': depositResult,\n                    };\n                } else {\n                    depositWithdrawFees[code]['withdraw'] = withdrawResult;\n                    depositWithdrawFees[code]['deposit'] = depositResult;\n                }\n            }\n        }\n        const depositWithdrawCodes = Object.keys (depositWithdrawFees);\n        for (let i = 0; i < depositWithdrawCodes.length; i++) {\n            const code = depositWithdrawCodes[i];\n            const currency = this.currency (code);\n            depositWithdrawFees[code] = this.assignDefaultDepositWithdrawFees (depositWithdrawFees[code], currency);\n        }\n        return depositWithdrawFees;\n    }"
      },
      {
        "name": "parseFundingHistories",
        "signature": "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[]",
        "line_start": 3439,
        "line_end": 3447,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[] {\n        const result = [];\n        for (let i = 0; i < contracts.length; i++) {\n            const contract = contracts[i];\n            result.push (this.parseFundingHistory (contract, market));\n        }\n        const sorted = this.sortBy (result, 'timestamp');\n        return this.filterBySinceLimit (sorted, since, limit);\n    }"
      },
      {
        "name": "parseFundingHistory",
        "signature": "parseFundingHistory (contract, market: Market = undefined)",
        "line_start": 3414,
        "line_end": 3437,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'swap')",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (contract, 'fundingAmount')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"market\": \"BTC_PERP\",\n         \"fundingTime\": \"1708704000000\",\n         \"fundingRate\": \"0.00017674\",\n         \"fundingAmount\": \"-0.171053531892\",\n         \"positionAmount\": \"0.019\",\n         \"settlementPrice\": \"50938.2\",\n         \"rateCalculatedTime\": \"1708675200000\"\n     }"
        ],
        "source": "parseFundingHistory (contract, market: Market = undefined) {\n        //\n        //     {\n        //         \"market\": \"BTC_PERP\",\n        //         \"fundingTime\": \"1708704000000\",\n        //         \"fundingRate\": \"0.00017674\",\n        //         \"fundingAmount\": \"-0.171053531892\",\n        //         \"positionAmount\": \"0.019\",\n        //         \"settlementPrice\": \"50938.2\",\n        //         \"rateCalculatedTime\": \"1708675200000\"\n        //     }\n        //\n        const marketId = this.safeString (contract, 'market');\n        const timestamp = this.safeInteger (contract, 'fundingTime');\n        return {\n            'info': contract,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n            'code': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.safeNumber (contract, 'fundingAmount'),\n        };\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market: Market = undefined): FundingRate",
        "line_start": 3303,
        "line_end": 3362,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "markPrice",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "indexPrice",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "interestRate",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "fundingTime",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (fundingTime)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"ticker_id\":\"ADA_PERP\",\n     \"stock_currency\":\"ADA\",\n     \"money_currency\":\"USDT\",\n     \"last_price\":\"0.296708\",\n     \"stock_volume\":\"7982130\",\n     \"money_volume\":\"2345758.29189\",\n     \"bid\":\"0.296608\",\n     \"ask\":\"0.296758\",\n     \"high\":\"0.298338\",\n     \"low\":\"0.290171\",\n     \"product_type\":\"Perpetual\",\n     \"open_interest\":\"46533000\",\n     \"index_price\":\"0.29659\",\n     \"index_name\":\"Cardano\",\n     \"index_currency\":\"ADA\",\n     \"funding_rate\":\"0.0001\",\n     \"next_funding_rate_timestamp\":\"1691193600000\",\n     \"brackets\":{\n        \"1\":\"0\",\n        \"2\":\"0\",\n        \"3\":\"0\",\n        \"5\":\"0\",\n        \"10\":\"0\",\n        \"20\":\"0\",\n        \"50\":\"-10000\",\n        \"100\":\"-5000\"\n     },\n     \"max_leverage\":\"100\"\n  }"
        ],
        "source": "parseFundingRate (contract, market: Market = undefined): FundingRate {\n        //\n        // {\n        //     \"ticker_id\":\"ADA_PERP\",\n        //     \"stock_currency\":\"ADA\",\n        //     \"money_currency\":\"USDT\",\n        //     \"last_price\":\"0.296708\",\n        //     \"stock_volume\":\"7982130\",\n        //     \"money_volume\":\"2345758.29189\",\n        //     \"bid\":\"0.296608\",\n        //     \"ask\":\"0.296758\",\n        //     \"high\":\"0.298338\",\n        //     \"low\":\"0.290171\",\n        //     \"product_type\":\"Perpetual\",\n        //     \"open_interest\":\"46533000\",\n        //     \"index_price\":\"0.29659\",\n        //     \"index_name\":\"Cardano\",\n        //     \"index_currency\":\"ADA\",\n        //     \"funding_rate\":\"0.0001\",\n        //     \"next_funding_rate_timestamp\":\"1691193600000\",\n        //     \"brackets\":{\n        //        \"1\":\"0\",\n        //        \"2\":\"0\",\n        //        \"3\":\"0\",\n        //        \"5\":\"0\",\n        //        \"10\":\"0\",\n        //        \"20\":\"0\",\n        //        \"50\":\"-10000\",\n        //        \"100\":\"-5000\"\n        //     },\n        //     \"max_leverage\":\"100\"\n        //  }\n        //\n        const marketId = this.safeString (contract, 'ticker_id');\n        const symbol = this.safeSymbol (marketId, market);\n        const markPrice = this.safeNumber (contract, 'markPrice');\n        const indexPrice = this.safeNumber (contract, 'indexPrice');\n        const interestRate = this.safeNumber (contract, 'interestRate');\n        const fundingRate = this.safeNumber (contract, 'funding_rate');\n        const fundingTime = this.safeInteger (contract, 'next_funding_rate_timestamp');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': markPrice,\n            'indexPrice': indexPrice,\n            'interestRate': interestRate,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': fundingRate,\n            'fundingTimestamp': fundingTime,\n            'fundingDatetime': this.iso8601 (fundingTime),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': undefined,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 480,
        "line_end": 568,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "isSpot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "margin",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (taker)",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.parseNumber (maker)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "isSpot ? undefined : contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': amountPrecision,\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'moneyPrec'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minAmount'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minTotal'),\n                    'max': this.safeNumber (market, 'maxTotal'),\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'minAmount'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'minTotal'),\n                    'max': this.safeNumber (market, 'maxTotal'),\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'name');\n        const baseId = this.safeString (market, 'stock');\n        let quoteId = this.safeString (market, 'money');\n        quoteId = (quoteId === 'PERP') ? 'USDT' : quoteId;\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const active = this.safeValue (market, 'tradesEnabled');\n        const isCollateral = this.safeValue (market, 'isCollateral');\n        const typeId = this.safeString (market, 'type');\n        let type: MarketType;\n        let settle: Str = undefined;\n        let settleId: Str = undefined;\n        let symbol = base + '/' + quote;\n        const swap = typeId === 'futures';\n        const margin = isCollateral && !swap;\n        let contract = false;\n        const amountPrecision = this.parseNumber (this.parsePrecision (this.safeString (market, 'stockPrec')));\n        const contractSize = amountPrecision;\n        let linear: Bool = undefined;\n        let inverse: Bool = undefined;\n        if (swap) {\n            settleId = quoteId;\n            settle = this.safeCurrencyCode (settleId);\n            symbol = symbol + ':' + settle;\n            type = 'swap';\n            contract = true;\n            linear = true;\n            inverse = false;\n        } else {\n            type = 'spot';\n        }\n        const takerFeeRate = this.safeString (market, 'takerFee');\n        const taker = Precise.stringDiv (takerFeeRate, '100');\n        const makerFeeRate = this.safeString (market, 'makerFee');\n        const maker = Precise.stringDiv (makerFeeRate, '100');\n        const isSpot = !swap;\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': isSpot,\n            'margin': margin,\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': this.parseNumber (taker),\n            'maker': this.parseNumber (maker),\n            'contractSize': isSpot ? undefined : contractSize,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': amountPrecision,\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'moneyPrec'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'minAmount'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minTotal'),\n                    'max': this.safeNumber (market, 'maxTotal'),\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1756,
        "line_end": 1776,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         1591488000,\n         \"0.025025\",\n         \"0.025025\",\n         \"0.025029\",\n         \"0.025023\",\n         \"6.181\",\n         \"0.154686629\"\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         1591488000,\n        //         \"0.025025\",\n        //         \"0.025025\",\n        //         \"0.025029\",\n        //         \"0.025023\",\n        //         \"6.181\",\n        //         \"0.154686629\"\n        //     ]\n        //\n        return [\n            this.safeTimestamp (ohlcv, 0), // timestamp\n            this.safeNumber (ohlcv, 1), // open\n            this.safeNumber (ohlcv, 3), // high\n            this.safeNumber (ohlcv, 4), // low\n            this.safeNumber (ohlcv, 2), // close\n            this.safeNumber (ohlcv, 5), // volume\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 2366,
        "line_end": 2462,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastTradeTimestamp",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'status'))",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"orderId\":105687928629,\n          \"clientOrderId\":\"\",\n          \"market\":\"DOGE_USDT\",\n          \"side\":\"sell\",\n          \"type\":\"stop market\",\n          \"timestamp\":1659091079.729576,\n          \"dealMoney\":\"0\",                // executed amount in quote\n          \"dealStock\":\"0\",                // base filled amount\n          \"amount\":\"100\",\n          \"takerFee\":\"0.001\",\n          \"makerFee\":\"0\",\n          \"left\":\"100\",\n          \"price\": \"40000\", // price if price isset\n          \"dealFee\":\"0\",\n          \"activation_price\":\"0.065\"      // stop price (if stop limit or stop market)\n      }",
          "{\n          \"id\":105531094719,\n          \"clientOrderId\":\"\",\n          \"ctime\":1659045334.550127,\n          \"ftime\":1659045334.550127,\n          \"side\":\"buy\",\n          \"amount\":\"5.9940059\",           // cost in terms of quote for regular market orders, amount in terms or base for all other order types\n          \"price\":\"0\",\n          \"type\":\"market\",\n          \"takerFee\":\"0.001\",\n          \"makerFee\":\"0\",\n          \"dealFee\":\"0.0059375815\",\n          \"dealStock\":\"85\",               // base filled amount\n          \"dealMoney\":\"5.9375815\",        // executed amount in quote\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder, fetchOpenOrders, cancelOrder\n        //\n        //      {\n        //          \"orderId\":105687928629,\n        //          \"clientOrderId\":\"\",\n        //          \"market\":\"DOGE_USDT\",\n        //          \"side\":\"sell\",\n        //          \"type\":\"stop market\",\n        //          \"timestamp\":1659091079.729576,\n        //          \"dealMoney\":\"0\",                // executed amount in quote\n        //          \"dealStock\":\"0\",                // base filled amount\n        //          \"amount\":\"100\",\n        //          \"takerFee\":\"0.001\",\n        //          \"makerFee\":\"0\",\n        //          \"left\":\"100\",\n        //          \"price\": \"40000\", // price if price isset\n        //          \"dealFee\":\"0\",\n        //          \"activation_price\":\"0.065\"      // stop price (if stop limit or stop market)\n        //      }\n        //\n        // fetchClosedOrders\n        //\n        //      {\n        //          \"id\":105531094719,\n        //          \"clientOrderId\":\"\",\n        //          \"ctime\":1659045334.550127,\n        //          \"ftime\":1659045334.550127,\n        //          \"side\":\"buy\",\n        //          \"amount\":\"5.9940059\",           // cost in terms of quote for regular market orders, amount in terms or base for all other order types\n        //          \"price\":\"0\",\n        //          \"type\":\"market\",\n        //          \"takerFee\":\"0.001\",\n        //          \"makerFee\":\"0\",\n        //          \"dealFee\":\"0.0059375815\",\n        //          \"dealStock\":\"85\",               // base filled amount\n        //          \"dealMoney\":\"5.9375815\",        // executed amount in quote\n        //      }\n        //\n        const marketId = this.safeString (order, 'market');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = market['symbol'];\n        const side = this.safeString (order, 'side');\n        const filled = this.safeString (order, 'dealStock');\n        let remaining = this.safeString (order, 'left');\n        let clientOrderId = this.safeString (order, 'clientOrderId');\n        if (clientOrderId === '') {\n            clientOrderId = undefined;\n        }\n        const price = this.safeString (order, 'price');\n        const triggerPrice = this.safeNumber (order, 'activation_price');\n        const orderId = this.safeString2 (order, 'orderId', 'id');\n        const type = this.safeString (order, 'type');\n        const orderType = this.parseOrderType (type);\n        if (orderType === 'market') {\n            remaining = undefined;\n        }\n        let amount = this.safeString (order, 'amount');\n        const cost = this.safeString (order, 'dealMoney');\n        if ((side === 'buy') && ((type === 'market') || (type === 'stop market'))) {\n            amount = filled;\n        }\n        const dealFee = this.safeString (order, 'dealFee');\n        let fee = undefined;\n        if (dealFee !== undefined) {\n            fee = {\n                'cost': this.parseNumber (dealFee),\n                'currency': market['quote'],\n            };\n        }\n        const timestamp = this.safeTimestamp2 (order, 'ctime', 'timestamp');\n        const lastTradeTimestamp = this.safeTimestamp (order, 'ftime');\n        return this.safeOrder ({\n            'info': order,\n            'id': orderId,\n            'symbol': symbol,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastTradeTimestamp,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'status': this.parseOrderStatus (this.safeString (order, 'status')),\n            'side': side,\n            'price': price,\n            'type': orderType,\n            'triggerPrice': triggerPrice,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining,\n            'average': undefined,\n            'cost': cost,\n            'fee': fee,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2464,
        "line_end": 2472,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            'CANCELED': 'canceled',\n            'OPEN': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n        };\n        return this.safeStringLower (statuses, status, status);\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 2353,
        "line_end": 2364,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'limit': 'limit',\n            'market': 'market',\n            'stop market': 'market',\n            'stop limit': 'limit',\n            'stock market': 'market',\n            'margin limit': 'limit',\n            'margin market': 'market',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined): Position",
        "line_start": 3836,
        "line_end": 3914,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (position, 'positionId')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidationPrice')",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'basePrice')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.safeNumber (position, 'pnl')",
            "comment": null
          },
          {
            "key": "realizedPnl",
            "value": "this.safeNumber (orderDetail, 'realizedPnl')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeNumber (position, 'pnlPercent')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "this.safeTimestamp (position, 'modifyDate')",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "this.safeNumber (position, 'margin')",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "this.safeNumber (tpsl, 'stopLoss')",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "this.safeNumber (tpsl, 'takeProfit')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"positionId\": 479975679,\n         \"market\": \"BTC_PERP\",\n         \"openDate\": 1741941025.3098869,\n         \"modifyDate\": 1741941025.3098869,\n         \"amount\": \"0.001\",\n         \"basePrice\": \"82498.7\",\n         \"liquidationPrice\": \"70177.2\",\n         \"pnl\": \"0\",\n         \"pnlPercent\": \"0.00\",\n         \"margin\": \"4.2\",\n         \"freeMargin\": \"9.9\",\n         \"funding\": \"0\",\n         \"unrealizedFunding\": \"0\",\n         \"liquidationState\": null,\n         \"tpsl\": null\n     }",
          "{\n         \"positionId\": 479975679,\n         \"market\": \"BTC_PERP\",\n         \"openDate\": 1741941025.309887,\n         \"modifyDate\": 1741941025.309887,\n         \"amount\": \"0.001\",\n         \"basePrice\": \"82498.7\",\n         \"realizedFunding\": \"0\",\n         \"liquidationPrice\": \"0\",\n         \"liquidationState\": null,\n         \"orderDetail\": {\n             \"id\": 1224727949521,\n             \"tradeAmount\": \"0.001\",\n             \"price\": \"82498.7\",\n             \"tradeFee\": \"0.028874545\",\n             \"fundingFee\": \"0\",\n             \"realizedPnl\": \"-0.028874545\"\n         }\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined): Position {\n        //\n        // fetchPosition, fetchPositions\n        //\n        //     {\n        //         \"positionId\": 479975679,\n        //         \"market\": \"BTC_PERP\",\n        //         \"openDate\": 1741941025.3098869,\n        //         \"modifyDate\": 1741941025.3098869,\n        //         \"amount\": \"0.001\",\n        //         \"basePrice\": \"82498.7\",\n        //         \"liquidationPrice\": \"70177.2\",\n        //         \"pnl\": \"0\",\n        //         \"pnlPercent\": \"0.00\",\n        //         \"margin\": \"4.2\",\n        //         \"freeMargin\": \"9.9\",\n        //         \"funding\": \"0\",\n        //         \"unrealizedFunding\": \"0\",\n        //         \"liquidationState\": null,\n        //         \"tpsl\": null\n        //     }\n        //\n        // fetchPositionHistory\n        //\n        //     {\n        //         \"positionId\": 479975679,\n        //         \"market\": \"BTC_PERP\",\n        //         \"openDate\": 1741941025.309887,\n        //         \"modifyDate\": 1741941025.309887,\n        //         \"amount\": \"0.001\",\n        //         \"basePrice\": \"82498.7\",\n        //         \"realizedFunding\": \"0\",\n        //         \"liquidationPrice\": \"0\",\n        //         \"liquidationState\": null,\n        //         \"orderDetail\": {\n        //             \"id\": 1224727949521,\n        //             \"tradeAmount\": \"0.001\",\n        //             \"price\": \"82498.7\",\n        //             \"tradeFee\": \"0.028874545\",\n        //             \"fundingFee\": \"0\",\n        //             \"realizedPnl\": \"-0.028874545\"\n        //         }\n        //     }\n        //\n        const marketId = this.safeString (position, 'market');\n        const timestamp = this.safeTimestamp (position, 'openDate');\n        const tpsl = this.safeDict (position, 'tpsl', {});\n        const orderDetail = this.safeDict (position, 'orderDetail', {});\n        return this.safePosition ({\n            'info': position,\n            'id': this.safeString (position, 'positionId'),\n            'symbol': this.safeSymbol (marketId, market),\n            'notional': undefined,\n            'marginMode': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n            'entryPrice': this.safeNumber (position, 'basePrice'),\n            'unrealizedPnl': this.safeNumber (position, 'pnl'),\n            'realizedPnl': this.safeNumber (orderDetail, 'realizedPnl'),\n            'percentage': this.safeNumber (position, 'pnlPercent'),\n            'contracts': undefined,\n            'contractSize': undefined,\n            'markPrice': undefined,\n            'lastPrice': undefined,\n            'side': undefined,\n            'hedged': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': this.safeTimestamp (position, 'modifyDate'),\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'collateral': this.safeNumber (position, 'margin'),\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'leverage': undefined,\n            'marginRatio': undefined,\n            'stopLossPrice': this.safeNumber (tpsl, 'stopLoss'),\n            'takeProfitPrice': this.safeNumber (tpsl, 'takeProfit'),\n        }) as Position;\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1272,
        "line_end": 1352,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString2 (ticker, 'bid', 'highestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString2 (ticker, 'ask', 'lowestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'open')",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.safeString (ticker, 'change')",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeStringN (ticker, [ 'base_volume', 'volume', 'baseVolume24h' ])",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeStringN (ticker, [ 'quote_volume', 'deal', 'quoteVolume24h' ])",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"bid\": \"0.021979\",\n        \"ask\": \"0.021996\",\n        \"open\": \"0.02182\",\n        \"high\": \"0.022039\",\n        \"low\": \"0.02161\",\n        \"last\": \"0.021987\",\n        \"volume\": \"2810.267\",\n        \"deal\": \"61.383565474\",\n        \"change\": \"0.76\",\n    }",
          "\"BCH_RUB\": {\n        \"base_id\": 1831,\n        \"quote_id\": 0,\n        \"last_price\": \"32830.21\",\n        \"quote_volume\": \"1494659.8024096\",\n        \"base_volume\": \"46.1083\",\n        \"isFrozen\": false,\n        \"change\": \"2.12\" // in percent\n    }",
          "{\n         \"open\": \"52853.04\",\n         \"close\": \"55913.88\",\n         \"high\": \"56272\",\n         \"low\": \"49549.67\",\n         \"volume\": \"57331.067185\",\n         \"deal\": \"3063860382.42985338\",\n         \"last\": \"55913.88\",\n         \"period\": 86400\n     }",
          "{\n       lastUpdateTimestamp: '2025-01-02T09:16:36.000Z',\n       tradingPairs: 'ARB_USDC',\n       lastPrice: '0.7727',\n       lowestAsk: '0.7735',\n       highestBid: '0.7732',\n       baseVolume24h: '1555793.74',\n       quoteVolume24h: '1157602.622406',\n       tradesEnabled: true\n   }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //  FetchTicker (v1)\n        //\n        //    {\n        //        \"bid\": \"0.021979\",\n        //        \"ask\": \"0.021996\",\n        //        \"open\": \"0.02182\",\n        //        \"high\": \"0.022039\",\n        //        \"low\": \"0.02161\",\n        //        \"last\": \"0.021987\",\n        //        \"volume\": \"2810.267\",\n        //        \"deal\": \"61.383565474\",\n        //        \"change\": \"0.76\",\n        //    }\n        //\n        // FetchTickers (v4)\n        //\n        //    \"BCH_RUB\": {\n        //        \"base_id\": 1831,\n        //        \"quote_id\": 0,\n        //        \"last_price\": \"32830.21\",\n        //        \"quote_volume\": \"1494659.8024096\",\n        //        \"base_volume\": \"46.1083\",\n        //        \"isFrozen\": false,\n        //        \"change\": \"2.12\" // in percent\n        //    }\n        //\n        // WS market_update\n        //\n        //     {\n        //         \"open\": \"52853.04\",\n        //         \"close\": \"55913.88\",\n        //         \"high\": \"56272\",\n        //         \"low\": \"49549.67\",\n        //         \"volume\": \"57331.067185\",\n        //         \"deal\": \"3063860382.42985338\",\n        //         \"last\": \"55913.88\",\n        //         \"period\": 86400\n        //     }\n        // v2\n        //   {\n        //       lastUpdateTimestamp: '2025-01-02T09:16:36.000Z',\n        //       tradingPairs: 'ARB_USDC',\n        //       lastPrice: '0.7727',\n        //       lowestAsk: '0.7735',\n        //       highestBid: '0.7732',\n        //       baseVolume24h: '1555793.74',\n        //       quoteVolume24h: '1157602.622406',\n        //       tradesEnabled: true\n        //   }\n        //\n        const marketId = this.safeString (ticker, 'tradingPairs');\n        market = this.safeMarket (marketId, market);\n        // last price is provided as \"last\" or \"last_price\"\n        const last = this.safeStringN (ticker, [ 'last', 'last_price', 'lastPrice' ]);\n        // if \"close\" is provided, use it, otherwise use <last>\n        const close = this.safeString (ticker, 'close', last);\n        return this.safeTicker ({\n            'symbol': market['symbol'],\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString2 (ticker, 'bid', 'highestBid'),\n            'bidVolume': undefined,\n            'ask': this.safeString2 (ticker, 'ask', 'lowestAsk'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'open'),\n            'close': close,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': this.safeString (ticker, 'change'),\n            'average': undefined,\n            'baseVolume': this.safeStringN (ticker, [ 'base_volume', 'volume', 'baseVolume24h' ]),\n            'quoteVolume': this.safeStringN (ticker, [ 'quote_volume', 'deal', 'quoteVolume24h' ]),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1626,
        "line_end": 1707,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n       \"tradeID\": 158056419,\n       \"price\": \"9186.13\",\n       \"quote_volume\": \"0.0021\",\n       \"base_volume\": \"9186.13\",\n       \"trade_timestamp\": 1594391747,\n       \"type\": \"sell\"\n     }",
          "{\n         \"time\": 1593342324.613711,\n         \"fee\": \"0.00000419198\",\n         \"price\": \"0.00000701\",\n         \"amount\": \"598\",\n         \"id\": 149156519, // trade id\n         \"dealOrderId\": 3134995325, // orderId\n         \"clientOrderId\": \"customId11\",\n         \"role\": 2, // 1 = maker, 2 = taker\n         \"deal\": \"0.00419198\" // amount in money\n         \"feeAsset\": \"USDT\"\n     }",
          "{\n          \"id\": 1343815269,\n          \"clientOrderId\": '',\n          \"time\": 1641051917.532965,\n          \"side\": \"sell\",\n          \"role\": 2,\n          \"amount\": \"9.986\",\n          \"price\": \"0.9995\",\n          \"deal\": \"9.981007\",\n          \"fee\": \"0.009981007\",\n          \"orderId\": 58166729555,\n          \"feeAsset\": \"USDT\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTradesV4\n        //\n        //     {\n        //       \"tradeID\": 158056419,\n        //       \"price\": \"9186.13\",\n        //       \"quote_volume\": \"0.0021\",\n        //       \"base_volume\": \"9186.13\",\n        //       \"trade_timestamp\": 1594391747,\n        //       \"type\": \"sell\"\n        //     }\n        //\n        // orderTrades (v4Private)\n        //\n        //     {\n        //         \"time\": 1593342324.613711,\n        //         \"fee\": \"0.00000419198\",\n        //         \"price\": \"0.00000701\",\n        //         \"amount\": \"598\",\n        //         \"id\": 149156519, // trade id\n        //         \"dealOrderId\": 3134995325, // orderId\n        //         \"clientOrderId\": \"customId11\",\n        //         \"role\": 2, // 1 = maker, 2 = taker\n        //         \"deal\": \"0.00419198\" // amount in money\n        //         \"feeAsset\": \"USDT\"\n        //     }\n        //\n        // fetchMyTrades\n        //\n        //      {\n        //          \"id\": 1343815269,\n        //          \"clientOrderId\": '',\n        //          \"time\": 1641051917.532965,\n        //          \"side\": \"sell\",\n        //          \"role\": 2,\n        //          \"amount\": \"9.986\",\n        //          \"price\": \"0.9995\",\n        //          \"deal\": \"9.981007\",\n        //          \"fee\": \"0.009981007\",\n        //          \"orderId\": 58166729555,\n        //          \"feeAsset\": \"USDT\"\n        //      }\n        //\n        market = this.safeMarket (undefined, market);\n        const timestamp = this.safeTimestamp2 (trade, 'time', 'trade_timestamp');\n        const orderId = this.safeString2 (trade, 'dealOrderId', 'orderId');\n        const cost = this.safeString (trade, 'deal');\n        const price = this.safeString (trade, 'price');\n        const amount = this.safeString2 (trade, 'amount', 'quote_volume');\n        const id = this.safeString2 (trade, 'id', 'tradeID');\n        const side = this.safeString2 (trade, 'type', 'side');\n        const symbol = market['symbol'];\n        const role = this.safeInteger (trade, 'role');\n        let takerOrMaker: Str = undefined;\n        if (role !== undefined) {\n            takerOrMaker = (role === 1) ? 'maker' : 'taker';\n        }\n        let fee = undefined;\n        const feeCost = this.safeString (trade, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': this.safeCurrencyCode (this.safeString (trade, 'feeAsset')),\n            };\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'id': id,\n            'order': orderId,\n            'type': undefined,\n            'takerOrMaker': takerOrMaker,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'fee': fee,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2923,
        "line_end": 2986,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'uniqueId')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transactionId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.safeString (transaction, 'network')",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "(method === '1') ? address : undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "(method === '2') ? address : undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "type",
            "value": "(method === '1') ? 'deposit' : 'withdrawal'",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (status)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'memo')",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "this.safeString (transaction, 'description')",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': this.safeNumber (transaction, 'fee'),\n                'currency': this.safeCurrencyCode (currencyId, currency),\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (transaction, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE\",                                              // deposit address\n         \"uniqueId\": null,                                                                             // unique Id of deposit\n         \"transactionId\": \"a6d71d69-2b17-4ad8-8b15-2d686c54a1a5\",\n         \"createdAt\": 1593437922,                                                                      // timestamp of deposit\n         \"currency\": \"Bitcoin\",                                                                        // deposit currency\n         \"ticker\": \"BTC\",                                                                              // deposit currency ticker\n         \"method\": 1,                                                                                  // called method 1 - deposit, 2 - withdraw\n         \"amount\": \"0.0006\",                                                                           // amount of deposit\n         \"description\": \"\",                                                                            // deposit description\n         \"memo\": \"\",                                                                                   // deposit memo\n         \"fee\": \"0\",                                                                                   // deposit fee\n         \"status\": 15,                                                                                 // transactions status\n         \"network\": null,                                                                              // if currency is multinetwork\n         \"transactionHash\": \"a275a514013e4e0f927fd0d1bed215e7f6f2c4c6ce762836fe135ec22529d886\",        // deposit transaction hash\n         \"details\": {\n             \"partial\": {                                                                              // details about partially successful withdrawals\n                 \"requestAmount\": \"50000\",                                                             // requested withdrawal amount\n                 \"processedAmount\": \"39000\",                                                           // processed withdrawal amount\n                 \"processedFee\": \"273\",                                                                // fee for processed withdrawal amount\n                 \"normalizeTransaction\": \"\"                                                            // deposit id\n             }\n         },\n         \"confirmations\": {                                                                            // if transaction status == 15 you can see this object\n             \"actual\": 1,                                                                              // current block confirmations\n             \"required\": 2                                                                             // required block confirmation for successful deposit\n         }\n         \"centralized\": false,\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"address\": \"3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE\",                                              // deposit address\n        //         \"uniqueId\": null,                                                                             // unique Id of deposit\n        //         \"transactionId\": \"a6d71d69-2b17-4ad8-8b15-2d686c54a1a5\",\n        //         \"createdAt\": 1593437922,                                                                      // timestamp of deposit\n        //         \"currency\": \"Bitcoin\",                                                                        // deposit currency\n        //         \"ticker\": \"BTC\",                                                                              // deposit currency ticker\n        //         \"method\": 1,                                                                                  // called method 1 - deposit, 2 - withdraw\n        //         \"amount\": \"0.0006\",                                                                           // amount of deposit\n        //         \"description\": \"\",                                                                            // deposit description\n        //         \"memo\": \"\",                                                                                   // deposit memo\n        //         \"fee\": \"0\",                                                                                   // deposit fee\n        //         \"status\": 15,                                                                                 // transactions status\n        //         \"network\": null,                                                                              // if currency is multinetwork\n        //         \"transactionHash\": \"a275a514013e4e0f927fd0d1bed215e7f6f2c4c6ce762836fe135ec22529d886\",        // deposit transaction hash\n        //         \"details\": {\n        //             \"partial\": {                                                                              // details about partially successful withdrawals\n        //                 \"requestAmount\": \"50000\",                                                             // requested withdrawal amount\n        //                 \"processedAmount\": \"39000\",                                                           // processed withdrawal amount\n        //                 \"processedFee\": \"273\",                                                                // fee for processed withdrawal amount\n        //                 \"normalizeTransaction\": \"\"                                                            // deposit id\n        //             }\n        //         },\n        //         \"confirmations\": {                                                                            // if transaction status == 15 you can see this object\n        //             \"actual\": 1,                                                                              // current block confirmations\n        //             \"required\": 2                                                                             // required block confirmation for successful deposit\n        //         }\n        //         \"centralized\": false,\n        //     }\n        //\n        currency = this.safeCurrency (undefined, currency);\n        const address = this.safeString (transaction, 'address');\n        const timestamp = this.safeTimestamp (transaction, 'createdAt');\n        const currencyId = this.safeString (transaction, 'ticker');\n        const status = this.safeString (transaction, 'status');\n        const method = this.safeString (transaction, 'method');\n        return {\n            'id': this.safeString (transaction, 'uniqueId'),\n            'txid': this.safeString (transaction, 'transactionId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'network': this.safeString (transaction, 'network'),\n            'addressFrom': (method === '1') ? address : undefined,\n            'address': address,\n            'addressTo': (method === '2') ? address : undefined,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'type': (method === '1') ? 'deposit' : 'withdrawal',\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'status': this.parseTransactionStatus (status),\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': this.safeString (transaction, 'memo'),\n            'tagTo': undefined,\n            'comment': this.safeString (transaction, 'description'),\n            'internal': undefined,\n            'fee': {\n                'cost': this.safeNumber (transaction, 'fee'),\n                'currency': this.safeCurrencyCode (currencyId, currency),\n            },\n            'info': transaction,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2988,
        "line_end": 3008,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            '1': 'pending',\n            '2': 'pending',\n            '3': 'ok',\n            '4': 'canceled',\n            '5': 'pending',\n            '6': 'pending',\n            '7': 'ok',\n            '9': 'canceled',\n            '10': 'pending',\n            '11': 'pending',\n            '12': 'pending',\n            '13': 'pending',\n            '14': 'pending',\n            '15': 'pending',\n            '16': 'pending',\n            '17': 'pending',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2861,
        "line_end": 2876,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    []\n        //\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "woo": [
      {
        "name": "parseAccount",
        "signature": "parseAccount (account)",
        "line_start": 2383,
        "line_end": 2422,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "account",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (account, 'applicationId')",
            "comment": null
          },
          {
            "key": "name",
            "value": "this.safeStringN (account, [ 'name', 'account', 'alias' ])",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (account, 'accountType', 'subaccount')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n         \"account\": \"carlos_jose_lima@yahoo.com\",\n         \"alias\": \"carlos_jose_lima@yahoo.com\",\n         \"otpauth\": true,\n         \"accountMode\": \"FUTURES\",\n         \"positionMode\": \"ONE_WAY\",\n         \"leverage\": 0,\n         \"marginRatio\": \"10\",\n         \"openMarginRatio\": \"10\",\n         \"initialMarginRatio\": \"10\",\n         \"maintenanceMarginRatio\": \"0.03\",\n         \"totalCollateral\": \"165.55629469\",\n         \"freeCollateral\": \"165.55629469\",\n         \"totalAccountValue\": \"167.32418611\",\n         \"totalTradingValue\": \"167.32418611\",\n         \"totalVaultValue\": \"0\",\n         \"totalStakingValue\": \"0\",\n         \"totalLaunchpadValue\": \"0\",\n         \"totalEarnValue\": \"0\",\n         \"referrerID\": null,\n         \"accountType\": \"Main\"\n     }",
          "{\n         \"applicationId\": \"6b43de5c-0955-4887-9862-d84e4689f9fe\",\n         \"name\": \"sub_account_2\",\n         \"createdTime\": \"1606897264.994\"\n     }"
        ],
        "source": "parseAccount (account) {\n        //\n        //     {\n        //         \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n        //         \"account\": \"carlos_jose_lima@yahoo.com\",\n        //         \"alias\": \"carlos_jose_lima@yahoo.com\",\n        //         \"otpauth\": true,\n        //         \"accountMode\": \"FUTURES\",\n        //         \"positionMode\": \"ONE_WAY\",\n        //         \"leverage\": 0,\n        //         \"marginRatio\": \"10\",\n        //         \"openMarginRatio\": \"10\",\n        //         \"initialMarginRatio\": \"10\",\n        //         \"maintenanceMarginRatio\": \"0.03\",\n        //         \"totalCollateral\": \"165.55629469\",\n        //         \"freeCollateral\": \"165.55629469\",\n        //         \"totalAccountValue\": \"167.32418611\",\n        //         \"totalTradingValue\": \"167.32418611\",\n        //         \"totalVaultValue\": \"0\",\n        //         \"totalStakingValue\": \"0\",\n        //         \"totalLaunchpadValue\": \"0\",\n        //         \"totalEarnValue\": \"0\",\n        //         \"referrerID\": null,\n        //         \"accountType\": \"Main\"\n        //     }\n        //\n        //     {\n        //         \"applicationId\": \"6b43de5c-0955-4887-9862-d84e4689f9fe\",\n        //         \"name\": \"sub_account_2\",\n        //         \"createdTime\": \"1606897264.994\"\n        //     }\n        //\n        return {\n            'info': account,\n            'id': this.safeString (account, 'applicationId'),\n            'name': this.safeStringN (account, [ 'name', 'account', 'alias' ]),\n            'code': undefined,\n            'type': this.safeStringLower (account, 'accountType', 'subaccount'),\n        };\n    }"
      },
      {
        "name": "parseADLRank",
        "signature": "parseADLRank (info: Dict, market: Market = undefined): ADL",
        "line_start": 4309,
        "line_end": 4346,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, undefined, 'contract')",
            "comment": null
          },
          {
            "key": "rank",
            "value": "this.safeNumber (info, 'adlQuantile')",
            "comment": null
          },
          {
            "key": "rating",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PERP_BTC_USDT\",\n         \"holding\": \"0.001\",\n         \"pendingLongQty\": \"0\",\n         \"pendingShortQty\": \"0\",\n         \"settlePrice\": \"90732\",\n         \"averageOpenPrice\": \"90732\",\n         \"pnl24H\": \"-0.001\",\n         \"fee24H\": \"0.1360115\",\n         \"markPrice\": \"90736\",\n         \"estLiqPrice\": \"0\",\n         \"timestamp\": 1768049379264,\n         \"adlQuantile\": 3,\n         \"positionSide\": \"BOTH\",\n         \"marginMode\": \"CROSS\",\n         \"isolatedMarginToken\": \"\",\n         \"isolatedMarginAmount\": \"0\",\n         \"isolatedFrozenLong\": \"0\",\n         \"isolatedFrozenShort\": \"0\",\n         \"leverage\": 10\n     }"
        ],
        "source": "parseADLRank (info: Dict, market: Market = undefined): ADL {\n        //\n        // fetchPositionsADLRank\n        //\n        //     {\n        //         \"symbol\": \"PERP_BTC_USDT\",\n        //         \"holding\": \"0.001\",\n        //         \"pendingLongQty\": \"0\",\n        //         \"pendingShortQty\": \"0\",\n        //         \"settlePrice\": \"90732\",\n        //         \"averageOpenPrice\": \"90732\",\n        //         \"pnl24H\": \"-0.001\",\n        //         \"fee24H\": \"0.1360115\",\n        //         \"markPrice\": \"90736\",\n        //         \"estLiqPrice\": \"0\",\n        //         \"timestamp\": 1768049379264,\n        //         \"adlQuantile\": 3,\n        //         \"positionSide\": \"BOTH\",\n        //         \"marginMode\": \"CROSS\",\n        //         \"isolatedMarginToken\": \"\",\n        //         \"isolatedMarginAmount\": \"0\",\n        //         \"isolatedFrozenLong\": \"0\",\n        //         \"isolatedFrozenShort\": \"0\",\n        //         \"leverage\": 10\n        //     }\n        //\n        const marketId = this.safeString (info, 'symbol');\n        const timestamp = this.safeInteger (info, 'timestamp');\n        return {\n            'info': info,\n            'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n            'rank': this.safeNumber (info, 'adlQuantile'),\n            'rating': undefined,\n            'percentage': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        } as ADL;\n    }"
      },
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2462,
        "line_end": 2476,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        const balances = this.safeList (response, 'holding', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'token'));\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'holding');\n            account['free'] = this.safeString (balance, 'availableBalance');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseConversion",
        "signature": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion",
        "line_start": 4143,
        "line_end": 4196,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "conversion",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (conversion, 'quoteId')",
            "comment": null
          },
          {
            "key": "fromCurrency",
            "value": "fromCode",
            "comment": null
          },
          {
            "key": "fromAmount",
            "value": "this.safeNumber2 (conversion, 'sellQuantity', 'sellAmount')",
            "comment": null
          },
          {
            "key": "toCurrency",
            "value": "toCode",
            "comment": null
          },
          {
            "key": "toAmount",
            "value": "this.safeNumber2 (conversion, 'buyQuantity', 'buyAmount')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (conversion, 'buyPrice')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"quoteId\": 123123123,\n         \"counterPartyId\": \"\",\n         \"sellToken\": \"ETH\",\n         \"sellQuantity\": \"0.0445\",\n         \"buyToken\": \"USDT\",\n         \"buyQuantity\": \"33.45\",\n         \"buyPrice\": \"6.77\",\n         \"expireTimestamp\": 1659084466000,\n         \"message\": 1659084466000\n     }",
          "{\n         \"quoteId\": 123123123,\n         \"counterPartyId\": \"\",\n         \"rftAccepted\": 1 // 1 -> success; 2 -> processing; 3 -> fail\n     }",
          "{\n         \"quoteId\": 12,\n         \"buyAsset\": \"\",\n         \"sellAsset\": \"\",\n         \"buyAmount\": 12.11,\n         \"sellAmount\": 12.11,\n         \"tradeStatus\": 12,\n         \"createdTime\": \"\"\n     }"
        ],
        "source": "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion {\n        //\n        // fetchConvertQuote\n        //\n        //     {\n        //         \"quoteId\": 123123123,\n        //         \"counterPartyId\": \"\",\n        //         \"sellToken\": \"ETH\",\n        //         \"sellQuantity\": \"0.0445\",\n        //         \"buyToken\": \"USDT\",\n        //         \"buyQuantity\": \"33.45\",\n        //         \"buyPrice\": \"6.77\",\n        //         \"expireTimestamp\": 1659084466000,\n        //         \"message\": 1659084466000\n        //     }\n        //\n        // createConvertTrade\n        //\n        //     {\n        //         \"quoteId\": 123123123,\n        //         \"counterPartyId\": \"\",\n        //         \"rftAccepted\": 1 // 1 -> success; 2 -> processing; 3 -> fail\n        //     }\n        //\n        // fetchConvertTrade, fetchConvertTradeHistory\n        //\n        //     {\n        //         \"quoteId\": 12,\n        //         \"buyAsset\": \"\",\n        //         \"sellAsset\": \"\",\n        //         \"buyAmount\": 12.11,\n        //         \"sellAmount\": 12.11,\n        //         \"tradeStatus\": 12,\n        //         \"createdTime\": \"\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (conversion, 'expireTimestamp', 'createdTime');\n        const fromCurr = this.safeString2 (conversion, 'sellToken', 'buyAsset');\n        const fromCode = this.safeCurrencyCode (fromCurr, fromCurrency);\n        const to = this.safeString2 (conversion, 'buyToken', 'sellAsset');\n        const toCode = this.safeCurrencyCode (to, toCurrency);\n        return {\n            'info': conversion,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (conversion, 'quoteId'),\n            'fromCurrency': fromCode,\n            'fromAmount': this.safeNumber2 (conversion, 'sellQuantity', 'sellAmount'),\n            'toCurrency': toCode,\n            'toAmount': this.safeNumber2 (conversion, 'buyQuantity', 'buyAmount'),\n            'price': this.safeNumber (conversion, 'buyPrice'),\n            'fee': undefined,\n        } as Conversion;\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositEntry, currency: Currency = undefined): DepositAddress",
        "line_start": 2525,
        "line_end": 2535,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositEntry",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeString (currency, 'code')",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositEntry, 'extra')",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseDepositAddress (depositEntry, currency: Currency = undefined): DepositAddress {\n        const address = this.safeString (depositEntry, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositEntry,\n            'currency': this.safeString (currency, 'code'),\n            'network': undefined,\n            'address': address,\n            'tag': this.safeString (depositEntry, 'extra'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate",
        "line_start": 3307,
        "line_end": 3358,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "estFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (estFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber2 (fundingRate, 'estFundingRate', 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "this.safeNumber (fundingRate, 'lastFundingRate')",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "lastFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "this.iso8601 (lastFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "interval",
            "value": "interval",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PERP_BTC_USDT\",\n         \"estFundingRate\": \"-0.00000441\",\n         \"estFundingRateTimestamp\": 1751623979022,\n         \"lastFundingRate\": \"-0.00004953\",\n         \"lastFundingRateTimestamp\": 1751616000000,\n         \"nextFundingTime\": 1751644800000,\n         \"lastFundingIntervalHours\": 8,\n         \"estFundingIntervalHours\": 8\n     }",
          "{\n         \"symbol\": \"PERP_BTC_USDT\",\n         \"fundingRate\": 0.0001,\n         \"fundingTs\": 1771488000000\n     }"
        ],
        "source": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"PERP_BTC_USDT\",\n        //         \"estFundingRate\": \"-0.00000441\",\n        //         \"estFundingRateTimestamp\": 1751623979022,\n        //         \"lastFundingRate\": \"-0.00004953\",\n        //         \"lastFundingRateTimestamp\": 1751616000000,\n        //         \"nextFundingTime\": 1751644800000,\n        //         \"lastFundingIntervalHours\": 8,\n        //         \"estFundingIntervalHours\": 8\n        //     }\n        //\n        // watchFundingRate\n        //\n        //     {\n        //         \"symbol\": \"PERP_BTC_USDT\",\n        //         \"fundingRate\": 0.0001,\n        //         \"fundingTs\": 1771488000000\n        //     }\n        //\n        const symbol = this.safeString (fundingRate, 'symbol');\n        market = this.market (symbol);\n        const nextFundingTimestamp = this.safeInteger2 (fundingRate, 'nextFundingTime', 'fundingTs');\n        const estFundingRateTimestamp = this.safeInteger (fundingRate, 'estFundingRateTimestamp');\n        const lastFundingRateTimestamp = this.safeInteger (fundingRate, 'lastFundingRateTimestamp');\n        const intervalString = this.safeString (fundingRate, 'estFundingIntervalHours');\n        let interval = undefined;\n        if (intervalString !== undefined) {\n            interval = intervalString + 'h';\n        }\n        return {\n            'info': fundingRate,\n            'symbol': market['symbol'],\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': estFundingRateTimestamp,\n            'datetime': this.iso8601 (estFundingRateTimestamp),\n            'fundingRate': this.safeNumber2 (fundingRate, 'estFundingRate', 'fundingRate'),\n            'fundingTimestamp': nextFundingTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': this.safeNumber (fundingRate, 'lastFundingRate'),\n            'previousFundingTimestamp': lastFundingRateTimestamp,\n            'previousFundingDatetime': this.iso8601 (lastFundingRateTimestamp),\n            'interval': interval,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 3202,
        "line_end": 3236,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 1286360,\n         \"symbol\": \"PERP_BTC_USDT\",\n         \"fundingRate\": -0.00001445,\n         \"markPrice\": \"26930.60000000\",\n         \"fundingFee\": \"9.56021744\",\n         \"fundingIntervalHours\": 8,\n         \"paymentType\": \"Pay\",\n         \"status\": \"COMPLETED\",\n         \"createdTime\": 1696060873259,\n         \"updatedTime\": 1696060873286\n     }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        //     {\n        //         \"id\": 1286360,\n        //         \"symbol\": \"PERP_BTC_USDT\",\n        //         \"fundingRate\": -0.00001445,\n        //         \"markPrice\": \"26930.60000000\",\n        //         \"fundingFee\": \"9.56021744\",\n        //         \"fundingIntervalHours\": 8,\n        //         \"paymentType\": \"Pay\",\n        //         \"status\": \"COMPLETED\",\n        //         \"createdTime\": 1696060873259,\n        //         \"updatedTime\": 1696060873286\n        //     }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        let amount = this.safeString (income, 'fundingFee');\n        const code = this.safeCurrencyCode ('USD');\n        const id = this.safeString (income, 'id');\n        const timestamp = this.safeInteger (income, 'updatedTime');\n        const rate = this.safeNumber (income, 'fundingRate');\n        const paymentType = this.safeString (income, 'paymentType');\n        amount = (paymentType === 'Pay') ? Precise.stringNeg (amount) : amount;\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': id,\n            'amount': this.parseNumber (amount),\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2619,
        "line_end": 2667,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'account')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'txId')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (item, 'status'))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"createdTime\": \"1734964440.523\",\n         \"updatedTime\": \"1734964614.081\",\n         \"id\": \"24122314340000585\",\n         \"externalId\": \"241223143600621\",\n         \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n         \"token\": \"ARB_USDCNATIVE\",\n         \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n         \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n         \"extra\": \"\",\n         \"type\": \"BALANCE\",\n         \"tokenSide\": \"WITHDRAW\",\n         \"amount\": \"10.00000000\",\n         \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n         \"feeToken\": \"USDC\",\n         \"feeAmount\": \"2\",\n         \"status\": \"COMPLETED\",\n         \"confirmingThreshold\": null,\n         \"confirmedNumber\": null\n     }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"createdTime\": \"1734964440.523\",\n        //         \"updatedTime\": \"1734964614.081\",\n        //         \"id\": \"24122314340000585\",\n        //         \"externalId\": \"241223143600621\",\n        //         \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n        //         \"token\": \"ARB_USDCNATIVE\",\n        //         \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n        //         \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n        //         \"extra\": \"\",\n        //         \"type\": \"BALANCE\",\n        //         \"tokenSide\": \"WITHDRAW\",\n        //         \"amount\": \"10.00000000\",\n        //         \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n        //         \"feeToken\": \"USDC\",\n        //         \"feeAmount\": \"2\",\n        //         \"status\": \"COMPLETED\",\n        //         \"confirmingThreshold\": null,\n        //         \"confirmedNumber\": null\n        //     }\n        //\n        const networkizedCode = this.safeString (item, 'token');\n        const code = this.safeCurrencyCode (networkizedCode, currency);\n        currency = this.safeCurrency (code, currency);\n        const amount = this.safeNumber (item, 'amount');\n        const side = this.safeString (item, 'tokenSide');\n        const direction = (side === 'DEPOSIT') ? 'in' : 'out';\n        const timestamp = this.safeTimestamp (item, 'createdTime');\n        const fee = this.parseTokenAndFeeTemp (item, [ 'feeToken' ], [ 'feeAmount' ]);\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'currency': code,\n            'account': this.safeString (item, 'account'),\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'txId'),\n            'status': this.parseTransactionStatus (this.safeString (item, 'status')),\n            'amount': amount,\n            'before': undefined,\n            'after': undefined,\n            'direction': direction,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'fee': fee,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2669,
        "line_end": 2675,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'BALANCE': 'transaction', // Funds moved in/out wallet\n            'COLLATERAL': 'transfer', // Funds moved between portfolios\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 3659,
        "line_end": 3690,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "longLeverage",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "shortLeverage",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const marginMode = this.safeStringLower (leverage, 'marginMode');\n        let spotLeverage = this.safeInteger (leverage, 'leverage');\n        if (spotLeverage === 0) {\n            spotLeverage = null;\n        }\n        let longLeverage = spotLeverage;\n        let shortLeverage = spotLeverage;\n        const details = this.safeList (leverage, 'details', []);\n        for (let i = 0; i < details.length; i++) {\n            const position = this.safeDict (details, i, {});\n            const positionLeverage = this.safeInteger (position, 'leverage');\n            const side = this.safeString (position, 'positionSide');\n            if (side === 'BOTH') {\n                longLeverage = positionLeverage;\n                shortLeverage = positionLeverage;\n            } else if (side === 'LONG') {\n                longLeverage = positionLeverage;\n            } else if (side === 'SHORT') {\n                shortLeverage = positionLeverage;\n            }\n        }\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': marginMode,\n            'longLeverage': longLeverage,\n            'shortLeverage': shortLeverage,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginLoan",
        "signature": "parseMarginLoan (info, currency: Currency = undefined)",
        "line_start": 3092,
        "line_end": 3107,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "info",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"success\": true,\n     }"
        ],
        "source": "parseMarginLoan (info, currency: Currency = undefined) {\n        //\n        //     {\n        //         \"success\": true,\n        //     }\n        //\n        return {\n            'id': undefined,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'amount': undefined,\n            'symbol': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'info': info,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 615,
        "line_end": 700,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "margin",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "active",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "contractSize",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'baseTick'),\n                'price': this.safeNumber (market, 'quoteTick'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'baseMin'),\n                    'max': this.safeNumber (market, 'baseMax'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'quoteMin'),\n                    'max': this.safeNumber (market, 'quoteMax'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minNotional'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'baseMin'),\n                    'max': this.safeNumber (market, 'baseMax'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'quoteMin'),\n                    'max': this.safeNumber (market, 'quoteMax'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'minNotional'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'quoteMin')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'quoteMax')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'minNotional')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const marketId = this.safeString (market, 'symbol');\n        const parts = marketId.split ('_');\n        const first = this.safeString (parts, 0);\n        let marketType: MarketType;\n        let spot = false;\n        let swap = false;\n        if (first === 'SPOT') {\n            spot = true;\n            marketType = 'spot';\n        } else if (first === 'PERP') {\n            swap = true;\n            marketType = 'swap';\n        }\n        const baseId = this.safeString (parts, 1);\n        const quoteId = this.safeString (parts, 2);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let settleId: Str = undefined;\n        let settle: Str = undefined;\n        let symbol = base + '/' + quote;\n        let contractSize: Num = undefined;\n        let linear: Bool = undefined;\n        let inverse: Bool = undefined;\n        let margin = true;\n        const contract = swap;\n        if (contract) {\n            margin = false;\n            settleId = this.safeString (parts, 2);\n            settle = this.safeCurrencyCode (settleId);\n            symbol = base + '/' + quote + ':' + settle;\n            contractSize = this.parseNumber ('1');\n            linear = true;\n            inverse = false;\n        }\n        const active = this.safeString (market, 'status') === 'TRADING';\n        return {\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': spot,\n            'margin': margin,\n            'swap': swap,\n            'future': false,\n            'option': false,\n            'active': active,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'contractSize': contractSize,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'baseTick'),\n                'price': this.safeNumber (market, 'quoteTick'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'baseMin'),\n                    'max': this.safeNumber (market, 'baseMax'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'quoteMin'),\n                    'max': this.safeNumber (market, 'quoteMax'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'minNotional'),\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 2192,
        "line_end": 2201,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'startTimestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1917,
        "line_end": 2067,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "orderType",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (orderType)",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': fee,\n                'currency': feeCurrency,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": 60667653330,\n         \"clientOrderId\": 0,\n         \"type\": \"LIMIT\",\n         \"price\": 60,\n         \"quantity\": 0.1,\n         \"amount\": null,\n         \"bidAskLevel\": null,\n         \"timestamp\": 1751871779855\n     }",
          "{\n         \"orderId\": \"1578938\",\n         \"clientOrderId\": \"0\",\n         \"algoType\": \"STOP_LOSS\",\n         \"quantity\": \"0.1\",\n         \"timestamp\": \"1686149372216\"\n     }",
          "{\n         \"orderId\": 60780315704,\n         \"clientOrderId\": 0,\n         \"symbol\": \"SPOT_LTC_USDT\",\n         \"orderTag\": \"default\",\n         \"side\": \"BUY\",\n         \"quantity\": 0.1,\n         \"amount\": null,\n         \"type\": \"LIMIT\",\n         \"status\": \"NEW\",\n         \"price\": 60,\n         \"executed\": 0,\n         \"visible\": 0.1,\n         \"averageExecutedPrice\": 0,\n         \"totalFee\": 0,\n         \"feeAsset\": \"LTC\",\n         \"totalRebate\": 0,\n         \"rebateAsset\": \"USDT\",\n         \"reduceOnly\": false,\n         \"createdTime\": \"1752049062.496\",\n         \"realizedPnl\": null,\n         \"positionSide\": \"BOTH\",\n         \"bidAskLevel\": null\n     }",
          "{\n         \"algoOrderId\": 10399260,\n         \"clientAlgoOrderId\": 0,\n         \"rootAlgoOrderId\": 10399260,\n         \"parentAlgoOrderId\": 0,\n         \"symbol\": \"SPOT_LTC_USDT\",\n         \"algoOrderTag\": \"default\",\n         \"algoType\": \"TAKE_PROFIT\",\n         \"side\": \"BUY\",\n         \"quantity\": 0.1,\n         \"isTriggered\": false,\n         \"triggerPrice\": 65,\n         \"triggerStatus\": \"USELESS\",\n         \"type\": \"LIMIT\",\n         \"rootAlgoStatus\": \"NEW\",\n         \"algoStatus\": \"NEW\",\n         \"triggerPriceType\": \"MARKET_PRICE\",\n         \"price\": 60,\n         \"triggerTime\": \"0\",\n         \"totalExecutedQuantity\": 0,\n         \"visibleQuantity\": 0.1,\n         \"averageExecutedPrice\": 0,\n         \"totalFee\": 0,\n         \"feeAsset\": \"\",\n         \"totalRebate\": 0,\n         \"rebateAsset\": \"\",\n         \"reduceOnly\": false,\n         \"createdTime\": \"1752049747.732\",\n         \"updatedTime\": \"1752049747.732\",\n         \"positionSide\": \"BOTH\"\n     }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder\n        //     {\n        //         \"orderId\": 60667653330,\n        //         \"clientOrderId\": 0,\n        //         \"type\": \"LIMIT\",\n        //         \"price\": 60,\n        //         \"quantity\": 0.1,\n        //         \"amount\": null,\n        //         \"bidAskLevel\": null,\n        //         \"timestamp\": 1751871779855\n        //     }\n        //\n        // createOrder - algo\n        //     {\n        //         \"orderId\": \"1578938\",\n        //         \"clientOrderId\": \"0\",\n        //         \"algoType\": \"STOP_LOSS\",\n        //         \"quantity\": \"0.1\",\n        //         \"timestamp\": \"1686149372216\"\n        //     }\n        //\n        // fetchOrder\n        //     {\n        //         \"orderId\": 60780315704,\n        //         \"clientOrderId\": 0,\n        //         \"symbol\": \"SPOT_LTC_USDT\",\n        //         \"orderTag\": \"default\",\n        //         \"side\": \"BUY\",\n        //         \"quantity\": 0.1,\n        //         \"amount\": null,\n        //         \"type\": \"LIMIT\",\n        //         \"status\": \"NEW\",\n        //         \"price\": 60,\n        //         \"executed\": 0,\n        //         \"visible\": 0.1,\n        //         \"averageExecutedPrice\": 0,\n        //         \"totalFee\": 0,\n        //         \"feeAsset\": \"LTC\",\n        //         \"totalRebate\": 0,\n        //         \"rebateAsset\": \"USDT\",\n        //         \"reduceOnly\": false,\n        //         \"createdTime\": \"1752049062.496\",\n        //         \"realizedPnl\": null,\n        //         \"positionSide\": \"BOTH\",\n        //         \"bidAskLevel\": null\n        //     }\n        //\n        // fetchOrder - algo\n        //     {\n        //         \"algoOrderId\": 10399260,\n        //         \"clientAlgoOrderId\": 0,\n        //         \"rootAlgoOrderId\": 10399260,\n        //         \"parentAlgoOrderId\": 0,\n        //         \"symbol\": \"SPOT_LTC_USDT\",\n        //         \"algoOrderTag\": \"default\",\n        //         \"algoType\": \"TAKE_PROFIT\",\n        //         \"side\": \"BUY\",\n        //         \"quantity\": 0.1,\n        //         \"isTriggered\": false,\n        //         \"triggerPrice\": 65,\n        //         \"triggerStatus\": \"USELESS\",\n        //         \"type\": \"LIMIT\",\n        //         \"rootAlgoStatus\": \"NEW\",\n        //         \"algoStatus\": \"NEW\",\n        //         \"triggerPriceType\": \"MARKET_PRICE\",\n        //         \"price\": 60,\n        //         \"triggerTime\": \"0\",\n        //         \"totalExecutedQuantity\": 0,\n        //         \"visibleQuantity\": 0.1,\n        //         \"averageExecutedPrice\": 0,\n        //         \"totalFee\": 0,\n        //         \"feeAsset\": \"\",\n        //         \"totalRebate\": 0,\n        //         \"rebateAsset\": \"\",\n        //         \"reduceOnly\": false,\n        //         \"createdTime\": \"1752049747.732\",\n        //         \"updatedTime\": \"1752049747.732\",\n        //         \"positionSide\": \"BOTH\"\n        //     }\n        //\n        let timestamp = undefined;\n        const timestrampString = this.safeString (order, 'createdTime');\n        if (timestrampString !== undefined) {\n            if (timestrampString.indexOf ('.') >= 0) {\n                timestamp = this.safeTimestamp (order, 'createdTime'); // algo orders\n            } else {\n                timestamp = this.safeInteger (order, 'createdTime'); // regular orders\n            }\n        }\n        if (timestamp === undefined) {\n            timestamp = this.safeInteger (order, 'timestamp');\n        }\n        const orderId = this.safeString2 (order, 'orderId', 'algoOrderId');\n        const clientOrderId = this.omitZero (this.safeString2 (order, 'clientOrderId', 'clientAlgoOrderId')); // Somehow, this always returns 0 for limit order\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'quantity'); // This is base amount\n        const cost = this.safeString (order, 'amount'); // This is quote amount\n        const orderType = this.safeStringLower (order, 'type');\n        const status = this.safeValue2 (order, 'status', 'algoStatus');\n        const side = this.safeStringLower (order, 'side');\n        const filled = this.omitZero (this.safeValue2 (order, 'executed', 'totalExecutedQuantity'));\n        const average = this.omitZero (this.safeString (order, 'averageExecutedPrice'));\n        // const remaining = Precise.stringSub (cost, filled);\n        const fee = this.safeNumber (order, 'totalFee');\n        const feeCurrency = this.safeString (order, 'feeAsset');\n        const triggerPrice = this.safeNumber (order, 'triggerPrice');\n        const lastUpdateTimestampString = this.safeString (order, 'updatedTime');\n        let lastUpdateTimestamp = undefined;\n        if (lastUpdateTimestampString !== undefined) {\n            if (lastUpdateTimestampString.indexOf ('.') >= 0) {\n                lastUpdateTimestamp = this.safeTimestamp (order, 'updatedTime'); // algo orders\n            } else {\n                lastUpdateTimestamp = this.safeInteger (order, 'updatedTime'); // regular orders\n            }\n        }\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': orderType,\n            'timeInForce': this.parseTimeInForce (orderType),\n            'postOnly': undefined, // TO_DO\n            'reduceOnly': this.safeBool (order, 'reduceOnly'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': undefined,\n            'stopLossPrice': undefined,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': undefined, // TO_DO\n            'cost': cost,\n            'trades': undefined,\n            'fee': {\n                'cost': fee,\n                'currency': feeCurrency,\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 2069,
        "line_end": 2085,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'NEW': 'open',\n                'FILLED': 'closed',\n                'CANCEL_SENT': 'canceled',\n                'CANCEL_ALL_SENT': 'canceled',\n                'CANCELLED': 'canceled',\n                'PARTIAL_FILLED': 'open',\n                'REJECTED': 'rejected',\n                'INCOMPLETE': 'open',\n                'COMPLETED': 'closed',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 3870,
        "line_end": 3974,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPrice)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeNumber (position, 'leverage')",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber2 (position, 'estLiqPrice', 'est_liq_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPrice)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "this.safeStringLower2 (position, 'marginMode', 'margin_mode')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "positionSide !== 'BOTH'",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PERP_ETH_USDT\",\n         \"position_side\": \"BOTH\",\n         \"leverage\": 10,\n         \"margin_mode\": \"CROSS\",\n         \"average_open_price\": 3139.9,\n         \"isolated_margin_amount\": 0.0,\n         \"isolated_margin_token\": \"\",\n         \"opening_time\": \"1720627963.094\",\n         \"mark_price\": 3155.19169891,\n         \"pending_short_qty\": 0.0,\n         \"pending_long_qty\": 0.0,\n         \"holding\": -0.7,\n         \"pnl_24_h\": 0.0,\n         \"est_liq_price\": 9107.40055552,\n         \"settle_price\": 3151.0319904,\n         \"success\": true,\n         \"fee_24_h\": 0.0,\n         \"isolated_frozen_long\": 0.0,\n         \"isolated_frozen_short\": 0.0,\n         \"timestamp\": \"1720867502.544\"\n     }",
          "{\n         \"symbol\": \"PERP_LTC_USDT\",\n         \"holding\": \"0.1\",\n         \"pendingLongQty\": \"0\",\n         \"pendingShortQty\": \"0\",\n         \"settlePrice\": \"96.87\",\n         \"averageOpenPrice\": \"96.87\",\n         \"pnl24H\": \"0\",\n         \"fee24H\": \"0.0048435\",\n         \"markPrice\": \"96.83793449\",\n         \"estLiqPrice\": \"0\",\n         \"timestamp\": 1752500555823,\n         \"adlQuantile\": 2,\n         \"positionSide\": \"BOTH\",\n         \"marginMode\": \"CROSS\",\n         \"isolatedMarginToken\": \"\",\n         \"isolatedMarginAmount\": \"0\",\n         \"isolatedFrozenLong\": \"0\",\n         \"isolatedFrozenShort\": \"0\",\n         \"leverage\": 10\n     }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // v1PrivateGetPositionSymbol\n        //     {\n        //         \"symbol\": \"PERP_ETH_USDT\",\n        //         \"position_side\": \"BOTH\",\n        //         \"leverage\": 10,\n        //         \"margin_mode\": \"CROSS\",\n        //         \"average_open_price\": 3139.9,\n        //         \"isolated_margin_amount\": 0.0,\n        //         \"isolated_margin_token\": \"\",\n        //         \"opening_time\": \"1720627963.094\",\n        //         \"mark_price\": 3155.19169891,\n        //         \"pending_short_qty\": 0.0,\n        //         \"pending_long_qty\": 0.0,\n        //         \"holding\": -0.7,\n        //         \"pnl_24_h\": 0.0,\n        //         \"est_liq_price\": 9107.40055552,\n        //         \"settle_price\": 3151.0319904,\n        //         \"success\": true,\n        //         \"fee_24_h\": 0.0,\n        //         \"isolated_frozen_long\": 0.0,\n        //         \"isolated_frozen_short\": 0.0,\n        //         \"timestamp\": \"1720867502.544\"\n        //     }\n        //\n        // v3PrivateGetPositions\n        //     {\n        //         \"symbol\": \"PERP_LTC_USDT\",\n        //         \"holding\": \"0.1\",\n        //         \"pendingLongQty\": \"0\",\n        //         \"pendingShortQty\": \"0\",\n        //         \"settlePrice\": \"96.87\",\n        //         \"averageOpenPrice\": \"96.87\",\n        //         \"pnl24H\": \"0\",\n        //         \"fee24H\": \"0.0048435\",\n        //         \"markPrice\": \"96.83793449\",\n        //         \"estLiqPrice\": \"0\",\n        //         \"timestamp\": 1752500555823,\n        //         \"adlQuantile\": 2,\n        //         \"positionSide\": \"BOTH\",\n        //         \"marginMode\": \"CROSS\",\n        //         \"isolatedMarginToken\": \"\",\n        //         \"isolatedMarginAmount\": \"0\",\n        //         \"isolatedFrozenLong\": \"0\",\n        //         \"isolatedFrozenShort\": \"0\",\n        //         \"leverage\": 10\n        //     }\n        //\n        const contract = this.safeString (position, 'symbol');\n        market = this.safeMarket (contract, market);\n        let size = this.safeString (position, 'holding');\n        let side: Str = undefined;\n        if (Precise.stringGt (size, '0')) {\n            side = 'long';\n        } else {\n            side = 'short';\n        }\n        const contractSize = this.safeString (market, 'contractSize');\n        const markPrice = this.safeString2 (position, 'markPrice', 'mark_price');\n        const timestampString = this.safeString (position, 'timestamp');\n        let timestamp = undefined;\n        if (timestampString !== undefined) {\n            if (timestampString.indexOf ('.') > -1) {\n                timestamp = this.safeTimestamp (position, 'timestamp');\n            } else {\n                timestamp = this.safeInteger (position, 'timestamp');\n            }\n        }\n        const entryPrice = this.safeString2 (position, 'averageOpenPrice', 'average_open_price');\n        const priceDifference = Precise.stringSub (markPrice, entryPrice);\n        const unrealisedPnl = Precise.stringMul (priceDifference, size);\n        size = Precise.stringAbs (size);\n        const notional = Precise.stringMul (size, markPrice);\n        const positionSide = this.safeString (position, 'positionSide'); // 'SHORT' or 'LONG' for hedged, 'BOTH' for non-hedged\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': this.parseNumber (entryPrice),\n            'notional': this.parseNumber (notional),\n            'leverage': this.safeNumber (position, 'leverage'),\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'contracts': this.parseNumber (size),\n            'contractSize': this.parseNumber (contractSize),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber2 (position, 'estLiqPrice', 'est_liq_price'),\n            'markPrice': this.parseNumber (markPrice),\n            'lastPrice': undefined,\n            'collateral': undefined,\n            'marginMode': this.safeStringLower2 (position, 'marginMode', 'margin_mode'),\n            'side': side,\n            'percentage': undefined,\n            'hedged': positionSide !== 'BOTH',\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1908,
        "line_end": 1915,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'ioc': 'IOC',\n            'fok': 'FOK',\n            'post_only': 'PO',\n        };\n        return this.safeString (timeInForces, timeInForce, undefined);\n    }"
      },
      {
        "name": "parseTokenAndFeeTemp",
        "signature": "parseTokenAndFeeTemp (item, feeTokenKeys, feeAmountKeys)",
        "line_start": 822,
        "line_end": 834,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTokenAndFeeTemp (item, feeTokenKeys, feeAmountKeys) {\n        const feeCost = this.safeStringN (item, feeAmountKeys);\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeStringN (item, feeTokenKeys);\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return fee;\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 746,
        "line_end": 820,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "order",
            "value": "order_id",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"SPOT_BTC_USDT\",\n         \"side\": \"SELL\",\n         \"source\": 0,\n         \"executedPrice\": \"108741.01\",\n         \"executedQuantity\": \"0.02477\",\n         \"executedTimestamp\": 1751513940144\n     }",
          "{\n         \"id\": 1734947821,\n         \"symbol\": \"SPOT_LTC_USDT\",\n         \"orderId\": 60780383217,\n         \"executedPrice\": 87.86,\n         \"executedQuantity\": 0.1,\n         \"fee\": 0.0001,\n         \"realizedPnl\": null,\n         \"feeAsset\": \"LTC\",\n         \"orderTag\": \"default\",\n         \"side\": \"BUY\",\n         \"executedTimestamp\": \"1752055173.630\",\n         \"isMaker\": 0\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public/market_trades\n        //\n        //     {\n        //         \"symbol\": \"SPOT_BTC_USDT\",\n        //         \"side\": \"SELL\",\n        //         \"source\": 0,\n        //         \"executedPrice\": \"108741.01\",\n        //         \"executedQuantity\": \"0.02477\",\n        //         \"executedTimestamp\": 1751513940144\n        //     }\n        //\n        // fetchOrderTrades, fetchOrder\n        //\n        //     {\n        //         \"id\": 1734947821,\n        //         \"symbol\": \"SPOT_LTC_USDT\",\n        //         \"orderId\": 60780383217,\n        //         \"executedPrice\": 87.86,\n        //         \"executedQuantity\": 0.1,\n        //         \"fee\": 0.0001,\n        //         \"realizedPnl\": null,\n        //         \"feeAsset\": \"LTC\",\n        //         \"orderTag\": \"default\",\n        //         \"side\": \"BUY\",\n        //         \"executedTimestamp\": \"1752055173.630\",\n        //         \"isMaker\": 0\n        //     }\n        //\n        const isFromFetchOrder = ('id' in trade);\n        const timestampString = this.safeString2 (trade, 'executed_timestamp', 'executedTimestamp');\n        let timestamp = undefined;\n        if (timestampString !== undefined) {\n            if (timestampString.indexOf ('.') > -1) {\n                timestamp = this.safeTimestamp2 (trade, 'executed_timestamp', 'executedTimestamp');\n            } else {\n                timestamp = this.safeInteger (trade, 'executedTimestamp');\n            }\n        }\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString2 (trade, 'executed_price', 'executedPrice');\n        const amount = this.safeString2 (trade, 'executed_quantity', 'executedQuantity');\n        const order_id = this.safeString2 (trade, 'order_id', 'orderId');\n        const fee = this.parseTokenAndFeeTemp (trade, [ 'fee_asset', 'feeAsset' ], [ 'fee' ]);\n        const feeCost = this.safeString (fee, 'cost');\n        if (feeCost !== undefined) {\n            fee['cost'] = feeCost;\n        }\n        const cost = Precise.stringMul (price, amount);\n        const side = this.safeStringLower (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        let takerOrMaker: Str = undefined;\n        if (isFromFetchOrder) {\n            const isMaker = this.safeString2 (trade, 'is_maker', 'isMaker') === '1';\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'order': order_id,\n            'takerOrMaker': takerOrMaker,\n            'type': undefined,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 836,
        "line_end": 847,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'makerFee'), '100'))",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'takerFee'), '100'))",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'makerFee'), '100')),\n            'taker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'takerFee'), '100')),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2750,
        "line_end": 2806,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (transaction, [ 'id', 'withdraw_id', 'withdrawId' ])",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString2 (transaction, 'tx_id', 'txId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString2 (transaction, 'extra', 'tag')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "movementDirection",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeTimestamp2 (transaction, 'updated_time', 'updatedTime')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (this.safeString (transaction, 'network'))",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"createdTime\": \"1734964440.523\",\n         \"updatedTime\": \"1734964614.081\",\n         \"id\": \"24122314340000585\",\n         \"externalId\": \"241223143600621\",\n         \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n         \"token\": \"ARB_USDCNATIVE\",\n         \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n         \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n         \"extra\": \"\",\n         \"type\": \"BALANCE\",\n         \"tokenSide\": \"WITHDRAW\",\n         \"amount\": \"10.00000000\",\n         \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n         \"feeToken\": \"USDC\",\n         \"feeAmount\": \"2\",\n         \"status\": \"COMPLETED\",\n         \"confirmingThreshold\": null,\n         \"confirmedNumber\": null\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"createdTime\": \"1734964440.523\",\n        //         \"updatedTime\": \"1734964614.081\",\n        //         \"id\": \"24122314340000585\",\n        //         \"externalId\": \"241223143600621\",\n        //         \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n        //         \"token\": \"ARB_USDCNATIVE\",\n        //         \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n        //         \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n        //         \"extra\": \"\",\n        //         \"type\": \"BALANCE\",\n        //         \"tokenSide\": \"WITHDRAW\",\n        //         \"amount\": \"10.00000000\",\n        //         \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n        //         \"feeToken\": \"USDC\",\n        //         \"feeAmount\": \"2\",\n        //         \"status\": \"COMPLETED\",\n        //         \"confirmingThreshold\": null,\n        //         \"confirmedNumber\": null\n        //     }\n        //\n        const networkizedCode = this.safeString (transaction, 'token');\n        const currencyDefined = this.getCurrencyFromChaincode (networkizedCode, currency);\n        const code = currencyDefined['code'];\n        let movementDirection = this.safeStringLowerN (transaction, [ 'token_side', 'tokenSide', 'type' ]);\n        if (movementDirection === 'withdraw') {\n            movementDirection = 'withdrawal';\n        }\n        const fee = this.parseTokenAndFeeTemp (transaction, [ 'fee_token', 'feeToken' ], [ 'fee_amount', 'feeAmount' ]);\n        const addressTo = this.safeStringN (transaction, [ 'target_address', 'targetAddress', 'addressTo' ]);\n        const addressFrom = this.safeString2 (transaction, 'source_address', 'sourceAddress');\n        const timestamp = this.safeTimestampN (transaction, [ 'created_time', 'createdTime' ], this.safeInteger (transaction, 'timestamp'));\n        return {\n            'info': transaction,\n            'id': this.safeStringN (transaction, [ 'id', 'withdraw_id', 'withdrawId' ]),\n            'txid': this.safeString2 (transaction, 'tx_id', 'txId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': this.safeString2 (transaction, 'extra', 'tag'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'type': movementDirection,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': this.safeTimestamp2 (transaction, 'updated_time', 'updatedTime'),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n            'network': this.networkIdToCode (this.safeString (transaction, 'network')),\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2808,
        "line_end": 2817,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'pending',\n            'CONFIRMING': 'pending',\n            'PROCESSING': 'pending',\n            'COMPLETED': 'ok',\n            'CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 2932,
        "line_end": 2990,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transfer, 'id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transfer, 'amount')",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "this.safeString (fromAccount, 'applicationId')",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "this.safeString (toAccount, 'applicationId')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (this.safeString (transfer, 'status', status))",
            "comment": null
          },
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 46704,\n         \"token\": \"USDT\",\n         \"amount\": 30000.00000000,\n         \"status\": \"COMPLETED\",\n         \"from_application_id\": \"0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3\",\n         \"to_application_id\": \"c01e6940-a735-4022-9b6c-9d3971cdfdfa\",\n         \"from_user\": \"LeverageLow\",\n         \"to_user\": \"dev\",\n         \"created_time\": \"1709022325.427\",\n         \"updated_time\": \"1709022325.542\"\n     }",
          "{\n         \"id\": 225,\n         \"token\": \"USDT\",\n         \"amount\": \"1000000\",\n         \"status\": \"COMPLETED\",\n         \"from\": {\n             \"applicationId\": \"046b5c5c-5b44-4d27-9593-ddc32c0a08ae\",\n             \"accountName\": \"Main\"\n         },\n         \"to\": {\n             \"applicationId\": \"082ae5ae-e26a-4fb1-be5b-03e5b4867663\",\n             \"accountName\": \"sub001\"\n         },\n         \"createdTime\": \"1642660941.534\",\n         \"updatedTime\": \"1642660941.950\"\n     }",
          "{\n            \"success\": true,\n            \"id\": 200\n        }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //    fetchTransfers\n        //     {\n        //         \"id\": 46704,\n        //         \"token\": \"USDT\",\n        //         \"amount\": 30000.00000000,\n        //         \"status\": \"COMPLETED\",\n        //         \"from_application_id\": \"0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3\",\n        //         \"to_application_id\": \"c01e6940-a735-4022-9b6c-9d3971cdfdfa\",\n        //         \"from_user\": \"LeverageLow\",\n        //         \"to_user\": \"dev\",\n        //         \"created_time\": \"1709022325.427\",\n        //         \"updated_time\": \"1709022325.542\"\n        //     }\n        //     {\n        //         \"id\": 225,\n        //         \"token\": \"USDT\",\n        //         \"amount\": \"1000000\",\n        //         \"status\": \"COMPLETED\",\n        //         \"from\": {\n        //             \"applicationId\": \"046b5c5c-5b44-4d27-9593-ddc32c0a08ae\",\n        //             \"accountName\": \"Main\"\n        //         },\n        //         \"to\": {\n        //             \"applicationId\": \"082ae5ae-e26a-4fb1-be5b-03e5b4867663\",\n        //             \"accountName\": \"sub001\"\n        //         },\n        //         \"createdTime\": \"1642660941.534\",\n        //         \"updatedTime\": \"1642660941.950\"\n        //     }\n        //\n        //    transfer\n        //        {\n        //            \"success\": true,\n        //            \"id\": 200\n        //        }\n        //\n        const code = this.safeCurrencyCode (this.safeString (transfer, 'token'), currency);\n        const timestamp = this.safeTimestamp2 (transfer, 'createdTime', 'timestamp');\n        const success = this.safeBool (transfer, 'success');\n        let status: Str = undefined;\n        if (success !== undefined) {\n            status = success ? 'ok' : 'failed';\n        }\n        const fromAccount = this.safeDict (transfer, 'from', {});\n        const toAccount = this.safeDict (transfer, 'to', {});\n        return {\n            'id': this.safeString (transfer, 'id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'currency': code,\n            'amount': this.safeNumber (transfer, 'amount'),\n            'fromAccount': this.safeString (fromAccount, 'applicationId'),\n            'toAccount': this.safeString (toAccount, 'applicationId'),\n            'status': this.parseTransferStatus (this.safeString (transfer, 'status', status)),\n            'info': transfer,\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 2992,
        "line_end": 3001,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'NEW': 'pending',\n            'CONFIRMING': 'pending',\n            'PROCESSING': 'pending',\n            'COMPLETED': 'ok',\n            'CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "woofipro": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 2288,
        "line_end": 2302,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n        };\n        const balances = this.safeList (response, 'holding', []);\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const code = this.safeCurrencyCode (this.safeString (balance, 'token'));\n            const account = this.account ();\n            account['total'] = this.safeString (balance, 'holding');\n            account['frozen'] = this.safeString (balance, 'frozen');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseFundingInterval",
        "signature": "parseFundingInterval (interval)",
        "line_start": 918,
        "line_end": 927,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseFundingInterval (interval) {\n        const intervals: Dict = {\n            '3600000': '1h',\n            '14400000': '4h',\n            '28800000': '8h',\n            '57600000': '16h',\n            '86400000': '24h',\n        };\n        return this.safeString (intervals, interval, interval);\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate",
        "line_start": 876,
        "line_end": 916,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fundingRate",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "this.parseNumber ('0')",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "estFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (estFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (fundingRate, 'est_funding_rate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "nextFundingTimestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (nextFundingTimestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "this.safeNumber (fundingRate, 'last_funding_rate')",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "lastFundingRateTimestamp",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "this.iso8601 (lastFundingRateTimestamp)",
            "comment": null
          },
          {
            "key": "interval",
            "value": "this.parseFundingInterval (millisecondsInterval)",
            "comment": null
          }
        ],
        "examples": [
          "{\n             \"symbol\":\"PERP_AAVE_USDT\",\n             \"est_funding_rate\":-0.00003447,\n             \"est_funding_rate_timestamp\":1653633959001,\n             \"last_funding_rate\":-0.00002094,\n             \"last_funding_rate_timestamp\":1653631200000,\n             \"next_funding_time\":1653634800000,\n            \"sum_unitary_funding\": 521.367\n         }"
        ],
        "source": "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n        //\n        //         {\n        //             \"symbol\":\"PERP_AAVE_USDT\",\n        //             \"est_funding_rate\":-0.00003447,\n        //             \"est_funding_rate_timestamp\":1653633959001,\n        //             \"last_funding_rate\":-0.00002094,\n        //             \"last_funding_rate_timestamp\":1653631200000,\n        //             \"next_funding_time\":1653634800000,\n        //            \"sum_unitary_funding\": 521.367\n        //         }\n        //\n        const symbol = this.safeString (fundingRate, 'symbol');\n        market = this.market (symbol);\n        const nextFundingTimestamp = this.safeInteger (fundingRate, 'next_funding_time');\n        const estFundingRateTimestamp = this.safeInteger (fundingRate, 'est_funding_rate_timestamp');\n        const lastFundingRateTimestamp = this.safeInteger (fundingRate, 'last_funding_rate_timestamp');\n        const fundingTimeString = this.safeString (fundingRate, 'last_funding_rate_timestamp');\n        const nextFundingTimeString = this.safeString (fundingRate, 'next_funding_time');\n        const millisecondsInterval = Precise.stringSub (nextFundingTimeString, fundingTimeString);\n        return {\n            'info': fundingRate,\n            'symbol': market['symbol'],\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': this.parseNumber ('0'),\n            'estimatedSettlePrice': undefined,\n            'timestamp': estFundingRateTimestamp,\n            'datetime': this.iso8601 (estFundingRateTimestamp),\n            'fundingRate': this.safeNumber (fundingRate, 'est_funding_rate'),\n            'fundingTimestamp': nextFundingTimestamp,\n            'fundingDatetime': this.iso8601 (nextFundingTimestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': this.safeNumber (fundingRate, 'last_funding_rate'),\n            'previousFundingTimestamp': lastFundingRateTimestamp,\n            'previousFundingDatetime': this.iso8601 (lastFundingRateTimestamp),\n            'interval': this.parseFundingInterval (millisecondsInterval),\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseIncome",
        "signature": "parseIncome (income, market: Market = undefined)",
        "line_start": 1081,
        "line_end": 1112,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "income",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "rate",
            "value": "rate",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"PERP_ETH_USDC\",\n         \"funding_rate\": 0.00046875,\n         \"mark_price\": 2100,\n         \"funding_fee\": 0.000016,\n         \"payment_type\": \"Pay\",\n         \"status\": \"Accrued\",\n         \"created_time\": 1682235722003,\n         \"updated_time\": 1682235722003\n }"
        ],
        "source": "parseIncome (income, market: Market = undefined) {\n        //\n        // {\n        //         \"symbol\": \"PERP_ETH_USDC\",\n        //         \"funding_rate\": 0.00046875,\n        //         \"mark_price\": 2100,\n        //         \"funding_fee\": 0.000016,\n        //         \"payment_type\": \"Pay\",\n        //         \"status\": \"Accrued\",\n        //         \"created_time\": 1682235722003,\n        //         \"updated_time\": 1682235722003\n        // }\n        //\n        const marketId = this.safeString (income, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        let amount = this.safeString (income, 'funding_fee');\n        const code = this.safeCurrencyCode ('USDC');\n        const timestamp = this.safeInteger (income, 'updated_time');\n        const rate = this.safeNumber (income, 'funding_rate');\n        const paymentType = this.safeString (income, 'payment_type');\n        amount = (paymentType === 'Pay') ? Precise.stringNeg (amount) : amount;\n        return {\n            'info': income,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': undefined,\n            'amount': this.parseNumber (amount),\n            'rate': rate,\n        };\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 2383,
        "line_end": 2409,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "account",
            "value": "this.safeString (item, 'account')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'tx_id')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (item, 'status'))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        const currencyId = this.safeString (item, 'token');\n        const code = this.safeCurrencyCode (currencyId, currency);\n        currency = this.safeCurrency (currencyId, currency);\n        const amount = this.safeNumber (item, 'amount');\n        const side = this.safeString (item, 'token_side');\n        const direction = (side === 'DEPOSIT') ? 'in' : 'out';\n        const timestamp = this.safeInteger (item, 'created_time');\n        const fee = this.parseTokenAndFeeTemp (item, 'fee_token', 'fee_amount');\n        return this.safeLedgerEntry ({\n            'id': this.safeString (item, 'id'),\n            'currency': code,\n            'account': this.safeString (item, 'account'),\n            'referenceAccount': undefined,\n            'referenceId': this.safeString (item, 'tx_id'),\n            'status': this.parseTransactionStatus (this.safeString (item, 'status')),\n            'amount': amount,\n            'before': undefined,\n            'after': undefined,\n            'fee': fee,\n            'direction': direction,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'info': item,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 2411,
        "line_end": 2417,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'BALANCE': 'transaction', // Funds moved in/out wallet\n            'COLLATERAL': 'transfer', // Funds moved between portfolios\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage, market = undefined): Leverage",
        "line_start": 2661,
        "line_end": 2670,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValue",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage, market = undefined): Leverage {\n        const leverageValue = this.safeInteger (leverage, 'max_leverage');\n        return {\n            'info': leverage,\n            'symbol': market['symbol'],\n            'marginMode': undefined,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValue,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 516,
        "line_end": 603,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "marketType",
            "comment": null
          },
          {
            "key": "spot",
            "value": "false",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "true",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contract",
            "value": "true",
            "comment": null
          },
          {
            "key": "linear",
            "value": "true",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "false",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber ('1')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'base_tick'),\n                'price': this.safeNumber (market, 'quote_tick'),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min'),\n                    'max': this.safeNumber (market, 'base_max'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'quote_min'),\n                    'max': this.safeNumber (market, 'quote_max'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "this.safeInteger (market, 'created_time')",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'base_min'),\n                    'max': this.safeNumber (market, 'base_max'),\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'quote_min'),\n                    'max': this.safeNumber (market, 'quote_max'),\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'quote_min')",
            "comment": null
          },
          {
            "key": "max",
            "value": "this.safeNumber (market, 'quote_max')",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'min_notional')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"symbol\": \"PERP_BTC_USDC\",\n     \"quote_min\": 123,\n     \"quote_max\": 100000,\n     \"quote_tick\": 0.1,\n     \"base_min\": 0.00001,\n     \"base_max\": 20,\n     \"base_tick\": 0.00001,\n     \"min_notional\": 1,\n     \"price_range\": 0.02,\n     \"price_scope\": 0.4,\n     \"std_liquidation_fee\": 0.03,\n     \"liquidator_fee\": 0.015,\n     \"claim_insurance_fund_discount\": 0.0075,\n     \"funding_period\": 8,\n     \"cap_funding\": 0.000375,\n     \"floor_funding\": -0.000375,\n     \"interest_rate\": 0.0001,\n     \"created_time\": 1684140107326,\n     \"updated_time\": 1685345968053,\n     \"base_mmr\": 0.05,\n     \"base_imr\": 0.1,\n     \"imr_factor\": 0.0002512,\n     \"liquidation_tier\": \"1\"\n   }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        //   {\n        //     \"symbol\": \"PERP_BTC_USDC\",\n        //     \"quote_min\": 123,\n        //     \"quote_max\": 100000,\n        //     \"quote_tick\": 0.1,\n        //     \"base_min\": 0.00001,\n        //     \"base_max\": 20,\n        //     \"base_tick\": 0.00001,\n        //     \"min_notional\": 1,\n        //     \"price_range\": 0.02,\n        //     \"price_scope\": 0.4,\n        //     \"std_liquidation_fee\": 0.03,\n        //     \"liquidator_fee\": 0.015,\n        //     \"claim_insurance_fund_discount\": 0.0075,\n        //     \"funding_period\": 8,\n        //     \"cap_funding\": 0.000375,\n        //     \"floor_funding\": -0.000375,\n        //     \"interest_rate\": 0.0001,\n        //     \"created_time\": 1684140107326,\n        //     \"updated_time\": 1685345968053,\n        //     \"base_mmr\": 0.05,\n        //     \"base_imr\": 0.1,\n        //     \"imr_factor\": 0.0002512,\n        //     \"liquidation_tier\": \"1\"\n        //   }\n        //\n        const marketId = this.safeString (market, 'symbol');\n        const parts = marketId.split ('_');\n        const marketType = 'swap';\n        const baseId = this.safeString (parts, 1);\n        const quoteId = this.safeString (parts, 2);\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const settleId: Str = this.safeString (parts, 2);\n        const settle: Str = this.safeCurrencyCode (settleId);\n        const symbol = base + '/' + quote + ':' + settle;\n        return {\n            'id': marketId,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': marketType,\n            'spot': false,\n            'margin': false,\n            'swap': true,\n            'future': false,\n            'option': false,\n            'active': undefined,\n            'contract': true,\n            'linear': true,\n            'inverse': false,\n            'contractSize': this.parseNumber ('1'),\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'base_tick'),\n                'price': this.safeNumber (market, 'quote_tick'),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'base_min'),\n                    'max': this.safeNumber (market, 'base_max'),\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'quote_min'),\n                    'max': this.safeNumber (market, 'quote_max'),\n                },\n                'cost': {\n                    'min': this.safeNumber (market, 'min_notional'),\n                    'max': undefined,\n                },\n            },\n            'created': this.safeInteger (market, 'created_time'),\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1278,
        "line_end": 1287,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        return [\n            this.safeInteger (ohlcv, 'start_timestamp'),\n            this.safeNumber (ohlcv, 'open'),\n            this.safeNumber (ohlcv, 'high'),\n            this.safeNumber (ohlcv, 'low'),\n            this.safeNumber (ohlcv, 'close'),\n            this.safeNumber (ohlcv, 'volume'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1337,
        "line_end": 1451,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdateTimestamp",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (status)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseOrderType (orderType)",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.parseTimeInForce (orderType)",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "triggerPrice",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "takeProfitPrice",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "stopLossPrice",
            "comment": null
          },
          {
            "key": "average",
            "value": "average",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "trades",
            "value": "transactions",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'cost': fee,\n                'currency': feeCurrency,\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"orderId\": \"1578938\",\n     \"clientOrderId\": \"0\",\n     \"algoType\": \"STOP_LOSS\",\n     \"quantity\": \"0.1\"\n   }",
          "{\n       \"algoOrderId\": \"1578958\",\n       \"clientOrderId\": \"0\",\n       \"rootAlgoOrderId\": \"1578958\",\n       \"parentAlgoOrderId\": \"0\",\n       \"symbol\": \"SPOT_LTC_USDT\",\n       \"orderTag\": \"default\",\n       \"algoType\": \"STOP_LOSS\",\n       \"side\": \"BUY\",\n       \"quantity\": \"0.1\",\n       \"isTriggered\": false,\n       \"triggerPrice\": \"100\",\n       \"triggerStatus\": \"USELESS\",\n       \"type\": \"LIMIT\",\n       \"rootAlgoStatus\": \"CANCELLED\",\n       \"algoStatus\": \"CANCELLED\",\n       \"triggerPriceType\": \"MARKET_PRICE\",\n       \"price\": \"75\",\n       \"triggerTime\": \"0\",\n       \"totalExecutedQuantity\": \"0\",\n       \"averageExecutedPrice\": \"0\",\n       \"totalFee\": \"0\",\n       \"feeAsset\": '',\n       \"reduceOnly\": false,\n       \"createdTime\": \"1686149609.744\",\n       \"updatedTime\": \"1686149903.362\"\n   }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // Possible input functions:\n        // * createOrder\n        // * createOrders\n        // * cancelOrder\n        // * fetchOrder\n        // * fetchOrders\n        // const isFromFetchOrder = ('order_tag' in order); TO_DO\n        //\n        // stop order after creating it:\n        //   {\n        //     \"orderId\": \"1578938\",\n        //     \"clientOrderId\": \"0\",\n        //     \"algoType\": \"STOP_LOSS\",\n        //     \"quantity\": \"0.1\"\n        //   }\n        // stop order after fetching it:\n        //   {\n        //       \"algoOrderId\": \"1578958\",\n        //       \"clientOrderId\": \"0\",\n        //       \"rootAlgoOrderId\": \"1578958\",\n        //       \"parentAlgoOrderId\": \"0\",\n        //       \"symbol\": \"SPOT_LTC_USDT\",\n        //       \"orderTag\": \"default\",\n        //       \"algoType\": \"STOP_LOSS\",\n        //       \"side\": \"BUY\",\n        //       \"quantity\": \"0.1\",\n        //       \"isTriggered\": false,\n        //       \"triggerPrice\": \"100\",\n        //       \"triggerStatus\": \"USELESS\",\n        //       \"type\": \"LIMIT\",\n        //       \"rootAlgoStatus\": \"CANCELLED\",\n        //       \"algoStatus\": \"CANCELLED\",\n        //       \"triggerPriceType\": \"MARKET_PRICE\",\n        //       \"price\": \"75\",\n        //       \"triggerTime\": \"0\",\n        //       \"totalExecutedQuantity\": \"0\",\n        //       \"averageExecutedPrice\": \"0\",\n        //       \"totalFee\": \"0\",\n        //       \"feeAsset\": '',\n        //       \"reduceOnly\": false,\n        //       \"createdTime\": \"1686149609.744\",\n        //       \"updatedTime\": \"1686149903.362\"\n        //   }\n        //\n        const timestamp = this.safeIntegerN (order, [ 'timestamp', 'created_time', 'createdTime' ]);\n        const orderId = this.safeStringN (order, [ 'order_id', 'orderId', 'algoOrderId' ]);\n        const clientOrderId = this.omitZero (this.safeString2 (order, 'client_order_id', 'clientOrderId')); // Somehow, this always returns 0 for limit order\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString2 (order, 'order_price', 'price');\n        const amount = this.safeString2 (order, 'order_quantity', 'quantity'); // This is base amount\n        const cost = this.safeString2 (order, 'order_amount', 'amount'); // This is quote amount\n        const orderType = this.safeStringLower2 (order, 'order_type', 'type');\n        let status = this.safeValue2 (order, 'status', 'algoStatus');\n        const success = this.safeBool (order, 'success');\n        if (success !== undefined) {\n            status = (success) ? 'NEW' : 'REJECTED';\n        }\n        const side = this.safeStringLower (order, 'side');\n        const filled = this.omitZero (this.safeValue2 (order, 'executed', 'totalExecutedQuantity'));\n        const average = this.omitZero (this.safeString2 (order, 'average_executed_price', 'averageExecutedPrice'));\n        const remaining = Precise.stringSub (cost, filled);\n        const fee = this.safeValue2 (order, 'total_fee', 'totalFee');\n        const feeCurrency = this.safeString2 (order, 'fee_asset', 'feeAsset');\n        const transactions = this.safeValue (order, 'Transactions');\n        const triggerPrice = this.safeNumber (order, 'triggerPrice');\n        let takeProfitPrice: Num = undefined;\n        let stopLossPrice: Num = undefined;\n        const childOrders = this.safeValue (order, 'childOrders');\n        if (childOrders !== undefined) {\n            const first = this.safeValue (childOrders, 0);\n            const innerChildOrders = this.safeValue (first, 'childOrders', []);\n            const innerChildOrdersLength = innerChildOrders.length;\n            if (innerChildOrdersLength > 0) {\n                const takeProfitOrder = this.safeValue (innerChildOrders, 0);\n                const stopLossOrder = this.safeValue (innerChildOrders, 1);\n                takeProfitPrice = this.safeNumber (takeProfitOrder, 'triggerPrice');\n                stopLossPrice = this.safeNumber (stopLossOrder, 'triggerPrice');\n            }\n        }\n        const lastUpdateTimestamp = this.safeInteger2 (order, 'updatedTime', 'updated_time');\n        return this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': lastUpdateTimestamp,\n            'status': this.parseOrderStatus (status),\n            'symbol': symbol,\n            'type': this.parseOrderType (orderType),\n            'timeInForce': this.parseTimeInForce (orderType),\n            'postOnly': undefined, // TO_DO\n            'reduceOnly': this.safeBool (order, 'reduce_only'),\n            'side': side,\n            'price': price,\n            'triggerPrice': triggerPrice,\n            'takeProfitPrice': takeProfitPrice,\n            'stopLossPrice': stopLossPrice,\n            'average': average,\n            'amount': amount,\n            'filled': filled,\n            'remaining': remaining, // TO_DO\n            'cost': cost,\n            'trades': transactions,\n            'fee': {\n                'cost': fee,\n                'currency': feeCurrency,\n            },\n            'info': order,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1462,
        "line_end": 1478,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        if (status !== undefined) {\n            const statuses: Dict = {\n                'NEW': 'open',\n                'FILLED': 'closed',\n                'CANCEL_SENT': 'canceled',\n                'CANCEL_ALL_SENT': 'canceled',\n                'CANCELLED': 'canceled',\n                'PARTIAL_FILLED': 'open',\n                'REJECTED': 'rejected',\n                'INCOMPLETE': 'open',\n                'COMPLETED': 'closed',\n            };\n            return this.safeString (statuses, status, status);\n        }\n        return status;\n    }"
      },
      {
        "name": "parseOrderType",
        "signature": "parseOrderType (type: Str)",
        "line_start": 1480,
        "line_end": 1487,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderType (type: Str) {\n        const types: Dict = {\n            'LIMIT': 'limit',\n            'MARKET': 'market',\n            'POST_ONLY': 'limit',\n        };\n        return this.safeStringLower (types, type, type);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 2737,
        "line_end": 2806,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeString (market, 'symbol')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.parseNumber (entryPrice)",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.parseNumber (notional)",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "this.parseNumber (unrealisedPnl)",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.parseNumber (size)",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.parseNumber (contractSize)",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'est_liq_price')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "this.parseNumber (markPrice)",
            "comment": null
          },
          {
            "key": "lastPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "'cross'",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "stopLossPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takeProfitPrice",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"IMR_withdraw_orders\": 0.1,\n     \"MMR_with_orders\": 0.05,\n     \"average_open_price\": 27908.14386047,\n     \"cost_position\": -139329.358492,\n     \"est_liq_price\": 117335.92899428,\n     \"fee_24_h\": 123,\n     \"imr\": 0.1,\n     \"last_sum_unitary_funding\": 70.38,\n     \"mark_price\": 27794.9,\n     \"mmr\": 0.05,\n     \"pending_long_qty\": 123,\n     \"pending_short_qty\": 123,\n     \"pnl_24_h\": 123,\n     \"position_qty\": -5,\n     \"settle_price\": 27865.8716984,\n     \"symbol\": \"PERP_BTC_USDC\",\n     \"timestamp\": 1685429350571,\n     \"unsettled_pnl\": 354.858492\n }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // {\n        //     \"IMR_withdraw_orders\": 0.1,\n        //     \"MMR_with_orders\": 0.05,\n        //     \"average_open_price\": 27908.14386047,\n        //     \"cost_position\": -139329.358492,\n        //     \"est_liq_price\": 117335.92899428,\n        //     \"fee_24_h\": 123,\n        //     \"imr\": 0.1,\n        //     \"last_sum_unitary_funding\": 70.38,\n        //     \"mark_price\": 27794.9,\n        //     \"mmr\": 0.05,\n        //     \"pending_long_qty\": 123,\n        //     \"pending_short_qty\": 123,\n        //     \"pnl_24_h\": 123,\n        //     \"position_qty\": -5,\n        //     \"settle_price\": 27865.8716984,\n        //     \"symbol\": \"PERP_BTC_USDC\",\n        //     \"timestamp\": 1685429350571,\n        //     \"unsettled_pnl\": 354.858492\n        // }\n        //\n        const contract = this.safeString (position, 'symbol');\n        market = this.safeMarket (contract, market);\n        let size = this.safeString (position, 'position_qty');\n        let side: Str = undefined;\n        if (Precise.stringGt (size, '0')) {\n            side = 'long';\n        } else {\n            side = 'short';\n        }\n        const contractSize = this.safeString (market, 'contractSize');\n        const markPrice = this.safeString (position, 'mark_price');\n        const timestamp = this.safeInteger (position, 'timestamp');\n        const entryPrice = this.safeString (position, 'average_open_price');\n        const unrealisedPnl = this.safeString (position, 'unsettled_pnl');\n        size = Precise.stringAbs (size);\n        const notional = Precise.stringMul (size, markPrice);\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': this.safeString (market, 'symbol'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastUpdateTimestamp': undefined,\n            'initialMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': this.parseNumber (entryPrice),\n            'notional': this.parseNumber (notional),\n            'leverage': undefined,\n            'unrealizedPnl': this.parseNumber (unrealisedPnl),\n            'contracts': this.parseNumber (size),\n            'contractSize': this.parseNumber (contractSize),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'est_liq_price'),\n            'markPrice': this.parseNumber (markPrice),\n            'lastPrice': undefined,\n            'collateral': undefined,\n            'marginMode': 'cross',\n            'marginType': undefined,\n            'side': side,\n            'percentage': undefined,\n            'hedged': undefined,\n            'stopLossPrice': undefined,\n            'takeProfitPrice': undefined,\n        });\n    }"
      },
      {
        "name": "parseTimeInForce",
        "signature": "parseTimeInForce (timeInForce: Str)",
        "line_start": 1453,
        "line_end": 1460,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTimeInForce (timeInForce: Str) {\n        const timeInForces: Dict = {\n            'ioc': 'IOC',\n            'fok': 'FOK',\n            'post_only': 'PO',\n        };\n        return this.safeString (timeInForces, timeInForce, undefined);\n    }"
      },
      {
        "name": "parseTokenAndFeeTemp",
        "signature": "parseTokenAndFeeTemp (item, feeTokenKey, feeAmountKey)",
        "line_start": 755,
        "line_end": 767,
        "comment": null,
        "mappings": [
          {
            "key": "cost",
            "value": "feeCost",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTokenAndFeeTemp (item, feeTokenKey, feeAmountKey) {\n        const feeCost = this.safeString (item, feeAmountKey);\n        let fee = undefined;\n        if (feeCost !== undefined) {\n            const feeCurrencyId = this.safeString (item, feeTokenKey);\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCost,\n                'currency': feeCurrencyCode,\n            };\n        }\n        return fee;\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 769,
        "line_end": 833,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "cost",
            "comment": null
          },
          {
            "key": "order",
            "value": "order_id",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"SPOT_BTC_USDT\",\n         \"side\": \"SELL\",\n         \"executed_price\": 46222.35,\n         \"executed_quantity\": 0.0012,\n         \"executed_timestamp\": \"1683878609166\"\n     }",
          "{\n         \"id\": \"99119876\",\n         \"symbol\": \"SPOT_WOO_USDT\",\n         \"fee\": \"0.0024\",\n         \"side\": \"BUY\",\n         \"executed_timestamp\": \"1641481113084\",\n         \"order_id\": \"87001234\",\n         \"order_tag\": \"default\", <-- this param only in \"fetchOrderTrades\"\n         \"executed_price\": \"1\",\n         \"executed_quantity\": \"12\",\n         \"fee_asset\": \"WOO\",\n         \"is_maker\": \"1\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // public/market_trades\n        //\n        //     {\n        //         \"symbol\": \"SPOT_BTC_USDT\",\n        //         \"side\": \"SELL\",\n        //         \"executed_price\": 46222.35,\n        //         \"executed_quantity\": 0.0012,\n        //         \"executed_timestamp\": \"1683878609166\"\n        //     }\n        //\n        // fetchOrderTrades, fetchOrder\n        //\n        //     {\n        //         \"id\": \"99119876\",\n        //         \"symbol\": \"SPOT_WOO_USDT\",\n        //         \"fee\": \"0.0024\",\n        //         \"side\": \"BUY\",\n        //         \"executed_timestamp\": \"1641481113084\",\n        //         \"order_id\": \"87001234\",\n        //         \"order_tag\": \"default\", <-- this param only in \"fetchOrderTrades\"\n        //         \"executed_price\": \"1\",\n        //         \"executed_quantity\": \"12\",\n        //         \"fee_asset\": \"WOO\",\n        //         \"is_maker\": \"1\"\n        //     }\n        //\n        const isFromFetchOrder = ('id' in trade);\n        const timestamp = this.safeInteger (trade, 'executed_timestamp');\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const price = this.safeString (trade, 'executed_price');\n        const amount = this.safeString (trade, 'executed_quantity');\n        const order_id = this.safeString (trade, 'order_id');\n        const fee = this.parseTokenAndFeeTemp (trade, 'fee_asset', 'fee');\n        const feeCost = this.safeString (fee, 'cost');\n        if (feeCost !== undefined) {\n            fee['cost'] = feeCost;\n        }\n        const cost = Precise.stringMul (price, amount);\n        const side = this.safeStringLower (trade, 'side');\n        const id = this.safeString (trade, 'id');\n        let takerOrMaker: Str = undefined;\n        if (isFromFetchOrder) {\n            const isMaker = this.safeString (trade, 'is_maker') === '1';\n            takerOrMaker = isMaker ? 'maker' : 'taker';\n        }\n        return this.safeTrade ({\n            'id': id,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'side': side,\n            'price': price,\n            'amount': amount,\n            'cost': cost,\n            'order': order_id,\n            'takerOrMaker': takerOrMaker,\n            'type': undefined,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 2437,
        "line_end": 2470,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString2 (transaction, 'id', 'withdraw_id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'tx_id')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "addressFrom",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "addressTo",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (transaction, 'extra')",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "movementDirection",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "code",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "updated",
            "value": "this.safeInteger (transaction, 'updated_time')",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        // example in fetchLedger\n        const code = this.safeString (transaction, 'token');\n        let movementDirection = this.safeStringLower (transaction, 'token_side');\n        if (movementDirection === 'withdraw') {\n            movementDirection = 'withdrawal';\n        }\n        const fee = this.parseTokenAndFeeTemp (transaction, 'fee_token', 'fee_amount');\n        const addressTo = this.safeString (transaction, 'target_address');\n        const addressFrom = this.safeString (transaction, 'source_address');\n        const timestamp = this.safeInteger (transaction, 'created_time');\n        return {\n            'info': transaction,\n            'id': this.safeString2 (transaction, 'id', 'withdraw_id'),\n            'txid': this.safeString (transaction, 'tx_id'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'address': undefined,\n            'addressFrom': addressFrom,\n            'addressTo': addressTo,\n            'tag': this.safeString (transaction, 'extra'),\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'type': movementDirection,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': code,\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'updated': this.safeInteger (transaction, 'updated_time'),\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n            'network': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status: Str)",
        "line_start": 2472,
        "line_end": 2481,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransactionStatus (status: Str) {\n        const statuses: Dict = {\n            'NEW': 'pending',\n            'CONFIRMING': 'pending',\n            'PROCESSING': 'pending',\n            'COMPLETED': 'ok',\n            'CANCELED': 'canceled',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ],
    "xt": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response)",
        "line_start": 2347,
        "line_end": 2393,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency\": \"usdt\",\n         \"currencyId\": 11,\n         \"frozenAmount\": \"0.03834082\",\n         \"availableAmount\": \"31.70995965\",\n         \"totalAmount\": \"31.74830047\",\n         \"convertBtcAmount\": \"0.00115911\",\n         \"convertUsdtAmount\": \"31.74830047\"\n     }",
          "{\n         \"coin\": \"usdt\",\n         \"walletBalance\": \"19.29849875\",\n         \"openOrderMarginFrozen\": \"0\",\n         \"isolatedMargin\": \"0.709475\",\n         \"crossedMargin\": \"0\",\n         \"availableBalance\": \"18.58902375\",\n         \"bonus\": \"0\",\n         \"coupon\":\"0\"\n     }"
        ],
        "source": "parseBalance (response) {\n        //\n        // spot\n        //\n        //     {\n        //         \"currency\": \"usdt\",\n        //         \"currencyId\": 11,\n        //         \"frozenAmount\": \"0.03834082\",\n        //         \"availableAmount\": \"31.70995965\",\n        //         \"totalAmount\": \"31.74830047\",\n        //         \"convertBtcAmount\": \"0.00115911\",\n        //         \"convertUsdtAmount\": \"31.74830047\"\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"coin\": \"usdt\",\n        //         \"walletBalance\": \"19.29849875\",\n        //         \"openOrderMarginFrozen\": \"0\",\n        //         \"isolatedMargin\": \"0.709475\",\n        //         \"crossedMargin\": \"0\",\n        //         \"availableBalance\": \"18.58902375\",\n        //         \"bonus\": \"0\",\n        //         \"coupon\":\"0\"\n        //     }\n        //\n        const result = { 'info': response };\n        for (let i = 0; i < response.length; i++) {\n            const balance = response[i];\n            const currencyId = this.safeString2 (balance, 'currency', 'coin');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            const free = this.safeString2 (balance, 'availableAmount', 'availableBalance');\n            let used = this.safeString (balance, 'frozenAmount');\n            const total = this.safeString2 (balance, 'totalAmount', 'walletBalance');\n            if (used === undefined) {\n                const crossedAndIsolatedMargin = Precise.stringAdd (this.safeString (balance, 'crossedMargin'), this.safeString (balance, 'isolatedMargin'));\n                used = Precise.stringAdd (this.safeString (balance, 'openOrderMarginFrozen'), crossedAndIsolatedMargin);\n            }\n            account['free'] = free;\n            account['used'] = used;\n            account['total'] = total;\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency = undefined): DepositAddress",
        "line_start": 3809,
        "line_end": 3825,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (undefined, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'memo')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"0x7f7173cf29d3846d20ca5a3aec1120b93dbd157a\",\n         \"memo\": \"\"\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"0x7f7173cf29d3846d20ca5a3aec1120b93dbd157a\",\n        //         \"memo\": \"\"\n        //     }\n        //\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (undefined, currency),\n            'network': undefined,\n            'address': address,\n            'tag': this.safeString (depositAddress, 'memo'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseFundingHistory",
        "signature": "parseFundingHistory (contract, market = undefined)",
        "line_start": 4611,
        "line_end": 4636,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "code",
            "value": "code",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (contract, 'id')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (contract, 'cast')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"210804044057280512\",\n         \"symbol\": \"btc_usdt\",\n         \"cast\": \"-0.0013\",\n         \"coin\": \"usdt\",\n         \"positionSide\": \"SHORT\",\n         \"createdTime\": 1679961600653\n     }"
        ],
        "source": "parseFundingHistory (contract, market = undefined) {\n        //\n        //     {\n        //         \"id\": \"210804044057280512\",\n        //         \"symbol\": \"btc_usdt\",\n        //         \"cast\": \"-0.0013\",\n        //         \"coin\": \"usdt\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"createdTime\": 1679961600653\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '_', 'swap');\n        const currencyId = this.safeString (contract, 'coin');\n        const code = this.safeCurrencyCode (currencyId);\n        const timestamp = this.safeInteger (contract, 'createdTime');\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'code': code,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'id': this.safeString (contract, 'id'),\n            'amount': this.safeNumber (contract, 'cast'),\n        };\n    }"
      },
      {
        "name": "parseFundingRate",
        "signature": "parseFundingRate (contract, market = undefined): FundingRate",
        "line_start": 4507,
        "line_end": 4543,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "contract",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "indexPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interestRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "estimatedSettlePrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fundingRate",
            "value": "this.safeNumber (contract, 'fundingRate')",
            "comment": null
          },
          {
            "key": "fundingTimestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "fundingDatetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "nextFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "nextFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingRate",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "previousFundingDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "interval",
            "value": "interval",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"btc_usdt\",\n         \"fundingRate\": \"0.000086\",\n         \"nextCollectionTime\": 1680307200000,\n         \"collectionInternal\": 8\n     }"
        ],
        "source": "parseFundingRate (contract, market = undefined): FundingRate {\n        //\n        //     {\n        //         \"symbol\": \"btc_usdt\",\n        //         \"fundingRate\": \"0.000086\",\n        //         \"nextCollectionTime\": 1680307200000,\n        //         \"collectionInternal\": 8\n        //     }\n        //\n        const marketId = this.safeString (contract, 'symbol');\n        const symbol = this.safeSymbol (marketId, market, '_', 'swap');\n        const timestamp = this.safeInteger (contract, 'nextCollectionTime');\n        let interval = this.safeString (contract, 'collectionInternal');\n        if (interval !== undefined) {\n            interval = interval + 'h';\n        }\n        return {\n            'info': contract,\n            'symbol': symbol,\n            'markPrice': undefined,\n            'indexPrice': undefined,\n            'interestRate': undefined,\n            'estimatedSettlePrice': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'fundingRate': this.safeNumber (contract, 'fundingRate'),\n            'fundingTimestamp': timestamp,\n            'fundingDatetime': this.iso8601 (timestamp),\n            'nextFundingRate': undefined,\n            'nextFundingTimestamp': undefined,\n            'nextFundingDatetime': undefined,\n            'previousFundingRate': undefined,\n            'previousFundingTimestamp': undefined,\n            'previousFundingDatetime': undefined,\n            'interval': interval,\n        } as FundingRate;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item, currency = undefined): LedgerEntry",
        "line_start": 3718,
        "line_end": 3756,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'id')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (item, 'amount')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "before",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (item, 'afterAmount')",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': undefined,\n                'cost': undefined,\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"207260567109387524\",\n         \"coin\": \"usdt\",\n         \"symbol\": \"btc_usdt\",\n         \"type\": \"FEE\",\n         \"amount\": \"-0.0213\",\n         \"side\": \"SUB\",\n         \"afterAmount\": null,\n         \"createdTime\": 1679116769914\n     }"
        ],
        "source": "parseLedgerEntry (item, currency = undefined): LedgerEntry {\n        //\n        //     {\n        //         \"id\": \"207260567109387524\",\n        //         \"coin\": \"usdt\",\n        //         \"symbol\": \"btc_usdt\",\n        //         \"type\": \"FEE\",\n        //         \"amount\": \"-0.0213\",\n        //         \"side\": \"SUB\",\n        //         \"afterAmount\": null,\n        //         \"createdTime\": 1679116769914\n        //     }\n        //\n        const side = this.safeString (item, 'side');\n        const direction = (side === 'ADD') ? 'in' : 'out';\n        const currencyId = this.safeString (item, 'coin');\n        currency = this.safeCurrency (currencyId, currency);\n        const timestamp = this.safeInteger (item, 'createdTime');\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'id'),\n            'direction': direction,\n            'account': undefined,\n            'referenceId': undefined,\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': this.safeNumber (item, 'amount'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'before': undefined,\n            'after': this.safeNumber (item, 'afterAmount'),\n            'status': undefined,\n            'fee': {\n                'currency': undefined,\n                'cost': undefined,\n            },\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 3758,
        "line_end": 3770,
        "comment": null,
        "mappings": [
          {
            "key": "EXCHANGE",
            "value": "'transfer'",
            "comment": null
          },
          {
            "key": "CLOSE_POSITION",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "TAKE_OVER",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "MERGE",
            "value": "'trade'",
            "comment": null
          },
          {
            "key": "QIANG_PING_MANAGER",
            "value": "'fee'",
            "comment": null
          },
          {
            "key": "FUND",
            "value": "'fee'",
            "comment": null
          },
          {
            "key": "FEE",
            "value": "'fee'",
            "comment": null
          },
          {
            "key": "ADL",
            "value": "'auto-deleveraging'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const ledgerType = {\n            'EXCHANGE': 'transfer',\n            'CLOSE_POSITION': 'trade',\n            'TAKE_OVER': 'trade',\n            'MERGE': 'trade',\n            'QIANG_PING_MANAGER': 'fee',\n            'FUND': 'fee',\n            'FEE': 'fee',\n            'ADL': 'auto-deleveraging',\n        };\n        return this.safeString (ledgerType, type, type);\n    }"
      },
      {
        "name": "parseLeverageTiers",
        "signature": "parseLeverageTiers (response, symbols = undefined, marketIdKey = undefined): LeverageTiers",
        "line_start": 4247,
        "line_end": 4280,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"symbol\": \"rad_usdt\",\n         \"leverageBrackets\": [\n             {\n                 \"symbol\": \"rad_usdt\",\n                 \"bracket\": 1,\n                 \"maxNominalValue\": \"5000\",\n                 \"maintMarginRate\": \"0.025\",\n                 \"startMarginRate\": \"0.05\",\n                 \"maxStartMarginRate\": null,\n                 \"maxLeverage\": \"20\",\n                 \"minLeverage\": \"1\"\n             },\n         ]\n     }"
        ],
        "source": "parseLeverageTiers (response, symbols = undefined, marketIdKey = undefined): LeverageTiers {\n        //\n        //     {\n        //         \"symbol\": \"rad_usdt\",\n        //         \"leverageBrackets\": [\n        //             {\n        //                 \"symbol\": \"rad_usdt\",\n        //                 \"bracket\": 1,\n        //                 \"maxNominalValue\": \"5000\",\n        //                 \"maintMarginRate\": \"0.025\",\n        //                 \"startMarginRate\": \"0.05\",\n        //                 \"maxStartMarginRate\": null,\n        //                 \"maxLeverage\": \"20\",\n        //                 \"minLeverage\": \"1\"\n        //             },\n        //         ]\n        //     }\n        //\n        const result = {};\n        for (let i = 0; i < response.length; i++) {\n            const entry = response[i];\n            const marketId = this.safeString (entry, 'symbol');\n            const market = this.safeMarket (marketId, undefined, '_', 'contract');\n            const symbol = this.safeSymbol (marketId, market);\n            if (symbols !== undefined) {\n                if (this.inArray (symbol, symbols)) {\n                    result[symbol] = this.parseMarketLeverageTiers (entry, market);\n                }\n            } else {\n                result[symbol] = this.parseMarketLeverageTiers (response[i], market);\n            }\n        }\n        return result as LeverageTiers;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (data, market = undefined): MarginModification",
        "line_start": 4184,
        "line_end": 4197,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "data",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarginModification (data, market = undefined): MarginModification {\n        return {\n            'info': data,\n            'type': undefined,\n            'amount': undefined,\n            'code': undefined,\n            'symbol': this.safeSymbol (undefined, market),\n            'status': undefined,\n            'marginMode': undefined,\n            'total': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 1139,
        "line_end": 1393,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "settle",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "settleId",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "spot",
            "value": "spot",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "swap",
            "comment": null
          },
          {
            "key": "future",
            "value": "future",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "isActive",
            "comment": null
          },
          {
            "key": "contract",
            "value": "contract",
            "comment": null
          },
          {
            "key": "linear",
            "value": "linear",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "inverse",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (market, 'takerFee')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (market, 'makerFee')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "expiry",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "this.iso8601 (expiry)",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision'))),\n                'amount': amountPrecision,\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseCoinPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteCoinPrecision'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': maxPrice,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': maxCost,\n                },\n            }",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision')))",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountPrecision",
            "comment": null
          },
          {
            "key": "base",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'baseCoinPrecision')))",
            "comment": null
          },
          {
            "key": "quote",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteCoinPrecision')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': this.parseNumber ('1'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': minAmount,\n                    'max': maxAmount,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': minPrice,\n                    'max': maxPrice,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': minCost,\n                    'max': maxCost,\n                }",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 640,\n         \"symbol\": \"xt_usdt\",\n         \"state\": \"ONLINE\",\n         \"stateTime\": 1554048000000,\n         \"tradingEnabled\": true,\n         \"openapiEnabled\": true,\n         \"nextStateTime\": null,\n         \"nextState\": null,\n         \"depthMergePrecision\": 5,\n         \"baseCurrency\": \"xt\",\n         \"baseCurrencyPrecision\": 8,\n         \"baseCurrencyId\": 128,\n         \"quoteCurrency\": \"usdt\",\n         \"quoteCurrencyPrecision\": 8,\n         \"quoteCurrencyId\": 11,\n         \"pricePrecision\": 4,\n         \"quantityPrecision\": 2,\n         \"orderTypes\": [\"LIMIT\",\"MARKET\"],\n         \"timeInForces\": [\"GTC\",\"IOC\"],\n         \"displayWeight\": 10002,\n         \"displayLevel\": \"FULL\",\n         \"plates\": [],\n         \"filters\":[\n             {\n                 \"filter\": \"QUOTE_QTY\",\n                 \"min\": \"1\"\n             },\n             {\n                 \"filter\": \"PRICE\",\n                 \"min\": null,\n                 \"max\": null,\n                 \"tickSize\": null\n             },\n             {\n                 \"filter\": \"QUANTITY\",\n                 \"min\": null,\n                 \"max\": null,\n                 \"tickSize\": null\n             },\n             {\n                 \"filter\": \"PROTECTION_LIMIT\",\n                 \"buyMaxDeviation\": \"0.8\",\n                 \"sellMaxDeviation\": \"4\"\n             },\n             {\n                 \"filter\": \"PROTECTION_MARKET\",\n                 \"maxDeviation\": \"0.02\"\n             },\n             {\n                  \"filter\": \"PROTECTION_ONLINE\",\n                  \"durationSeconds\": \"300\",\n                  \"maxPriceMultiple\": \"5\"\n             },\n         ]\n     }",
          "{\n         \"id\": 52,\n         \"symbolGroupId\": 71,\n         \"symbol\": \"xt_usdt\",\n         \"pair\": \"xt_usdt\",\n         \"contractType\": \"PERPETUAL\",\n         \"productType\": \"perpetual\",\n         \"predictEventType\": null,\n         \"underlyingType\": \"U_BASED\",\n         \"contractSize\": \"1\",\n         \"tradeSwitch\": true,\n         \"isDisplay\": true,\n         \"isOpenApi\": false,\n         \"state\": 0,\n         \"initLeverage\": 20,\n         \"initPositionType\": \"CROSSED\",\n         \"baseCoin\": \"xt\",\n         \"quoteCoin\": \"usdt\",\n         \"baseCoinPrecision\": 8,\n         \"baseCoinDisplayPrecision\": 4,\n         \"quoteCoinPrecision\": 8,\n         \"quoteCoinDisplayPrecision\": 4,\n         \"quantityPrecision\": 0,\n         \"pricePrecision\": 4,\n         \"supportOrderType\": \"LIMIT,MARKET\",\n         \"supportTimeInForce\": \"GTC,FOK,IOC,GTX\",\n         \"supportEntrustType\": \"TAKE_PROFIT,STOP,TAKE_PROFIT_MARKET,STOP_MARKET,TRAILING_STOP_MARKET\",\n         \"supportPositionType\": \"CROSSED,ISOLATED\",\n         \"minQty\": \"1\",\n         \"minNotional\": \"5\",\n         \"maxNotional\": \"20000000\",\n         \"multiplierDown\": \"0.1\",\n         \"multiplierUp\": \"0.1\",\n         \"maxOpenOrders\": 200,\n         \"maxEntrusts\": 200,\n         \"makerFee\": \"0.0004\",\n         \"takerFee\": \"0.0006\",\n         \"liquidationFee\": \"0.01\",\n         \"marketTakeBound\": \"0.1\",\n         \"depthPrecisionMerge\": 5,\n         \"labels\": [\"HOT\"],\n         \"onboardDate\": 1657101601000,\n         \"enName\": \"XTUSDT \",\n         \"cnName\": \"XTUSDT\",\n         \"minStepPrice\": \"0.0001\",\n         \"minPrice\": null,\n         \"maxPrice\": null,\n         \"deliveryDate\": 1669879634000,\n         \"deliveryPrice\": null,\n         \"deliveryCompletion\": false,\n         \"cnDesc\": null,\n         \"enDesc\": null\n     }"
        ],
        "source": "parseMarket (market: Dict): Market {\n        //\n        // spot\n        //\n        //     {\n        //         \"id\": 640,\n        //         \"symbol\": \"xt_usdt\",\n        //         \"state\": \"ONLINE\",\n        //         \"stateTime\": 1554048000000,\n        //         \"tradingEnabled\": true,\n        //         \"openapiEnabled\": true,\n        //         \"nextStateTime\": null,\n        //         \"nextState\": null,\n        //         \"depthMergePrecision\": 5,\n        //         \"baseCurrency\": \"xt\",\n        //         \"baseCurrencyPrecision\": 8,\n        //         \"baseCurrencyId\": 128,\n        //         \"quoteCurrency\": \"usdt\",\n        //         \"quoteCurrencyPrecision\": 8,\n        //         \"quoteCurrencyId\": 11,\n        //         \"pricePrecision\": 4,\n        //         \"quantityPrecision\": 2,\n        //         \"orderTypes\": [\"LIMIT\",\"MARKET\"],\n        //         \"timeInForces\": [\"GTC\",\"IOC\"],\n        //         \"displayWeight\": 10002,\n        //         \"displayLevel\": \"FULL\",\n        //         \"plates\": [],\n        //         \"filters\":[\n        //             {\n        //                 \"filter\": \"QUOTE_QTY\",\n        //                 \"min\": \"1\"\n        //             },\n        //             {\n        //                 \"filter\": \"PRICE\",\n        //                 \"min\": null,\n        //                 \"max\": null,\n        //                 \"tickSize\": null\n        //             },\n        //             {\n        //                 \"filter\": \"QUANTITY\",\n        //                 \"min\": null,\n        //                 \"max\": null,\n        //                 \"tickSize\": null\n        //             },\n        //             {\n        //                 \"filter\": \"PROTECTION_LIMIT\",\n        //                 \"buyMaxDeviation\": \"0.8\",\n        //                 \"sellMaxDeviation\": \"4\"\n        //             },\n        //             {\n        //                 \"filter\": \"PROTECTION_MARKET\",\n        //                 \"maxDeviation\": \"0.02\"\n        //             },\n        //             {\n        //                  \"filter\": \"PROTECTION_ONLINE\",\n        //                  \"durationSeconds\": \"300\",\n        //                  \"maxPriceMultiple\": \"5\"\n        //             },\n        //         ]\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"id\": 52,\n        //         \"symbolGroupId\": 71,\n        //         \"symbol\": \"xt_usdt\",\n        //         \"pair\": \"xt_usdt\",\n        //         \"contractType\": \"PERPETUAL\",\n        //         \"productType\": \"perpetual\",\n        //         \"predictEventType\": null,\n        //         \"underlyingType\": \"U_BASED\",\n        //         \"contractSize\": \"1\",\n        //         \"tradeSwitch\": true,\n        //         \"isDisplay\": true,\n        //         \"isOpenApi\": false,\n        //         \"state\": 0,\n        //         \"initLeverage\": 20,\n        //         \"initPositionType\": \"CROSSED\",\n        //         \"baseCoin\": \"xt\",\n        //         \"quoteCoin\": \"usdt\",\n        //         \"baseCoinPrecision\": 8,\n        //         \"baseCoinDisplayPrecision\": 4,\n        //         \"quoteCoinPrecision\": 8,\n        //         \"quoteCoinDisplayPrecision\": 4,\n        //         \"quantityPrecision\": 0,\n        //         \"pricePrecision\": 4,\n        //         \"supportOrderType\": \"LIMIT,MARKET\",\n        //         \"supportTimeInForce\": \"GTC,FOK,IOC,GTX\",\n        //         \"supportEntrustType\": \"TAKE_PROFIT,STOP,TAKE_PROFIT_MARKET,STOP_MARKET,TRAILING_STOP_MARKET\",\n        //         \"supportPositionType\": \"CROSSED,ISOLATED\",\n        //         \"minQty\": \"1\",\n        //         \"minNotional\": \"5\",\n        //         \"maxNotional\": \"20000000\",\n        //         \"multiplierDown\": \"0.1\",\n        //         \"multiplierUp\": \"0.1\",\n        //         \"maxOpenOrders\": 200,\n        //         \"maxEntrusts\": 200,\n        //         \"makerFee\": \"0.0004\",\n        //         \"takerFee\": \"0.0006\",\n        //         \"liquidationFee\": \"0.01\",\n        //         \"marketTakeBound\": \"0.1\",\n        //         \"depthPrecisionMerge\": 5,\n        //         \"labels\": [\"HOT\"],\n        //         \"onboardDate\": 1657101601000,\n        //         \"enName\": \"XTUSDT \",\n        //         \"cnName\": \"XTUSDT\",\n        //         \"minStepPrice\": \"0.0001\",\n        //         \"minPrice\": null,\n        //         \"maxPrice\": null,\n        //         \"deliveryDate\": 1669879634000,\n        //         \"deliveryPrice\": null,\n        //         \"deliveryCompletion\": false,\n        //         \"cnDesc\": null,\n        //         \"enDesc\": null\n        //     }\n        //\n        const id = this.safeString (market, 'symbol');\n        const baseId = this.safeString2 (market, 'baseCurrency', 'baseCoin');\n        const quoteId = this.safeString2 (market, 'quoteCurrency', 'quoteCoin');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const state = this.safeString (market, 'state');\n        let symbol = base + '/' + quote;\n        const filters = this.safeValue (market, 'filters', []);\n        let minAmount = undefined;\n        let maxAmount = undefined;\n        let minCost = undefined;\n        let maxCost = undefined;\n        let minPrice = undefined;\n        let maxPrice = undefined;\n        let amountPrecision = undefined;\n        for (let i = 0; i < filters.length; i++) {\n            const entry = filters[i];\n            const filter = this.safeString (entry, 'filter');\n            if (filter === 'QUANTITY') {\n                minAmount = this.safeNumber (entry, 'min');\n                maxAmount = this.safeNumber (entry, 'max');\n                amountPrecision = this.safeNumber (entry, 'tickSize');\n            }\n            if (filter === 'QUOTE_QTY') {\n                minCost = this.safeNumber (entry, 'min');\n            }\n            if (filter === 'PRICE') {\n                minPrice = this.safeNumber (entry, 'min');\n                maxPrice = this.safeNumber (entry, 'max');\n            }\n        }\n        if (amountPrecision === undefined) {\n            amountPrecision = this.parseNumber (this.parsePrecision (this.safeString (market, 'quantityPrecision')));\n        }\n        const underlyingType = this.safeString (market, 'underlyingType');\n        let linear = undefined;\n        let inverse = undefined;\n        let settleId = undefined;\n        let settle = undefined;\n        let expiry = undefined;\n        let future = false;\n        let swap = false;\n        let contract = false;\n        let spot = true;\n        let type = 'spot';\n        if (underlyingType === 'U_BASED') {\n            symbol = symbol + ':' + quote;\n            settleId = baseId;\n            settle = quote;\n            linear = true;\n            inverse = false;\n        } else if (underlyingType === 'COIN_BASED') {\n            symbol = symbol + ':' + base;\n            settleId = baseId;\n            settle = base;\n            linear = false;\n            inverse = true;\n        }\n        if (underlyingType !== undefined) {\n            expiry = this.safeInteger (market, 'deliveryDate');\n            const productType = this.safeString (market, 'productType');\n            if (productType !== 'perpetual') {\n                symbol = symbol + '-' + this.yymmdd (expiry);\n                type = 'future';\n                future = true;\n            } else {\n                type = 'swap';\n                swap = true;\n            }\n            minAmount = this.safeNumber (market, 'minQty');\n            minCost = this.safeNumber (market, 'minNotional');\n            maxCost = this.safeNumber (market, 'maxNotional');\n            minPrice = this.safeNumber (market, 'minPrice');\n            maxPrice = this.safeNumber (market, 'maxPrice');\n            contract = true;\n            spot = false;\n        }\n        let isActive = false;\n        if (contract) {\n            isActive = this.safeValue (market, 'isOpenApi', false);\n        } else {\n            if ((state === 'ONLINE') && (this.safeValue (market, 'tradingEnabled')) && (this.safeValue (market, 'openapiEnabled'))) {\n                isActive = true;\n            }\n        }\n        return this.safeMarketStructure ({\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': settle,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': settleId,\n            'type': type,\n            'spot': spot,\n            'margin': undefined,\n            'swap': swap,\n            'future': future,\n            'option': false,\n            'active': isActive,\n            'contract': contract,\n            'linear': linear,\n            'inverse': inverse,\n            'taker': this.safeNumber (market, 'takerFee'),\n            'maker': this.safeNumber (market, 'makerFee'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'expiry': expiry,\n            'expiryDatetime': this.iso8601 (expiry),\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision'))),\n                'amount': amountPrecision,\n                'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'baseCoinPrecision'))),\n                'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteCoinPrecision'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': this.parseNumber ('1'),\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': minAmount,\n                    'max': maxAmount,\n                },\n                'price': {\n                    'min': minPrice,\n                    'max': maxPrice,\n                },\n                'cost': {\n                    'min': minCost,\n                    'max': maxCost,\n                },\n            },\n            'info': market,\n        });\n    }"
      },
      {
        "name": "parseMarketLeverageTiers",
        "signature": "parseMarketLeverageTiers (info, market = undefined): LeverageTier[]",
        "line_start": 4331,
        "line_end": 4367,
        "comment": null,
        "mappings": [
          {
            "key": "tier",
            "value": "this.safeInteger (tier, 'bracket')",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market, '_', 'contract')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "market['settle']",
            "comment": null
          },
          {
            "key": "minNotional",
            "value": "this.safeNumber (brackets[i - 1], 'maxNominalValue', 0)",
            "comment": null
          },
          {
            "key": "maxNotional",
            "value": "this.safeNumber (tier, 'maxNominalValue')",
            "comment": null
          },
          {
            "key": "maintenanceMarginRate",
            "value": "this.safeNumber (tier, 'maintMarginRate')",
            "comment": null
          },
          {
            "key": "maxLeverage",
            "value": "this.safeNumber (tier, 'maxLeverage')",
            "comment": null
          },
          {
            "key": "info",
            "value": "tier",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"rad_usdt\",\n         \"leverageBrackets\": [\n             {\n                 \"symbol\": \"rad_usdt\",\n                 \"bracket\": 1,\n                 \"maxNominalValue\": \"5000\",\n                 \"maintMarginRate\": \"0.025\",\n                 \"startMarginRate\": \"0.05\",\n                 \"maxStartMarginRate\": null,\n                 \"maxLeverage\": \"20\",\n                 \"minLeverage\": \"1\"\n             },\n         ]\n     }"
        ],
        "source": "parseMarketLeverageTiers (info, market = undefined): LeverageTier[] {\n        //\n        //     {\n        //         \"symbol\": \"rad_usdt\",\n        //         \"leverageBrackets\": [\n        //             {\n        //                 \"symbol\": \"rad_usdt\",\n        //                 \"bracket\": 1,\n        //                 \"maxNominalValue\": \"5000\",\n        //                 \"maintMarginRate\": \"0.025\",\n        //                 \"startMarginRate\": \"0.05\",\n        //                 \"maxStartMarginRate\": null,\n        //                 \"maxLeverage\": \"20\",\n        //                 \"minLeverage\": \"1\"\n        //             },\n        //         ]\n        //     }\n        //\n        const tiers = [];\n        const brackets = this.safeValue (info, 'leverageBrackets', []);\n        for (let i = 0; i < brackets.length; i++) {\n            const tier = brackets[i];\n            const marketId = this.safeString (info, 'symbol');\n            market = this.safeMarket (marketId, market, '_', 'contract');\n            tiers.push ({\n                'tier': this.safeInteger (tier, 'bracket'),\n                'symbol': this.safeSymbol (marketId, market, '_', 'contract'),\n                'currency': market['settle'],\n                'minNotional': this.safeNumber (brackets[i - 1], 'maxNominalValue', 0),\n                'maxNotional': this.safeNumber (tier, 'maxNominalValue'),\n                'maintenanceMarginRate': this.safeNumber (tier, 'maintMarginRate'),\n                'maxLeverage': this.safeNumber (tier, 'maxLeverage'),\n                'info': tier,\n            });\n        }\n        return tiers as LeverageTier[];\n    }"
      },
      {
        "name": "parseMarkets",
        "signature": "parseMarkets (markets)",
        "line_start": 1131,
        "line_end": 1137,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseMarkets (markets) {\n        const result = [];\n        for (let i = 0; i < markets.length; i++) {\n            result.push (this.parseMarket (markets[i]));\n        }\n        return result;\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1488,
        "line_end": 1525,
        "comment": null,
        "mappings": [],
        "examples": [
          "{\n         \"t\": 1678167720000,\n         \"o\": \"22467.85\",\n         \"c\": \"22465.87\",\n         \"h\": \"22468.86\",\n         \"l\": \"22465.21\",\n         \"q\": \"1.316656\",\n         \"v\": \"29582.73018498\"\n     }",
          "{\n         \"s\": \"btc_usdt\",\n         \"p\": \"btc_usdt\",\n         \"t\": 1678168020000,\n         \"o\": \"22450.0\",\n         \"c\": \"22441.5\",\n         \"h\": \"22450.0\",\n         \"l\": \"22441.5\",\n         \"a\": \"312931\",\n         \"v\": \"702461.58895\"\n     }"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        // spot\n        //\n        //     {\n        //         \"t\": 1678167720000,\n        //         \"o\": \"22467.85\",\n        //         \"c\": \"22465.87\",\n        //         \"h\": \"22468.86\",\n        //         \"l\": \"22465.21\",\n        //         \"q\": \"1.316656\",\n        //         \"v\": \"29582.73018498\"\n        //     }\n        //\n        // swap and future\n        //\n        //     {\n        //         \"s\": \"btc_usdt\",\n        //         \"p\": \"btc_usdt\",\n        //         \"t\": 1678168020000,\n        //         \"o\": \"22450.0\",\n        //         \"c\": \"22441.5\",\n        //         \"h\": \"22450.0\",\n        //         \"l\": \"22441.5\",\n        //         \"a\": \"312931\",\n        //         \"v\": \"702461.58895\"\n        //     }\n        //\n        const volumeIndex = (market['inverse']) ? 'v' : 'a';\n        return [\n            this.safeInteger (ohlcv, 't'),\n            this.safeNumber (ohlcv, 'o'),\n            this.safeNumber (ohlcv, 'h'),\n            this.safeNumber (ohlcv, 'l'),\n            this.safeNumber (ohlcv, 'c'),\n            this.safeNumber2 (ohlcv, 'q', volumeIndex),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order, market = undefined)",
        "line_start": 3467,
        "line_end": 3633,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (order, [ 'orderId', 'result', 'cancelId', 'entrustId', 'profitId' ])",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "this.safeString2 (order, 'clientOrderId', 'clientModifyId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "lastUpdatedTimestamp",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "lastUpdatedTimestamp",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower2 (order, 'type', 'orderType')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "this.safeString (order, 'timeInForce')",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower2 (order, 'side', 'orderSide')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeNumber (order, 'price')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "this.safeNumber (order, 'stopPrice')",
            "comment": null
          },
          {
            "key": "stopLoss",
            "value": "this.safeNumber (order, 'triggerStopPrice')",
            "comment": null
          },
          {
            "key": "takeProfit",
            "value": "this.safeNumber (order, 'triggerProfitPrice')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "this.safeNumber (order, 'leavingQty')",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeNumber (order, 'avgPrice')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseOrderStatus (this.safeString (order, 'state'))",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': this.safeCurrencyCode (this.safeString (order, 'feeCurrency')),\n                'cost': this.safeNumber (order, 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString (order, 'feeCurrency'))",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeNumber (order, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"orderId\": \"204371980095156544\"\n     }",
          "{\n         \"cancelId\": \"208322474307982720\"\n     }",
          "{\n         \"returnCode\": 0,\n         \"msgInfo\": \"success\",\n         \"error\": null,\n         \"result\": \"206410760006650176\"\n     }",
          "{\n         \"symbol\": \"btc_usdt\",\n         \"orderId\": \"207505997850909952\",\n         \"clientOrderId\": null,\n         \"baseCurrency\": \"btc\",\n         \"quoteCurrency\": \"usdt\",\n         \"side\": \"BUY\",\n         \"type\": \"LIMIT\",\n         \"timeInForce\": \"GTC\",\n         \"price\": \"20000.00\",\n         \"origQty\": \"0.001000\",\n         \"origQuoteQty\": \"20.00\",\n         \"executedQty\": \"0.000000\",\n         \"leavingQty\": \"0.001000\",\n         \"tradeBase\": \"0.000000\",\n         \"tradeQuote\": \"0.00\",\n         \"avgPrice\": null,\n         \"fee\": null,\n         \"feeCurrency\": null,\n         \"closed\": false,\n         \"state\": \"NEW\",\n         \"time\": 1679175285162,\n         \"updatedTime\": 1679175285255\n     }",
          "{\n         \"orderId\": \"207519546930995456\",\n         \"clientOrderId\": null,\n         \"symbol\": \"btc_usdt\",\n         \"orderType\": \"LIMIT\",\n         \"orderSide\": \"BUY\",\n         \"positionSide\": \"LONG\",\n         \"timeInForce\": \"GTC\",\n         \"closePosition\": false,\n         \"price\": \"20000\",\n         \"origQty\": \"100\",\n         \"avgPrice\": \"0\",\n         \"executedQty\": \"0\",\n         \"marginFrozen\": \"4.12\",\n         \"remark\": null,\n         \"triggerProfitPrice\": null,\n         \"triggerStopPrice\": null,\n         \"sourceId\": null,\n         \"sourceType\": \"DEFAULT\",\n         \"forceClose\": false,\n         \"closeProfit\": null,\n         \"state\": \"CANCELED\",\n         \"createdTime\": 1679178515689,\n         \"updatedTime\": 1679180096172\n     }"
        ],
        "source": "parseOrder (order, market = undefined) {\n        //\n        // spot: createOrder\n        //\n        //     {\n        //         \"orderId\": \"204371980095156544\"\n        //     }\n        //\n        // spot: cancelOrder\n        //\n        //     {\n        //         \"cancelId\": \"208322474307982720\"\n        //     }\n        //\n        // swap and future: createOrder, cancelOrder, editOrder\n        //\n        //     {\n        //         \"returnCode\": 0,\n        //         \"msgInfo\": \"success\",\n        //         \"error\": null,\n        //         \"result\": \"206410760006650176\"\n        //     }\n        //\n        // spot: fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders, fetchOrdersByStatus\n        //\n        //     {\n        //         \"symbol\": \"btc_usdt\",\n        //         \"orderId\": \"207505997850909952\",\n        //         \"clientOrderId\": null,\n        //         \"baseCurrency\": \"btc\",\n        //         \"quoteCurrency\": \"usdt\",\n        //         \"side\": \"BUY\",\n        //         \"type\": \"LIMIT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"price\": \"20000.00\",\n        //         \"origQty\": \"0.001000\",\n        //         \"origQuoteQty\": \"20.00\",\n        //         \"executedQty\": \"0.000000\",\n        //         \"leavingQty\": \"0.001000\",\n        //         \"tradeBase\": \"0.000000\",\n        //         \"tradeQuote\": \"0.00\",\n        //         \"avgPrice\": null,\n        //         \"fee\": null,\n        //         \"feeCurrency\": null,\n        //         \"closed\": false,\n        //         \"state\": \"NEW\",\n        //         \"time\": 1679175285162,\n        //         \"updatedTime\": 1679175285255\n        //     }\n        //\n        // swap and future: fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders, fetchOrdersByStatus\n        //\n        //     {\n        //         \"orderId\": \"207519546930995456\",\n        //         \"clientOrderId\": null,\n        //         \"symbol\": \"btc_usdt\",\n        //         \"orderType\": \"LIMIT\",\n        //         \"orderSide\": \"BUY\",\n        //         \"positionSide\": \"LONG\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"closePosition\": false,\n        //         \"price\": \"20000\",\n        //         \"origQty\": \"100\",\n        //         \"avgPrice\": \"0\",\n        //         \"executedQty\": \"0\",\n        //         \"marginFrozen\": \"4.12\",\n        //         \"remark\": null,\n        //         \"triggerProfitPrice\": null,\n        //         \"triggerStopPrice\": null,\n        //         \"sourceId\": null,\n        //         \"sourceType\": \"DEFAULT\",\n        //         \"forceClose\": false,\n        //         \"closeProfit\": null,\n        //         \"state\": \"CANCELED\",\n        //         \"createdTime\": 1679178515689,\n        //         \"updatedTime\": 1679180096172\n        //     }\n        //\n        // trigger: fetchOrder, fetchOrders, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders, fetchOrdersByStatus\n        //\n        //     {\n        //         \"entrustId\": \"216300248132756992\",\n        //         \"symbol\": \"btc_usdt\",\n        //         \"entrustType\": \"STOP\",\n        //         \"orderSide\": \"SELL\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"timeInForce\": \"GTC\",\n        //         \"closePosition\": null,\n        //         \"price\": \"20000\",\n        //         \"origQty\": \"1\",\n        //         \"stopPrice\": \"19000\",\n        //         \"triggerPriceType\": \"LATEST_PRICE\",\n        //         \"state\": \"NOT_TRIGGERED\",\n        //         \"marketOrderLevel\": null,\n        //         \"createdTime\": 1681271998064,\n        //         \"updatedTime\": 1681271998064,\n        //         \"ordinary\": false\n        //     }\n        //\n        // stop-loss and take-profit: fetchOrder, fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders, fetchOrdersByStatus\n        //\n        //     {\n        //         \"profitId\": \"216306213226230400\",\n        //         \"symbol\": \"btc_usdt\",\n        //         \"positionSide\": \"LONG\",\n        //         \"origQty\": \"1\",\n        //         \"triggerPriceType\": \"LATEST_PRICE\",\n        //         \"triggerProfitPrice\": null,\n        //         \"triggerStopPrice\": \"20000\",\n        //         \"entryPrice\": null,\n        //         \"positionSize\": null,\n        //         \"isolatedMargin\": null,\n        //         \"executedQty\": null,\n        //         \"avgPrice\": null,\n        //         \"positionType\": \"ISOLATED\",\n        //         \"state\": \"NOT_TRIGGERED\",\n        //         \"createdTime\": 1681273420039\n        //     }\n        //\n        // spot editOrder\n        //\n        //     {\n        //         \"orderId\": \"484203027161892224\",\n        //         \"modifyId\": \"484203544105344000\",\n        //         \"clientModifyId\": null\n        //     }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        const marketType = ('result' in order) || ('positionSide' in order) ? 'contract' : 'spot';\n        market = this.safeMarket (marketId, market, undefined, marketType);\n        const symbol = this.safeSymbol (marketId, market, undefined, marketType);\n        const timestamp = this.safeInteger2 (order, 'time', 'createdTime');\n        const quantity = this.safeNumber (order, 'origQty');\n        const amount = (marketType === 'spot') ? quantity : Precise.stringMul (this.numberToString (quantity), this.numberToString (market['contractSize']));\n        const filledQuantity = this.safeNumber (order, 'executedQty');\n        const filled = (marketType === 'spot') ? filledQuantity : Precise.stringMul (this.numberToString (filledQuantity), this.numberToString (market['contractSize']));\n        const lastUpdatedTimestamp = this.safeInteger (order, 'updatedTime');\n        return this.safeOrder ({\n            'info': order,\n            'id': this.safeStringN (order, [ 'orderId', 'result', 'cancelId', 'entrustId', 'profitId' ]),\n            'clientOrderId': this.safeString2 (order, 'clientOrderId', 'clientModifyId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': lastUpdatedTimestamp,\n            'lastUpdateTimestamp': lastUpdatedTimestamp,\n            'symbol': symbol,\n            'type': this.safeStringLower2 (order, 'type', 'orderType'),\n            'timeInForce': this.safeString (order, 'timeInForce'),\n            'postOnly': undefined,\n            'side': this.safeStringLower2 (order, 'side', 'orderSide'),\n            'price': this.safeNumber (order, 'price'),\n            'triggerPrice': this.safeNumber (order, 'stopPrice'),\n            'stopLoss': this.safeNumber (order, 'triggerStopPrice'),\n            'takeProfit': this.safeNumber (order, 'triggerProfitPrice'),\n            'amount': amount,\n            'filled': filled,\n            'remaining': this.safeNumber (order, 'leavingQty'),\n            'cost': undefined,\n            'average': this.safeNumber (order, 'avgPrice'),\n            'status': this.parseOrderStatus (this.safeString (order, 'state')),\n            'fee': {\n                'currency': this.safeCurrencyCode (this.safeString (order, 'feeCurrency')),\n                'cost': this.safeNumber (order, 'fee'),\n            },\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status)",
        "line_start": 3635,
        "line_end": 3652,
        "comment": null,
        "mappings": [
          {
            "key": "NEW",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "PARTIALLY_FILLED",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "FILLED",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "CANCELED",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "REJECTED",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "EXPIRED",
            "value": "'expired'",
            "comment": null
          },
          {
            "key": "UNFINISHED",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "NOT_TRIGGERED",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "TRIGGERING",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "TRIGGERED",
            "value": "'closed'",
            "comment": null
          },
          {
            "key": "USER_REVOCATION",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "PLATFORM_REVOCATION",
            "value": "'rejected'",
            "comment": null
          },
          {
            "key": "HISTORY",
            "value": "'expired'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseOrderStatus (status) {\n        const statuses = {\n            'NEW': 'open',\n            'PARTIALLY_FILLED': 'open',\n            'FILLED': 'closed',\n            'CANCELED': 'canceled',\n            'REJECTED': 'rejected',\n            'EXPIRED': 'expired',\n            'UNFINISHED': 'open',\n            'NOT_TRIGGERED': 'open',\n            'TRIGGERING': 'open',\n            'TRIGGERED': 'closed',\n            'USER_REVOCATION': 'canceled',\n            'PLATFORM_REVOCATION': 'rejected',\n            'HISTORY': 'expired',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position, market = undefined)",
        "line_start": 4754,
        "line_end": 4804,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "hedged",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (position, 'positionSide')",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'positionSize')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "market['contractSize']",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "notional",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "this.safeInteger (position, 'leverage')",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "collateral",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"btc_usdt\",\n         \"positionType\": \"ISOLATED\",\n         \"positionSide\": \"SHORT\",\n         \"contractType\": \"PERPETUAL\",\n         \"positionSize\": \"10\",\n         \"closeOrderSize\": \"0\",\n         \"availableCloseSize\": \"10\",\n         \"entryPrice\": \"27060\",\n         \"openOrderSize\": \"0\",\n         \"isolatedMargin\": \"1.0824\",\n         \"openOrderMarginFrozen\": \"0\",\n         \"realizedProfit\": \"-0.00130138\",\n         \"autoMargin\": false,\n         \"leverage\": 25\n     }"
        ],
        "source": "parsePosition (position, market = undefined) {\n        //\n        //     {\n        //         \"symbol\": \"btc_usdt\",\n        //         \"positionType\": \"ISOLATED\",\n        //         \"positionSide\": \"SHORT\",\n        //         \"contractType\": \"PERPETUAL\",\n        //         \"positionSize\": \"10\",\n        //         \"closeOrderSize\": \"0\",\n        //         \"availableCloseSize\": \"10\",\n        //         \"entryPrice\": \"27060\",\n        //         \"openOrderSize\": \"0\",\n        //         \"isolatedMargin\": \"1.0824\",\n        //         \"openOrderMarginFrozen\": \"0\",\n        //         \"realizedProfit\": \"-0.00130138\",\n        //         \"autoMargin\": false,\n        //         \"leverage\": 25\n        //     }\n        //\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market, undefined, 'contract');\n        const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n        const positionType = this.safeString (position, 'positionType');\n        const marginMode = (positionType === 'CROSSED') ? 'cross' : 'isolated';\n        const collateral = this.safeNumber (position, 'isolatedMargin');\n        return this.safePosition ({\n            'info': position,\n            'id': undefined,\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'hedged': undefined,\n            'side': this.safeStringLower (position, 'positionSide'),\n            'contracts': this.safeNumber (position, 'positionSize'),\n            'contractSize': market['contractSize'],\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'markPrice': undefined,\n            'notional': undefined,\n            'leverage': this.safeInteger (position, 'leverage'),\n            'collateral': collateral,\n            'initialMargin': collateral,\n            'maintenanceMargin': undefined,\n            'initialMarginPercentage': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'unrealizedPnl': undefined,\n            'liquidationPrice': undefined,\n            'marginMode': marginMode,\n            'percentage': undefined,\n            'marginRatio': undefined,\n        });\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker, market = undefined)",
        "line_start": 1829,
        "line_end": 1910,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeNumber (ticker, 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeNumber (ticker, 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'bp')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "this.safeNumber (ticker, 'bq')",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'ap')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "this.safeNumber (ticker, 'aq')",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'o')",
            "comment": null
          },
          {
            "key": "close",
            "value": "this.safeString (ticker, 'c')",
            "comment": null
          },
          {
            "key": "last",
            "value": "this.safeString (ticker, 'c')",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeNumber (ticker, 'cv')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "this.parseNumber (percentage)",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeNumber (ticker, 'a')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeNumber (ticker, 'v')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"s\": \"btc_usdt\",\n         \"t\": 1678172693931,\n         \"cv\": \"34.00\",\n         \"cr\": \"0.0015\",\n         \"o\": \"22398.05\",\n         \"l\": \"22323.72\",\n         \"h\": \"22600.50\",\n         \"c\": \"22432.05\",\n         \"q\": \"7962.256931\",\n         \"v\": \"178675209.47416856\"\n     }",
          "{\n         \"t\": 1678172848572,\n         \"s\": \"btc_usdt\",\n         \"c\": \"22415.5\",\n         \"h\": \"22590.0\",\n         \"l\": \"22310.0\",\n         \"a\": \"623654031\",\n         \"v\": \"1399166074.31675\",\n         \"o\": \"22381.5\",\n         \"r\": \"0.0015\",\n         \"i\": \"22424.5\",\n         \"m\": \"22416.5\",\n         \"bp\": \"22415\",\n         \"ap\": \"22415.5\"\n     }",
          "{\n         \"s\": \"kas_usdt\",\n         \"t\": 1679539891853,\n         \"ap\": \"0.016298\",\n         \"aq\": \"5119.09\",\n         \"bp\": \"0.016290\",\n         \"bq\": \"135.37\"\n     }"
        ],
        "source": "parseTicker (ticker, market = undefined) {\n        //\n        // spot: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"s\": \"btc_usdt\",\n        //         \"t\": 1678172693931,\n        //         \"cv\": \"34.00\",\n        //         \"cr\": \"0.0015\",\n        //         \"o\": \"22398.05\",\n        //         \"l\": \"22323.72\",\n        //         \"h\": \"22600.50\",\n        //         \"c\": \"22432.05\",\n        //         \"q\": \"7962.256931\",\n        //         \"v\": \"178675209.47416856\"\n        //     }\n        //\n        // swap and future: fetchTicker, fetchTickers\n        //\n        //     {\n        //         \"t\": 1678172848572,\n        //         \"s\": \"btc_usdt\",\n        //         \"c\": \"22415.5\",\n        //         \"h\": \"22590.0\",\n        //         \"l\": \"22310.0\",\n        //         \"a\": \"623654031\",\n        //         \"v\": \"1399166074.31675\",\n        //         \"o\": \"22381.5\",\n        //         \"r\": \"0.0015\",\n        //         \"i\": \"22424.5\",\n        //         \"m\": \"22416.5\",\n        //         \"bp\": \"22415\",\n        //         \"ap\": \"22415.5\"\n        //     }\n        //\n        // fetchBidsAsks\n        //\n        //     {\n        //         \"s\": \"kas_usdt\",\n        //         \"t\": 1679539891853,\n        //         \"ap\": \"0.016298\",\n        //         \"aq\": \"5119.09\",\n        //         \"bp\": \"0.016290\",\n        //         \"bq\": \"135.37\"\n        //     }\n        //\n        const marketId = this.safeString (ticker, 's');\n        let marketType = (market !== undefined) ? market['type'] : undefined;\n        const hasSpotKeys = ('cv' in ticker) || ('aq' in ticker);\n        if (marketType === undefined) {\n            marketType = hasSpotKeys ? 'spot' : 'contract';\n        }\n        market = this.safeMarket (marketId, market, '_', marketType);\n        const symbol = market['symbol'];\n        const timestamp = this.safeInteger (ticker, 't');\n        let percentage = this.safeString2 (ticker, 'cr', 'r');\n        if (percentage !== undefined) {\n            percentage = Precise.stringMul (percentage, '100');\n        }\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeNumber (ticker, 'h'),\n            'low': this.safeNumber (ticker, 'l'),\n            'bid': this.safeNumber (ticker, 'bp'),\n            'bidVolume': this.safeNumber (ticker, 'bq'),\n            'ask': this.safeNumber (ticker, 'ap'),\n            'askVolume': this.safeNumber (ticker, 'aq'),\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'o'),\n            'close': this.safeString (ticker, 'c'),\n            'last': this.safeString (ticker, 'c'),\n            'previousClose': undefined,\n            'change': this.safeNumber (ticker, 'cv'),\n            'percentage': this.parseNumber (percentage),\n            'average': undefined,\n            'baseVolume': this.safeNumber (ticker, 'a'),\n            'quoteVolume': this.safeNumber (ticker, 'v'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade, market = undefined)",
        "line_start": 2096,
        "line_end": 2267,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeStringN (trade, [ 'i', 'tradeId', 'execId' ])",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "order",
            "value": "this.safeString2 (trade, 'orderId', 'oi')",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'orderType')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString2 (trade, 'p', 'price')",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': this.safeCurrencyCode (this.safeString2 (trade, 'feeCurrency', 'feeCoin')),\n                'cost': this.safeString (trade, 'fee'),\n            }",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (this.safeString2 (trade, 'feeCurrency', 'feeCoin'))",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"i\": 203530723141917063,\n         \"t\": 1678227505815,\n         \"p\": \"22038.81\",\n         \"q\": \"0.000978\",\n         \"v\": \"21.55395618\",\n         \"b\": true\n     }",
          "{\n        s: 'btc_usdt',\n        i: '228825383103928709',\n        t: 1684258222702,\n        p: '27003.65',\n        q: '0.000796',\n        b: true\n    }",
          "{\n        \"s\": \"btc_usdt\",                // symbol\n        \"t\": 1656043204763,             // time\n        \"i\": \"6316559590087251233\",     // tradeId\n        \"oi\": \"6216559590087220004\",    // orderId\n        \"p\": \"30000\",                   // trade price\n        \"q\": \"3\",                       // qty quantity\n        \"v\": \"90000\"                    // volume trade amount\n    }",
          "{\n         \"t\": 1678227683897,\n         \"s\": \"btc_usdt\",\n         \"p\": \"22031\",\n         \"a\": \"1067\",\n         \"m\": \"BID\"\n     }",
          "{\n         \"symbol\": \"btc_usdt\",\n         \"tradeId\": \"206906233569974658\",\n         \"orderId\": \"206906233178463488\",\n         \"orderSide\": \"SELL\",\n         \"orderType\": \"MARKET\",\n         \"bizType\": \"SPOT\",\n         \"time\": 1679032290215,\n         \"price\": \"25703.46\",\n         \"quantity\": \"0.000099\",\n         \"quoteQty\": \"2.54464254\",\n         \"baseCurrency\": \"btc\",\n         \"quoteCurrency\": \"usdt\",\n         \"fee\": \"0.00508929\",\n         \"feeCurrency\": \"usdt\",\n         \"takerMaker\": \"TAKER\"\n     }"
        ],
        "source": "parseTrade (trade, market = undefined) {\n        //\n        // spot: fetchTrades\n        //\n        //     {\n        //         \"i\": 203530723141917063,\n        //         \"t\": 1678227505815,\n        //         \"p\": \"22038.81\",\n        //         \"q\": \"0.000978\",\n        //         \"v\": \"21.55395618\",\n        //         \"b\": true\n        //     }\n        //\n        // spot: watchTrades\n        //\n        //    {\n        //        s: 'btc_usdt',\n        //        i: '228825383103928709',\n        //        t: 1684258222702,\n        //        p: '27003.65',\n        //        q: '0.000796',\n        //        b: true\n        //    }\n        //\n        // spot: watchMyTrades\n        //\n        //    {\n        //        \"s\": \"btc_usdt\",                // symbol\n        //        \"t\": 1656043204763,             // time\n        //        \"i\": \"6316559590087251233\",     // tradeId\n        //        \"oi\": \"6216559590087220004\",    // orderId\n        //        \"p\": \"30000\",                   // trade price\n        //        \"q\": \"3\",                       // qty quantity\n        //        \"v\": \"90000\"                    // volume trade amount\n        //    }\n        //\n        // swap and future: fetchTrades\n        //\n        //     {\n        //         \"t\": 1678227683897,\n        //         \"s\": \"btc_usdt\",\n        //         \"p\": \"22031\",\n        //         \"a\": \"1067\",\n        //         \"m\": \"BID\"\n        //     }\n        //\n        // spot: fetchMyTrades\n        //\n        //     {\n        //         \"symbol\": \"btc_usdt\",\n        //         \"tradeId\": \"206906233569974658\",\n        //         \"orderId\": \"206906233178463488\",\n        //         \"orderSide\": \"SELL\",\n        //         \"orderType\": \"MARKET\",\n        //         \"bizType\": \"SPOT\",\n        //         \"time\": 1679032290215,\n        //         \"price\": \"25703.46\",\n        //         \"quantity\": \"0.000099\",\n        //         \"quoteQty\": \"2.54464254\",\n        //         \"baseCurrency\": \"btc\",\n        //         \"quoteCurrency\": \"usdt\",\n        //         \"fee\": \"0.00508929\",\n        //         \"feeCurrency\": \"usdt\",\n        //         \"takerMaker\": \"TAKER\"\n        //     }\n        //\n        // swap and future: fetchMyTrades\n        //\n        //     {\n        //         \"orderId\": \"207260566170987200\",\n        //         \"execId\": \"207260566790603265\",\n        //         \"symbol\": \"btc_usdt\",\n        //         \"quantity\": \"13\",\n        //         \"price\": \"27368\",\n        //         \"fee\": \"0.02134704\",\n        //         \"feeCoin\": \"usdt\",\n        //         \"timestamp\": 1679116769838,\n        //         \"takerMaker\": \"TAKER\"\n        //     }\n        //\n        // contract watchMyTrades\n        //\n        //    {\n        //        \"symbol\": 'btc_usdt',\n        //        \"orderSide\": 'SELL',\n        //        \"positionSide\": 'LONG',\n        //        \"orderId\": '231485367663419328',\n        //        \"price\": '27152.7',\n        //        \"quantity\": '33',\n        //        \"marginUnfrozen\": '2.85318000',\n        //        \"timestamp\": 1684892412565\n        //    }\n        //\n        // watchMyTrades (ws, swap)\n        //\n        //    {\n        //        'fee': '0.04080840',\n        //        'isMaker': False,\n        //        'marginUnfrozen': '0.75711984',\n        //        'orderId': '376172779053188416',\n        //        'orderSide': 'BUY',\n        //        'positionSide': 'LONG',\n        //        'price': '3400.70',\n        //        'quantity': '2',\n        //        'symbol': 'eth_usdt',\n        //        'timestamp': 1719388579622\n        //    }\n        //\n        const marketId = this.safeString2 (trade, 's', 'symbol');\n        let marketType = (market !== undefined) ? market['type'] : undefined;\n        const hasSpotKeys = ('b' in trade) || ('bizType' in trade) || ('oi' in trade);\n        if (marketType === undefined) {\n            marketType = hasSpotKeys ? 'spot' : 'contract';\n        }\n        market = this.safeMarket (marketId, market, '_', marketType);\n        let side = undefined;\n        let takerOrMaker = undefined;\n        const isBuyerMaker = this.safeBool (trade, 'b');\n        if (isBuyerMaker !== undefined) {\n            side = isBuyerMaker ? 'sell' : 'buy';\n            takerOrMaker = 'taker'; // public trades always taker\n        } else {\n            const takerMaker = this.safeStringLower (trade, 'takerMaker');\n            if (takerMaker !== undefined) {\n                takerOrMaker = takerMaker;\n            } else {\n                const isMaker = this.safeBool (trade, 'isMaker');\n                if (isMaker !== undefined) {\n                    takerOrMaker = isMaker ? 'maker' : 'taker';\n                }\n            }\n            const orderSide = this.safeStringLower (trade, 'orderSide');\n            if (orderSide !== undefined) {\n                side = orderSide;\n            } else {\n                const bidOrAsk = this.safeString (trade, 'm');\n                if (bidOrAsk !== undefined) {\n                    side = (bidOrAsk === 'BID') ? 'buy' : 'sell';\n                }\n            }\n        }\n        const timestamp = this.safeIntegerN (trade, [ 't', 'time', 'timestamp' ]);\n        const quantity = this.safeString2 (trade, 'q', 'quantity');\n        let amount = undefined;\n        if (marketType === 'spot') {\n            amount = quantity;\n        } else {\n            if (quantity === undefined) {\n                amount = Precise.stringMul (this.safeString (trade, 'a'), this.numberToString (market['contractSize']));\n            } else {\n                amount = Precise.stringMul (quantity, this.numberToString (market['contractSize']));\n            }\n        }\n        return this.safeTrade ({\n            'info': trade,\n            'id': this.safeStringN (trade, [ 'i', 'tradeId', 'execId' ]),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': market['symbol'],\n            'order': this.safeString2 (trade, 'orderId', 'oi'),\n            'type': this.safeStringLower (trade, 'orderType'),\n            'side': side,\n            'takerOrMaker': takerOrMaker,\n            'price': this.safeString2 (trade, 'p', 'price'),\n            'amount': amount,\n            'cost': undefined,\n            'fee': {\n                'currency': this.safeCurrencyCode (this.safeString2 (trade, 'feeCurrency', 'feeCoin')),\n                'cost': this.safeString (trade, 'fee'),\n            },\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 3986,
        "line_end": 4060,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'transactionId')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "this.safeString (transaction, 'fromAddr')",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "address",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "memo",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (transaction, 'amount')",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currencyCode",
            "comment": null
          },
          {
            "key": "network",
            "value": "this.networkIdToCode (networkId, currencyCode)",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransactionStatus (this.safeString (transaction, 'status'))",
            "comment": null
          },
          {
            "key": "comment",
            "value": "memo",
            "comment": null
          },
          {
            "key": "fee",
            "value": "{\n                'currency': feeCurrency,\n                'cost': fee,\n                'rate': undefined,\n            }",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrency",
            "comment": null
          },
          {
            "key": "cost",
            "value": "fee",
            "comment": null
          },
          {
            "key": "rate",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 170368702,\n         \"currency\": \"usdt\",\n         \"chain\": \"Ethereum\",\n         \"memo\": \"\",\n         \"status\": \"SUCCESS\",\n         \"amount\": \"31.792528\",\n         \"confirmations\": 12,\n         \"transactionId\": \"0x90b8487c258b81b85e15e461b1839c49d4d8e6e9de4c1adb658cd47d4f5c5321\",\n         \"address\": \"0x7f7172cf29d3846d30ca5a3aec1120b92dbd150b\",\n         \"fromAddr\": \"0x7830c87c02e56aff27fa9ab1241711331fa86f58\",\n         \"createdTime\": 1678491442000\n     }",
          "{\n         \"id\": 950898,\n         \"currency\": \"usdt\",\n         \"chain\": \"Tron\",\n         \"address\": \"TGB2vxTjiqraVZBy7YHXF8V3CSMVhQKcaf\",\n         \"memo\": \"\",\n         \"status\": \"SUCCESS\",\n         \"amount\": \"5\",\n         \"fee\": \"2\",\n         \"confirmations\": 6,\n         \"transactionId\": \"c36e230b879842b1d7afd19d15ee1a866e26eaa0626e367d6f545d2932a15156\",\n         \"createdTime\": 1680049062000\n     }",
          "{\n         \"id\": 950898\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // fetchDeposits\n        //\n        //     {\n        //         \"id\": 170368702,\n        //         \"currency\": \"usdt\",\n        //         \"chain\": \"Ethereum\",\n        //         \"memo\": \"\",\n        //         \"status\": \"SUCCESS\",\n        //         \"amount\": \"31.792528\",\n        //         \"confirmations\": 12,\n        //         \"transactionId\": \"0x90b8487c258b81b85e15e461b1839c49d4d8e6e9de4c1adb658cd47d4f5c5321\",\n        //         \"address\": \"0x7f7172cf29d3846d30ca5a3aec1120b92dbd150b\",\n        //         \"fromAddr\": \"0x7830c87c02e56aff27fa9ab1241711331fa86f58\",\n        //         \"createdTime\": 1678491442000\n        //     }\n        //\n        // fetchWithdrawals\n        //\n        //     {\n        //         \"id\": 950898,\n        //         \"currency\": \"usdt\",\n        //         \"chain\": \"Tron\",\n        //         \"address\": \"TGB2vxTjiqraVZBy7YHXF8V3CSMVhQKcaf\",\n        //         \"memo\": \"\",\n        //         \"status\": \"SUCCESS\",\n        //         \"amount\": \"5\",\n        //         \"fee\": \"2\",\n        //         \"confirmations\": 6,\n        //         \"transactionId\": \"c36e230b879842b1d7afd19d15ee1a866e26eaa0626e367d6f545d2932a15156\",\n        //         \"createdTime\": 1680049062000\n        //     }\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": 950898\n        //     }\n        //\n        const type = ('fromAddr' in transaction) ? 'deposit' : 'withdraw';\n        const timestamp = this.safeInteger (transaction, 'createdTime');\n        const address = this.safeString (transaction, 'address');\n        const memo = this.safeString (transaction, 'memo');\n        const currencyCode = this.safeCurrencyCode (this.safeString (transaction, 'currency'), currency);\n        const fee = this.safeNumber (transaction, 'fee');\n        const feeCurrency = (fee !== undefined) ? currencyCode : undefined;\n        const networkId = this.safeString (transaction, 'chain');\n        return {\n            'info': transaction,\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'transactionId'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'updated': undefined,\n            'addressFrom': this.safeString (transaction, 'fromAddr'),\n            'addressTo': address,\n            'address': address,\n            'tagFrom': undefined,\n            'tagTo': undefined,\n            'tag': memo,\n            'type': type,\n            'amount': this.safeNumber (transaction, 'amount'),\n            'currency': currencyCode,\n            'network': this.networkIdToCode (networkId, currencyCode),\n            'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n            'comment': memo,\n            'fee': {\n                'currency': feeCurrency,\n                'cost': fee,\n                'rate': undefined,\n            },\n            'internal': undefined,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransactionStatus",
        "signature": "parseTransactionStatus (status)",
        "line_start": 4062,
        "line_end": 4073,
        "comment": null,
        "mappings": [
          {
            "key": "SUBMIT",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "REVIEW",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "AUDITED",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "PENDING",
            "value": "'pending'",
            "comment": null
          },
          {
            "key": "CANCEL",
            "value": "'canceled'",
            "comment": null
          },
          {
            "key": "FAIL",
            "value": "'failed'",
            "comment": null
          },
          {
            "key": "SUCCESS",
            "value": "'ok'",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransactionStatus (status) {\n        const statuses = {\n            'SUBMIT': 'pending',\n            'REVIEW': 'pending',\n            'AUDITED': 'pending',\n            'PENDING': 'pending',\n            'CANCEL': 'canceled',\n            'FAIL': 'failed',\n            'SUCCESS': 'ok',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer, currency = undefined)",
        "line_start": 4849,
        "line_end": 4861,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (transfer, 'result')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTransfer (transfer, currency = undefined) {\n        return {\n            'info': transfer,\n            'id': this.safeString (transfer, 'result'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': undefined,\n            'amount': undefined,\n            'fromAccount': undefined,\n            'toAccount': undefined,\n            'status': undefined,\n        };\n    }"
      }
    ],
    "yobit": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 386,
        "line_end": 406,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeDict (response, 'return', {});\n        const timestamp = this.safeInteger (balances, 'server_time');\n        const result: Dict = {\n            'info': response,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n        const free = this.safeDict (balances, 'funds', {});\n        const total = this.safeDict (balances, 'funds_incl_orders', {});\n        const currencyIds = Object.keys (this.extend (free, total));\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['free'] = this.safeString (free, currencyId);\n            account['total'] = this.safeString (total, currencyId);\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1018,
        "line_end": 1119,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "filled",
            "value": "filled",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"received\":0,\n          \"remains\":10,\n          \"order_id\":1101103635125179,\n          \"funds\": {\n              \"usdt\":27.84756553,\n              \"usdttrc20\":0,\n              \"doge\":19.98327206\n          },\n          \"funds_incl_orders\": {\n              \"usdt\":30.35256553,\n              \"usdttrc20\":0,\n              \"doge\":19.98327206\n          },\n          \"server_time\":1650114256\n      }",
          "{\n          \"id: \"1101103635103335\",  // id-field is manually added in fetchOrder () from exchange response id-order dictionary structure\n          \"pair\":\"doge_usdt\",\n          \"type\":\"buy\",\n          \"start_amount\":10,\n          \"amount\":10,\n          \"rate\":0.05,\n          \"timestamp_created\":\"1650112553\",\n          \"status\":0\n      }",
          "{\n          \"id\":\"1101103635103335\", // id-field is manually added in fetchOpenOrders () from exchange response id-order dictionary structure\n          \"pair\":\"doge_usdt\",\n          \"type\":\"buy\",\n          \"amount\":10,\n          \"rate\":0.05,\n          \"timestamp_created\":\"1650112553\",\n          \"status\":0\n      }",
          "{\n          \"order_id\":1101103634000197,\n          \"funds\": {\n              \"usdt\":31.81275443,\n              \"usdttrc20\":0,\n              \"doge\":9.98327206\n          },\n          \"funds_incl_orders\": {\n              \"usdt\":31.81275443,\n              \"usdttrc20\":0,\n              \"doge\":9.98327206\n          }\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        // createOrder (private)\n        //\n        //      {\n        //          \"received\":0,\n        //          \"remains\":10,\n        //          \"order_id\":1101103635125179,\n        //          \"funds\": {\n        //              \"usdt\":27.84756553,\n        //              \"usdttrc20\":0,\n        //              \"doge\":19.98327206\n        //          },\n        //          \"funds_incl_orders\": {\n        //              \"usdt\":30.35256553,\n        //              \"usdttrc20\":0,\n        //              \"doge\":19.98327206\n        //          },\n        //          \"server_time\":1650114256\n        //      }\n        //\n        // fetchOrder (private)\n        //\n        //      {\n        //          \"id: \"1101103635103335\",  // id-field is manually added in fetchOrder () from exchange response id-order dictionary structure\n        //          \"pair\":\"doge_usdt\",\n        //          \"type\":\"buy\",\n        //          \"start_amount\":10,\n        //          \"amount\":10,\n        //          \"rate\":0.05,\n        //          \"timestamp_created\":\"1650112553\",\n        //          \"status\":0\n        //      }\n        //\n        // fetchOpenOrders (private)\n        //\n        //      {\n        //          \"id\":\"1101103635103335\", // id-field is manually added in fetchOpenOrders () from exchange response id-order dictionary structure\n        //          \"pair\":\"doge_usdt\",\n        //          \"type\":\"buy\",\n        //          \"amount\":10,\n        //          \"rate\":0.05,\n        //          \"timestamp_created\":\"1650112553\",\n        //          \"status\":0\n        //      }\n        //\n        // cancelOrder (private)\n        //\n        //      {\n        //          \"order_id\":1101103634000197,\n        //          \"funds\": {\n        //              \"usdt\":31.81275443,\n        //              \"usdttrc20\":0,\n        //              \"doge\":9.98327206\n        //          },\n        //          \"funds_incl_orders\": {\n        //              \"usdt\":31.81275443,\n        //              \"usdttrc20\":0,\n        //              \"doge\":9.98327206\n        //          }\n        //      }\n        //\n        let id = this.safeString2 (order, 'id', 'order_id');\n        let status = this.parseOrderStatus (this.safeString (order, 'status', 'open'));\n        if (id === '0') {\n            id = this.safeString (order, 'init_order_id');\n            status = 'closed';\n        }\n        const timestamp = this.safeTimestamp2 (order, 'timestamp_created', 'server_time');\n        const marketId = this.safeString (order, 'pair');\n        const symbol = this.safeSymbol (marketId, market);\n        const amount = this.safeString (order, 'start_amount');\n        const remaining = this.safeString2 (order, 'amount', 'remains');\n        const filled = this.safeString (order, 'received', '0.0');\n        const price = this.safeString (order, 'rate');\n        const fee = undefined;\n        const type = 'limit';\n        const side = this.safeString (order, 'type');\n        return this.safeOrder ({\n            'info': order,\n            'id': id,\n            'clientOrderId': undefined,\n            'symbol': symbol,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'type': type,\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'amount': amount,\n            'remaining': remaining,\n            'filled': filled,\n            'status': status,\n            'fee': fee,\n            'average': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseOrderStatus",
        "signature": "parseOrderStatus (status: Str)",
        "line_start": 1008,
        "line_end": 1016,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseOrderStatus (status: Str) {\n        const statuses: Dict = {\n            '0': 'open',\n            '1': 'closed',\n            '2': 'canceled',\n            '3': 'open', // or partially-filled and canceled? https://github.com/ccxt/ccxt/issues/1594\n        };\n        return this.safeString (statuses, status, status);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 615,
        "line_end": 653,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (undefined, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'buy')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'sell')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'avg')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'vol_cur')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'vol')",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"high\": 0.03497582,\n         \"low\": 0.03248474,\n         \"avg\": 0.03373028,\n         \"vol\": 120.11485715062999,\n         \"vol_cur\": 3572.24914074,\n         \"last\": 0.0337611,\n         \"buy\": 0.0337442,\n         \"sell\": 0.03377798,\n         \"updated\": 1537522009\n     }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     {\n        //         \"high\": 0.03497582,\n        //         \"low\": 0.03248474,\n        //         \"avg\": 0.03373028,\n        //         \"vol\": 120.11485715062999,\n        //         \"vol_cur\": 3572.24914074,\n        //         \"last\": 0.0337611,\n        //         \"buy\": 0.0337442,\n        //         \"sell\": 0.03377798,\n        //         \"updated\": 1537522009\n        //     }\n        //\n        const timestamp = this.safeTimestamp (ticker, 'updated');\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': this.safeSymbol (undefined, market),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'buy'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'sell'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': this.safeString (ticker, 'avg'),\n            'baseVolume': this.safeString (ticker, 'vol_cur'),\n            'quoteVolume': this.safeString (ticker, 'vol'),\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 742,
        "line_end": 819,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "cost",
            "value": "feeCostString",
            "comment": null
          },
          {
            "key": "currency",
            "value": "feeCurrencyCode",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"type\":\"bid\",\n          \"price\":0.14046179,\n          \"amount\":0.001,\n          \"tid\":200256901,\n          \"timestamp\":1649861004\n      }",
          "{\n          \"pair\":\"doge_usdt\",\n          \"type\":\"sell\",\n          \"amount\":139,\n          \"rate\":0.139,\n          \"order_id\":\"2101103631773172\",\n          \"is_your_order\":1,\n          \"timestamp\":\"1649861561\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"type\":\"bid\",\n        //          \"price\":0.14046179,\n        //          \"amount\":0.001,\n        //          \"tid\":200256901,\n        //          \"timestamp\":1649861004\n        //      }\n        //\n        // fetchMyTrades (private)\n        //\n        //      {\n        //          \"pair\":\"doge_usdt\",\n        //          \"type\":\"sell\",\n        //          \"amount\":139,\n        //          \"rate\":0.139,\n        //          \"order_id\":\"2101103631773172\",\n        //          \"is_your_order\":1,\n        //          \"timestamp\":\"1649861561\"\n        //      }\n        //\n        const timestamp = this.safeTimestamp (trade, 'timestamp');\n        let side = this.safeString (trade, 'type');\n        if (side === 'ask') {\n            side = 'sell';\n        } else if (side === 'bid') {\n            side = 'buy';\n        }\n        const priceString = this.safeString2 (trade, 'rate', 'price');\n        const id = this.safeString2 (trade, 'trade_id', 'tid');\n        const order = this.safeString (trade, 'order_id');\n        const marketId = this.safeString (trade, 'pair');\n        const symbol = this.safeSymbol (marketId, market);\n        const amountString = this.safeString (trade, 'amount');\n        // arguments for calculateFee (need to be numbers)\n        const price = this.parseNumber (priceString);\n        const amount = this.parseNumber (amountString);\n        const type = 'limit'; // all trades are still limit trades\n        let fee = undefined;\n        const feeCostString = this.safeNumber (trade, 'commission');\n        if (feeCostString !== undefined) {\n            const feeCurrencyId = this.safeString (trade, 'commissionCurrency');\n            const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n            fee = {\n                'cost': feeCostString,\n                'currency': feeCurrencyCode,\n            };\n        }\n        const isYourOrder = this.safeString (trade, 'is_your_order');\n        if (isYourOrder !== undefined) {\n            if (fee === undefined) {\n                const feeInNumbers = this.calculateFee (symbol, type, side, amount, price, 'taker');\n                fee = {\n                    'currency': this.safeString (feeInNumbers, 'currency'),\n                    'cost': this.safeString (feeInNumbers, 'cost'),\n                    'rate': this.safeString (feeInNumbers, 'rate'),\n                };\n            }\n        }\n        return this.safeTrade ({\n            'id': id,\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      }
    ],
    "zaif": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 325,
        "line_end": 350,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "response",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response, 'return', {});\n        const deposit = this.safeValue (balances, 'deposit');\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const funds = this.safeValue (balances, 'funds', {});\n        const currencyIds = Object.keys (funds);\n        for (let i = 0; i < currencyIds.length; i++) {\n            const currencyId = currencyIds[i];\n            const code = this.safeCurrencyCode (currencyId);\n            const balance = this.safeString (funds, currencyId);\n            const account = this.account ();\n            account['free'] = balance;\n            account['total'] = balance;\n            if (deposit !== undefined) {\n                if (currencyId in deposit) {\n                    account['total'] = this.safeString (deposit, currencyId);\n                }\n            }\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (market: Dict): Market",
        "line_start": 267,
        "line_end": 323,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.safeNumber (market, 'item_unit_step'),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'aux_unit_point'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'item_unit_min'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'aux_unit_min'),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "market",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (market, 'item_unit_min'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': this.safeNumber (market, 'aux_unit_min'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "this.safeNumber (market, 'aux_unit_min')",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (market: Dict): Market {\n        const id = this.safeString (market, 'currency_pair');\n        const name = this.safeString (market, 'name');\n        const [ baseId, quoteId ] = name.split ('/');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        const symbol = base + '/' + quote;\n        return {\n            'id': id,\n            'symbol': symbol,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': undefined,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': undefined, // can trade or not\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'strike': undefined,\n            'optionType': undefined,\n            'precision': {\n                'amount': this.safeNumber (market, 'item_unit_step'),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'aux_unit_point'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (market, 'item_unit_min'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': this.safeNumber (market, 'aux_unit_min'),\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': market,\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 600,
        "line_end": 654,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "'open'",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "'limit'",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"currency_pair\": \"btc_jpy\",\n         \"action\": \"ask\",\n         \"amount\": 0.03,\n         \"price\": 56000,\n         \"timestamp\": 1402021125,\n         \"comment\" : \"demo\"\n     }",
          "{\n        \"order_id\": 184,\n        \"funds\": {\n            \"jpy\": 15320,\n            \"btc\": 1.392,\n            \"mona\": 2600,\n            \"kaori\": 0.1\n        }\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"currency_pair\": \"btc_jpy\",\n        //         \"action\": \"ask\",\n        //         \"amount\": 0.03,\n        //         \"price\": 56000,\n        //         \"timestamp\": 1402021125,\n        //         \"comment\" : \"demo\"\n        //     }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        \"order_id\": 184,\n        //        \"funds\": {\n        //            \"jpy\": 15320,\n        //            \"btc\": 1.392,\n        //            \"mona\": 2600,\n        //            \"kaori\": 0.1\n        //        }\n        //    }\n        //\n        let side = this.safeString (order, 'action');\n        side = (side === 'bid') ? 'buy' : 'sell';\n        const timestamp = this.safeTimestamp (order, 'timestamp');\n        const marketId = this.safeString (order, 'currency_pair');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        const price = this.safeString (order, 'price');\n        const amount = this.safeString (order, 'amount');\n        const id = this.safeString2 (order, 'id', 'order_id');\n        return this.safeOrder ({\n            'id': id,\n            'clientOrderId': undefined,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': 'open',\n            'symbol': symbol,\n            'type': 'limit',\n            'timeInForce': undefined,\n            'postOnly': undefined,\n            'side': side,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'amount': amount,\n            'filled': undefined,\n            'remaining': undefined,\n            'trades': undefined,\n            'fee': undefined,\n            'info': order,\n            'average': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 386,
        "line_end": 425,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "vwap",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "last",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "baseVolume",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "quoteVolume",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n     \"last\": 9e-08,\n     \"high\": 1e-07,\n     \"low\": 9e-08,\n     \"vwap\": 0.0,\n     \"volume\": 135250.0,\n     \"bid\": 9e-08,\n     \"ask\": 1e-07\n }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // {\n        //     \"last\": 9e-08,\n        //     \"high\": 1e-07,\n        //     \"low\": 9e-08,\n        //     \"vwap\": 0.0,\n        //     \"volume\": 135250.0,\n        //     \"bid\": 9e-08,\n        //     \"ask\": 1e-07\n        // }\n        //\n        const symbol = this.safeSymbol (undefined, market);\n        const vwap = this.safeString (ticker, 'vwap');\n        const baseVolume = this.safeString (ticker, 'volume');\n        const quoteVolume = Precise.stringMul (baseVolume, vwap);\n        const last = this.safeString (ticker, 'last');\n        return this.safeTicker ({\n            'symbol': symbol,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': undefined,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': undefined,\n            'vwap': vwap,\n            'open': undefined,\n            'close': last,\n            'last': last,\n            'previousClose': undefined,\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': baseVolume,\n            'quoteVolume': quoteVolume,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 457,
        "line_end": 493,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "order",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"date\": 1648559414,\n          \"price\": 5880375.0,\n          \"amount\": 0.017,\n          \"tid\": 176126557,\n          \"currency_pair\": \"btc_jpy\",\n          \"trade_type\": \"ask\"\n      }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchTrades (public)\n        //\n        //      {\n        //          \"date\": 1648559414,\n        //          \"price\": 5880375.0,\n        //          \"amount\": 0.017,\n        //          \"tid\": 176126557,\n        //          \"currency_pair\": \"btc_jpy\",\n        //          \"trade_type\": \"ask\"\n        //      }\n        //\n        let side = this.safeString (trade, 'trade_type');\n        side = (side === 'bid') ? 'buy' : 'sell';\n        const timestamp = this.safeTimestamp (trade, 'date');\n        const id = this.safeString2 (trade, 'id', 'tid');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString (trade, 'amount');\n        const marketId = this.safeString (trade, 'currency_pair');\n        const symbol = this.safeSymbol (marketId, market, '_');\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': undefined,\n            'side': side,\n            'order': undefined,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'fee': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 765,
        "line_end": 810,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "this.safeString (transaction, 'txid')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": 23634,\n         \"fee\": 0.001,\n         \"txid\":,\n         \"funds\": {\n             \"jpy\": 15320,\n             \"btc\": 1.392,\n             \"xem\": 100.2,\n             \"mona\": 2600\n         }\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        //     {\n        //         \"id\": 23634,\n        //         \"fee\": 0.001,\n        //         \"txid\":,\n        //         \"funds\": {\n        //             \"jpy\": 15320,\n        //             \"btc\": 1.392,\n        //             \"xem\": 100.2,\n        //             \"mona\": 2600\n        //         }\n        //     }\n        //\n        currency = this.safeCurrency (undefined, currency);\n        let fee = undefined;\n        const feeCost = this.safeValue (transaction, 'fee');\n        if (feeCost !== undefined) {\n            fee = {\n                'cost': feeCost,\n                'currency': currency['code'],\n            };\n        }\n        return {\n            'id': this.safeString (transaction, 'id'),\n            'txid': this.safeString (transaction, 'txid'),\n            'timestamp': undefined,\n            'datetime': undefined,\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'amount': undefined,\n            'type': undefined,\n            'currency': currency['code'],\n            'status': undefined,\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': fee,\n            'info': transaction,\n        } as Transaction;\n    }"
      }
    ],
    "zebpay": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 1702,
        "line_end": 1720,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const result: Dict = {\n            'info': response,\n            'timestamp': undefined,\n            'datetime': undefined,\n        };\n        const currencyList = this.safeList (response, 'data', []);\n        for (let i = 0; i < currencyList.length; i++) {\n            const entry = currencyList[i];\n            const account = this.account ();\n            account['total'] = this.safeString (entry, 'total');\n            account['free'] = this.safeString (entry, 'free');\n            account['used'] = this.safeString (entry, 'used');\n            const currencyId = this.safeString (entry, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseLeverage",
        "signature": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage",
        "line_start": 1763,
        "line_end": 1776,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "marginMode",
            "comment": null
          },
          {
            "key": "longLeverage",
            "value": "leverageValue",
            "comment": null
          },
          {
            "key": "shortLeverage",
            "value": "leverageValueShort",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n        const marketId = this.safeString (leverage, 'symbol');\n        const info = this.safeDict (leverage, 'info');\n        const leverageValue = this.safeInteger (leverage, 'longLeverage');\n        const leverageValueShort = this.safeInteger (leverage, 'shortLeverage');\n        const marginMode = this.safeString (leverage, 'marginMode');\n        return {\n            'info': info,\n            'symbol': marketId,\n            'marginMode': marginMode,\n            'longLeverage': leverageValue,\n            'shortLeverage': leverageValueShort,\n        } as Leverage;\n    }"
      },
      {
        "name": "parseMarginModification",
        "signature": "parseMarginModification (info, market: Market = undefined): MarginModification",
        "line_start": 1844,
        "line_end": 1867,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "info",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['id']",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginMode",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.safeNumber (info, 'amount')",
            "comment": null
          },
          {
            "key": "total",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "code",
            "value": "this.safeString (info, 'code')",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.safeString (info, 'status')",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"symbol\": \"BTCINR\",\n         \"type\": \"reduce\",\n         \"amount\": 1000,\n         \"code\": \"INR\",\n         \"status\": \"ok\"\n    }"
        ],
        "source": "parseMarginModification (info, market: Market = undefined): MarginModification {\n        //\n        //    {\n        //         \"symbol\": \"BTCINR\",\n        //         \"type\": \"reduce\",\n        //         \"amount\": 1000,\n        //         \"code\": \"INR\",\n        //         \"status\": \"ok\"\n        //    }\n        //\n        const timestamp = this.milliseconds ();\n        return {\n            'info': info,\n            'symbol': market['id'],\n            'type': undefined,\n            'marginMode': undefined,\n            'amount': this.safeNumber (info, 'amount'),\n            'total': undefined,\n            'code': this.safeString (info, 'code'),\n            'status': this.safeString (info, 'status'),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n        };\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 1276,
        "line_end": 1333,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "clientOrderId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "timeInForce",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "reduceOnly",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "price",
            "value": "price",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "status",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "lastUpdateTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n          \"clientOrderId\": \"64507d02921f1c0001ff6892-123-zeb\",\n          \"datetime\": \"2025-03-14T14:34:34.4567\",\n          \"timestamp\": 1741962557553,\n          \"status\": \"open\",\n          \"symbol\": \"BTCINR\",\n          \"type\": \"market\",\n          \"timeInForce\": \"GTC\",\n          \"side\": \"buy\",\n          \"price\": 700000,\n          \"amount\": 0.002,\n          \"filled\": null,\n          \"remaining\": 0.002,\n          \"trades\": []\n      }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //      {\n        //          \"clientOrderId\": \"64507d02921f1c0001ff6892-123-zeb\",\n        //          \"datetime\": \"2025-03-14T14:34:34.4567\",\n        //          \"timestamp\": 1741962557553,\n        //          \"status\": \"open\",\n        //          \"symbol\": \"BTCINR\",\n        //          \"type\": \"market\",\n        //          \"timeInForce\": \"GTC\",\n        //          \"side\": \"buy\",\n        //          \"price\": 700000,\n        //          \"amount\": 0.002,\n        //          \"filled\": null,\n        //          \"remaining\": 0.002,\n        //          \"trades\": []\n        //      }\n        //\n        const marketId = this.safeString (order, 'symbol');\n        market = this.safeMarket (marketId, market);\n        const symbol = market['symbol'];\n        const type = this.safeString (order, 'type');\n        const timestamp = this.safeNumber (order, 'timestamp');\n        const datetime = this.iso8601 (timestamp);\n        const price = this.safeString (order, 'price');\n        const side = this.safeString (order, 'side');\n        const amount = this.safeString (order, 'amount');\n        const clientOrderId = this.safeString (order, 'clientOrderId');\n        const timeInForce = this.safeString (order, 'timeInForce');\n        const status = this.safeStringLower (order, 'status');\n        const orderId = this.safeString (order, 'orderId', undefined);\n        const parsedOrder = this.safeOrder ({\n            'id': orderId,\n            'clientOrderId': clientOrderId,\n            'symbol': symbol,\n            'type': type,\n            'timeInForce': timeInForce,\n            'postOnly': undefined,\n            'reduceOnly': undefined,\n            'side': side,\n            'amount': amount,\n            'price': price,\n            'triggerPrice': undefined,\n            'cost': undefined,\n            'filled': undefined,\n            'remaining': undefined,\n            'timestamp': timestamp,\n            'datetime': datetime,\n            'fee': undefined,\n            'status': status,\n            'info': order,\n            'lastTradeTimestamp': undefined,\n            'lastUpdateTimestamp': undefined,\n            'average': undefined,\n            'trades': undefined,\n        }, market);\n        return parsedOrder;\n    }"
      },
      {
        "name": "parsePosition",
        "signature": "parsePosition (position: Dict, market: Market = undefined)",
        "line_start": 1722,
        "line_end": 1761,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "position",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "this.parse8601 (datetime)",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "datetime",
            "comment": null
          },
          {
            "key": "initialMargin",
            "value": "this.safeNumber (position, 'initialMargin')",
            "comment": null
          },
          {
            "key": "initialMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMargin",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "maintenanceMarginPercentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "entryPrice",
            "value": "this.safeNumber (position, 'entryPrice')",
            "comment": null
          },
          {
            "key": "notional",
            "value": "this.safeNumber (position, 'notional')",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "leverage",
            "comment": null
          },
          {
            "key": "unrealizedPnl",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contracts",
            "value": "this.safeNumber (position, 'contracts')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "this.safeNumber (market, 'contractSize')",
            "comment": null
          },
          {
            "key": "marginRatio",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "liquidationPrice",
            "value": "this.safeNumber (position, 'liquidationPrice')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "collateral",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "marginType",
            "value": "'isolated'",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeString (position, 'side')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"id\":\"long\",\n        \"symbol\":\"pf_ftmusd\",\n        \"entryPrice\":\"0.4921\",\n        \"datetime\":\"2023-02-22T11:37:16.685Z\",\n        \"contractSize\":\"1\",\n        \"leverage\":\"1.0\"\n    }"
        ],
        "source": "parsePosition (position: Dict, market: Market = undefined) {\n        //\n        // isolated\n        //    {\n        //        \"id\":\"long\",\n        //        \"symbol\":\"pf_ftmusd\",\n        //        \"entryPrice\":\"0.4921\",\n        //        \"datetime\":\"2023-02-22T11:37:16.685Z\",\n        //        \"contractSize\":\"1\",\n        //        \"leverage\":\"1.0\"\n        //    }\n        //\n        const leverage = this.safeNumber (position, 'leverage');\n        const datetime = this.safeString (position, 'datetime');\n        const marketId = this.safeString (position, 'symbol');\n        market = this.safeMarket (marketId, market);\n        return {\n            'info': position,\n            'symbol': marketId,\n            'timestamp': this.parse8601 (datetime),\n            'datetime': datetime,\n            'initialMargin': this.safeNumber (position, 'initialMargin'),\n            'initialMarginPercentage': undefined,\n            'maintenanceMargin': undefined,\n            'maintenanceMarginPercentage': undefined,\n            'entryPrice': this.safeNumber (position, 'entryPrice'),\n            'notional': this.safeNumber (position, 'notional'),\n            'leverage': leverage,\n            'unrealizedPnl': undefined,\n            'contracts': this.safeNumber (position, 'contracts'),\n            'contractSize': this.safeNumber (market, 'contractSize'),\n            'marginRatio': undefined,\n            'liquidationPrice': this.safeNumber (position, 'liquidationPrice'),\n            'markPrice': undefined,\n            'collateral': undefined,\n            'marginType': 'isolated',\n            'side': this.safeString (position, 'side'),\n            'percentage': undefined,\n        };\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 1791,
        "line_end": 1842,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "marketId",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "market['symbol']",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'high')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'low')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeString (ticker, 'bid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "bidVolume",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeString (ticker, 'ask')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "askVolume",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "close",
            "value": "close",
            "comment": null
          },
          {
            "key": "last",
            "value": "last",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeString (ticker, 'previousClose')",
            "comment": null
          },
          {
            "key": "change",
            "value": "this.safeString (ticker, 'change')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "percentage",
            "comment": null
          },
          {
            "key": "average",
            "value": "this.safeString (ticker, 'average')",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'baseVolume')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "this.safeString (ticker, 'quoteVolume')",
            "comment": null
          },
          {
            "key": "markPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "[\n        {\n            \"symbol\": \"BTC-INR\",\n            \"bestBid\": \"4900000\",\n            \"bestBidQty\": \"0.00014938\",\n            \"bestAsk\": \"\",\n            \"bestAskQty\": \"0\",\n            \"priceChange\": \"-98134.56\",\n            \"priceChangePercent\": \"-1.84\",\n            \"high\": \"5433400\",\n            \"low\": \"5333400\",\n            \"vol\": \"0.0002\",\n            \"volValue\": \"1066.68\",\n            \"last\": \"5333400\"\n        }\n     ]"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        //     [\n        //        {\n        //            \"symbol\": \"BTC-INR\",\n        //            \"bestBid\": \"4900000\",\n        //            \"bestBidQty\": \"0.00014938\",\n        //            \"bestAsk\": \"\",\n        //            \"bestAskQty\": \"0\",\n        //            \"priceChange\": \"-98134.56\",\n        //            \"priceChangePercent\": \"-1.84\",\n        //            \"high\": \"5433400\",\n        //            \"low\": \"5333400\",\n        //            \"vol\": \"0.0002\",\n        //            \"volValue\": \"1066.68\",\n        //            \"last\": \"5333400\"\n        //        }\n        //     ]\n        //\n        const timestamp = this.safeInteger2 (ticker, 'timestamp', 'ts', undefined);\n        const marketId = this.safeString (ticker, 'symbol');\n        market = this.safeMarket (marketId);\n        const close = this.safeString (ticker, 'close', undefined);\n        const last = this.safeString (ticker, 'last', undefined);\n        const percentage = this.safeString (ticker, 'percentage');\n        const bidVolume = this.safeString (ticker, 'bidVolume');\n        const askVolume = this.safeString (ticker, 'askVolume');\n        return this.safeTicker ({\n            'id': marketId,\n            'symbol': market['symbol'],\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'high'),\n            'low': this.safeString (ticker, 'low'),\n            'bid': this.safeString (ticker, 'bid'),\n            'bidVolume': bidVolume,\n            'ask': this.safeString (ticker, 'ask'),\n            'askVolume': askVolume,\n            'vwap': undefined,\n            'open': undefined,\n            'close': close,\n            'last': last,\n            'previousClose': this.safeString (ticker, 'previousClose'),\n            'change': this.safeString (ticker, 'change'),\n            'percentage': percentage,\n            'average': this.safeString (ticker, 'average'),\n            'baseVolume': this.safeString (ticker, 'baseVolume'),\n            'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n            'markPrice': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 887,
        "line_end": 944,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "order",
            "value": "orderId",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeStringLower (trade, 'type')",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "this.safeString (trade, 'cost')",
            "comment": null
          },
          {
            "key": "fee",
            "value": "this.safeDict (trade, 'fee')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"32164924331503616\",\n         \"symbol\": \"LINK_USDT\",\n         \"accountType\": \"SPOT\",\n         \"orderId\": \"32164923987566592\",\n         \"side\": \"SELL\",\n         \"type\": \"MARKET\",\n         \"matchRole\": \"TAKER\",\n         \"createTime\": 1648635115525,\n         \"price\": \"11\",\n         \"quantity\": \"0.5\",\n         \"amount\": \"5.5\",\n         \"feeCurrency\": \"USDT\",\n         \"feeAmount\": \"0.007975\",\n         \"pageId\": \"32164924331503616\",\n         \"clientOrderId\": \"myOwnId-321\"\n     }",
          "{\n     aggregateTradeId: '2659115835',\n     symbol: 'ETHINR',\n     price: '292848',\n     quantity: '0.147',\n     firstTradeId: '7018766077',\n     lastTradeId: '7018766081',\n     tradeTime: '1765381971447',\n     isBuyerMarketMaker: true\n   }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // fetchMyTrades\n        //\n        //     {\n        //         \"id\": \"32164924331503616\",\n        //         \"symbol\": \"LINK_USDT\",\n        //         \"accountType\": \"SPOT\",\n        //         \"orderId\": \"32164923987566592\",\n        //         \"side\": \"SELL\",\n        //         \"type\": \"MARKET\",\n        //         \"matchRole\": \"TAKER\",\n        //         \"createTime\": 1648635115525,\n        //         \"price\": \"11\",\n        //         \"quantity\": \"0.5\",\n        //         \"amount\": \"5.5\",\n        //         \"feeCurrency\": \"USDT\",\n        //         \"feeAmount\": \"0.007975\",\n        //         \"pageId\": \"32164924331503616\",\n        //         \"clientOrderId\": \"myOwnId-321\"\n        //     }\n        //   {\n        //     aggregateTradeId: '2659115835',\n        //     symbol: 'ETHINR',\n        //     price: '292848',\n        //     quantity: '0.147',\n        //     firstTradeId: '7018766077',\n        //     lastTradeId: '7018766081',\n        //     tradeTime: '1765381971447',\n        //     isBuyerMarketMaker: true\n        //   }\n        //\n        //\n        const id = this.safeString2 (trade, 'id', 'aggregateTradeId');\n        const orderId = this.safeString2 (trade, 'id', 'order');\n        const timestamp = this.safeInteger2 (trade, 'timestamp', 'tradeTime');\n        const marketId = this.safeString (trade, 'symbol');\n        market = this.safeMarket (marketId, market, '_');\n        const symbol = market['symbol'];\n        const side = this.safeStringLower (trade, 'side');\n        const priceString = this.safeString (trade, 'price');\n        const amountString = this.safeString2 (trade, 'amount', 'quantity');\n        return this.safeTrade ({\n            'id': id,\n            'info': trade,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'order': orderId,\n            'type': this.safeStringLower (trade, 'type'),\n            'side': side,\n            'takerOrMaker': undefined,\n            'price': priceString,\n            'amount': amountString,\n            'cost': this.safeString (trade, 'cost'),\n            'fee': this.safeDict (trade, 'fee'),\n        }, market);\n    }"
      },
      {
        "name": "parseTradingFee",
        "signature": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
        "line_start": 1778,
        "line_end": 1789,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "fee",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber2 (fee, 'makerFeeRate', 'makerFee')",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber2 (fee, 'takerFeeRate', 'takerFee')",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tierBased",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n        const marketId = this.safeString (fee, 'symbol');\n        const symbol = this.safeSymbol (marketId, market);\n        return {\n            'info': fee,\n            'symbol': symbol,\n            'maker': this.safeNumber2 (fee, 'makerFeeRate', 'makerFee'),\n            'taker': this.safeNumber2 (fee, 'takerFeeRate', 'takerFee'),\n            'percentage': undefined,\n            'tierBased': undefined,\n        };\n    }"
      }
    ],
    "zonda": [
      {
        "name": "parseBalance",
        "signature": "parseBalance (response): Balances",
        "line_start": 631,
        "line_end": 647,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseBalance (response): Balances {\n        const balances = this.safeValue (response, 'balances');\n        if (balances === undefined) {\n            throw new ExchangeError (this.id + ' empty balance response ' + this.json (response));\n        }\n        const result: Dict = { 'info': response };\n        for (let i = 0; i < balances.length; i++) {\n            const balance = balances[i];\n            const currencyId = this.safeString (balance, 'currency');\n            const code = this.safeCurrencyCode (currencyId);\n            const account = this.account ();\n            account['used'] = this.safeString (balance, 'lockedFunds');\n            account['free'] = this.safeString (balance, 'availableFunds');\n            result[code] = account;\n        }\n        return this.safeBalance (result);\n    }"
      },
      {
        "name": "parseDepositAddress",
        "signature": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
        "line_start": 1631,
        "line_end": 1651,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "depositAddress",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "address",
            "comment": null
          },
          {
            "key": "tag",
            "value": "this.safeString (depositAddress, 'tag')",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"address\": \"33u5YAEhQbYfjHHPsfMfCoSdEjfwYjVcBE\",\n         \"currency\": \"BTC\",\n         \"balanceId\": \"5d5d19e7-2265-49c7-af9a-047bcf384f21\",\n         \"balanceEngine\": \"BITBAY\",\n         \"tag\": null\n     }"
        ],
        "source": "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n        //\n        //     {\n        //         \"address\": \"33u5YAEhQbYfjHHPsfMfCoSdEjfwYjVcBE\",\n        //         \"currency\": \"BTC\",\n        //         \"balanceId\": \"5d5d19e7-2265-49c7-af9a-047bcf384f21\",\n        //         \"balanceEngine\": \"BITBAY\",\n        //         \"tag\": null\n        //     }\n        //\n        const currencyId = this.safeString (depositAddress, 'currency');\n        const address = this.safeString (depositAddress, 'address');\n        this.checkAddress (address);\n        return {\n            'info': depositAddress,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'network': undefined,\n            'address': address,\n            'tag': this.safeString (depositAddress, 'tag'),\n        } as DepositAddress;\n    }"
      },
      {
        "name": "parseLedgerEntry",
        "signature": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
        "line_start": 954,
        "line_end": 1254,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "id",
            "value": "this.safeString (item, 'historyId')",
            "comment": null
          },
          {
            "key": "direction",
            "value": "direction",
            "comment": null
          },
          {
            "key": "account",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "referenceId",
            "value": "this.safeString (item, 'detailId')",
            "comment": null
          },
          {
            "key": "referenceAccount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.parseLedgerEntryType (this.safeString (item, 'type'))",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (amount)",
            "comment": null
          },
          {
            "key": "before",
            "value": "this.safeNumber (fundsBefore, 'total')",
            "comment": null
          },
          {
            "key": "after",
            "value": "this.safeNumber (fundsAfter, 'total')",
            "comment": null
          },
          {
            "key": "status",
            "value": "'ok'",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n      \"historyId\": \"84ea7a29-7da5-4de5-b0c0-871e83cad765\",\n      \"balance\": {\n        \"id\": \"821ec166-cb88-4521-916c-f4eb44db98df\",\n        \"currency\": \"LTC\",\n        \"type\": \"CRYPTO\",\n        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        \"name\": \"LTC\"\n      },\n      \"detailId\": null,\n      \"time\": 1506128252968,\n      \"type\": \"FUNDS_MIGRATION\",\n      \"value\": 0.0009957,\n      \"fundsBefore\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n      \"fundsAfter\": { \"total\": 0.0009957, \"available\": 0.0009957, \"locked\": 0 },\n      \"change\": { \"total\": 0.0009957, \"available\": 0.0009957, \"locked\": 0 }\n    }",
          "{\n      \"historyId\": \"d0fabd8d-9107-4b5e-b9a6-3cab8af70d49\",\n      \"balance\": {\n        \"id\": \"653ffcf2-3037-4ebe-8e13-d5ea1a01d60d\",\n        \"currency\": \"BTG\",\n        \"type\": \"CRYPTO\",\n        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        \"name\": \"BTG\"\n      },\n      \"detailId\": null,\n      \"time\": 1508895244751,\n      \"type\": \"CREATE_BALANCE\",\n      \"value\": 0,\n      \"fundsBefore\": { \"total\": null, \"available\": null, \"locked\": null },\n      \"fundsAfter\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n      \"change\": { \"total\": 0, \"available\": 0, \"locked\": 0 }\n    }",
          "{\n      \"historyId\": \"2b4d52d3-611c-473d-b92c-8a8d87a24e41\",\n      \"balance\": {\n        \"id\": \"653ffcf2-3037-4ebe-8e13-d5ea1a01d60d\",\n        \"currency\": \"BTG\",\n        \"type\": \"CRYPTO\",\n        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        \"name\": \"BTG\"\n      },\n      \"detailId\": null,\n      \"time\": 1508895244778,\n      \"type\": \"BITCOIN_GOLD_FORK\",\n      \"value\": 0.00453512,\n      \"fundsBefore\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n      \"fundsAfter\": { \"total\": 0.00453512, \"available\": 0.00453512, \"locked\": 0 },\n      \"change\": { \"total\": 0.00453512, \"available\": 0.00453512, \"locked\": 0 }\n    }",
          "{\n      \"historyId\": \"3158236d-dae5-4a5d-81af-c1fa4af340fb\",\n      \"balance\": {\n        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        \"currency\": \"BTC\",\n        \"type\": \"CRYPTO\",\n        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        \"name\": \"BTC\"\n      },\n      \"detailId\": \"8e83a960-e737-4380-b8bb-259d6e236faa\",\n      \"time\": 1520631178816,\n      \"type\": \"ADD_FUNDS\",\n      \"value\": 0.628405,\n      \"fundsBefore\": { \"total\": 0.00453512, \"available\": 0.00453512, \"locked\": 0 },\n      \"fundsAfter\": { \"total\": 0.63294012, \"available\": 0.63294012, \"locked\": 0 },\n      \"change\": { \"total\": 0.628405, \"available\": 0.628405, \"locked\": 0 }\n    }",
          "{\n      \"historyId\": \"e7d19e0f-03b3-46a8-bc72-dde72cc24ead\",\n      \"balance\": {\n        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        \"currency\": \"BTC\",\n        \"type\": \"CRYPTO\",\n        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        \"name\": \"BTC\"\n      },\n      \"detailId\": null,\n      \"time\": 1520706403868,\n      \"type\": \"TRANSACTION_PRE_LOCKING\",\n      \"value\": -0.1,\n      \"fundsBefore\": { \"total\": 0.63294012, \"available\": 0.63294012, \"locked\": 0 },\n      \"fundsAfter\": { \"total\": 0.63294012, \"available\": 0.53294012, \"locked\": 0.1 },\n      \"change\": { \"total\": 0, \"available\": -0.1, \"locked\": 0.1 }\n    }"
        ],
        "source": "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n        //\n        //    FUNDS_MIGRATION\n        //    {\n        //      \"historyId\": \"84ea7a29-7da5-4de5-b0c0-871e83cad765\",\n        //      \"balance\": {\n        //        \"id\": \"821ec166-cb88-4521-916c-f4eb44db98df\",\n        //        \"currency\": \"LTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"LTC\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1506128252968,\n        //      \"type\": \"FUNDS_MIGRATION\",\n        //      \"value\": 0.0009957,\n        //      \"fundsBefore\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 0.0009957, \"available\": 0.0009957, \"locked\": 0 },\n        //      \"change\": { \"total\": 0.0009957, \"available\": 0.0009957, \"locked\": 0 }\n        //    }\n        //\n        //    CREATE_BALANCE\n        //    {\n        //      \"historyId\": \"d0fabd8d-9107-4b5e-b9a6-3cab8af70d49\",\n        //      \"balance\": {\n        //        \"id\": \"653ffcf2-3037-4ebe-8e13-d5ea1a01d60d\",\n        //        \"currency\": \"BTG\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTG\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1508895244751,\n        //      \"type\": \"CREATE_BALANCE\",\n        //      \"value\": 0,\n        //      \"fundsBefore\": { \"total\": null, \"available\": null, \"locked\": null },\n        //      \"fundsAfter\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n        //      \"change\": { \"total\": 0, \"available\": 0, \"locked\": 0 }\n        //    }\n        //\n        //    BITCOIN_GOLD_FORK\n        //    {\n        //      \"historyId\": \"2b4d52d3-611c-473d-b92c-8a8d87a24e41\",\n        //      \"balance\": {\n        //        \"id\": \"653ffcf2-3037-4ebe-8e13-d5ea1a01d60d\",\n        //        \"currency\": \"BTG\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTG\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1508895244778,\n        //      \"type\": \"BITCOIN_GOLD_FORK\",\n        //      \"value\": 0.00453512,\n        //      \"fundsBefore\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 0.00453512, \"available\": 0.00453512, \"locked\": 0 },\n        //      \"change\": { \"total\": 0.00453512, \"available\": 0.00453512, \"locked\": 0 }\n        //    }\n        //\n        //    ADD_FUNDS\n        //    {\n        //      \"historyId\": \"3158236d-dae5-4a5d-81af-c1fa4af340fb\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": \"8e83a960-e737-4380-b8bb-259d6e236faa\",\n        //      \"time\": 1520631178816,\n        //      \"type\": \"ADD_FUNDS\",\n        //      \"value\": 0.628405,\n        //      \"fundsBefore\": { \"total\": 0.00453512, \"available\": 0.00453512, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 0.63294012, \"available\": 0.63294012, \"locked\": 0 },\n        //      \"change\": { \"total\": 0.628405, \"available\": 0.628405, \"locked\": 0 }\n        //    }\n        //\n        //    TRANSACTION_PRE_LOCKING\n        //    {\n        //      \"historyId\": \"e7d19e0f-03b3-46a8-bc72-dde72cc24ead\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1520706403868,\n        //      \"type\": \"TRANSACTION_PRE_LOCKING\",\n        //      \"value\": -0.1,\n        //      \"fundsBefore\": { \"total\": 0.63294012, \"available\": 0.63294012, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 0.63294012, \"available\": 0.53294012, \"locked\": 0.1 },\n        //      \"change\": { \"total\": 0, \"available\": -0.1, \"locked\": 0.1 }\n        //    }\n        //\n        //    TRANSACTION_POST_OUTCOME\n        //    {\n        //      \"historyId\": \"c4010825-231d-4a9c-8e46-37cde1f7b63c\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": \"bf2876bc-b545-4503-96c8-ef4de8233876\",\n        //      \"time\": 1520706404032,\n        //      \"type\": \"TRANSACTION_POST_OUTCOME\",\n        //      \"value\": -0.01771415,\n        //      \"fundsBefore\": { \"total\": 0.63294012, \"available\": 0.53294012, \"locked\": 0.1 },\n        //      \"fundsAfter\": { \"total\": 0.61522597, \"available\": 0.53294012, \"locked\": 0.08228585 },\n        //      \"change\": { \"total\": -0.01771415, \"available\": 0, \"locked\": -0.01771415 }\n        //    }\n        //\n        //    TRANSACTION_POST_INCOME\n        //    {\n        //      \"historyId\": \"7f18b7af-b676-4125-84fd-042e683046f6\",\n        //      \"balance\": {\n        //        \"id\": \"ab43023b-4079-414c-b340-056e3430a3af\",\n        //        \"currency\": \"EUR\",\n        //        \"type\": \"FIAT\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"EUR\"\n        //      },\n        //      \"detailId\": \"f5fcb274-0cc7-4385-b2d3-bae2756e701f\",\n        //      \"time\": 1520706404035,\n        //      \"type\": \"TRANSACTION_POST_INCOME\",\n        //      \"value\": 628.78,\n        //      \"fundsBefore\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 628.78, \"available\": 628.78, \"locked\": 0 },\n        //      \"change\": { \"total\": 628.78, \"available\": 628.78, \"locked\": 0 }\n        //    }\n        //\n        //    TRANSACTION_COMMISSION_OUTCOME\n        //    {\n        //      \"historyId\": \"843177fa-61bc-4cbf-8be5-b029d856c93b\",\n        //      \"balance\": {\n        //        \"id\": \"ab43023b-4079-414c-b340-056e3430a3af\",\n        //        \"currency\": \"EUR\",\n        //        \"type\": \"FIAT\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"EUR\"\n        //      },\n        //      \"detailId\": \"f5fcb274-0cc7-4385-b2d3-bae2756e701f\",\n        //      \"time\": 1520706404050,\n        //      \"type\": \"TRANSACTION_COMMISSION_OUTCOME\",\n        //      \"value\": -2.71,\n        //      \"fundsBefore\": { \"total\": 766.06, \"available\": 766.06, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 763.35,\"available\": 763.35, \"locked\": 0 },\n        //      \"change\": { \"total\": -2.71, \"available\": -2.71, \"locked\": 0 }\n        //    }\n        //\n        //    TRANSACTION_OFFER_COMPLETED_RETURN\n        //    {\n        //      \"historyId\": \"cac69b04-c518-4dc5-9d86-e76e91f2e1d2\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1520714886425,\n        //      \"type\": \"TRANSACTION_OFFER_COMPLETED_RETURN\",\n        //      \"value\": 0.00000196,\n        //      \"fundsBefore\": { \"total\": 0.00941208, \"available\": 0.00941012, \"locked\": 0.00000196 },\n        //      \"fundsAfter\": { \"total\": 0.00941208, \"available\": 0.00941208, \"locked\": 0 },\n        //      \"change\": { \"total\": 0, \"available\": 0.00000196, \"locked\": -0.00000196 }\n        //    }\n        //\n        //    WITHDRAWAL_LOCK_FUNDS\n        //    {\n        //      \"historyId\": \"03de2271-66ab-4960-a786-87ab9551fc14\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": \"6ad3dc72-1d6d-4ec2-8436-ca43f85a38a6\",\n        //      \"time\": 1522245654481,\n        //      \"type\": \"WITHDRAWAL_LOCK_FUNDS\",\n        //      \"value\": -0.8,\n        //      \"fundsBefore\": { \"total\": 0.8, \"available\": 0.8, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 0.8, \"available\": 0, \"locked\": 0.8 },\n        //      \"change\": { \"total\": 0, \"available\": -0.8, \"locked\": 0.8 }\n        //    }\n        //\n        //    WITHDRAWAL_SUBTRACT_FUNDS\n        //    {\n        //      \"historyId\": \"b0308c89-5288-438d-a306-c6448b1a266d\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": \"6ad3dc72-1d6d-4ec2-8436-ca43f85a38a6\",\n        //      \"time\": 1522246526186,\n        //      \"type\": \"WITHDRAWAL_SUBTRACT_FUNDS\",\n        //      \"value\": -0.8,\n        //      \"fundsBefore\": { \"total\": 0.8, \"available\": 0, \"locked\": 0.8 },\n        //      \"fundsAfter\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n        //      \"change\": { \"total\": -0.8, \"available\": 0, \"locked\": -0.8 }\n        //    }\n        //\n        //    TRANSACTION_OFFER_ABORTED_RETURN\n        //    {\n        //      \"historyId\": \"b1a3c075-d403-4e05-8f32-40512cdd88c0\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1522512298662,\n        //      \"type\": \"TRANSACTION_OFFER_ABORTED_RETURN\",\n        //      \"value\": 0.0564931,\n        //      \"fundsBefore\": { \"total\": 0.44951311, \"available\": 0.39302001, \"locked\": 0.0564931 },\n        //      \"fundsAfter\": { \"total\": 0.44951311, \"available\": 0.44951311, \"locked\": 0 },\n        //      \"change\": { \"total\": 0, \"available\": 0.0564931, \"locked\": -0.0564931 }\n        //    }\n        //\n        //    WITHDRAWAL_UNLOCK_FUNDS\n        //    {\n        //      \"historyId\": \"0ed569a2-c330-482e-bb89-4cb553fb5b11\",\n        //      \"balance\": {\n        //        \"id\": \"3a7e7a1e-0324-49d5-8f59-298505ebd6c7\",\n        //        \"currency\": \"BTC\",\n        //        \"type\": \"CRYPTO\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"BTC\"\n        //      },\n        //      \"detailId\": \"0c7be256-c336-4111-bee7-4eb22e339700\",\n        //      \"time\": 1527866360785,\n        //      \"type\": \"WITHDRAWAL_UNLOCK_FUNDS\",\n        //      \"value\": 0.05045,\n        //      \"fundsBefore\": { \"total\": 0.86001578, \"available\": 0.80956578, \"locked\": 0.05045 },\n        //      \"fundsAfter\": { \"total\": 0.86001578, \"available\": 0.86001578, \"locked\": 0 },\n        //      \"change\": { \"total\": 0, \"available\": 0.05045, \"locked\": -0.05045 }\n        //    }\n        //\n        //    TRANSACTION_COMMISSION_RETURN\n        //    {\n        //      \"historyId\": \"07c89c27-46f1-4d7a-8518-b73798bf168a\",\n        //      \"balance\": {\n        //        \"id\": \"ab43023b-4079-414c-b340-056e3430a3af\",\n        //        \"currency\": \"EUR\",\n        //        \"type\": \"FIAT\",\n        //        \"userId\": \"a34d361d-7bad-49c1-888e-62473b75d877\",\n        //        \"name\": \"EUR\"\n        //      },\n        //      \"detailId\": null,\n        //      \"time\": 1528304043063,\n        //      \"type\": \"TRANSACTION_COMMISSION_RETURN\",\n        //      \"value\": 0.6,\n        //      \"fundsBefore\": { \"total\": 0, \"available\": 0, \"locked\": 0 },\n        //      \"fundsAfter\": { \"total\": 0.6, \"available\": 0.6, \"locked\": 0 },\n        //      \"change\": { \"total\": 0.6, \"available\": 0.6, \"locked\": 0 }\n        //    }\n        //\n        const timestamp = this.safeInteger (item, 'time');\n        const balance = this.safeValue (item, 'balance', {});\n        const currencyId = this.safeString (balance, 'currency');\n        currency = this.safeCurrency (currencyId, currency);\n        const change = this.safeValue (item, 'change', {});\n        let amount = this.safeString (change, 'total');\n        let direction = 'in';\n        if (Precise.stringLt (amount, '0')) {\n            direction = 'out';\n            amount = Precise.stringNeg (amount);\n        }\n        // there are 2 undocumented api calls: (v1_01PrivateGetPaymentsDepositDetailId and v1_01PrivateGetPaymentsWithdrawalDetailId)\n        // that can be used to enrich the transfers with txid, address etc (you need to use info.detailId as a parameter)\n        const fundsBefore = this.safeValue (item, 'fundsBefore', {});\n        const fundsAfter = this.safeValue (item, 'fundsAfter', {});\n        return this.safeLedgerEntry ({\n            'info': item,\n            'id': this.safeString (item, 'historyId'),\n            'direction': direction,\n            'account': undefined,\n            'referenceId': this.safeString (item, 'detailId'),\n            'referenceAccount': undefined,\n            'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n            'currency': this.safeCurrencyCode (currencyId),\n            'amount': this.parseNumber (amount),\n            'before': this.safeNumber (fundsBefore, 'total'),\n            'after': this.safeNumber (fundsAfter, 'total'),\n            'status': 'ok',\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'fee': undefined,\n        }, currency) as LedgerEntry;\n    }"
      },
      {
        "name": "parseLedgerEntryType",
        "signature": "parseLedgerEntryType (type)",
        "line_start": 1256,
        "line_end": 1274,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseLedgerEntryType (type) {\n        const types: Dict = {\n            'ADD_FUNDS': 'transaction',\n            'BITCOIN_GOLD_FORK': 'transaction',\n            'CREATE_BALANCE': 'transaction',\n            'FUNDS_MIGRATION': 'transaction',\n            'WITHDRAWAL_LOCK_FUNDS': 'transaction',\n            'WITHDRAWAL_SUBTRACT_FUNDS': 'transaction',\n            'WITHDRAWAL_UNLOCK_FUNDS': 'transaction',\n            'TRANSACTION_COMMISSION_OUTCOME': 'fee',\n            'TRANSACTION_COMMISSION_RETURN': 'fee',\n            'TRANSACTION_OFFER_ABORTED_RETURN': 'trade',\n            'TRANSACTION_OFFER_COMPLETED_RETURN': 'trade',\n            'TRANSACTION_POST_INCOME': 'trade',\n            'TRANSACTION_POST_OUTCOME': 'trade',\n            'TRANSACTION_PRE_LOCKING': 'trade',\n        };\n        return this.safeString (types, type, type);\n    }"
      },
      {
        "name": "parseMarket",
        "signature": "parseMarket (item): Market",
        "line_start": 437,
        "line_end": 503,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "id",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "base + '/' + quote",
            "comment": null
          },
          {
            "key": "base",
            "value": "base",
            "comment": null
          },
          {
            "key": "quote",
            "value": "quote",
            "comment": null
          },
          {
            "key": "settle",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseId",
            "value": "baseId",
            "comment": null
          },
          {
            "key": "quoteId",
            "value": "quoteId",
            "comment": null
          },
          {
            "key": "settleId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "'spot'",
            "comment": null
          },
          {
            "key": "spot",
            "value": "true",
            "comment": null
          },
          {
            "key": "margin",
            "value": "false",
            "comment": null
          },
          {
            "key": "swap",
            "value": "false",
            "comment": null
          },
          {
            "key": "future",
            "value": "false",
            "comment": null
          },
          {
            "key": "option",
            "value": "false",
            "comment": null
          },
          {
            "key": "active",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "contract",
            "value": "false",
            "comment": null
          },
          {
            "key": "linear",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "inverse",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "taker",
            "value": "this.safeNumber (fees, 'taker')",
            "comment": null
          },
          {
            "key": "maker",
            "value": "this.safeNumber (fees, 'maker')",
            "comment": null
          },
          {
            "key": "contractSize",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiry",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "expiryDatetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "optionType",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "strike",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "precision",
            "value": "{\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (first, 'scale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (second, 'scale'))),\n            }",
            "comment": null
          },
          {
            "key": "limits",
            "value": "{\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (first, 'minOffer'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            }",
            "comment": null
          },
          {
            "key": "created",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "item",
            "comment": null
          },
          {
            "key": "amount",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (first, 'scale')))",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.parseNumber (this.parsePrecision (this.safeString (second, 'scale')))",
            "comment": null
          },
          {
            "key": "leverage",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "amount",
            "value": "{\n                    'min': this.safeNumber (first, 'minOffer'),\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "price",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "cost",
            "value": "{\n                    'min': undefined,\n                    'max': undefined,\n                }",
            "comment": null
          },
          {
            "key": "min",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "max",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [],
        "source": "parseMarket (item): Market {\n        const market = this.safeValue (item, 'market', {});\n        const id = this.safeString (market, 'code');\n        const first = this.safeValue (market, 'first', {});\n        const second = this.safeValue (market, 'second', {});\n        const baseId = this.safeString (first, 'currency');\n        const quoteId = this.safeString (second, 'currency');\n        const base = this.safeCurrencyCode (baseId);\n        const quote = this.safeCurrencyCode (quoteId);\n        let fees = this.safeValue (this.fees, 'trading', {});\n        const fiatCurrencies = this.safeValue (this.options, 'fiatCurrencies', []);\n        if (this.inArray (base, fiatCurrencies) || this.inArray (quote, fiatCurrencies)) {\n            fees = this.safeValue (this.fees, 'fiat', {});\n        }\n        // todo: check that the limits have ben interpreted correctly\n        return {\n            'id': id,\n            'symbol': base + '/' + quote,\n            'base': base,\n            'quote': quote,\n            'settle': undefined,\n            'baseId': baseId,\n            'quoteId': quoteId,\n            'settleId': undefined,\n            'type': 'spot',\n            'spot': true,\n            'margin': false,\n            'swap': false,\n            'future': false,\n            'option': false,\n            'active': undefined,\n            'contract': false,\n            'linear': undefined,\n            'inverse': undefined,\n            'taker': this.safeNumber (fees, 'taker'),\n            'maker': this.safeNumber (fees, 'maker'),\n            'contractSize': undefined,\n            'expiry': undefined,\n            'expiryDatetime': undefined,\n            'optionType': undefined,\n            'strike': undefined,\n            'precision': {\n                'amount': this.parseNumber (this.parsePrecision (this.safeString (first, 'scale'))),\n                'price': this.parseNumber (this.parsePrecision (this.safeString (second, 'scale'))),\n            },\n            'limits': {\n                'leverage': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'amount': {\n                    'min': this.safeNumber (first, 'minOffer'),\n                    'max': undefined,\n                },\n                'price': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n                'cost': {\n                    'min': undefined,\n                    'max': undefined,\n                },\n            },\n            'created': undefined,\n            'info': item,\n        };\n    }"
      },
      {
        "name": "parseOHLCV",
        "signature": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
        "line_start": 1276,
        "line_end": 1299,
        "comment": null,
        "mappings": [],
        "examples": [
          "[\n         \"1582399800000\",\n         {\n             \"o\": \"0.0001428\",\n             \"c\": \"0.0001428\",\n             \"h\": \"0.0001428\",\n             \"l\": \"0.0001428\",\n             \"v\": \"4\",\n             \"co\": \"1\"\n         }\n     ]"
        ],
        "source": "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n        //\n        //     [\n        //         \"1582399800000\",\n        //         {\n        //             \"o\": \"0.0001428\",\n        //             \"c\": \"0.0001428\",\n        //             \"h\": \"0.0001428\",\n        //             \"l\": \"0.0001428\",\n        //             \"v\": \"4\",\n        //             \"co\": \"1\"\n        //         }\n        //     ]\n        //\n        const first = this.safeValue (ohlcv, 1, {});\n        return [\n            this.safeInteger (ohlcv, 0),\n            this.safeNumber (first, 'o'),\n            this.safeNumber (first, 'h'),\n            this.safeNumber (first, 'l'),\n            this.safeNumber (first, 'c'),\n            this.safeNumber (first, 'v'),\n        ];\n    }"
      },
      {
        "name": "parseOrder",
        "signature": "parseOrder (order: Dict, market: Market = undefined): Order",
        "line_start": 525,
        "line_end": 580,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (order, 'id')",
            "comment": null
          },
          {
            "key": "clientOrderId",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "lastTradeTimestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "this.safeString (order, 'mode')",
            "comment": null
          },
          {
            "key": "timeInForce",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "postOnly",
            "value": "postOnly",
            "comment": null
          },
          {
            "key": "side",
            "value": "this.safeStringLower (order, 'offerType')",
            "comment": null
          },
          {
            "key": "price",
            "value": "this.safeString (order, 'rate')",
            "comment": null
          },
          {
            "key": "triggerPrice",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amount",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "filled",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "remaining",
            "value": "remaining",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "trades",
            "value": "undefined",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"market\": \"ETH-EUR\",\n         \"offerType\": \"Sell\",\n         \"id\": \"93d3657b-d616-11e9-9248-0242ac110005\",\n         \"currentAmount\": \"0.04\",\n         \"lockedAmount\": \"0.04\",\n         \"rate\": \"280\",\n         \"startAmount\": \"0.04\",\n         \"time\": \"1568372806924\",\n         \"postOnly\": false,\n         \"hidden\": false,\n         \"mode\": \"limit\",\n         \"receivedAmount\": \"0.0\",\n         \"firstBalanceId\": \"5b816c3e-437c-4e43-9bef-47814ae7ebfc\",\n         \"secondBalanceId\": \"ab43023b-4079-414c-b340-056e3430a3af\"\n     }",
          "{\n        status: \"Ok\",\n        errors: []\n    }"
        ],
        "source": "parseOrder (order: Dict, market: Market = undefined): Order {\n        //\n        //     {\n        //         \"market\": \"ETH-EUR\",\n        //         \"offerType\": \"Sell\",\n        //         \"id\": \"93d3657b-d616-11e9-9248-0242ac110005\",\n        //         \"currentAmount\": \"0.04\",\n        //         \"lockedAmount\": \"0.04\",\n        //         \"rate\": \"280\",\n        //         \"startAmount\": \"0.04\",\n        //         \"time\": \"1568372806924\",\n        //         \"postOnly\": false,\n        //         \"hidden\": false,\n        //         \"mode\": \"limit\",\n        //         \"receivedAmount\": \"0.0\",\n        //         \"firstBalanceId\": \"5b816c3e-437c-4e43-9bef-47814ae7ebfc\",\n        //         \"secondBalanceId\": \"ab43023b-4079-414c-b340-056e3430a3af\"\n        //     }\n        //\n        // cancelOrder\n        //\n        //    {\n        //        status: \"Ok\",\n        //        errors: []\n        //    }\n        //\n        const marketId = this.safeString (order, 'market');\n        const symbol = this.safeSymbol (marketId, market, '-');\n        const timestamp = this.safeInteger (order, 'time');\n        const amount = this.safeString (order, 'startAmount');\n        const remaining = this.safeString (order, 'currentAmount');\n        const postOnly = this.safeValue (order, 'postOnly');\n        return this.safeOrder ({\n            'id': this.safeString (order, 'id'),\n            'clientOrderId': undefined,\n            'info': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'lastTradeTimestamp': undefined,\n            'status': undefined,\n            'symbol': symbol,\n            'type': this.safeString (order, 'mode'),\n            'timeInForce': undefined,\n            'postOnly': postOnly,\n            'side': this.safeStringLower (order, 'offerType'),\n            'price': this.safeString (order, 'rate'),\n            'triggerPrice': undefined,\n            'amount': amount,\n            'cost': undefined,\n            'filled': undefined,\n            'remaining': remaining,\n            'average': undefined,\n            'fee': undefined,\n            'trades': undefined,\n        }, market);\n    }"
      },
      {
        "name": "parseTicker",
        "signature": "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
        "line_start": 710,
        "line_end": 775,
        "comment": null,
        "mappings": [
          {
            "key": "symbol",
            "value": "this.safeSymbol (marketId, market)",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "high",
            "value": "this.safeString (ticker, 'h')",
            "comment": null
          },
          {
            "key": "low",
            "value": "this.safeString (ticker, 'l')",
            "comment": null
          },
          {
            "key": "bid",
            "value": "this.safeNumber (ticker, 'highestBid')",
            "comment": null
          },
          {
            "key": "bidVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "ask",
            "value": "this.safeNumber (ticker, 'lowestAsk')",
            "comment": null
          },
          {
            "key": "askVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "vwap",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "open",
            "value": "this.safeString (ticker, 'r24h')",
            "comment": null
          },
          {
            "key": "close",
            "value": "rate",
            "comment": null
          },
          {
            "key": "last",
            "value": "rate",
            "comment": null
          },
          {
            "key": "previousClose",
            "value": "this.safeValue (ticker, 'previousRate')",
            "comment": null
          },
          {
            "key": "change",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "percentage",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "average",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "baseVolume",
            "value": "this.safeString (ticker, 'v')",
            "comment": null
          },
          {
            "key": "quoteVolume",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "ticker",
            "comment": null
          }
        ],
        "examples": [
          "{\n        \"m\": \"ETH-PLN\",\n        \"h\": \"13485.13\",\n        \"l\": \"13100.01\",\n        \"v\": \"126.10710939\",\n        \"r24h\": \"13332.72\"\n    }",
          "{\n        \"market\": {\n            \"code\": \"ADA-USDT\",\n            \"first\": {\n                \"currency\": \"ADA\",\n                \"minOffer\": \"0.2\",\n                \"scale\": \"6\"\n            },\n            \"second\": {\n                \"currency\": \"USDT\",\n                \"minOffer\": \"0.099\",\n                \"scale\": \"6\"\n            },\n            \"amountPrecision\": \"6\",\n            \"pricePrecision\": \"6\",\n            \"ratePrecision\": \"6\"\n        },\n        \"time\": \"1655812661202\",\n        \"highestBid\": \"0.492\",\n        \"lowestAsk\": \"0.499389\",\n        \"rate\": \"0.50588\",\n        \"previousRate\": \"0.504981\"\n    }"
        ],
        "source": "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n        //\n        // version 1\n        //\n        //    {\n        //        \"m\": \"ETH-PLN\",\n        //        \"h\": \"13485.13\",\n        //        \"l\": \"13100.01\",\n        //        \"v\": \"126.10710939\",\n        //        \"r24h\": \"13332.72\"\n        //    }\n        //\n        // version 2\n        //\n        //    {\n        //        \"market\": {\n        //            \"code\": \"ADA-USDT\",\n        //            \"first\": {\n        //                \"currency\": \"ADA\",\n        //                \"minOffer\": \"0.2\",\n        //                \"scale\": \"6\"\n        //            },\n        //            \"second\": {\n        //                \"currency\": \"USDT\",\n        //                \"minOffer\": \"0.099\",\n        //                \"scale\": \"6\"\n        //            },\n        //            \"amountPrecision\": \"6\",\n        //            \"pricePrecision\": \"6\",\n        //            \"ratePrecision\": \"6\"\n        //        },\n        //        \"time\": \"1655812661202\",\n        //        \"highestBid\": \"0.492\",\n        //        \"lowestAsk\": \"0.499389\",\n        //        \"rate\": \"0.50588\",\n        //        \"previousRate\": \"0.504981\"\n        //    }\n        //\n        const tickerMarket = this.safeValue (ticker, 'market');\n        const marketId = this.safeString2 (tickerMarket, 'code', 'm');\n        market = this.safeMarket (marketId, market);\n        const timestamp = this.safeInteger (ticker, 'time');\n        const rate = this.safeValue (ticker, 'rate');\n        return this.safeTicker ({\n            'symbol': this.safeSymbol (marketId, market),\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'high': this.safeString (ticker, 'h'),\n            'low': this.safeString (ticker, 'l'),\n            'bid': this.safeNumber (ticker, 'highestBid'),\n            'bidVolume': undefined,\n            'ask': this.safeNumber (ticker, 'lowestAsk'),\n            'askVolume': undefined,\n            'vwap': undefined,\n            'open': this.safeString (ticker, 'r24h'),\n            'close': rate,\n            'last': rate,\n            'previousClose': this.safeValue (ticker, 'previousRate'),\n            'change': undefined,\n            'percentage': undefined,\n            'average': undefined,\n            'baseVolume': this.safeString (ticker, 'v'),\n            'quoteVolume': undefined,\n            'info': ticker,\n        }, market);\n    }"
      },
      {
        "name": "parseTrade",
        "signature": "parseTrade (trade: Dict, market: Market = undefined): Trade",
        "line_start": 1352,
        "line_end": 1428,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (trade, 'id')",
            "comment": null
          },
          {
            "key": "order",
            "value": "order",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "timestamp",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "this.iso8601 (timestamp)",
            "comment": null
          },
          {
            "key": "symbol",
            "value": "symbol",
            "comment": null
          },
          {
            "key": "type",
            "value": "type",
            "comment": null
          },
          {
            "key": "side",
            "value": "side",
            "comment": null
          },
          {
            "key": "price",
            "value": "priceString",
            "comment": null
          },
          {
            "key": "amount",
            "value": "amountString",
            "comment": null
          },
          {
            "key": "cost",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "takerOrMaker",
            "value": "takerOrMaker",
            "comment": null
          },
          {
            "key": "fee",
            "value": "fee",
            "comment": null
          },
          {
            "key": "info",
            "value": "trade",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"rate\": \"0.02195928\",\n         \"amount\": \"0.00167952\"\n     }",
          "{\n         \"amount\": \"0.29285199\",\n         \"commissionValue\": \"0.00125927\",\n         \"id\": \"11c8203a-a267-11e9-b698-0242ac110007\",\n         \"initializedBy\": \"Buy\",\n         \"market\": \"ETH-EUR\",\n         \"offerId\": \"11c82038-a267-11e9-b698-0242ac110007\",\n         \"rate\": \"277\",\n         \"time\": \"1562689917517\",\n         \"userAction\": \"Buy\",\n         \"wasTaker\": true,\n     }",
          "{\n          \"id\": \"df00b0da-e5e0-11e9-8c19-0242ac11000a\",\n          \"t\": \"1570108958831\",\n          \"a\": \"0.04776653\",\n          \"r\": \"0.02145854\",\n          \"ty\": \"Sell\"\n     }"
        ],
        "source": "parseTrade (trade: Dict, market: Market = undefined): Trade {\n        //\n        // createOrder trades\n        //\n        //     {\n        //         \"rate\": \"0.02195928\",\n        //         \"amount\": \"0.00167952\"\n        //     }\n        //\n        // fetchMyTrades (private)\n        //\n        //     {\n        //         \"amount\": \"0.29285199\",\n        //         \"commissionValue\": \"0.00125927\",\n        //         \"id\": \"11c8203a-a267-11e9-b698-0242ac110007\",\n        //         \"initializedBy\": \"Buy\",\n        //         \"market\": \"ETH-EUR\",\n        //         \"offerId\": \"11c82038-a267-11e9-b698-0242ac110007\",\n        //         \"rate\": \"277\",\n        //         \"time\": \"1562689917517\",\n        //         \"userAction\": \"Buy\",\n        //         \"wasTaker\": true,\n        //     }\n        //\n        // fetchTrades (public)\n        //\n        //     {\n        //          \"id\": \"df00b0da-e5e0-11e9-8c19-0242ac11000a\",\n        //          \"t\": \"1570108958831\",\n        //          \"a\": \"0.04776653\",\n        //          \"r\": \"0.02145854\",\n        //          \"ty\": \"Sell\"\n        //     }\n        //\n        const timestamp = this.safeInteger2 (trade, 'time', 't');\n        const side = this.safeStringLower2 (trade, 'userAction', 'ty');\n        const wasTaker = this.safeValue (trade, 'wasTaker');\n        let takerOrMaker: Str = undefined;\n        if (wasTaker !== undefined) {\n            takerOrMaker = wasTaker ? 'taker' : 'maker';\n        }\n        const priceString = this.safeString2 (trade, 'rate', 'r');\n        const amountString = this.safeString2 (trade, 'amount', 'a');\n        const feeCostString = this.safeString (trade, 'commissionValue');\n        const marketId = this.safeString (trade, 'market');\n        market = this.safeMarket (marketId, market, '-');\n        const symbol = market['symbol'];\n        let fee = undefined;\n        if (feeCostString !== undefined) {\n            const feeCurrency = (side === 'buy') ? market['base'] : market['quote'];\n            fee = {\n                'currency': feeCurrency,\n                'cost': feeCostString,\n            };\n        }\n        const order = this.safeString (trade, 'offerId');\n        // todo: check this logic\n        let type: Str = undefined;\n        if (order !== undefined) {\n            type = order ? 'limit' : 'market';\n        }\n        return this.safeTrade ({\n            'id': this.safeString (trade, 'id'),\n            'order': order,\n            'timestamp': timestamp,\n            'datetime': this.iso8601 (timestamp),\n            'symbol': symbol,\n            'type': type,\n            'side': side,\n            'price': priceString,\n            'amount': amountString,\n            'cost': undefined,\n            'takerOrMaker': takerOrMaker,\n            'fee': fee,\n            'info': trade,\n        }, market);\n    }"
      },
      {
        "name": "parseTransaction",
        "signature": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
        "line_start": 1877,
        "line_end": 1908,
        "comment": null,
        "mappings": [
          {
            "key": "id",
            "value": "this.safeString (transaction, 'id')",
            "comment": null
          },
          {
            "key": "txid",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "network",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "address",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "addressTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "type",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "currency['code']",
            "comment": null
          },
          {
            "key": "status",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "updated",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagFrom",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tag",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "tagTo",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "comment",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "internal",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fee",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "info",
            "value": "transaction",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"id\": \"65e01087-afb0-4ab2-afdb-cc925e360296\"\n     }"
        ],
        "source": "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n        //\n        // withdraw\n        //\n        //     {\n        //         \"id\": \"65e01087-afb0-4ab2-afdb-cc925e360296\"\n        //     }\n        //\n        currency = this.safeCurrency (undefined, currency);\n        return {\n            'id': this.safeString (transaction, 'id'),\n            'txid': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'network': undefined,\n            'addressFrom': undefined,\n            'address': undefined,\n            'addressTo': undefined,\n            'amount': undefined,\n            'type': undefined,\n            'currency': currency['code'],\n            'status': undefined,\n            'updated': undefined,\n            'tagFrom': undefined,\n            'tag': undefined,\n            'tagTo': undefined,\n            'comment': undefined,\n            'internal': undefined,\n            'fee': undefined,\n            'info': transaction,\n        } as Transaction;\n    }"
      },
      {
        "name": "parseTransfer",
        "signature": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
        "line_start": 1776,
        "line_end": 1822,
        "comment": null,
        "mappings": [
          {
            "key": "info",
            "value": "transfer",
            "comment": null
          },
          {
            "key": "id",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "timestamp",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "datetime",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "currency",
            "value": "this.safeCurrencyCode (currencyId, currency)",
            "comment": null
          },
          {
            "key": "amount",
            "value": "undefined",
            "comment": null
          },
          {
            "key": "fromAccount",
            "value": "fromId",
            "comment": null
          },
          {
            "key": "toAccount",
            "value": "toId",
            "comment": null
          },
          {
            "key": "status",
            "value": "this.parseTransferStatus (status)",
            "comment": null
          }
        ],
        "examples": [
          "{\n         \"status\": \"Ok\",\n         \"from\": {\n             \"id\": \"ad9397c5-3bd9-4372-82ba-22da6a90cb56\",\n             \"userId\": \"4bc43956-423f-47fd-9faa-acd37c58ed9f\",\n             \"availableFunds\": 0.01803472,\n             \"totalFunds\": 0.01804161,\n             \"lockedFunds\": 0.00000689,\n             \"currency\": \"BTC\",\n             \"type\": \"CRYPTO\",\n             \"name\": \"BTC\",\n             \"balanceEngine\": \"BITBAY\"\n         },\n         \"to\": {\n             \"id\": \"01931d52-536b-4ca5-a9f4-be28c86d0cc3\",\n             \"userId\": \"4bc43956-423f-47fd-9faa-acd37c58ed9f\",\n             \"availableFunds\": 0.0001,\n             \"totalFunds\": 0.0001,\n             \"lockedFunds\": 0,\n             \"currency\": \"BTC\",\n             \"type\": \"CRYPTO\",\n             \"name\": \"Prowizja\",\n             \"balanceEngine\": \"BITBAY\"\n         },\n         \"errors\": null\n     }"
        ],
        "source": "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n        //\n        //     {\n        //         \"status\": \"Ok\",\n        //         \"from\": {\n        //             \"id\": \"ad9397c5-3bd9-4372-82ba-22da6a90cb56\",\n        //             \"userId\": \"4bc43956-423f-47fd-9faa-acd37c58ed9f\",\n        //             \"availableFunds\": 0.01803472,\n        //             \"totalFunds\": 0.01804161,\n        //             \"lockedFunds\": 0.00000689,\n        //             \"currency\": \"BTC\",\n        //             \"type\": \"CRYPTO\",\n        //             \"name\": \"BTC\",\n        //             \"balanceEngine\": \"BITBAY\"\n        //         },\n        //         \"to\": {\n        //             \"id\": \"01931d52-536b-4ca5-a9f4-be28c86d0cc3\",\n        //             \"userId\": \"4bc43956-423f-47fd-9faa-acd37c58ed9f\",\n        //             \"availableFunds\": 0.0001,\n        //             \"totalFunds\": 0.0001,\n        //             \"lockedFunds\": 0,\n        //             \"currency\": \"BTC\",\n        //             \"type\": \"CRYPTO\",\n        //             \"name\": \"Prowizja\",\n        //             \"balanceEngine\": \"BITBAY\"\n        //         },\n        //         \"errors\": null\n        //     }\n        //\n        const status = this.safeString (transfer, 'status');\n        const fromAccount = this.safeValue (transfer, 'from', {});\n        const fromId = this.safeString (fromAccount, 'id');\n        const to = this.safeValue (transfer, 'to', {});\n        const toId = this.safeString (to, 'id');\n        const currencyId = this.safeString (fromAccount, 'currency');\n        return {\n            'info': transfer,\n            'id': undefined,\n            'timestamp': undefined,\n            'datetime': undefined,\n            'currency': this.safeCurrencyCode (currencyId, currency),\n            'amount': undefined,\n            'fromAccount': fromId,\n            'toAccount': toId,\n            'status': this.parseTransferStatus (status),\n        };\n    }"
      },
      {
        "name": "parseTransferStatus",
        "signature": "parseTransferStatus (status: Str): Str",
        "line_start": 1824,
        "line_end": 1830,
        "comment": null,
        "mappings": [],
        "examples": [],
        "source": "parseTransferStatus (status: Str): Str {\n        const statuses: Dict = {\n            'Ok': 'ok',\n            'Fail': 'failed',\n        };\n        return this.safeString (statuses, status, status);\n    }"
      }
    ]
  },
  "orderbook_keys": {
    "alp": {
      "bids_key": "buy",
      "asks_key": "sell"
    },
    "alpaca": {
      "bids_key": "b",
      "asks_key": "a"
    },
    "apex": {
      "bids_key": "b",
      "asks_key": "a"
    },
    "bybit": {
      "bids_key": "b",
      "asks_key": "a"
    },
    "coinspot": {
      "bids_key": "buyorders",
      "asks_key": "sellorders"
    },
    "delta": {
      "bids_key": "buy",
      "asks_key": "sell"
    },
    "exmo": {
      "bids_key": "bid",
      "asks_key": "ask"
    },
    "hashkey": {
      "bids_key": "b",
      "asks_key": "a"
    },
    "hibachi": {
      "bids_key": "bid",
      "asks_key": "ask"
    },
    "hitbtc": {
      "bids_key": "bid",
      "asks_key": "ask"
    },
    "independentreserve": {
      "bids_key": "BuyOrders",
      "asks_key": "SellOrders"
    },
    "indodax": {
      "bids_key": "buy",
      "asks_key": "sell"
    },
    "latoken": {
      "bids_key": "bid",
      "asks_key": "ask"
    },
    "timex": {
      "bids_key": "bid",
      "asks_key": "ask"
    },
    "toobit": {
      "bids_key": "b",
      "asks_key": "a"
    },
    "xt": {
      "bids_key": "b",
      "asks_key": "a"
    },
    "bequant": {
      "bids_key": "bid",
      "asks_key": "ask"
    },
    "fmfwio": {
      "bids_key": "bid",
      "asks_key": "ask"
    }
  },
  "inheritance_map": {
    "bequant": "hitbtc",
    "binancecoinm": "binance",
    "binanceus": "binance",
    "binanceusdm": "binance",
    "coinbaseadvanced": "coinbase",
    "fmfwio": "hitbtc",
    "gateio": "gate",
    "huobi": "htx",
    "kucoinfutures": "kucoin",
    "myokx": "okx",
    "okxus": "okx"
  }
}
