# AscendEX Exchange Specification # # Auto-generated by: mix ccxt.extract ascendex # CCXT version: 4.5.34 # Spec format version: 1 # # 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: [ "SG" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "BOND" => "BONDED", "BTCBEAR" => "BEAR", "BTCBULL" => "BULL", "BYN" => "BeyondFi", "PLN" => "Pollen", "XBT" => "XBT" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 40, "coveragePercent" => 100, "enabledMethods" => 47, "excluded" => [ %{ "method" => "editOrder", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchDepositWithdrawFee", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchFundingRate", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchLeverage", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchMarginMode", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchMarketLeverageTiers", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchTransactions", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 7, "extractableMethods" => 40, "failures" => [] }, endpoints: [ %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :cancel_all_orders, param_mappings: %{}, params: [ :symbol ], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :cancel_order, param_mappings: %{}, params: [ :id, :symbol ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :create_limit_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :create_market_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :create_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :create_orders, param_mappings: %{}, params: [ :orders ], path: "/info", response_transformer: {:extract_path, ["data", "info"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :create_post_only_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :create_reduce_only_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :create_stop_limit_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :create_stop_market_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :triggerPrice ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :create_stop_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/info", response_transformer: {:extract_path, ["data", "order"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/info", response_transformer: {:extract_path, ["data", "accountGroup"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_closed_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v2/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/assets", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposit_address, param_mappings: %{ "code" => "asset" }, params: [ :code ], path: "/wallet/deposit/address", response_transformer: {:extract_path_unwrap, ["data", "address"]}, source: :intercepted }, %{ api_section: "v2/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_deposit_withdraw_fees, param_mappings: %{}, params: [ :codes ], path: "/assets", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, default_params: %{ "txType" => "deposit" }, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{ "code" => "asset" }, params: [ :code, :since, :limit ], path: "/wallet/transactions", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposits_withdrawals, param_mappings: %{ "code" => "asset" }, params: [ :code, :since, :limit ], path: "/wallet/transactions", response_transformer: {:extract_path, ["data", "data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/info", response_transformer: {:extract_path, ["data", "data"]}, source: :intercepted }, %{ api_section: "v2/public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_rates, param_mappings: %{}, params: [ :symbols ], path: "/futures/pricing-data", response_transformer: {:extract_path, ["data", "contracts"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/depth", response_transformer: {:extract_path, ["data", "data"]}, source: :intercepted }, %{ api_section: "v2/public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_leverage_tiers, param_mappings: %{}, params: [ :symbols ], path: "/futures/contract", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_leverages, param_mappings: %{}, params: [ :symbols ], path: "/info", response_transformer: {:extract_path, ["data", "contracts"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_margin_modes, param_mappings: %{}, params: [ :symbols ], path: "/info", response_transformer: {:extract_path, ["data", "contracts"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/products", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, default_params: %{ "interval" => "60", "to" => "" }, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "from", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/barhist", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_open_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_order, param_mappings: %{}, params: [ :id, :symbol ], path: "/info", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/depth", response_transformer: {:extract_path_unwrap, ["data", "data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/info", response_transformer: {:extract_path, ["data", "contracts"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{}, params: [ :symbol ], path: "/ticker", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/ticker", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, default_params: %{ "requestTime" => "" }, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/exchange-info", response_transformer: {:extract_path, ["data", "requestReceiveAt"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "limit" => "n" }, params: [ :symbol, :since, :limit ], path: "/trades", response_transformer: {:extract_path, ["data", "data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/info", response_transformer: {:extract_path, ["data", "fees"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, default_params: %{ "txType" => "withdrawal" }, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{ "code" => "asset" }, params: [ :code, :since, :limit ], path: "/wallet/transactions", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :set_leverage, param_mappings: %{}, params: [ :leverage, :symbol ], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :swap, method: :get, name: :set_margin_mode, param_mappings: %{}, params: [ :marginMode, :symbol ], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :transfer, param_mappings: %{}, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted } ], error_code_details: %{ 100001 => %{ description: "INVALID_HTTP_INPUT Http request is invalid", type: :invalid_parameters }, 100002 => %{ description: "DATA_NOT_AVAILABLE Some required data is missing", type: :invalid_parameters }, 100003 => %{ description: "KEY_CONFLICT The same key exists already", type: :invalid_parameters }, 100004 => %{ description: "INVALID_REQUEST_DATA The HTTP request contains invalid field or argument", type: :invalid_parameters }, 100005 => %{ description: "INVALID_WS_REQUEST_DATA Websocket request contains invalid field or argument", type: :invalid_parameters }, 100006 => %{ description: "INVALID_ARGUMENT The arugment is invalid", type: :invalid_parameters }, 100007 => %{ description: "ENCRYPTION_ERROR Something wrong with data encryption", type: :invalid_parameters }, 100008 => %{ description: "SYMBOL_ERROR Symbol does not exist or not valid for the request", type: :invalid_order }, 100009 => %{ description: "AUTHORIZATION_NEEDED Authorization is require for the API access or request", type: :invalid_credentials }, 100010 => %{ description: "INVALID_OPERATION The action is invalid or not allowed for the account", type: :invalid_parameters }, 100011 => %{ description: "INVALID_TIMESTAMP Not a valid timestamp", type: :invalid_parameters }, 100012 => %{ description: "INVALID_STR_FORMAT String format does not", type: :invalid_parameters }, 100013 => %{ description: "INVALID_NUM_FORMAT Invalid number input", type: :invalid_parameters }, 100101 => %{ description: "UNKNOWN_ERROR Some unknown error", type: :exchange_error }, 150001 => %{ description: "INVALID_JSON_FORMAT Require a valid json object", type: :invalid_parameters }, 1900 => %{ description: "Invalid Http Request Input", type: :invalid_parameters }, 200001 => %{ description: "AUTHENTICATION_FAILED Authorization failed", type: :invalid_credentials }, 200002 => %{ description: "TOO_MANY_ATTEMPTS Tried and failed too many times", type: :exchange_error }, 200003 => %{ description: "ACCOUNT_NOT_FOUND Account not exist", type: :exchange_error }, 200004 => %{ description: "ACCOUNT_NOT_SETUP Account not setup properly", type: :exchange_error }, 200005 => %{ description: "ACCOUNT_ALREADY_EXIST Account already exist", type: :exchange_error }, 200006 => %{ description: "ACCOUNT_ERROR Some error related with error", type: :exchange_error }, 200007 => %{ description: "CODE_NOT_FOUND", type: :exchange_error }, 200008 => %{ description: "CODE_EXPIRED Code expired", type: :exchange_error }, 200009 => %{ description: "CODE_MISMATCH Code does not match", type: :exchange_error }, 200010 => %{ description: "PASSWORD_ERROR Wrong assword", type: :invalid_credentials }, 200011 => %{ description: "CODE_GEN_FAILED Do not generate required code promptly", type: :exchange_error }, 200012 => %{ description: "FAKE_COKE_VERIFY", type: :exchange_error }, 200013 => %{ description: "SECURITY_ALERT Provide security alert message", type: :exchange_error }, 200014 => %{ description: "RESTRICTED_ACCOUNT Account is restricted for certain activity, such as trading, or withdraw.", type: :access_restricted }, 200015 => %{ description: "PERMISSION_DENIED No enough permission for the operation", type: :access_restricted }, 2100 => %{ description: "ApiKeyFailure", type: :invalid_credentials }, 300001 => %{ description: "INVALID_PRICE Order price is invalid", type: :invalid_order }, 300002 => %{ description: "INVALID_QTY Order size is invalid", type: :invalid_order }, 300003 => %{ description: "INVALID_SIDE Order side is invalid", type: :invalid_order }, 300004 => %{ description: "INVALID_NOTIONAL Notional is too small or too large", type: :invalid_order }, 300005 => %{ description: "INVALID_TYPE Order typs is invalid", type: :invalid_order }, 300006 => %{ description: "INVALID_ORDER_ID Order id is invalid", type: :invalid_order }, 300007 => %{ description: "INVALID_TIME_IN_FORCE Time In Force in order request is invalid", type: :invalid_order }, 300008 => %{ description: "INVALID_ORDER_PARAMETER Some order parameter is invalid", type: :invalid_order }, 300009 => %{ description: "TRADING_VIOLATION Trading violation on account or asset", type: :invalid_order }, 300011 => %{ description: "INVALID_BALANCE No enough account or asset balance for the trading", type: :insufficient_balance }, 300012 => %{ description: "INVALID_PRODUCT Not a valid product supported by exchange", type: :invalid_order }, 300013 => %{ description: "INVALID_BATCH_ORDER Some or all orders are invalid in batch order request", type: :invalid_order }, 300014 => %{ description: "Order price doesn't conform to the required tick size: 0.1", type: :invalid_order }, 300020 => %{ description: "TRADING_RESTRICTED There is some trading restriction on account or asset", type: :invalid_order }, 300021 => %{ description: "Trading disabled for this account.", type: :access_restricted }, 300031 => %{ description: "NO_MARKET_PRICE No market price for market type order trading", type: :invalid_order }, 310001 => %{ description: "INVALID_MARGIN_BALANCE No enough margin balance", type: :insufficient_balance }, 310002 => %{ description: "INVALID_MARGIN_ACCOUNT Not a valid account for margin trading", type: :invalid_order }, 310003 => %{ description: "MARGIN_TOO_RISKY Leverage is too high", type: :invalid_order }, 310004 => %{ description: "INVALID_MARGIN_ASSET This asset does not support margin trading", type: :invalid_order }, 310005 => %{ description: "INVALID_REFERENCE_PRICE There is no valid reference price", type: :invalid_order }, 5002 => %{ description: "Invalid Symbol", type: :invalid_order }, 510001 => %{ description: "SERVER_ERROR Something wrong with server.", type: :exchange_error }, 6001 => %{ description: "Trading is disabled on symbol.", type: :invalid_order }, 600503 => %{ description: "Notional is too small.", type: :invalid_order }, 60060 => %{ description: "{ 'code': 60060, 'message': 'The order is already filled or canceled.' }", type: :invalid_order }, 6010 => %{ description: "{'code': 6010, 'message': 'Not enough balance.'}", type: :insufficient_balance }, 900001 => %{ description: "HUMAN_CHALLENGE Human change do not pass", type: :exchange_error } }, error_codes: %{ 100001 => :invalid_parameters, 100002 => :invalid_parameters, 100003 => :invalid_parameters, 100004 => :invalid_parameters, 100005 => :invalid_parameters, 100006 => :invalid_parameters, 100007 => :invalid_parameters, 100008 => :invalid_order, 100009 => :invalid_credentials, 100010 => :invalid_parameters, 100011 => :invalid_parameters, 100012 => :invalid_parameters, 100013 => :invalid_parameters, 100101 => :exchange_error, 150001 => :invalid_parameters, 1900 => :invalid_parameters, 200001 => :invalid_credentials, 200002 => :exchange_error, 200003 => :exchange_error, 200004 => :exchange_error, 200005 => :exchange_error, 200006 => :exchange_error, 200007 => :exchange_error, 200008 => :exchange_error, 200009 => :exchange_error, 200010 => :invalid_credentials, 200011 => :exchange_error, 200012 => :exchange_error, 200013 => :exchange_error, 200014 => :access_restricted, 200015 => :access_restricted, 2100 => :invalid_credentials, 300001 => :invalid_order, 300002 => :invalid_order, 300003 => :invalid_order, 300004 => :invalid_order, 300005 => :invalid_order, 300006 => :invalid_order, 300007 => :invalid_order, 300008 => :invalid_order, 300009 => :invalid_order, 300011 => :insufficient_balance, 300012 => :invalid_order, 300013 => :invalid_order, 300014 => :invalid_order, 300020 => :invalid_order, 300021 => :access_restricted, 300031 => :invalid_order, 310001 => :insufficient_balance, 310002 => :invalid_order, 310003 => :invalid_order, 310004 => :invalid_order, 310005 => :invalid_order, 5002 => :invalid_order, 510001 => :exchange_error, 6001 => :invalid_order, 600503 => :invalid_order, 60060 => :invalid_order, 6010 => :insufficient_balance, 900001 => :exchange_error }, exceptions: %{ exact: %{ "100001" => :bad_request, "100002" => :bad_request, "100003" => :bad_request, "100004" => :bad_request, "100005" => :bad_request, "100006" => :bad_request, "100007" => :bad_request, "100008" => :bad_symbol, "100009" => :authentication_error, "100010" => :bad_request, "100011" => :bad_request, "100012" => :bad_request, "100013" => :bad_request, "100101" => :exchange_error, "150001" => :bad_request, "1900" => :bad_request, "200001" => :authentication_error, "200002" => :exchange_error, "200003" => :exchange_error, "200004" => :exchange_error, "200005" => :exchange_error, "200006" => :exchange_error, "200007" => :exchange_error, "200008" => :exchange_error, "200009" => :exchange_error, "200010" => :authentication_error, "200011" => :exchange_error, "200012" => :exchange_error, "200013" => :exchange_error, "200014" => :permission_denied, "200015" => :permission_denied, "2100" => :authentication_error, "300001" => :invalid_order, "300002" => :invalid_order, "300003" => :invalid_order, "300004" => :invalid_order, "300005" => :invalid_order, "300006" => :invalid_order, "300007" => :invalid_order, "300008" => :invalid_order, "300009" => :invalid_order, "300011" => :insufficient_funds, "300012" => :bad_symbol, "300013" => :invalid_order, "300014" => :invalid_order, "300020" => :invalid_order, "300021" => :account_suspended, "300031" => :invalid_order, "310001" => :insufficient_funds, "310002" => :invalid_order, "310003" => :invalid_order, "310004" => :bad_symbol, "310005" => :invalid_order, "5002" => :bad_symbol, "510001" => :exchange_error, "6001" => :bad_symbol, "600503" => :invalid_order, "60060" => :invalid_order, "6010" => :insufficient_funds, "900001" => :exchange_error } }, exchange_options: %{ "account-category" => "cash", "account-group" => nil, "accountsByType" => %{ "margin" => "margin", "spot" => "cash", "swap" => "futures" }, "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "defaultType" => "spot", "fetchClosedOrders" => %{ "method" => "v2PrivateDataGetOrderHist" }, "networks" => %{ "AKT" => "Akash", "ARB" => "arbitrum", "AVAX" => "avalanche C chain", "BCH" => "Bitcoin ABC", "BEP2" => "BEP2", "BSC" => "BEP20 (BSC)", "BTC" => "Bitcoin", "ERC20" => "ERC20", "GO20" => "GO20", "LTC" => "Litecoin", "MATIC" => "Matic Network", "OMNI" => "Omni", "SOL" => "Solana", "TRC20" => "TRC20" }, "networksById" => %{ "Akash" => "AKT", "BEP2" => "BEP2", "BEP20 (BSC)" => "BSC", "Bitcoin" => "BTC", "Bitcoin ABC" => "BCH", "ERC20" => "ERC20", "GO20" => "GO20", "Litecoin" => "LTC", "Matic Network" => "MATIC", "Omni" => "OMNI", "Solana" => "SOL", "TRC20" => "TRC20", "arbitrum" => "ARB", "avalanche C chain" => "AVAX" }, "transfer" => %{ "fillResponseFromRequest" => true } }, extended_metadata: %{ fees_url: "https://ascendex.com/en/feerate/transactionfee-traderate", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/user-attachments/assets/55bab6b9-d4ca-42a8-a0e6-fac81ae557f1", referral_discount: 0.25, referral_url: "https://ascendex.com/en-us/register?inviteCode=EL6BXBQM" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: false, leverage: false, margin_mode: true, market_buy_by_cost: false, market_buy_requires_price: false, self_trade_prevention: false, stop_loss_price: false, take_profit_price: false, time_in_force: %{ fok: true, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: true }, create_orders: %{ max: 10 }, fetch_ohlcv: %{ limit: 500 }, fetch_open_orders: %{ margin_mode: false, market_type: true, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, market_type: true, symbol_required: false, trailing: false, trigger: false }, sandbox: true }, for_derivatives: %{ create_order: %{ attached_stop_loss_take_profit: %{ price: false, trigger_price_type: %{ index: false, last: true, mark: false } } }, extends: "default", fetch_closed_orders: %{ limit: 1000, margin_mode: false, symbol_required: false, trailing: false, trigger: false } }, future: %{}, spot: %{ extends: "default", fetch_closed_orders: %{ days_back: 100000, days_back_canceled: 1, limit: 1000, margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 100000 } }, swap: %{ linear: %{ extends: "forDerivatives" } } }, fees: %{ trading: %{ fee_side: "get", maker: 0.002, percentage: true, taker: 0.002, tier_based: true } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined; // fallback to default error handler\n }\n //\n // {\"code\": 6010, \"message\": \"Not enough balance.\"}\n // {\"code\": 60060, \"message\": \"The order is already filled or canceled.\"}\n // {\"code\":2100,\"message\":\"ApiKeyFailure\"}\n // {\"code\":300001,\"message\":\"Price is too low from market price.\",\"reason\":\"INVALID_PRICE\",\"accountId\":\"cshrHKLZCjlZ2ejqkmvIHHtPmLYqdnda\",\"ac\":\"CASH\",\"action\":\"place-order\",\"status\":\"Err\",\"info\":{\"symbol\":\"BTC/USDT\"}}\n //\n const code = this.safeString(response, 'code');\n const message = this.safeString(response, 'message');\n const error = (code !== undefined) && (code !== '0');\n if (error || (message !== undefined)) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\n }\n return undefined;\n }", has: %{ add_margin: true, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: false, cancel_all_orders: 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_deposit_address: false, 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: false, 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: true, create_post_only_order: true, create_post_only_order_ws: false, create_reduce_only_order: true, 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: false, 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_accounts: true, fetch_all_greeks: false, 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: false, fetch_convert_trade: false, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: false, 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_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: true, fetch_leverage_tiers: true, fetch_leverages: true, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: true, fetch_margin_modes: true, fetch_mark_ohlcv: false, fetch_mark_prices: false, fetch_market_leverage_tiers: true, fetch_markets: true, fetch_markets_ws: false, fetch_my_liquidations: false, fetch_my_settlement_history: false, fetch_my_trades: false, 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: false, fetch_order_with_client_order_id: false, fetch_order_ws: false, fetch_orders: false, fetch_orders_by_status: false, fetch_orders_ws: false, fetch_position: false, fetch_position_history: false, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: true, 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: false, 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: false, fetch_transaction_fee: false, fetch_transaction_fees: false, 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: true, repay_cross_margin: false, repay_isolated_margin: false, sandbox: true, set_leverage: true, set_margin: false, set_margin_mode: true, 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: false, 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: false, watch_tickers: false, watch_trades: true, watch_trades_for_symbols: true, withdraw: false, ws: false }, http_config: nil, id: "ascendex", markets: nil, name: "AscendEX", ohlcv_timestamp_resolution: :milliseconds, options: %{ "account-category" => "cash", "account-group" => nil, :accounts_by_type => %{ "margin" => "margin", "spot" => "cash", "swap" => "futures" }, :default_account_type => "spot", :default_type => "spot", :fetch_closed_orders => %{ "method" => "v2PrivateDataGetOrderHist" }, :networks => %{ "AKT" => "Akash", "ARB" => "arbitrum", "AVAX" => "avalanche C chain", "BCH" => "Bitcoin ABC", "BEP2" => "BEP2", "BSC" => "BEP20 (BSC)", "BTC" => "Bitcoin", "ERC20" => "ERC20", "GO20" => "GO20", "LTC" => "Litecoin", "MATIC" => "Matic Network", "OMNI" => "Omni", "SOL" => "Solana", "TRC20" => "TRC20" }, :transfer => %{ "fillResponseFromRequest" => true } }, order_mappings: nil, param_mappings: %{ "code" => "asset", "limit" => "n", "since" => "from", "timeframe" => "interval" }, parse_methods: [ %{ "comment" => nil, "examples" => [], "line_end" => 944, "line_start" => 928, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "source" => "parseBalance (response): Balances {\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n const balances = this.safeList (response, 'data', []);\n for (let i = 0; i < balances.length; i++) {\n const balance = balances[i];\n const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n const account = this.account ();\n account['free'] = this.safeString (balance, 'availableBalance');\n account['total'] = this.safeString (balance, 'totalBalance');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n \"destTag\": \"\",\n \"tagType\": \"\",\n \"tagId\": \"\",\n \"chainName\": \"ERC20\",\n \"numConfirmations\": 20,\n \"withdrawalFee\": 1,\n \"nativeScale\": 4,\n \"tips\": []\n }" ], "line_end" => 2588, "line_start" => 2560, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositAddress" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "network", "value" => "network" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "tag", "value" => "tag" } ], "name" => "parseDepositAddress", "signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress", "source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n //\n // {\n // \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n // \"destTag\": \"\",\n // \"tagType\": \"\",\n // \"tagId\": \"\",\n // \"chainName\": \"ERC20\",\n // \"numConfirmations\": 20,\n // \"withdrawalFee\": 1,\n // \"nativeScale\": 4,\n // \"tips\": []\n // }\n //\n const address = this.safeString (depositAddress, 'address');\n const tagId = this.safeString (depositAddress, 'tagId');\n const tag = this.safeString (depositAddress, tagId);\n this.checkAddress (address);\n const code = (currency === undefined) ? undefined : currency['code'];\n const chainName = this.safeString (depositAddress, 'blockchain');\n const network = this.networkIdToCode (chainName, code);\n return {\n 'info': depositAddress,\n 'currency': code,\n 'network': network,\n 'address': address,\n 'tag': tag,\n } as DepositAddress;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"assetCode\": \"USDT\",\n \"assetName\": \"Tether\",\n \"precisionScale\": 9,\n \"nativeScale\": 4,\n \"blockChain\": [\n {\n \"chainName\": \"Omni\",\n \"withdrawFee\": \"30.0\",\n \"allowDeposit\": true,\n \"allowWithdraw\": true,\n \"minDepositAmt\": \"0.0\",\n \"minWithdrawal\": \"50.0\",\n \"numConfirmations\": 3\n },\n ]\n }" ], "line_end" => 3331, "line_start" => 3282, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "fee" }, %{ "comment" => nil, "key" => "withdraw", "value" => "{\n 'fee': undefined,\n 'percentage': undefined,\n }" }, %{ "comment" => nil, "key" => "deposit", "value" => "{\n 'fee': undefined,\n 'percentage': undefined,\n }" }, %{ "comment" => nil, "key" => "networks", "value" => "{}" }, %{ "comment" => nil, "key" => "deposit", "value" => "{ 'fee': undefined, 'percentage': undefined }" }, %{ "comment" => nil, "key" => "withdraw", "value" => "{ 'fee': this.safeNumber (blockChain, 'withdrawFee'), 'percentage': false }" } ], "name" => "parseDepositWithdrawFee", "signature" => "parseDepositWithdrawFee (fee, currency: Currency = undefined)", "source" => "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n //\n // {\n // \"assetCode\": \"USDT\",\n // \"assetName\": \"Tether\",\n // \"precisionScale\": 9,\n // \"nativeScale\": 4,\n // \"blockChain\": [\n // {\n // \"chainName\": \"Omni\",\n // \"withdrawFee\": \"30.0\",\n // \"allowDeposit\": true,\n // \"allowWithdraw\": true,\n // \"minDepositAmt\": \"0.0\",\n // \"minWithdrawal\": \"50.0\",\n // \"numConfirmations\": 3\n // },\n // ]\n // }\n //\n const blockChains = this.safeList (fee, 'blockChain', []);\n const blockChainsLength = blockChains.length;\n const result: Dict = {\n 'info': fee,\n 'withdraw': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'deposit': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'networks': {},\n };\n for (let i = 0; i < blockChainsLength; i++) {\n const blockChain = blockChains[i];\n const networkId = this.safeString (blockChain, 'chainName');\n const currencyCode = this.safeString (currency, 'code');\n const networkCode = this.networkIdToCode (networkId, currencyCode);\n result['networks'][networkCode] = {\n 'deposit': { 'fee': undefined, 'percentage': undefined },\n 'withdraw': { 'fee': this.safeNumber (blockChain, 'withdrawFee'), 'percentage': false },\n };\n if (blockChainsLength === 1) {\n result['withdraw']['fee'] = this.safeNumber (blockChain, 'withdrawFee');\n result['withdraw']['percentage'] = false;\n }\n }\n return result;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"time\": 1640061364830,\n \"symbol\": \"EOS-PERP\",\n \"markPrice\": \"3.353854865\",\n \"indexPrice\": \"3.3542\",\n \"openInterest\": \"14242\",\n \"fundingRate\": \"-0.000073026\",\n \"nextFundingTime\": 1640073600000\n }" ], "line_end" => 2997, "line_start" => 2960, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (contract, 'markPrice')" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeNumber (contract, 'indexPrice')" }, %{ "comment" => nil, "key" => "interestRate", "value" => "this.parseNumber ('0')" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "currentTime" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (currentTime)" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "nextFundingRate" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "nextFundingRateTimestamp" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "this.iso8601 (nextFundingRateTimestamp)" }, %{ "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 // \"time\": 1640061364830,\n // \"symbol\": \"EOS-PERP\",\n // \"markPrice\": \"3.353854865\",\n // \"indexPrice\": \"3.3542\",\n // \"openInterest\": \"14242\",\n // \"fundingRate\": \"-0.000073026\",\n // \"nextFundingTime\": 1640073600000\n // }\n //\n const marketId = this.safeString (contract, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\n const currentTime = this.safeInteger (contract, 'time');\n const nextFundingRate = this.safeNumber (contract, 'fundingRate');\n const nextFundingRateTimestamp = this.safeInteger (contract, 'nextFundingTime');\n return {\n 'info': contract,\n 'symbol': symbol,\n 'markPrice': this.safeNumber (contract, 'markPrice'),\n 'indexPrice': this.safeNumber (contract, 'indexPrice'),\n 'interestRate': this.parseNumber ('0'),\n 'estimatedSettlePrice': undefined,\n 'timestamp': currentTime,\n 'datetime': this.iso8601 (currentTime),\n 'previousFundingRate': undefined,\n 'nextFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'nextFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'nextFundingDatetime': undefined,\n 'fundingRate': nextFundingRate,\n 'fundingTimestamp': nextFundingRateTimestamp,\n 'fundingDatetime': this.iso8601 (nextFundingRateTimestamp),\n 'interval': undefined,\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"timestamp\": 1640476800000,\n \"symbol\": \"BTC-PERP\",\n \"paymentInUSDT\": \"-0.013991178\",\n \"fundingRate\": \"0.000173497\"\n }" ], "line_end" => 3498, "line_start" => 3478, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "income" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market, '-', 'swap')" }, %{ "comment" => nil, "key" => "code", "value" => "'USDT'" }, %{ "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 (income, 'paymentInUSDT')" } ], "name" => "parseIncome", "signature" => "parseIncome (income, market: Market = undefined)", "source" => "parseIncome (income, market: Market = undefined) {\n //\n // {\n // \"timestamp\": 1640476800000,\n // \"symbol\": \"BTC-PERP\",\n // \"paymentInUSDT\": \"-0.013991178\",\n // \"fundingRate\": \"0.000173497\"\n // }\n //\n const marketId = this.safeString (income, 'symbol');\n const timestamp = this.safeInteger (income, 'timestamp');\n return {\n 'info': income,\n 'symbol': this.safeSymbol (marketId, market, '-', 'swap'),\n 'code': 'USDT',\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'id': undefined,\n 'amount': this.safeNumber (income, 'paymentInUSDT'),\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3647, "line_start" => 3635, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "leverage" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "marginMode", "value" => "marginMode" }, %{ "comment" => nil, "key" => "longLeverage", "value" => "leverageValue" }, %{ "comment" => nil, "key" => "shortLeverage", "value" => "leverageValue" } ], "name" => "parseLeverage", "signature" => "parseLeverage (leverage: Dict, market: Market = undefined): Leverage", "source" => "parseLeverage (leverage: Dict, market: Market = undefined): Leverage {\n const marketId = this.safeString (leverage, 'symbol');\n const leverageValue = this.safeInteger (leverage, 'leverage');\n const marginType = this.safeString (leverage, 'marginType');\n const marginMode = (marginType === 'crossed') ? 'cross' : 'isolated';\n return {\n 'info': leverage,\n 'symbol': this.safeSymbol (marketId, market),\n 'marginMode': marginMode,\n 'longLeverage': leverageValue,\n 'shortLeverage': leverageValue,\n } as Leverage;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 965, "line_start" => 946, "mappings" => [], "name" => "parseMarginBalance", "signature" => "parseMarginBalance (response)", "source" => "parseMarginBalance (response) {\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n const balances = this.safeList (response, 'data', []);\n for (let i = 0; i < balances.length; i++) {\n const balance = balances[i];\n const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n const account = this.account ();\n account['free'] = this.safeString (balance, 'availableBalance');\n account['total'] = this.safeString (balance, 'totalBalance');\n const debt = this.safeString (balance, 'borrowed');\n const interest = this.safeString (balance, 'interest');\n account['debt'] = Precise.stringAdd (debt, interest);\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3571, "line_start" => 3562, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "marginMode" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "marginMode", "value" => "margin" } ], "name" => "parseMarginMode", "signature" => "parseMarginMode (marginMode: Dict, market = undefined): MarginMode", "source" => "parseMarginMode (marginMode: Dict, market = undefined): MarginMode {\n const marketId = this.safeString (marginMode, 'symbol');\n const marginType = this.safeString (marginMode, 'marginType');\n const margin = (marginType === 'crossed') ? 'cross' : 'isolated';\n return {\n 'info': marginMode,\n 'symbol': this.safeSymbol (marketId, market),\n 'marginMode': margin,\n } as MarginMode;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"code\": 0\n }" ], "line_end" => 3091, "line_start" => 3069, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "data" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "'isolated'" }, %{ "comment" => nil, "key" => "amount", "value" => "undefined" }, %{ "comment" => nil, "key" => "total", "value" => "undefined" }, %{ "comment" => nil, "key" => "code", "value" => "market['quote']" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" } ], "name" => "parseMarginModification", "signature" => "parseMarginModification (data: Dict, market: Market = undefined): MarginModification", "source" => "parseMarginModification (data: Dict, market: Market = undefined): MarginModification {\n //\n // addMargin/reduceMargin\n //\n // {\n // \"code\": 0\n // }\n //\n const errorCode = this.safeString (data, 'code');\n const status = (errorCode === '0') ? 'ok' : 'failed';\n return {\n 'info': data,\n 'symbol': market['symbol'],\n 'type': undefined,\n 'marginMode': 'isolated',\n 'amount': undefined,\n 'total': undefined,\n 'code': market['quote'],\n 'status': status,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n }" }, %{ "comment" => nil, "examples" => [ "@param {object} info Exchange market response for 1 market", "@param {object} market CCXT market", "{\n \"symbol\":\"BTC-PERP\",\n \"status\":\"Normal\",\n \"displayName\":\"BTCUSDT\",\n \"settlementAsset\":\"USDT\",\n \"underlying\":\"BTC/USDT\",\n \"tradingStartTime\":1579701600000,\n \"priceFilter\":{\"minPrice\":\"1\",\"maxPrice\":\"1000000\",\"tickSize\":\"1\"},\n \"lotSizeFilter\":{\"minQty\":\"0.0001\",\"maxQty\":\"1000000000\",\"lotSize\":\"0.0001\"},\n \"commissionType\":\"Quote\",\n \"commissionReserveRate\":\"0.001\",\n \"marketOrderPriceMarkup\":\"0.03\",\n \"marginRequirements\":[\n {\"positionNotionalLowerBound\":\"0\",\"positionNotionalUpperBound\":\"50000\",\"initialMarginRate\":\"0.01\",\"maintenanceMarginRate\":\"0.006\"},\n {\"positionNotionalLowerBound\":\"50000\",\"positionNotionalUpperBound\":\"200000\",\"initialMarginRate\":\"0.02\",\"maintenanceMarginRate\":\"0.012\"},\n {\"positionNotionalLowerBound\":\"200000\",\"positionNotionalUpperBound\":\"2000000\",\"initialMarginRate\":\"0.04\",\"maintenanceMarginRate\":\"0.024\"},\n {\"positionNotionalLowerBound\":\"2000000\",\"positionNotionalUpperBound\":\"20000000\",\"initialMarginRate\":\"0.1\",\"maintenanceMarginRate\":\"0.06\"},\n {\"positionNotionalLowerBound\":\"20000000\",\"positionNotionalUpperBound\":\"40000000\",\"initialMarginRate\":\"0.2\",\"maintenanceMarginRate\":\"0.12\"},\n {\"positionNotionalLowerBound\":\"40000000\",\"positionNotionalUpperBound\":\"1000000000\",\"initialMarginRate\":\"0.333333\",\"maintenanceMarginRate\":\"0.2\"}\n ]\n }" ], "line_end" => 3280, "line_start" => 3233, "mappings" => [ %{ "comment" => nil, "key" => "tier", "value" => "this.sum (i, 1)" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market, undefined, 'contract')" }, %{ "comment" => nil, "key" => "currency", "value" => "market['quote']" }, %{ "comment" => nil, "key" => "minNotional", "value" => "this.safeNumber (tier, 'positionNotionalLowerBound')" }, %{ "comment" => nil, "key" => "maxNotional", "value" => "this.safeNumber (tier, 'positionNotionalUpperBound')" }, %{ "comment" => nil, "key" => "maintenanceMarginRate", "value" => "this.safeNumber (tier, 'maintenanceMarginRate')" }, %{ "comment" => nil, "key" => "maxLeverage", "value" => "this.parseNumber (Precise.stringDiv ('1', initialMarginRate))" }, %{ "comment" => nil, "key" => "info", "value" => "tier" } ], "name" => "parseMarketLeverageTiers", "signature" => "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]", "source" => "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n /**\n * @param {object} info Exchange market response for 1 market\n * @param {object} market CCXT market\n */\n //\n // {\n // \"symbol\":\"BTC-PERP\",\n // \"status\":\"Normal\",\n // \"displayName\":\"BTCUSDT\",\n // \"settlementAsset\":\"USDT\",\n // \"underlying\":\"BTC/USDT\",\n // \"tradingStartTime\":1579701600000,\n // \"priceFilter\":{\"minPrice\":\"1\",\"maxPrice\":\"1000000\",\"tickSize\":\"1\"},\n // \"lotSizeFilter\":{\"minQty\":\"0.0001\",\"maxQty\":\"1000000000\",\"lotSize\":\"0.0001\"},\n // \"commissionType\":\"Quote\",\n // \"commissionReserveRate\":\"0.001\",\n // \"marketOrderPriceMarkup\":\"0.03\",\n // \"marginRequirements\":[\n // {\"positionNotionalLowerBound\":\"0\",\"positionNotionalUpperBound\":\"50000\",\"initialMarginRate\":\"0.01\",\"maintenanceMarginRate\":\"0.006\"},\n // {\"positionNotionalLowerBound\":\"50000\",\"positionNotionalUpperBound\":\"200000\",\"initialMarginRate\":\"0.02\",\"maintenanceMarginRate\":\"0.012\"},\n // {\"positionNotionalLowerBound\":\"200000\",\"positionNotionalUpperBound\":\"2000000\",\"initialMarginRate\":\"0.04\",\"maintenanceMarginRate\":\"0.024\"},\n // {\"positionNotionalLowerBound\":\"2000000\",\"positionNotionalUpperBound\":\"20000000\",\"initialMarginRate\":\"0.1\",\"maintenanceMarginRate\":\"0.06\"},\n // {\"positionNotionalLowerBound\":\"20000000\",\"positionNotionalUpperBound\":\"40000000\",\"initialMarginRate\":\"0.2\",\"maintenanceMarginRate\":\"0.12\"},\n // {\"positionNotionalLowerBound\":\"40000000\",\"positionNotionalUpperBound\":\"1000000000\",\"initialMarginRate\":\"0.333333\",\"maintenanceMarginRate\":\"0.2\"}\n // ]\n // }\n //\n const marginRequirements = this.safeList (info, 'marginRequirements', []);\n const marketId = this.safeString (info, 'symbol');\n market = this.safeMarket (marketId, market);\n const tiers = [];\n for (let i = 0; i < marginRequirements.length; i++) {\n const tier = marginRequirements[i];\n const initialMarginRate = this.safeString (tier, 'initialMarginRate');\n tiers.push ({\n 'tier': this.sum (i, 1),\n 'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n 'currency': market['quote'],\n 'minNotional': this.safeNumber (tier, 'positionNotionalLowerBound'),\n 'maxNotional': this.safeNumber (tier, 'positionNotionalUpperBound'),\n 'maintenanceMarginRate': this.safeNumber (tier, 'maintenanceMarginRate'),\n 'maxLeverage': this.parseNumber (Precise.stringDiv ('1', initialMarginRate)),\n 'info': tier,\n });\n }\n return tiers as LeverageTier[];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"m\":\"bar\",\n \"s\":\"BTC/USDT\",\n \"data\":{\n \"i\":\"1\",\n \"ts\":1590228000000,\n \"o\":\"9139.59\",\n \"c\":\"9131.94\",\n \"h\":\"9139.99\",\n \"l\":\"9121.71\",\n \"v\":\"25.20648\"\n }\n }" ], "line_end" => 1286, "line_start" => 1261, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"m\":\"bar\",\n // \"s\":\"BTC/USDT\",\n // \"data\":{\n // \"i\":\"1\",\n // \"ts\":1590228000000,\n // \"o\":\"9139.59\",\n // \"c\":\"9131.94\",\n // \"h\":\"9139.99\",\n // \"l\":\"9121.71\",\n // \"v\":\"25.20648\"\n // }\n // }\n //\n const data = this.safeDict (ohlcv, 'data', {});\n return [\n this.safeInteger (data, 'ts'),\n this.safeNumber (data, 'o'),\n this.safeNumber (data, 'h'),\n this.safeNumber (data, 'l'),\n this.safeNumber (data, 'c'),\n this.safeNumber (data, 'v'),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": \"16e607e2b83a8bXHbAwwoqDo55c166fa\",\n \"orderId\": \"16e85b4d9b9a8bXHbAwwoqDoc3d66830\",\n \"orderType\": \"Market\",\n \"symbol\": \"BTC/USDT\",\n \"timestamp\": 1573576916201\n }", "{\n \"ac\": \"FUTURES\",\n \"accountId\": \"fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn\",\n \"time\": 1640819389454,\n \"orderId\": \"a17e0874ecbdU0711043490bbtcpDU5X\",\n \"seqNum\": -1,\n \"orderType\": \"Limit\",\n \"execInst\": \"NULL_VAL\", // NULL_VAL, ReduceOnly , ...\n \"side\": \"Buy\",\n \"symbol\": \"BTC-PERP\",\n \"price\": \"30000\",\n \"orderQty\": \"0.002\",\n \"stopPrice\": \"0\",\n \"stopBy\": \"ref-px\",\n \"status\": \"Ack\",\n \"lastExecTime\": 1640819389454,\n \"lastQty\": \"0\",\n \"lastPx\": \"0\",\n \"avgFilledPx\": \"0\",\n \"cumFilledQty\": \"0\",\n \"fee\": \"0\",\n \"cumFee\": \"0\",\n \"feeAsset\": \"\",\n \"errorCode\": \"\",\n \"posStopLossPrice\": \"0\",\n \"posStopLossTrigger\": \"market\",\n \"posTakeProfitPrice\": \"0\",\n \"posTakeProfitTrigger\": \"market\",\n \"liquidityInd\": \"n\"\n }", "{\n \"symbol\": \"BTC/USDT\",\n \"price\": \"8131.22\",\n \"orderQty\": \"0.00082\",\n \"orderType\": \"Market\",\n \"avgPx\": \"7392.02\",\n \"cumFee\": \"0.005152238\",\n \"cumFilledQty\": \"0.00082\",\n \"errorCode\": \"\",\n \"feeAsset\": \"USDT\",\n \"lastExecTime\": 1575953151764,\n \"orderId\": \"a16eee20b6750866943712zWEDdAjt3\",\n \"seqNum\": 2623469,\n \"side\": \"Buy\",\n \"status\": \"Filled\",\n \"stopPrice\": \"\",\n \"execInst\": \"NULL_VAL\" // \"Post\" (for postOnly orders), \"reduceOnly\" (for reduceOnly orders)\n }", "{\n \"orderId\": \"a173ad938fc3U22666567717788c3b66\", // orderId\n \"seqNum\": 18777366360, // sequence number\n \"accountId\": \"cshwSjbpPjSwHmxPdz2CPQVU9mnbzPpt\", // accountId\n \"symbol\": \"BTC/USDT\", // symbol\n \"orderType\": \"Limit\", // order type (Limit/Market/StopMarket/StopLimit)\n \"side\": \"Sell\", // order side (Buy/Sell)\n \"price\": \"11346.77\", // order price\n \"stopPrice\": \"0\", // stop price (0 by default)\n \"orderQty\": \"0.01\", // order quantity (in base asset)\n \"status\": \"Canceled\", // order status (Filled/Canceled/Rejected)\n \"createTime\": 1596344995793, // order creation time\n \"lastExecTime\": 1596344996053, // last execution time\n \"avgFillPrice\": \"11346.77\", // average filled price\n \"fillQty\": \"0.01\", // filled quantity (in base asset)\n \"fee\": \"-0.004992579\", // cummulative fee. if negative, this value is the commission charged; if possitive, this value is the rebate received.\n \"feeAsset\": \"USDT\" // fee asset\n }", "{\n \"ac\": \"FUTURES\",\n \"accountId\": \"testabcdefg\",\n \"avgPx\": \"0\",\n \"cumFee\": \"0\",\n \"cumQty\": \"0\",\n \"errorCode\": \"NULL_VAL\",\n \"execInst\": \"NULL_VAL\",\n \"feeAsset\": \"USDT\",\n \"lastExecTime\": 1584072844085,\n \"orderId\": \"r170d21956dd5450276356bbtcpKa74\",\n \"orderQty\": \"1.1499\",\n \"orderType\": \"Limit\",\n \"price\": \"4000\",\n \"sendingTime\": 1584072841033,\n \"seqNum\": 24105338,\n \"side\": \"Buy\",\n \"status\": \"Canceled\",\n \"stopPrice\": \"\",\n \"symbol\": \"BTC-PERP\"\n }," ], "line_end" => 1631, "line_start" => 1450, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "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" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "undefined" }, %{ "comment" => nil, "key" => "postOnly", "value" => "postOnly" }, %{ "comment" => nil, "key" => "reduceOnly", "value" => "reduceOnly" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "average" }, %{ "comment" => nil, "key" => "filled", "value" => "filled" }, %{ "comment" => nil, "key" => "remaining", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "trades", "value" => "undefined" }, %{ "comment" => nil, "key" => "cost", "value" => "feeCost" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrencyCode" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n //\n // {\n // \"id\": \"16e607e2b83a8bXHbAwwoqDo55c166fa\",\n // \"orderId\": \"16e85b4d9b9a8bXHbAwwoqDoc3d66830\",\n // \"orderType\": \"Market\",\n // \"symbol\": \"BTC/USDT\",\n // \"timestamp\": 1573576916201\n // }\n //\n // & linear (fetchClosedOrders)\n //\n // {\n // \"ac\": \"FUTURES\",\n // \"accountId\": \"fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn\",\n // \"time\": 1640819389454,\n // \"orderId\": \"a17e0874ecbdU0711043490bbtcpDU5X\",\n // \"seqNum\": -1,\n // \"orderType\": \"Limit\",\n // \"execInst\": \"NULL_VAL\", // NULL_VAL, ReduceOnly , ...\n // \"side\": \"Buy\",\n // \"symbol\": \"BTC-PERP\",\n // \"price\": \"30000\",\n // \"orderQty\": \"0.002\",\n // \"stopPrice\": \"0\",\n // \"stopBy\": \"ref-px\",\n // \"status\": \"Ack\",\n // \"lastExecTime\": 1640819389454,\n // \"lastQty\": \"0\",\n // \"lastPx\": \"0\",\n // \"avgFilledPx\": \"0\",\n // \"cumFilledQty\": \"0\",\n // \"fee\": \"0\",\n // \"cumFee\": \"0\",\n // \"feeAsset\": \"\",\n // \"errorCode\": \"\",\n // \"posStopLossPrice\": \"0\",\n // \"posStopLossTrigger\": \"market\",\n // \"posTakeProfitPrice\": \"0\",\n // \"posTakeProfitTrigger\": \"market\",\n // \"liquidityInd\": \"n\"\n // }\n //\n // fetchOrder, fetchOpenOrders, fetchClosedOrders\n //\n // {\n // \"symbol\": \"BTC/USDT\",\n // \"price\": \"8131.22\",\n // \"orderQty\": \"0.00082\",\n // \"orderType\": \"Market\",\n // \"avgPx\": \"7392.02\",\n // \"cumFee\": \"0.005152238\",\n // \"cumFilledQty\": \"0.00082\",\n // \"errorCode\": \"\",\n // \"feeAsset\": \"USDT\",\n // \"lastExecTime\": 1575953151764,\n // \"orderId\": \"a16eee20b6750866943712zWEDdAjt3\",\n // \"seqNum\": 2623469,\n // \"side\": \"Buy\",\n // \"status\": \"Filled\",\n // \"stopPrice\": \"\",\n // \"execInst\": \"NULL_VAL\" // \"Post\" (for postOnly orders), \"reduceOnly\" (for reduceOnly orders)\n // }\n //\n // {\n // \"orderId\": \"a173ad938fc3U22666567717788c3b66\", // orderId\n // \"seqNum\": 18777366360, // sequence number\n // \"accountId\": \"cshwSjbpPjSwHmxPdz2CPQVU9mnbzPpt\", // accountId\n // \"symbol\": \"BTC/USDT\", // symbol\n // \"orderType\": \"Limit\", // order type (Limit/Market/StopMarket/StopLimit)\n // \"side\": \"Sell\", // order side (Buy/Sell)\n // \"price\": \"11346.77\", // order price\n // \"stopPrice\": \"0\", // stop price (0 by default)\n // \"orderQty\": \"0.01\", // order quantity (in base asset)\n // \"status\": \"Canceled\", // order status (Filled/Canceled/Rejected)\n // \"createTime\": 1596344995793, // order creation time\n // \"lastExecTime\": 1596344996053, // last execution time\n // \"avgFillPrice\": \"11346.77\", // average filled price\n // \"fillQty\": \"0.01\", // filled quantity (in base asset)\n // \"fee\": \"-0.004992579\", // cummulative fee. if negative, this value is the commission charged; if possitive, this value is the rebate received.\n // \"feeAsset\": \"USDT\" // fee asset\n // }\n //\n // {\n // \"ac\": \"FUTURES\",\n // \"accountId\": \"testabcdefg\",\n // \"avgPx\": \"0\",\n // \"cumFee\": \"0\",\n // \"cumQty\": \"0\",\n // \"errorCode\": \"NULL_VAL\",\n // \"execInst\": \"NULL_VAL\",\n // \"feeAsset\": \"USDT\",\n // \"lastExecTime\": 1584072844085,\n // \"orderId\": \"r170d21956dd5450276356bbtcpKa74\",\n // \"orderQty\": \"1.1499\",\n // \"orderType\": \"Limit\",\n // \"price\": \"4000\",\n // \"sendingTime\": 1584072841033,\n // \"seqNum\": 24105338,\n // \"side\": \"Buy\",\n // \"status\": \"Canceled\",\n // \"stopPrice\": \"\",\n // \"symbol\": \"BTC-PERP\"\n // },\n //\n const status = this.parseOrderStatus (this.safeString (order, 'status'));\n const marketId = this.safeString (order, 'symbol');\n const symbol = this.safeSymbol (marketId, market, '/');\n let timestamp = this.safeIntegerN (order, [ 'timestamp', 'sendingTime', 'time' ]);\n const lastTradeTimestamp = this.safeInteger (order, 'lastExecTime');\n if (timestamp === undefined) {\n timestamp = lastTradeTimestamp;\n }\n const price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'orderQty');\n const average = this.safeString2 (order, 'avgPx', 'avgFilledPx');\n const filled = this.safeStringN (order, [ 'cumFilledQty', 'cumQty', 'fillQty' ]);\n const id = this.safeString (order, 'orderId');\n let clientOrderId = this.safeString (order, 'id');\n if (clientOrderId !== undefined) {\n if (clientOrderId.length < 1) {\n clientOrderId = undefined;\n }\n }\n const rawTypeLower = this.safeStringLower (order, 'orderType');\n let type = rawTypeLower;\n if (rawTypeLower !== undefined) {\n if (rawTypeLower === 'stoplimit') {\n type = 'limit';\n }\n if (rawTypeLower === 'stopmarket') {\n type = 'market';\n }\n }\n const side = this.safeStringLower (order, 'side');\n const feeCost = this.safeNumber2 (order, 'cumFee', 'fee');\n let fee = undefined;\n if (feeCost !== undefined) {\n const feeCurrencyId = this.safeString (order, 'feeAsset');\n const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n fee = {\n 'cost': feeCost,\n 'currency': feeCurrencyCode,\n };\n }\n const triggerPrice = this.omitZero (this.safeString (order, 'stopPrice'));\n let reduceOnly = undefined;\n const execInst = this.safeStringLower (order, 'execInst');\n if (execInst === 'reduceonly') {\n reduceOnly = true;\n }\n let postOnly = undefined;\n if (execInst === 'post') {\n postOnly = true;\n }\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': clientOrderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': lastTradeTimestamp,\n 'symbol': symbol,\n 'type': type,\n 'timeInForce': undefined,\n 'postOnly': postOnly,\n 'reduceOnly': reduceOnly,\n 'side': side,\n 'price': price,\n 'triggerPrice': triggerPrice,\n 'amount': amount,\n 'cost': undefined,\n 'average': average,\n 'filled': filled,\n 'remaining': undefined,\n 'status': status,\n 'fee': fee,\n 'trades': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1448, "line_start" => 1438, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'PendingNew': 'open',\n 'New': 'open',\n 'PartiallyFilled': 'open',\n 'Filled': 'closed',\n 'Canceled': 'canceled',\n 'Rejected': 'rejected',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"symbol\": \"BTC-PERP\",\n \"side\": \"LONG\",\n \"position\": \"0.0001\",\n \"referenceCost\": \"-3.12277254\",\n \"unrealizedPnl\": \"-0.001700233\",\n \"realizedPnl\": \"0\",\n \"avgOpenPrice\": \"31209\",\n \"marginType\": \"isolated\",\n \"isolatedMargin\": \"1.654972977\",\n \"leverage\": \"2\",\n \"takeProfitPrice\": \"0\",\n \"takeProfitTrigger\": \"market\",\n \"stopLossPrice\": \"0\",\n \"stopLossTrigger\": \"market\",\n \"buyOpenOrderNotional\": \"0\",\n \"sellOpenOrderNotional\": \"0\",\n \"markPrice\": \"31210.723063672\",\n \"indexPrice\": \"31223.148857925\"\n }," ], "line_end" => 2958, "line_start" => 2894, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "notional", "value" => "this.parseNumber (notional)" }, %{ "comment" => nil, "key" => "marginMode", "value" => "marginMode" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.safeNumber (position, 'avgOpenPrice')" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.safeNumber (position, 'unrealizedPnl')" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.safeNumber (position, 'position')" }, %{ "comment" => nil, "key" => "contractSize", "value" => "this.safeNumber (market, 'contractSize')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (position, 'markPrice')" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeStringLower (position, 'side')" }, %{ "comment" => nil, "key" => "hedged", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "collateral" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "leverage", "value" => "this.safeInteger (position, 'leverage')" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "this.safeNumber (position, 'stopLossPrice')" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "this.safeNumber (position, 'takeProfitPrice')" } ], "name" => "parsePosition", "signature" => "parsePosition (position: Dict, market: Market = undefined)", "source" => "parsePosition (position: Dict, market: Market = undefined) {\n //\n // {\n // \"symbol\": \"BTC-PERP\",\n // \"side\": \"LONG\",\n // \"position\": \"0.0001\",\n // \"referenceCost\": \"-3.12277254\",\n // \"unrealizedPnl\": \"-0.001700233\",\n // \"realizedPnl\": \"0\",\n // \"avgOpenPrice\": \"31209\",\n // \"marginType\": \"isolated\",\n // \"isolatedMargin\": \"1.654972977\",\n // \"leverage\": \"2\",\n // \"takeProfitPrice\": \"0\",\n // \"takeProfitTrigger\": \"market\",\n // \"stopLossPrice\": \"0\",\n // \"stopLossTrigger\": \"market\",\n // \"buyOpenOrderNotional\": \"0\",\n // \"sellOpenOrderNotional\": \"0\",\n // \"markPrice\": \"31210.723063672\",\n // \"indexPrice\": \"31223.148857925\"\n // },\n //\n const marketId = this.safeString (position, 'symbol');\n market = this.safeMarket (marketId, market);\n let notional = this.safeString (position, 'buyOpenOrderNotional');\n if (Precise.stringEq (notional, '0')) {\n notional = this.safeString (position, 'sellOpenOrderNotional');\n }\n const marginType = this.safeString (position, 'marginType');\n const marginMode = (marginType === 'crossed') ? 'cross' : 'isolated';\n let collateral = undefined;\n if (marginMode === 'isolated') {\n collateral = this.safeString (position, 'isolatedMargin');\n }\n return this.safePosition ({\n 'info': position,\n 'id': undefined,\n 'symbol': market['symbol'],\n 'notional': this.parseNumber (notional),\n 'marginMode': marginMode,\n 'liquidationPrice': undefined,\n 'entryPrice': this.safeNumber (position, 'avgOpenPrice'),\n 'unrealizedPnl': this.safeNumber (position, 'unrealizedPnl'),\n 'percentage': undefined,\n 'contracts': this.safeNumber (position, 'position'),\n 'contractSize': this.safeNumber (market, 'contractSize'),\n 'markPrice': this.safeNumber (position, 'markPrice'),\n 'lastPrice': undefined,\n 'side': this.safeStringLower (position, 'side'),\n 'hedged': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'lastUpdateTimestamp': undefined,\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'collateral': collateral,\n 'initialMargin': undefined,\n 'initialMarginPercentage': undefined,\n 'leverage': this.safeInteger (position, 'leverage'),\n 'marginRatio': undefined,\n 'stopLossPrice': this.safeNumber (position, 'stopLossPrice'),\n 'takeProfitPrice': this.safeNumber (position, 'takeProfitPrice'),\n });\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 983, "line_start" => 967, "mappings" => [], "name" => "parseSwapBalance", "signature" => "parseSwapBalance (response)", "source" => "parseSwapBalance (response) {\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n const data = this.safeDict (response, 'data', {});\n const collaterals = this.safeList (data, 'collaterals', []);\n for (let i = 0; i < collaterals.length; i++) {\n const balance = collaterals[i];\n const code = this.safeCurrencyCode (this.safeString (balance, 'asset'));\n const account = this.account ();\n account['total'] = this.safeString (balance, 'balance');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"symbol\":\"QTUM/BTC\",\n \"open\":\"0.00016537\",\n \"close\":\"0.00019077\",\n \"high\":\"0.000192\",\n \"low\":\"0.00016537\",\n \"volume\":\"846.6\",\n \"ask\":[\"0.00018698\",\"26.2\"],\n \"bid\":[\"0.00018408\",\"503.7\"],\n \"type\":\"spot\"\n }" ], "line_end" => 1173, "line_start" => 1128, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "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.safeString (bid, 0)" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "this.safeString (bid, 1)" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeString (ask, 0)" }, %{ "comment" => nil, "key" => "askVolume", "value" => "this.safeString (ask, 1)" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "open" }, %{ "comment" => nil, "key" => "close", "value" => "close" }, %{ "comment" => nil, "key" => "last", "value" => "close" }, %{ "comment" => nil, "key" => "previousClose", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "this.safeString (ticker, 'volume')" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "undefined" }, %{ "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 // {\n // \"symbol\":\"QTUM/BTC\",\n // \"open\":\"0.00016537\",\n // \"close\":\"0.00019077\",\n // \"high\":\"0.000192\",\n // \"low\":\"0.00016537\",\n // \"volume\":\"846.6\",\n // \"ask\":[\"0.00018698\",\"26.2\"],\n // \"bid\":[\"0.00018408\",\"503.7\"],\n // \"type\":\"spot\"\n // }\n //\n const timestamp = undefined;\n const marketId = this.safeString (ticker, 'symbol');\n const type = this.safeString (ticker, 'type');\n const delimiter = (type === 'spot') ? '/' : undefined;\n const symbol = this.safeSymbol (marketId, market, delimiter);\n const close = this.safeString (ticker, 'close');\n const bid = this.safeList (ticker, 'bid', []);\n const ask = this.safeList (ticker, 'ask', []);\n const open = this.safeString (ticker, 'open');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': undefined,\n 'high': this.safeString (ticker, 'high'),\n 'low': this.safeString (ticker, 'low'),\n 'bid': this.safeString (bid, 0),\n 'bidVolume': this.safeString (bid, 1),\n 'ask': this.safeString (ask, 0),\n 'askVolume': this.safeString (ask, 1),\n 'vwap': undefined,\n 'open': open,\n 'close': close,\n 'last': close,\n 'previousClose': undefined, // previous day close\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'volume'),\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"p\":\"9128.5\", // price\n \"q\":\"0.0030\", // quantity\n \"ts\":1590229002385, // timestamp\n \"bm\":false, // if true, the buyer is the market maker, we only use this field to \"define the side\" of a public trade\n \"seqnum\":180143985289898554\n }" ], "line_end" => 1396, "line_start" => 1363, "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" => "market['symbol']" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "order", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "priceString" }, %{ "comment" => nil, "key" => "amount", "value" => "amountString" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "undefined" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // public fetchTrades\n //\n // {\n // \"p\":\"9128.5\", // price\n // \"q\":\"0.0030\", // quantity\n // \"ts\":1590229002385, // timestamp\n // \"bm\":false, // if true, the buyer is the market maker, we only use this field to \"define the side\" of a public trade\n // \"seqnum\":180143985289898554\n // }\n //\n const timestamp = this.safeInteger (trade, 'ts');\n const priceString = this.safeString2 (trade, 'price', 'p');\n const amountString = this.safeString (trade, 'q');\n const buyerIsMaker = this.safeBool (trade, 'bm', false);\n const side = buyerIsMaker ? 'sell' : 'buy';\n market = this.safeMarket (undefined, market);\n return this.safeTrade ({\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'id': undefined,\n 'order': undefined,\n 'type': undefined,\n 'takerOrMaker': undefined,\n 'side': side,\n 'price': priceString,\n 'amount': amountString,\n 'cost': undefined,\n 'fee': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"requestId\": \"wuzd1Ojsqtz4bCA3UXwtUnnJDmU8PiyB\",\n \"time\": 1591606166000,\n \"asset\": \"USDT\",\n \"transactionType\": \"deposit\",\n \"amount\": \"25\",\n \"commission\": \"0\",\n \"networkTransactionId\": \"0xbc4eabdce92f14dbcc01d799a5f8ca1f02f4a3a804b6350ea202be4d3c738fce\",\n \"status\": \"pending\",\n \"numConfirmed\": 8,\n \"numConfirmations\": 20,\n \"destAddress\": {\n \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n \"destTag\": \"...\" // for currencies that have it\n }\n }" ], "line_end" => 2826, "line_start" => 2772, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transaction, 'requestId')" }, %{ "comment" => nil, "key" => "txid", "value" => "this.safeString (transaction, 'networkTransactionId')" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeString (transaction, 'transactionType')" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "amount", "value" => "this.parseNumber (amountString)" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransactionStatus (this.safeString (transaction, 'status'))" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "addressTo", "value" => "address" }, %{ "comment" => nil, "key" => "tag", "value" => "tag" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagTo", "value" => "tag" }, %{ "comment" => nil, "key" => "updated", "value" => "undefined" }, %{ "comment" => nil, "key" => "comment", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': code,\n 'cost': this.parseNumber (feeCostString),\n 'rate': undefined,\n }" }, %{ "comment" => nil, "key" => "internal", "value" => "false" }, %{ "comment" => nil, "key" => "cost", "value" => "this.parseNumber (feeCostString)" }, %{ "comment" => nil, "key" => "rate", "value" => "undefined" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // {\n // \"requestId\": \"wuzd1Ojsqtz4bCA3UXwtUnnJDmU8PiyB\",\n // \"time\": 1591606166000,\n // \"asset\": \"USDT\",\n // \"transactionType\": \"deposit\",\n // \"amount\": \"25\",\n // \"commission\": \"0\",\n // \"networkTransactionId\": \"0xbc4eabdce92f14dbcc01d799a5f8ca1f02f4a3a804b6350ea202be4d3c738fce\",\n // \"status\": \"pending\",\n // \"numConfirmed\": 8,\n // \"numConfirmations\": 20,\n // \"destAddress\": {\n // \"address\": \"0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722\",\n // \"destTag\": \"...\" // for currencies that have it\n // }\n // }\n //\n const destAddress = this.safeDict (transaction, 'destAddress', {});\n const address = this.safeString (destAddress, 'address');\n const tag = this.safeString (destAddress, 'destTag');\n const timestamp = this.safeInteger (transaction, 'time');\n const currencyId = this.safeString (transaction, 'asset');\n let amountString = this.safeString (transaction, 'amount');\n const feeCostString = this.safeString (transaction, 'commission');\n amountString = Precise.stringSub (amountString, feeCostString);\n const code = this.safeCurrencyCode (currencyId, currency);\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'requestId'),\n 'txid': this.safeString (transaction, 'networkTransactionId'),\n 'type': this.safeString (transaction, 'transactionType'),\n 'currency': code,\n 'network': undefined,\n 'amount': this.parseNumber (amountString),\n 'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': address,\n 'addressFrom': undefined,\n 'addressTo': address,\n 'tag': tag,\n 'tagFrom': undefined,\n 'tagTo': tag,\n 'updated': undefined,\n 'comment': undefined,\n 'fee': {\n 'currency': code,\n 'cost': this.parseNumber (feeCostString),\n 'rate': undefined,\n },\n 'internal': false,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2770, "line_start" => 2762, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'reviewing': 'pending',\n 'pending': 'pending',\n 'confirmed': 'ok',\n 'rejected': 'rejected',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3412, "line_start" => 3395, "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" => "currencyCode" }, %{ "comment" => nil, "key" => "amount", "value" => "undefined" }, %{ "comment" => nil, "key" => "fromAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "toAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransferStatus (status)" } ], "name" => "parseTransfer", "signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry", "source" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n //\n // { \"code\": \"0\" }\n //\n const status = this.safeString (transfer, 'code');\n const currencyCode = this.safeCurrencyCode (undefined, currency);\n return {\n 'info': transfer,\n 'id': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'currency': currencyCode,\n 'amount': undefined,\n 'fromAccount': undefined,\n 'toAccount': undefined,\n 'status': this.parseTransferStatus (status),\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3419, "line_start" => 3414, "mappings" => [], "name" => "parseTransferStatus", "signature" => "parseTransferStatus (status: Str): Str", "source" => "parseTransferStatus (status: Str): Str {\n if (status === '0') {\n return 'ok';\n }\n return 'failed';\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 400, period: 1000, requests: 2, rolling_window_size: 60000 }, raw_endpoints: %{ private: [], public: [] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: %{ code_field: "code", field: "code", message_field: "msg", success_values: [ "0" ], type: :success_code }, signing: %{ confidence: :medium, pattern: :hmac_sha256_headers, signature_encoding: :base64 }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ precision_mode: 4, sample_limits: %{ "amount" => %{ "max" => 1000000000, "min" => 1.0e-9 }, "cost" => %{ "max" => 1000000, "min" => 5 }, "price" => %{ "min" => 0.01 } }, sample_precision: %{ "amount" => 0.001, "price" => 0.01 }, spot: %{ base: "BCH", base_id: "BCH", case: :upper, contract: false, id: "BCH/USDT", limits: %{ "amount" => %{ "max" => 1000000000, "min" => 1.0e-9 }, "cost" => %{ "max" => 1000000, "min" => 5 }, "leverage" => %{}, "price" => %{ "min" => 0.01 } }, maker: 0.001, precision: %{ "amount" => 0.001, "price" => 0.01 }, quote: "USDT", quote_id: "USDT", separator: "", symbol: "BCH/USDT", taker: 0.001 }, swap: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, contract_size: 1, id: "BTC-PERP", inverse: false, limits: %{ "amount" => %{ "max" => 100000000000, "min" => 0.0001 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "max" => 1000000, "min" => 0.1 } }, linear: true, maker: 0.001, precision: %{ "amount" => 0.0001, "price" => 0.1 }, quote: "USDT", quote_id: "USDT", separator: "-", settle: "USDT", settle_id: "USDT", symbol: "BTC/USDT:USDT", taker: 0.001 } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :no_separator_upper, separator: "", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :suffix_perp, separator: "", suffix: "-PERP" } }, timeframes: %{ "12h" => "720", "15m" => "15", "1M" => "1m", "1d" => "1d", "1h" => "60", "1m" => "1", "1w" => "1w", "2h" => "120", "30m" => "30", "4h" => "240", "5m" => "5", "6h" => "360" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://ascendex.com", api_sections: %{ "rest" => "https://ascendex.com" }, doc: [ "https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation" ], other: nil, sandbox: %{ "rest" => "https://api-test.ascendex-sandbox.com" }, www: "https://ascendex.com" }, version: "v2", ws: %{ auth: %{ algorithm: :sha256, encoding: :base64, market_specific: false, message_format: :op_args, op_field: "op", op_value: "auth", pattern: :generic_hmac, payload_format: "custom", requires_passphrase: false, timestamp_unit: :milliseconds }, channel_templates: %{ watch_balance: %{ auth_required: true, market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_ohlcv: %{ channel_name: "bar", market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_order_book: %{ channel_name: "depth", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_order_book_snapshot: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_orders: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_private: %{ auth_required: true, market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_public: %{ market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_public_multiple: %{ market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_trades: %{ channel_name: "trades:", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_trades_for_symbols: %{ channel_name: "trades:", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." } }, 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: nil, 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: false, watch_tickers: nil, watch_trades: true, watch_trades_for_symbols: true }, message_patterns: [ %{ format: :op, id_field: "id", keys: [ "ch", "id", "op" ], kind_field: "op", kind_value: "sub", sources: [ :send, :watch, :watch_multiple ] } ], subscription_config: %{ args_field: "ch", args_format: :string, market_id_format: :native, op_field: "op", separator: "." }, subscription_pattern: :op_subscribe, test_urls: %{ "private" => "wss://api-test.ascendex-sandbox.com:443/{accountGroup}/api/pro/v2/stream", "public" => "wss://api-test.ascendex-sandbox.com:443/api/pro/v2/stream" }, urls: %{ "private" => "wss://ascendex.com:443/{accountGroup}/api/pro/v2/stream", "public" => "wss://ascendex.com:443/api/pro/v2/stream" }, watch_methods: [ "watchBalance", "watchOHLCV", "watchOrderBook", "watchOrderBookSnapshot", "watchOrders", "watchPrivate", "watchPublic", "watchPublicMultiple", "watchTrades", "watchTradesForSymbols" ] } }