# WhiteBit Exchange Specification # # Auto-generated by: mix ccxt.extract whitebit # CCXT version: 4.5.42 # Spec format version: 2 # # Review before use: # - signing: Detected from sign() method, verify with testnet # - endpoints: Raw paths extracted, map to unified API as needed # - exceptions: Extracted (exact, broad, HTTP status codes) # - features/options: Extracted from describe() # - classification: Set to :supported initially, promote after validation # %{ api_param_requirements: nil, certified: false, classification: :pro, comment: nil, countries: [ "EE" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 51, "coveragePercent" => 100, "enabledMethods" => 57, "excluded" => [ %{ "method" => "fetchDepositWithdrawFee", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 1, "extractableMethods" => 56, "failures" => [ %{ "error" => "no HTTP request captured (method returned without request)", "method" => "fetchTradingLimits" }, %{ "error" => "whitebit does not have currency code BTC/USDT", "method" => "fetchTransactions" }, %{ "error" => "whitebit setLeverage() does not allow to set per symbol", "method" => "setLeverage" }, %{ "error" => "whitebit cancelAllOrdersAfter() requires a symbol argument in params", "method" => "cancelAllOrdersAfter" }, %{ "error" => "whitebit does not have currency code 0.01", "method" => "createConvertTrade" } ] }, endpoints: [ %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ _by_market_type: %{ spot: %{ "type" => [ "spot" ] }, swap: %{ "type" => [ "futures" ] } } }, expects: :list, market_type: :spot, method: :post, name: :cancel_all_orders, param_mappings: %{ "symbol" => "market" }, params: [ :symbol ], path: "/order/cancel/all", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :cancel_order, param_mappings: %{ "id" => "orderId", "symbol" => "market" }, params: [ :id, :symbol ], path: "/order/cancel", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :create_deposit_address, param_mappings: %{ "code" => "ticker" }, params: [ :code ], path: "/main-account/create-new-address", response_transformer: {:extract_path_unwrap, ["account"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "" }, expects: :single, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :side, :amount, :price ], path: "/order/new", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "", "side" => "buy" }, expects: :single, market_type: :spot, method: :post, name: :create_market_buy_order_with_cost, param_mappings: %{ "cost" => "amount", "symbol" => "market" }, params: [ :symbol, :cost ], path: "/order/market", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "" }, expects: :single, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :side, :amount, :price ], path: "/order/stock_market", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "" }, expects: :single, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/order/new", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "", "postOnly" => true }, expects: :single, market_type: :spot, method: :post, name: :create_post_only_order, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/order/new", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "", "triggerDirection" => "below" }, expects: :single, market_type: :swap, method: :post, name: :create_stop_limit_order, param_mappings: %{ "symbol" => "market", "triggerPrice" => "activation_price" }, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/order/stop_limit", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "", "triggerDirection" => "below" }, expects: :single, market_type: :swap, method: :post, name: :create_stop_market_order, param_mappings: %{ "symbol" => "market", "triggerPrice" => "activation_price" }, params: [ :symbol, :side, :amount, :triggerPrice ], path: "/order/collateral/trigger-market", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "", "triggerDirection" => "below" }, expects: :single, market_type: :swap, method: :post, name: :create_stop_order, param_mappings: %{ "symbol" => "market", "triggerPrice" => "activation_price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/order/stop_limit", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "clientOrderId" => "", "triggerDirection" => "below" }, expects: :single, market_type: :swap, method: :post, name: :create_trigger_order, param_mappings: %{ "symbol" => "market", "triggerPrice" => "activation_price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/order/stop_limit", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :edit_order, param_mappings: %{ "id" => "orderId", "symbol" => "market" }, params: [ :id, :symbol, :type, :side, :amount, :price ], path: "/order/modify", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/sub-account/list", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :fetch_balance, param_mappings: %{}, params: [], path: "/trade-account/balance", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_closed_orders, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/trade-account/order/history", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "direction" => "from" }, expects: :single, market_type: :spot, method: :post, name: :fetch_convert_quote, param_mappings: %{ "fromCode" => "from", "toCode" => "to" }, params: [ :fromCode, :toCode, :amount ], path: "/convert/estimate", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_convert_trade_history, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/convert/history", response_transformer: {:extract_path, ["records"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :fetch_cross_borrow_rate, param_mappings: %{ "code" => "ticker" }, params: [ :code ], path: "/main-account/smart/plans", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/assets", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "limit" => 1, "offset" => 0, "transactionMethod" => 1 }, expects: :single, market_type: :spot, method: :post, name: :fetch_deposit, param_mappings: %{ "id" => "uniqueId" }, params: [ :id, :code ], path: "/main-account/history", response_transformer: {:extract_path_unwrap, ["records"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :fetch_deposit_address, param_mappings: %{ "code" => "ticker" }, params: [ :code ], path: "/main-account/address", response_transformer: {:extract_path_unwrap, ["account"]}, source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_deposit_withdraw_fees, param_mappings: %{}, params: [ :codes ], path: "/fee", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "limit" => 100, "offset" => 0, "transactionMethod" => 1 }, expects: :list, market_type: :spot, method: :post, name: :fetch_deposits, param_mappings: %{ "code" => "ticker" }, params: [ :code, :since, :limit ], path: "/main-account/history", response_transformer: {:extract_path, ["records"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_deposits_withdrawals, param_mappings: %{ "code" => "ticker" }, params: [ :code, :since, :limit ], path: "/main-account/history", response_transformer: {:extract_path, ["records"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :swap, method: :post, name: :fetch_funding_history, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/collateral-account/funding-history", response_transformer: {:extract_path, ["records"]}, source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_funding_limits, param_mappings: %{}, params: [], path: "/assets", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :single, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{}, params: [ :symbol ], path: "/futures", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :swap, method: :get, name: :fetch_funding_rates, param_mappings: %{}, params: [ :symbols ], path: "/futures", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :single, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :limit ], path: "/orderbook/{market}", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/markets", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_my_trades, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/trade-account/executed-history", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, default_params: %{ "limit" => 1440 }, expects: :list, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "start", "symbol" => "market", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/kline", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_open_orders, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/orders", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :fetch_order, param_mappings: %{ "id" => "orderId", "symbol" => "market" }, params: [ :id, :symbol ], path: "/orders", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :single, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :limit ], path: "/orderbook/{market}", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_order_trades, param_mappings: %{ "id" => "orderId", "symbol" => "market" }, params: [ :id, :symbol, :since, :limit ], path: "/trade-account/order", response_transformer: {:extract_path, ["records"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :spot, method: :post, name: :fetch_orders, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/orders", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :swap, method: :post, name: :fetch_position, param_mappings: %{}, params: [ :symbol ], path: "/collateral-account/positions/open", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :swap, method: :post, name: :fetch_position_history, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/collateral-account/positions/history", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :list, market_type: :swap, method: :post, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/collateral-account/positions/open", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :single, market_type: :spot, method: :get, name: :fetch_status, param_mappings: %{}, params: [], path: "/ping", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, expects: :single, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "market" }, params: [ :symbol ], path: "/ticker", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/ticker", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :single, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/time", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/trades/{market}", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/assets", source: :intercepted }, %{ api_section: "v4/public", auth: false, cost: 1, expects: :list, market_type: :spot, method: :get, name: :fetch_transaction_fees, param_mappings: %{}, params: [ :codes ], path: "/fee", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "limit" => 100, "transactionMethod" => "2" }, expects: :list, market_type: :spot, method: :post, name: :fetch_withdrawals, param_mappings: %{ "code" => "ticker" }, params: [ :code, :since, :limit ], path: "/main-account/history", response_transformer: {:extract_path, ["records"]}, source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, expects: :single, market_type: :spot, method: :post, name: :transfer, param_mappings: %{ "code" => "ticker", "fromAccount" => "from", "toAccount" => "to" }, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/main-account/transfer", source: :intercepted }, %{ api_section: "v4/private", auth: true, cost: 1, default_params: %{ "uniqueId" => "5b73fd39972646c39ed283" }, expects: :single, market_type: :spot, method: :post, name: :withdraw, param_mappings: %{ "code" => "ticker" }, params: [ :code, :amount, :address, :tag ], path: "/main-account/withdraw", source: :intercepted } ], error_code_details: %{ 422 => %{ description: "{\"response\":null,\"status\":422,\"errors\":{\"orderId\":[\"Finished order id 1295772653 not found on your account\"]},\"notification\":null,\"warning\":\"Finished order id 1295772653 not found on your account\",\"_token\":null}", type: :order_not_found }, 503 => %{ description: "{\"response\":null,\"status\":503,\"errors\":{\"message\":[\"\"]},\"notification\":null,\"warning\":null,\"_token\":null},", type: :network_error }, "Amount must be greater than 0" => %{ description: "Validation failed", type: :invalid_order }, "Enable your key in API settings" => %{ description: "This action is unauthorized. Enable your key in API settings", type: :access_restricted }, "Given amount is less than min amount" => %{ description: "Validation failed", type: :invalid_order }, "Invalid payload." => %{ description: "Invalid payload.", type: :invalid_parameters }, "Market is not available" => %{ description: "{\"success\":false,\"message\":{\"market\":[\"Market is not available\"]},\"result\":[]}", type: :invalid_order }, "Min amount step" => %{ description: "Validation failed", type: :invalid_order }, "Not enough balance" => %{ description: "Validation failed", type: :insufficient_balance }, "Not enough balance." => %{ description: "Inner validation failed", type: :insufficient_balance }, "The market format is invalid." => %{ description: "Validation failed", type: :invalid_order }, "The order id field is required." => %{ description: "Validation failed", type: :invalid_order }, "The selected from is invalid." => %{ description: "Validation failed", type: :invalid_parameters }, "This API Key is not authorized to perform this action." => %{ description: "This API Key is not authorized to perform this action.", type: :access_restricted }, "This action is unauthorized" => %{ description: "This action is unauthorized. Enable your key in API settings", type: :access_restricted }, "This action is unauthorized." => %{ description: "This action is unauthorized.", type: :access_restricted }, "Total is less than" => %{ description: "Validation failed", type: :invalid_order }, "Unauthorized request." => %{ description: "Unauthorized request.", type: :invalid_credentials }, "Unexecuted order was not found." => %{ description: "Inner validation failed", type: :order_not_found }, "You don't have such amount for transfer" => %{ description: "Inner validation failed", type: :insufficient_balance }, "fee must be no less than" => %{ description: "Validation failed", type: :invalid_order } }, error_codes: %{ 422 => :order_not_found, 503 => :network_error, "Amount must be greater than 0" => :invalid_order, "Enable your key in API settings" => :access_restricted, "Given amount is less than min amount" => :invalid_order, "Invalid payload." => :invalid_parameters, "Market is not available" => :invalid_order, "Min amount step" => :invalid_order, "Not enough balance" => :insufficient_balance, "Not enough balance." => :insufficient_balance, "The market format is invalid." => :invalid_order, "The order id field is required." => :invalid_order, "The selected from is invalid." => :invalid_parameters, "This API Key is not authorized to perform this action." => :access_restricted, "This action is unauthorized" => :access_restricted, "This action is unauthorized." => :access_restricted, "Total is less than" => :invalid_order, "Unauthorized request." => :invalid_credentials, "Unexecuted order was not found." => :order_not_found, "You don't have such amount for transfer" => :insufficient_balance, "fee must be no less than" => :invalid_order }, exceptions: %{ broad: %{ "Enable your key in API settings" => :permission_denied, "Given amount is less than min amount" => :invalid_order, "Min amount step" => :invalid_order, "This action is unauthorized" => :permission_denied, "Total is less than" => :invalid_order, "You don't have such amount for transfer" => :insufficient_funds, "fee must be no less than" => :invalid_order }, exact: %{ "422" => :order_not_found, "503" => :exchange_not_available, "Amount must be greater than 0" => :invalid_order, "Invalid payload." => :bad_request, "Market is not available" => :bad_symbol, "Not enough balance" => :insufficient_funds, "Not enough balance." => :insufficient_funds, "The market format is invalid." => :bad_symbol, "The order id field is required." => :invalid_order, "The selected from is invalid." => :bad_request, "This API Key is not authorized to perform this action." => :permission_denied, "This action is unauthorized." => :permission_denied, "Unauthorized request." => :authentication_error, "Unexecuted order was not found." => :order_not_found } }, exchange_options: %{ "accountsByType" => %{ "funding" => "main", "main" => "main", "margin" => "collateral", "spot" => "spot", "trade" => "spot" }, "adjustForTimeDifference" => false, "brokerId" => "ccxt", "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "defaultType" => "spot", "fetchBalance" => %{ "account" => "spot" }, "fiatCurrencies" => [ "EUR", "USD", "RUB", "UAH" ], "networksById" => %{}, "nonceWindow" => false, "timeDifference" => 0 }, extended_metadata: %{ fees_url: "https://whitebit.com/fee-schedule", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://user-images.githubusercontent.com/1294454/66732963-8eb7dd00-ee66-11e9-849b-10d9282bb9e0.jpg", referral_url: "https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963" }, extracted_metadata: %{ ccxt_version: "4.5.42" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: false, leverage: false, margin_mode: true, market_buy_by_cost: true, market_buy_requires_price: false, self_trade_prevention: false, stop_loss_price: false, take_profit_price: false, time_in_force: %{ fok: false, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: true }, fetch_closed_orders: %{ limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_my_trades: %{ limit: 100, margin_mode: false, symbol_required: false }, fetch_ohlcv: %{ limit: 1440 }, fetch_open_orders: %{ limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ check_active: true, check_executed: true, margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_orders: %{ limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_withdrawals: %{ limit: 100, margin_mode: false, symbol_required: false }, sandbox: false }, future: %{}, spot: %{ extends: "default" }, swap: %{ inverse: %{ extends: "default" }, linear: %{ extends: "default" } } }, fees: %{ trading: %{ maker: 0.001, percentage: true, taker: 0.001, tier_based: false } }, forward_aliases: nil, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if ((code === 418) || (code === 429)) {\n throw new errors.DDoSProtection(this.id + ' ' + code.toString() + ' ' + reason + ' ' + body);\n }\n if (code === 404) {\n throw new errors.ExchangeError(this.id + ' ' + code.toString() + ' endpoint not found');\n }\n if (response !== undefined) {\n // For cases where we have a meaningful status\n // {\"response\":null,\"status\":422,\"errors\":{\"orderId\":[\"Finished order id 435453454535 not found on your account\"]},\"notification\":null,\"warning\":\"Finished order id 435453454535 not found on your account\",\"_token\":null}\n const status = this.safeString(response, 'status');\n const errors$1 = this.safeValue(response, 'errors');\n // {\"code\":10,\"message\":\"Unauthorized request.\"}\n const message = this.safeString(response, 'message');\n // For these cases where we have a generic code variable error key\n // {\"code\":0,\"message\":\"Validation failed\",\"errors\":{\"amount\":[\"Amount must be greater than 0\"]}}\n const codeNew = this.safeInteger(response, 'code');\n const hasErrorStatus = status !== undefined && status !== '200' && errors$1 !== undefined;\n if (hasErrorStatus || codeNew !== undefined) {\n const feedback = this.id + ' ' + body;\n let errorInfo = message;\n if (hasErrorStatus) {\n errorInfo = status;\n }\n else {\n const errorObject = this.safeDict(response, 'errors', {});\n const errorKeys = Object.keys(errorObject);\n const errorsLength = errorKeys.length;\n if (errorsLength > 0) {\n const errorKey = errorKeys[0];\n const errorMessageArray = this.safeValue(errorObject, errorKey, []);\n const errorMessageLength = errorMessageArray.length;\n errorInfo = (errorMessageLength > 0) ? errorMessageArray[0] : body;\n }\n }\n this.throwExactlyMatchedException(this.exceptions['exact'], errorInfo, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n throw new errors.ExchangeError(feedback);\n }\n }\n return undefined;\n }", has: %{ add_margin: false, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: false, cancel_all_orders: true, cancel_all_orders_after: true, cancel_all_orders_ws: false, cancel_order: true, cancel_order_with_client_order_id: false, cancel_order_ws: false, cancel_orders: false, cancel_orders_with_client_order_id: false, cancel_orders_ws: false, close_all_positions: false, close_position: false, create_convert_trade: true, create_deposit_address: true, create_limit_buy_order: false, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: false, create_limit_sell_order_ws: false, create_market_buy_order: false, create_market_buy_order_with_cost: true, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: true, create_market_order_with_cost: false, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: false, create_market_sell_order_with_cost: false, create_market_sell_order_with_cost_ws: false, create_market_sell_order_ws: false, create_order: true, create_order_with_take_profit_and_stop_loss: false, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: false, create_post_only_order: true, create_post_only_order_ws: false, create_reduce_only_order: false, create_reduce_only_order_ws: false, create_stop_limit_order: true, create_stop_limit_order_ws: false, create_stop_loss_order: false, create_stop_loss_order_ws: false, create_stop_market_order: true, create_stop_market_order_ws: false, create_stop_order: true, create_stop_order_ws: false, create_take_profit_order: false, create_take_profit_order_ws: false, create_trailing_amount_order: false, create_trailing_amount_order_ws: false, create_trailing_percent_order: false, create_trailing_percent_order_ws: false, create_trigger_order: true, create_trigger_order_ws: false, deposit: false, edit_order: true, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: false, fetch_a_d_l_rank: false, fetch_accounts: true, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: false, fetch_borrow_interest: false, fetch_borrow_rate: false, fetch_borrow_rate_histories: false, fetch_borrow_rate_history: false, fetch_borrow_rates: false, fetch_borrow_rates_per_symbol: false, fetch_canceled_and_closed_orders: false, fetch_canceled_orders: false, fetch_closed_order: false, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: false, fetch_convert_quote: true, fetch_convert_trade: false, fetch_convert_trade_history: true, fetch_cross_borrow_rate: true, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: true, fetch_deposit_address: true, fetch_deposit_addresses: false, fetch_deposit_addresses_by_network: false, fetch_deposit_withdraw_fee: true, fetch_deposit_withdraw_fees: true, fetch_deposits: true, fetch_deposits_withdrawals: true, fetch_deposits_ws: false, fetch_funding_history: true, fetch_funding_interval: false, fetch_funding_intervals: false, fetch_funding_limits: true, fetch_funding_rate: true, fetch_funding_rate_history: false, fetch_funding_rates: true, fetch_greeks: false, fetch_index_ohlcv: false, fetch_isolated_borrow_rate: false, fetch_isolated_borrow_rates: false, fetch_isolated_positions: false, fetch_l2_order_book: true, fetch_l3_order_book: false, fetch_last_prices: false, fetch_ledger: false, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: false, fetch_leverages: false, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: false, fetch_margin_modes: false, fetch_mark_ohlcv: false, fetch_mark_prices: false, fetch_market_leverage_tiers: false, fetch_markets: true, fetch_markets_ws: false, fetch_my_liquidations: false, fetch_my_settlement_history: false, fetch_my_trades: true, fetch_my_trades_ws: false, fetch_ohlcv: true, fetch_ohlcv_ws: false, fetch_open_interest: false, fetch_open_interest_history: false, fetch_open_interests: false, fetch_open_order: false, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: false, fetch_option_chain: false, fetch_order: true, fetch_order_book: true, fetch_order_book_ws: false, fetch_order_books: false, fetch_order_trades: true, fetch_order_with_client_order_id: false, fetch_order_ws: false, fetch_orders: true, fetch_orders_by_status: false, fetch_orders_ws: false, fetch_position: true, fetch_position_a_d_l_rank: false, fetch_position_history: true, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: true, fetch_positions_a_d_l_rank: false, fetch_positions_for_symbol: false, fetch_positions_for_symbol_ws: false, fetch_positions_history: false, fetch_positions_risk: false, fetch_positions_ws: false, fetch_premium_index_ohlcv: false, fetch_settlement_history: false, fetch_status: true, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: true, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: false, fetch_trading_fees: true, fetch_trading_fees_ws: false, fetch_trading_limits: true, fetch_transaction_fee: false, fetch_transaction_fees: true, fetch_transactions: true, fetch_transfer: false, fetch_transfers: false, fetch_underlying_assets: false, fetch_volatility_history: false, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: true, fetch_withdrawals_ws: false, future: false, margin: true, option: false, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: false, set_leverage: true, set_margin: false, set_margin_mode: false, set_position_mode: false, sign_in: false, spot: true, swap: true, transfer: true, un_watch_my_trades: false, un_watch_ohlcv: false, un_watch_ohlcv_for_symbols: false, un_watch_order_book: false, un_watch_order_book_for_symbols: false, un_watch_orders: false, un_watch_positions: false, un_watch_ticker: false, un_watch_tickers: false, un_watch_trades: false, un_watch_trades_for_symbols: false, watch_balance: true, watch_bids_asks: false, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: false, watch_order_book: true, watch_order_book_for_symbols: false, watch_orders: true, watch_orders_for_symbols: false, watch_position: false, watch_positions: false, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: false, withdraw: true, ws: false }, http_config: nil, id: "whitebit", markets: nil, name: "WhiteBit", ohlcv_timestamp_resolution: :seconds, options: %{ :accounts_by_type => %{ "funding" => "main", "main" => "main", "margin" => "collateral", "spot" => "spot", "trade" => "spot" }, :adjust_for_time_difference => false, :broker_id => "ccxt", :default_account_type => "spot", :default_type => "spot", :fetch_balance => %{ "account" => "spot" }, "fiat_currencies" => [ "EUR", "USD", "RUB", "UAH" ], :networks_by_id => %{}, "nonce_window" => false, :time_difference => 0 }, order_mappings: %{ side_format: :lowercase, side_key: "side", type_format: nil, type_key: nil }, param_mappings: %{ "code" => "ticker", "cost" => "amount", "fromAccount" => "from", "fromCode" => "from", "id" => "orderId", "since" => "start", "symbol" => "market", "timeframe" => "interval", "toAccount" => "to", "toCode" => "to", "triggerPrice" => "activation_price" }, parse_methods: [ %{ "comment" => nil, "examples" => [], "line_end" => 2295, "line_start" => 2275, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 3323, "line_start" => 3289, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "info" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "currency", "value" => "'USDT'" }, %{ "comment" => nil, "key" => "interest", "value" => "this.safeNumber (info, 'unrealizedFunding')" }, %{ "comment" => nil, "key" => "interestRate", "value" => "0.00098" }, %{ "comment" => nil, "key" => "marginMode", "value" => "'cross'" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" } ], "name" => "parseBorrowInterest", "signature" => "parseBorrowInterest (info: Dict, market: Market = undefined): BorrowInterest", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 4050, "line_start" => 4037, "mappings" => [ %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "rate", "value" => "this.parseNumber (Precise.stringDiv (percent, '100'))" }, %{ "comment" => nil, "key" => "period", "value" => "this.safeInteger (info, 'duration')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "info" } ], "name" => "parseBorrowRate", "signature" => "parseBorrowRate (info, currency: Currency = undefined)", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 3802, "line_start" => 3743, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "conversion" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (conversion, 'id')" }, %{ "comment" => nil, "key" => "fromCurrency", "value" => "fromCode" }, %{ "comment" => nil, "key" => "fromAmount", "value" => "this.safeNumber2 (conversion, 'give', 'finalGive')" }, %{ "comment" => nil, "key" => "toCurrency", "value" => "toCode" }, %{ "comment" => nil, "key" => "toAmount", "value" => "this.safeNumber2 (conversion, 'receive', 'finalReceive')" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeNumber (conversion, 'rate')" }, %{ "comment" => nil, "key" => "fee", "value" => "undefined" } ], "name" => "parseConversion", "signature" => "parseConversion (conversion: Dict, fromCurrency: Currency = undefined, toCurrency: Currency = undefined): Conversion", "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 }" }, %{ "comment" => nil, "examples" => [ "{\n \"address\": \"GDTSOI56XNVAKJNJBLJGRNZIVOCIZJRBIDKTWSCYEYNFAZEMBLN75RMN\",\n \"memo\": \"48565488244493\"\n }," ], "line_end" => 2857, "line_start" => 2843, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositAddress" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (undefined, currency)" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "address", "value" => "this.safeString (depositAddress, 'address')" }, %{ "comment" => nil, "key" => "tag", "value" => "this.safeString (depositAddress, 'memo')" } ], "name" => "parseDepositAddress", "signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 923, "line_start" => 831, "mappings" => [ %{ "comment" => nil, "key" => "fee", "value" => "withdrawFee" }, %{ "comment" => nil, "key" => "percentage", "value" => "(withdrawFee !== undefined) ? false : undefined" } ], "name" => "parseDepositWithdrawFees", "signature" => "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3546, "line_start" => 3538, "mappings" => [], "name" => "parseFundingHistories", "signature" => "parseFundingHistories (contracts, market = undefined, since: Int = undefined, limit: Int = undefined): FundingHistory[]", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 3536, "line_start" => 3513, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market, undefined, 'swap')" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (contract, 'fundingAmount')" } ], "name" => "parseFundingHistory", "signature" => "parseFundingHistory (contract, market: Market = undefined)", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 3461, "line_start" => 3402, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "markPrice", "value" => "markPrice" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "indexPrice" }, %{ "comment" => nil, "key" => "interestRate", "value" => "interestRate" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "fundingRate" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "fundingTime" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "this.iso8601 (fundingTime)" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "interval", "value" => "undefined" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (contract, market: Market = undefined): FundingRate", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 568, "line_start" => 480, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "base", "value" => "base" }, %{ "comment" => nil, "key" => "quote", "value" => "quote" }, %{ "comment" => nil, "key" => "settle", "value" => "settle" }, %{ "comment" => nil, "key" => "baseId", "value" => "baseId" }, %{ "comment" => nil, "key" => "quoteId", "value" => "quoteId" }, %{ "comment" => nil, "key" => "settleId", "value" => "settleId" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "spot", "value" => "isSpot" }, %{ "comment" => nil, "key" => "margin", "value" => "margin" }, %{ "comment" => nil, "key" => "swap", "value" => "swap" }, %{ "comment" => nil, "key" => "future", "value" => "false" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "active" }, %{ "comment" => nil, "key" => "contract", "value" => "contract" }, %{ "comment" => nil, "key" => "linear", "value" => "linear" }, %{ "comment" => nil, "key" => "inverse", "value" => "inverse" }, %{ "comment" => nil, "key" => "taker", "value" => "this.parseNumber (taker)" }, %{ "comment" => nil, "key" => "maker", "value" => "this.parseNumber (maker)" }, %{ "comment" => nil, "key" => "contractSize", "value" => "isSpot ? undefined : contractSize" }, %{ "comment" => nil, "key" => "expiry", "value" => "undefined" }, %{ "comment" => nil, "key" => "expiryDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "strike", "value" => "undefined" }, %{ "comment" => nil, "key" => "optionType", "value" => "undefined" }, %{ "comment" => nil, "key" => "precision", "value" => "{\n 'amount': amountPrecision,\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'moneyPrec'))),\n }" }, %{ "comment" => nil, "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" => nil, "key" => "created", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "market" }, %{ "comment" => nil, "key" => "leverage", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "amount", "value" => "{\n 'min': this.safeNumber (market, 'minAmount'),\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': this.safeNumber (market, 'minTotal'),\n 'max': this.safeNumber (market, 'maxTotal'),\n }" }, %{ "comment" => nil, "key" => "min", "value" => "undefined" }, %{ "comment" => nil, "key" => "max", "value" => "undefined" } ], "name" => "parseMarket", "signature" => "parseMarket (market: Dict): Market", "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 }" }, %{ "comment" => nil, "examples" => [ "[\n 1591488000,\n \"0.025025\",\n \"0.025025\",\n \"0.025029\",\n \"0.025023\",\n \"6.181\",\n \"0.154686629\"\n ]" ], "line_end" => 1875, "line_start" => 1855, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 2561, "line_start" => 2465, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "id", "value" => "orderId" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "clientOrderId" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "lastTradeTimestamp" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "undefined" }, %{ "comment" => nil, "key" => "postOnly", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseOrderStatus (this.safeString (order, 'status'))" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "type", "value" => "orderType" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "filled", "value" => "filled" }, %{ "comment" => nil, "key" => "remaining", "value" => "remaining" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "cost", "value" => "cost" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "trades", "value" => "undefined" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2571, "line_start" => 2563, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2463, "line_start" => 2452, "mappings" => [], "name" => "parseOrderType", "signature" => "parseOrderType (type: Str)", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 4013, "line_start" => 3935, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (position, 'positionId')" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "notional", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "undefined" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "this.safeNumber (position, 'liquidationPrice')" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.safeNumber (position, 'basePrice')" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.safeNumber (position, 'pnl')" }, %{ "comment" => nil, "key" => "realizedPnl", "value" => "this.safeNumber (orderDetail, 'realizedPnl')" }, %{ "comment" => nil, "key" => "percentage", "value" => "this.safeNumber (position, 'pnlPercent')" }, %{ "comment" => nil, "key" => "contracts", "value" => "undefined" }, %{ "comment" => nil, "key" => "contractSize", "value" => "undefined" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "undefined" }, %{ "comment" => nil, "key" => "hedged", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "this.safeTimestamp (position, 'modifyDate')" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "this.safeNumber (position, 'margin')" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "leverage", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "this.safeNumber (tpsl, 'stopLoss')" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "this.safeNumber (tpsl, 'takeProfit')" } ], "name" => "parsePosition", "signature" => "parsePosition (position: Dict, market: Market = undefined): Position", "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 }" }, %{ "comment" => nil, "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 }", "{\n \"ticker_id\": \"0G_PERP\",\n \"stock_currency\": \"0G\",\n \"money_currency\": \"USDT\",\n \"last_price\": \"0.6065\",\n \"stock_volume\": \"2563218\",\n \"money_volume\": \"1587952.6137\",\n \"bid\": \"0.6065\",\n \"ask\": \"0.6077\",\n \"high\": \"0.6472\",\n \"low\": \"0.6045\",\n \"product_type\": \"Perpetual\",\n \"open_interest\": \"3721488\",\n \"index_price\": \"0.61\",\n \"index_name\": \"0G future contract\",\n \"index_currency\": \"0G\",\n \"funding_rate\": \"-0.00000778\",\n \"next_funding_rate_timestamp\": \"1772467200000\",\n \"brackets\": {\n \"1\": 0,\n \"10\": 0,\n \"100\": 0,\n \"2\": 0,\n \"20\": 4000,\n \"3\": 0,\n \"5\": 0,\n \"50\": 800\n },\n \"max_leverage\": 50,\n \"funding_interval_minutes\": 240\n }" ], "line_end" => 1386, "line_start" => 1272, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "high", "value" => "this.safeString (ticker, 'high')" }, %{ "comment" => nil, "key" => "low", "value" => "this.safeString (ticker, 'low')" }, %{ "comment" => nil, "key" => "bid", "value" => "this.safeString2 (ticker, 'bid', 'highestBid')" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeString2 (ticker, 'ask', 'lowestAsk')" }, %{ "comment" => nil, "key" => "askVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "this.safeString (ticker, 'open')" }, %{ "comment" => nil, "key" => "last", "value" => "last" }, %{ "comment" => nil, "key" => "previousClose", "value" => "undefined" }, %{ "comment" => nil, "key" => "change", "value" => "undefined" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "this.safeStringN (ticker, [ 'quote_volume', 'deal', 'quoteVolume24h', 'money_volume' ])" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeString (ticker, 'index_price')" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker", "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 // v4PublicGetFutures\n // {\n // \"ticker_id\": \"0G_PERP\",\n // \"stock_currency\": \"0G\",\n // \"money_currency\": \"USDT\",\n // \"last_price\": \"0.6065\",\n // \"stock_volume\": \"2563218\",\n // \"money_volume\": \"1587952.6137\",\n // \"bid\": \"0.6065\",\n // \"ask\": \"0.6077\",\n // \"high\": \"0.6472\",\n // \"low\": \"0.6045\",\n // \"product_type\": \"Perpetual\",\n // \"open_interest\": \"3721488\",\n // \"index_price\": \"0.61\",\n // \"index_name\": \"0G future contract\",\n // \"index_currency\": \"0G\",\n // \"funding_rate\": \"-0.00000778\",\n // \"next_funding_rate_timestamp\": \"1772467200000\",\n // \"brackets\": {\n // \"1\": 0,\n // \"10\": 0,\n // \"100\": 0,\n // \"2\": 0,\n // \"20\": 4000,\n // \"3\": 0,\n // \"5\": 0,\n // \"50\": 800\n // },\n // \"max_leverage\": 50,\n // \"funding_interval_minutes\": 240\n // }\n //\n const marketId = this.safeString2 (ticker, 'tradingPairs', 'ticker_id');\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 \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'), // can not be defined in v4PublicGetFutures\n 'close': close,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined, // can not be defined in v4PublicGetFutures\n 'percentage': this.safeString (ticker, 'change'), // can not be defined in v4PublicGetFutures\n 'average': undefined, // can not be defined in v4PublicGetFutures\n 'baseVolume': this.safeStringN (ticker, [ 'base_volume', 'volume', 'baseVolume24h', 'stock_volume' ]),\n 'quoteVolume': this.safeStringN (ticker, [ 'quote_volume', 'deal', 'quoteVolume24h', 'money_volume' ]),\n 'indexPrice': this.safeString (ticker, 'index_price'),\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "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 }" ], "line_end" => 1806, "line_start" => 1725, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "order", "value" => "orderId" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "cost" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "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 }" }, %{ "comment" => nil, "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 }" ], "line_end" => 3085, "line_start" => 3022, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transaction, 'uniqueId')" }, %{ "comment" => nil, "key" => "txid", "value" => "this.safeString (transaction, 'transactionId')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "network", "value" => "this.safeString (transaction, 'network')" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "(method === '1') ? address : undefined" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "addressTo", "value" => "(method === '2') ? address : undefined" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transaction, 'amount')" }, %{ "comment" => nil, "key" => "type", "value" => "(method === '1') ? 'deposit' : 'withdrawal'" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransactionStatus (status)" }, %{ "comment" => nil, "key" => "updated", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "tag", "value" => "this.safeString (transaction, 'memo')" }, %{ "comment" => nil, "key" => "tagTo", "value" => "undefined" }, %{ "comment" => nil, "key" => "comment", "value" => "this.safeString (transaction, 'description')" }, %{ "comment" => nil, "key" => "internal", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'cost': this.safeNumber (transaction, 'fee'),\n 'currency': this.safeCurrencyCode (currencyId, currency),\n }" }, %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeNumber (transaction, 'fee')" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3107, "line_start" => 3087, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "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 }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2975, "line_start" => 2960, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transfer" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (undefined, currency)" }, %{ "comment" => nil, "key" => "amount", "value" => "undefined" }, %{ "comment" => nil, "key" => "fromAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "toAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "undefined" } ], "name" => "parseTransfer", "signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry", "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 }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 20, period: 1000, requests: 50, rolling_window_size: 60000 }, raw_endpoints: %{ private: [], public: [] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: nil, signing: %{ api_key_header: "X-TXC-APIKEY", confidence: :medium, pattern: :hmac_sha512_nonce, signature_header: "X-TXC-SIGNATURE" }, spec_format_version: 2, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ precision_mode: 4, sample_limits: %{ "amount" => %{ "min" => 0.0001 }, "cost" => %{ "max" => 100000, "min" => 1.2e-5 }, "price" => %{} }, sample_precision: %{ "amount" => 0.0001, "price" => 1.0e-6 }, spot: %{ base: "ETH", base_id: "ETH", case: :upper, contract: false, id: "ETH_BTC", limits: %{ "amount" => %{ "min" => 0.0001 }, "cost" => %{ "max" => 100000, "min" => 1.2e-5 }, "leverage" => %{}, "price" => %{} }, maker: 0.001, precision: %{ "amount" => 0.0001, "price" => 1.0e-6 }, quote: "BTC", quote_id: "BTC", separator: "_", symbol: "ETH/BTC", taker: 0.001 }, swap: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, contract_size: 0.001, id: "BTC_PERP", inverse: false, limits: %{ "amount" => %{ "min" => 0.001 }, "cost" => %{ "max" => 100000000000, "min" => 5 }, "leverage" => %{}, "price" => %{} }, linear: true, maker: 0.0001, precision: %{ "amount" => 0.001, "price" => 0.1 }, quote: "USDT", quote_id: "USDT", separator: "_", settle: "USDT", settle_id: "USDT", symbol: "BTC/USDT:USDT", taker: 5.5e-4 } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :underscore_upper, prefix: nil, separator: "_", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :suffix_perp, prefix: nil, separator: "", suffix: "_PERP" } }, timeframes: %{ "12h" => "12h", "15m" => "15m", "1M" => "1M", "1d" => "1d", "1h" => "1h", "1m" => "1m", "1w" => "1w", "2h" => "2h", "30m" => "30m", "3d" => "3d", "3m" => "3m", "4h" => "4h", "5m" => "5m", "6h" => "6h", "8h" => "8h" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://whitebit.com/api/v1/public", api_sections: nil, doc: "https://github.com/whitebit-exchange/api-docs", other: nil, sandbox: nil, www: "https://www.whitebit.com" }, version: "v4", ws: %{ channel_templates: %{ watch_balance: %{ auth_required: true, market_id_format: :native, params: [], pattern: :method_as_topic }, watch_my_trades: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_ohlcv: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_order_book: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_orders: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_private: %{ auth_required: true, market_id_format: :native, params: [], pattern: :method_as_topic }, watch_public: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_ticker: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_tickers: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic } }, has: %{ watch_balance: true, watch_bids_asks: nil, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: nil, watch_order_book: true, watch_order_book_for_symbols: nil, watch_orders: true, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: nil, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: false }, message_patterns: [ %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "authorize", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "balanceSpot_subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "candles_subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "deals_subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "depth_subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "market_subscribe", sources: [ :send, :watch, :watch_multiple ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "ordersPending_subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "ping", sources: [ :ping ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "trades_subscribe", sources: [ :send, :watch ] } ], options: %{ "watchOrderBook" => %{ "priceInterval" => 0 } }, subscription_config: %{ args_field: "params", args_format: :string_list, market_id_format: :native, op_field: "method" }, subscription_pattern: :method_as_topic, urls: "wss://api.whitebit.com/ws", watch_methods: [ "watchBalance", "watchMultipleSubscription", "watchMyTrades", "watchOHLCV", "watchOrderBook", "watchOrders", "watchPrivate", "watchPublic", "watchTicker", "watchTickers", "watchTrades" ] } }