# WOO X Exchange Specification # # Auto-generated by: mix ccxt.extract woo # 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: true, classification: :certified_pro, comment: nil, countries: [ "KY" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 55, "coveragePercent" => 100, "enabledMethods" => 57, "excluded" => [ %{ "method" => "editOrder", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchTransactions", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 2, "extractableMethods" => 55, "failures" => [] }, endpoints: [ %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_all_orders, param_mappings: %{}, params: [ :symbol ], path: "/trade/orders", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :post, name: :cancel_all_orders_after, param_mappings: %{ "timeout" => "triggerAfter" }, params: [ :timeout ], path: "/trade/cancelAllAfter", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_order, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, market_type: :spot, method: :post, name: :create_convert_trade, param_mappings: %{ "id" => "quoteId" }, params: [ :id, :fromCode, :toCode, :amount ], path: "/convert/rft", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, default_params: %{ "type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :side, :amount, :price ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, default_params: %{ "side" => "BUY", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_buy_order_with_cost, param_mappings: %{ "cost" => "amount" }, params: [ :symbol, :cost ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, default_params: %{ "side" => "SELL", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_sell_order_with_cost, param_mappings: %{ "cost" => "amount" }, params: [ :symbol, :cost ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 5, default_params: %{ "algoType" => "BRACKET", "childOrders" => [ %{ "algoType" => "POSITIONAL_TP_SL", "childOrders" => [ %{ "algoType" => "STOP_LOSS", "reduceOnly" => true, "side" => "SELL", "triggerPrice" => "48000", "type" => "CLOSE_POSITION" }, %{ "algoType" => "TAKE_PROFIT", "reduceOnly" => true, "side" => "SELL", "triggerPrice" => "52000", "type" => "CLOSE_POSITION" } ], "reduceOnly" => false, "symbol" => "BTCUSDT" } ], "symbol" => "BTCUSDT" }, market_type: :swap, method: :post, name: :create_order_with_take_profit_and_stop_loss, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price, :takeProfit, :stopLoss ], path: "/trade/algoOrder", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, default_params: %{ "reduceOnly" => true, "symbol" => "BTCUSDT" }, market_type: :swap, method: :post, name: :create_reduce_only_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, default_params: %{ "symbol" => "BTCUSDT", "triggerDirection" => "below" }, market_type: :swap, method: :post, name: :create_stop_loss_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price, :stopLossPrice ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, default_params: %{ "symbol" => "BTCUSDT", "triggerDirection" => "above" }, market_type: :swap, method: :post, name: :create_take_profit_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price, :takeProfitPrice ], path: "/trade/order", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 5, default_params: %{ "algoType" => "TRAILING_STOP", "symbol" => "BTCUSDT" }, market_type: :swap, method: :post, name: :create_trailing_amount_order, param_mappings: %{ "amount" => "quantity", "trailingAmount" => "callbackValue", "trailingTriggerPrice" => "activatedPrice" }, params: [ :symbol, :type, :side, :amount, :price, :trailingAmount, :trailingTriggerPrice ], path: "/trade/algoOrder", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 5, default_params: %{ "algoType" => "TRAILING_STOP", "callbackRate" => "0.01", "symbol" => "BTCUSDT" }, market_type: :swap, method: :post, name: :create_trailing_percent_order, param_mappings: %{ "amount" => "quantity", "trailingTriggerPrice" => "activatedPrice" }, params: [ :symbol, :type, :side, :amount, :price, :trailingPercent, :trailingTriggerPrice ], path: "/trade/algoOrder", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 5, default_params: %{ "algoType" => "STOP", "symbol" => "BTCUSDT", "triggerDirection" => "below" }, market_type: :swap, method: :post, name: :create_trigger_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/trade/algoOrder", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, market_type: :spot, method: :get, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/account/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/asset/balances", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "status" => "COMPLETED" }, market_type: :spot, method: :get, name: :fetch_closed_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/trade/orders", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_convert_currencies, param_mappings: %{}, params: [], path: "/convert/assetInfo", response_transformer: {:extract_path, ["rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, market_type: :spot, method: :get, name: :fetch_convert_quote, param_mappings: %{ "amount" => "sellQuantity", "fromCode" => "sellToken", "toCode" => "buyToken" }, params: [ :fromCode, :toCode, :amount ], path: "/convert/rfq", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_convert_trade, param_mappings: %{ "id" => "quoteId" }, params: [ :id, :code ], path: "/convert/trade", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_convert_trade_history, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/convert/trades", response_transformer: {:extract_path, ["data", "tradeVos"]}, source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/token", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, market_type: :spot, method: :get, name: :fetch_deposit_address, param_mappings: %{ "code" => "token" }, params: [ :code ], path: "/asset/wallet/deposit", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, default_params: %{ "tokenSide" => "DEPOSIT", "type" => "BALANCE" }, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{ "code" => "token" }, params: [ :code, :since, :limit ], path: "/asset/wallet/history", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, default_params: %{ "type" => "BALANCE" }, market_type: :spot, method: :get, name: :fetch_deposits_withdrawals, param_mappings: %{ "code" => "token" }, params: [ :code, :since, :limit ], path: "/asset/wallet/history", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 30, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/futures/fundingFee/history", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_interval, param_mappings: %{}, params: [ :symbol ], path: "/fundingRate", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{}, params: [ :symbol ], path: "/fundingRate", response_transformer: {:extract_path_unwrap, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rate_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/fundingRateHistory", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_rates, param_mappings: %{}, params: [ :symbols ], path: "/fundingRate", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/orderbook", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, market_type: :spot, method: :get, name: :fetch_ledger, param_mappings: %{ "code" => "token" }, params: [ :code, :since, :limit ], path: "/asset/wallet/history", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, default_params: %{ "marginMode" => "CROSS", "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_leverage, param_mappings: %{}, params: [ :symbol ], path: "/futures/leverage", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/instruments", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 5, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/trade/transactionHistory", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "after", "timeframe" => "type" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/klineHistory", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, default_params: %{ "status" => "INCOMPLETE" }, market_type: :spot, method: :get, name: :fetch_open_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/trade/orders", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 2, market_type: :spot, method: :get, name: :fetch_order, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol ], path: "/trade/order", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "limit" => "maxLevel" }, params: [ :symbol, :limit ], path: "/orderbook", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_order_trades, param_mappings: %{ "id" => "oid" }, params: [ :id, :symbol, :since, :limit ], path: "/order/{oid}/trades", response_transformer: {:extract_path, ["rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/trade/orders", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 3.33, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_position, param_mappings: %{}, params: [ :symbol ], path: "/futures/positions", response_transformer: {:extract_path_unwrap, ["data", "positions"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 3.33, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/futures/positions", response_transformer: {:extract_path, ["data", "positions"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_status, param_mappings: %{}, params: [], path: "/systemInfo", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/systemInfo", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/marketTrades", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 5, market_type: :spot, method: :get, name: :fetch_trading_fee, param_mappings: %{}, params: [ :symbol ], path: "/trade/tradingFee", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, market_type: :spot, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/account/info", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 30, market_type: :spot, method: :get, name: :fetch_transfers, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/asset/transfer/history", response_transformer: {:extract_path, ["data", "rows"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, default_params: %{ "tokenSide" => "WITHDRAW", "type" => "BALANCE" }, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{ "code" => "token" }, params: [ :code, :since, :limit ], path: "/asset/wallet/history", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, default_params: %{ "marginMode" => "CROSS", "symbol" => "BTCUSDT" }, market_type: :swap, method: :put, name: :set_leverage, param_mappings: %{}, params: [ :leverage, :symbol ], path: "/futures/leverage", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 120, default_params: %{ "positionMode" => "HEDGE_MODE" }, market_type: :swap, method: :put, name: :set_position_mode, param_mappings: %{}, params: [ :hedged, :symbol ], path: "/futures/positionMode", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 30, default_params: %{ "from" => "", "to" => "" }, market_type: :spot, method: :post, name: :transfer, param_mappings: %{ "code" => "token" }, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/asset/transfer", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "v3/private", auth: true, cost: 60, default_params: %{ "network" => "ETH" }, market_type: :spot, method: :post, name: :withdraw, param_mappings: %{ "code" => "token" }, params: [ :code, :amount, :address, :tag ], path: "/asset/wallet/withdraw", response_transformer: {:extract_path, ["data", "withdrawId"]}, source: :intercepted } ], error_code_details: %{ -1000 => %{ description: "{ \"code\": -1000, \"message\": \"An unknown error occurred while processing the request\" } || {\"success\":false,\"code\":\"-1000\",\"message\":\"An internal error has occurred. We are unable to process your request. Please try again later.\"}", type: :exchange_error }, -1001 => %{ description: "The api key or secret is in wrong format", type: :invalid_credentials }, -1002 => %{ description: "API key or secret is invalid, it may because key have insufficient permission or the key is expired/revoked.", type: :invalid_credentials }, -1003 => %{ description: "Rate limit exceed.", type: :rate_limited }, -1004 => %{ description: "An unknown parameter was sent.", type: :invalid_parameters }, -1005 => %{ description: "Some parameters are in wrong format for api.", type: :invalid_parameters }, -1006 => %{ description: "The data is not found in server.", type: :invalid_parameters }, -1007 => %{ description: "The data is already exists or your request is duplicated.", type: :invalid_parameters }, -1008 => %{ description: "The quantity of settlement is too high than you can request.", type: :invalid_order }, -1009 => %{ description: "Can not request withdrawal settlement, you need to deposit other arrears first.", type: :invalid_parameters }, -1012 => %{ description: "{ \"code\": -1012, \"message\": \"Amount is required for buy market orders when margin disabled.\"} The place/cancel order request is rejected by internal module, it may because the account is in liquidation or other internal errors. Please try again in a few seconds.\" }", type: :invalid_parameters }, -1101 => %{ description: "The risk exposure for client is too high, it may cause by sending too big order or the leverage is too low. please refer to client info to check the current exposure.", type: :invalid_order }, -1102 => %{ description: "The order value (price * size) is too small.", type: :invalid_order }, -1103 => %{ description: "The order price is not following the tick size rule for the symbol.", type: :invalid_order }, -1104 => %{ description: "The order quantity is not following the step size rule for the symbol.", type: :invalid_order }, -1105 => %{ description: "Price is X% too high or X% too low from the mid price.", type: :invalid_order }, "Can not place" => %{ description: "Can not place/cancel orders, it may because internal network error. Please try again in a few seconds.", type: :exchange_error }, "Insufficient WOO. Please enable margin trading for leverage trading" => %{ description: "when selling insufficent token [-1012]", type: :invalid_parameters }, "The token is not supported" => %{ description: "when getting incorrect token's deposit address [-1005]", type: :invalid_parameters }, "Your order and symbol are not valid or already canceled" => %{ description: "actual response whensending 'cancelOrder' for already canceled id [-1006]", type: :invalid_parameters }, "maintenance" => %{ description: "The system is under maintenance.", type: :network_error }, "symbol must not be blank" => %{ description: "when sending 'cancelOrder' without symbol [-1005]", type: :invalid_parameters } }, error_codes: %{ -1000 => :exchange_error, -1001 => :invalid_credentials, -1002 => :invalid_credentials, -1003 => :rate_limited, -1004 => :invalid_parameters, -1005 => :invalid_parameters, -1006 => :invalid_parameters, -1007 => :invalid_parameters, -1008 => :invalid_order, -1009 => :invalid_parameters, -1012 => :invalid_parameters, -1101 => :invalid_order, -1102 => :invalid_order, -1103 => :invalid_order, -1104 => :invalid_order, -1105 => :invalid_order, "Can not place" => :exchange_error, "Insufficient WOO. Please enable margin trading for leverage trading" => :invalid_parameters, "The token is not supported" => :invalid_parameters, "Your order and symbol are not valid or already canceled" => :invalid_parameters, "maintenance" => :network_error, "symbol must not be blank" => :invalid_parameters }, exceptions: %{ broad: %{ "Can not place" => :exchange_error, "Insufficient WOO. Please enable margin trading for leverage trading" => :bad_request, "The token is not supported" => :bad_request, "Your order and symbol are not valid or already canceled" => :bad_request, "maintenance" => :on_maintenance, "symbol must not be blank" => :bad_request }, exact: %{ "-1000" => :operation_failed, "-1001" => :authentication_error, "-1002" => :authentication_error, "-1003" => :rate_limit_exceeded, "-1004" => :bad_request, "-1005" => :bad_request, "-1006" => :bad_request, "-1007" => :bad_request, "-1008" => :invalid_order, "-1009" => :bad_request, "-1012" => :bad_request, "-1101" => :invalid_order, "-1102" => :invalid_order, "-1103" => :invalid_order, "-1104" => :invalid_order, "-1105" => :invalid_order } }, exchange_options: %{ "adjustForTimeDifference" => false, "brokerId" => "bc830de7-50f3-460b-9ee0-f430f83f9dad", "createMarketBuyOrderRequiresPrice" => true, "defaultNetworkCodeForCurrencies" => %{}, "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "network-aliases-for-tokens" => %{ "HT" => "ERC20", "OMG" => "ERC20", "UATOM" => "ATOM", "ZRX" => "ZRX" }, "networks" => %{ "ARB" => "Arbitrum", "BEP20" => "BSC", "ERC20" => "ETH", "TRC20" => "TRON", "TRX" => "TRON" }, "networksById" => %{ "Arbitrum" => "ARB", "BSC" => "BEP20", "ETH" => "ERC20", "TRON" => "TRC20", "TRX" => "TRC20" }, "sandboxMode" => false, "timeDifference" => 0, "transfer" => %{ "fillResponseFromRequest" => true } }, extended_metadata: %{ limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg", referral_discount: 0.35, referral_url: "https://woox.io/register?ref=DIJT0CNL" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: true, 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: true, gtd: true, ioc: true, po: true }, trailing: true, trigger_direction: false, trigger_price: true, trigger_price_type: %{ index: false, last: true, mark: true } }, fetch_closed_orders: %{ limit: 500, margin_mode: false, symbol_required: false, trailing: true, trigger: true, until_days: 100000 }, fetch_my_trades: %{ days_back: 90, limit: 500, margin_mode: false, symbol_required: false, until_days: 10000 }, fetch_ohlcv: %{ limit: 1000 }, fetch_open_orders: %{ limit: 500, margin_mode: false, symbol_required: false, trailing: true, trigger: true }, fetch_order: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: true }, fetch_orders: %{ limit: 500, margin_mode: false, symbol_required: false, trailing: true, trigger: true, until_days: 100000 }, sandbox: true }, for_swap: %{ create_order: %{ hedged: true }, extends: "default" }, future: %{}, spot: %{ extends: "default" }, swap: %{ linear: %{ extends: "forSwap" } } }, fees: %{ trading: %{ maker: 0.0002, percentage: true, taker: 0.0005, 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) {\n return undefined; // fallback to default error handler\n }\n //\n // 400 Bad Request {\"success\":false,\"code\":-1012,\"message\":\"Amount is required for buy market orders when margin disabled.\"}\n // {\"code\":\"-1011\",\"message\":\"The system is under maintenance.\",\"success\":false}\n //\n const success = this.safeBool(response, 'success');\n const errorCode = this.safeString(response, 'code');\n if (!success) {\n const feedback = this.id + ' ' + this.json(response);\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\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_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, cancel_withdraw: false, close_all_positions: false, close_position: false, create_convert_trade: true, 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: true, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: false, 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: true, 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: true, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: false, create_post_only_order: false, create_post_only_order_ws: false, create_reduce_only_order: true, create_reduce_only_order_ws: false, create_stop_limit_order: false, create_stop_limit_order_ws: false, create_stop_loss_order: true, create_stop_loss_order_ws: false, create_stop_market_order: false, create_stop_market_order_ws: false, create_stop_order: false, create_stop_order_ws: false, create_take_profit_order: true, create_take_profit_order_ws: false, create_trailing_amount_order: true, create_trailing_amount_order_ws: false, create_trailing_percent_order: true, 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_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: true, fetch_convert_quote: true, fetch_convert_trade: true, fetch_convert_trade_history: true, 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: false, fetch_deposit_withdraw_fees: false, fetch_deposits: true, fetch_deposits_withdrawals: true, fetch_deposits_ws: false, fetch_funding_history: true, fetch_funding_interval: true, fetch_funding_intervals: false, fetch_funding_rate: true, fetch_funding_rate_history: true, 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: true, fetch_ledger_entry: false, fetch_leverage: true, 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_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: true, fetch_ticker: false, fetch_ticker_ws: false, fetch_tickers: false, fetch_tickers_ws: false, fetch_time: true, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: true, 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: true, 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: true, set_leverage: true, set_margin: false, set_margin_mode: false, set_position_mode: true, 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: true, 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: true, 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: "woo", markets: nil, name: "WOO X", ohlcv_timestamp_resolution: :unknown, options: %{ adjust_for_time_difference: false, broker_id: "bc830de7-50f3-460b-9ee0-f430f83f9dad", create_market_buy_order_requires_price: true, default_network_code_for_currencies: %{}, "network-aliases-for-tokens": %{ "HT" => "ERC20", "OMG" => "ERC20", "UATOM" => "ATOM", "ZRX" => "ZRX" }, networks: %{ "ARB" => "Arbitrum", "BEP20" => "BSC", "ERC20" => "ETH", "TRC20" => "TRON", "TRX" => "TRON" }, networks_by_id: %{ "TRON" => "TRC20", "TRX" => "TRC20" }, sandbox_mode: false, time_difference: 0, transfer: %{ "fillResponseFromRequest" => true } }, order_mappings: %{ side_format: :uppercase, side_key: "side", type_format: :uppercase, type_key: "type" }, param_mappings: %{ "amount" => "sellQuantity", "code" => "token", "cost" => "amount", "fromCode" => "sellToken", "id" => "oid", "limit" => "maxLevel", "since" => "after", "timeframe" => "type", "timeout" => "triggerAfter", "toCode" => "buyToken", "trailingAmount" => "callbackValue", "trailingTriggerPrice" => "activatedPrice" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n \"account\": \"carlos_jose_lima@yahoo.com\",\n \"alias\": \"carlos_jose_lima@yahoo.com\",\n \"otpauth\": true,\n \"accountMode\": \"FUTURES\",\n \"positionMode\": \"ONE_WAY\",\n \"leverage\": 0,\n \"marginRatio\": \"10\",\n \"openMarginRatio\": \"10\",\n \"initialMarginRatio\": \"10\",\n \"maintenanceMarginRatio\": \"0.03\",\n \"totalCollateral\": \"165.55629469\",\n \"freeCollateral\": \"165.55629469\",\n \"totalAccountValue\": \"167.32418611\",\n \"totalTradingValue\": \"167.32418611\",\n \"totalVaultValue\": \"0\",\n \"totalStakingValue\": \"0\",\n \"totalLaunchpadValue\": \"0\",\n \"totalEarnValue\": \"0\",\n \"referrerID\": null,\n \"accountType\": \"Main\"\n }", "{\n \"applicationId\": \"6b43de5c-0955-4887-9862-d84e4689f9fe\",\n \"name\": \"sub_account_2\",\n \"createdTime\": \"1606897264.994\"\n }" ], "line_end" => 2420, "line_start" => 2381, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "account" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (account, 'applicationId')" }, %{ "comment" => nil, "key" => "name", "value" => "this.safeStringN (account, [ 'name', 'account', 'alias' ])" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeStringLower (account, 'accountType', 'subaccount')" } ], "name" => "parseAccount", "signature" => "parseAccount (account)", "source" => "parseAccount (account) {\n //\n // {\n // \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n // \"account\": \"carlos_jose_lima@yahoo.com\",\n // \"alias\": \"carlos_jose_lima@yahoo.com\",\n // \"otpauth\": true,\n // \"accountMode\": \"FUTURES\",\n // \"positionMode\": \"ONE_WAY\",\n // \"leverage\": 0,\n // \"marginRatio\": \"10\",\n // \"openMarginRatio\": \"10\",\n // \"initialMarginRatio\": \"10\",\n // \"maintenanceMarginRatio\": \"0.03\",\n // \"totalCollateral\": \"165.55629469\",\n // \"freeCollateral\": \"165.55629469\",\n // \"totalAccountValue\": \"167.32418611\",\n // \"totalTradingValue\": \"167.32418611\",\n // \"totalVaultValue\": \"0\",\n // \"totalStakingValue\": \"0\",\n // \"totalLaunchpadValue\": \"0\",\n // \"totalEarnValue\": \"0\",\n // \"referrerID\": null,\n // \"accountType\": \"Main\"\n // }\n //\n // {\n // \"applicationId\": \"6b43de5c-0955-4887-9862-d84e4689f9fe\",\n // \"name\": \"sub_account_2\",\n // \"createdTime\": \"1606897264.994\"\n // }\n //\n return {\n 'info': account,\n 'id': this.safeString (account, 'applicationId'),\n 'name': this.safeStringN (account, [ 'name', 'account', 'alias' ]),\n 'code': undefined,\n 'type': this.safeStringLower (account, 'accountType', 'subaccount'),\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2474, "line_start" => 2460, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "source" => "parseBalance (response): Balances {\n const result: Dict = {\n 'info': response,\n };\n const balances = this.safeList (response, 'holding', []);\n for (let i = 0; i < balances.length; i++) {\n const balance = balances[i];\n const code = this.safeCurrencyCode (this.safeString (balance, 'token'));\n const account = this.account ();\n account['total'] = this.safeString (balance, 'holding');\n account['free'] = this.safeString (balance, 'availableBalance');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"quoteId\": 123123123,\n \"counterPartyId\": \"\",\n \"sellToken\": \"ETH\",\n \"sellQuantity\": \"0.0445\",\n \"buyToken\": \"USDT\",\n \"buyQuantity\": \"33.45\",\n \"buyPrice\": \"6.77\",\n \"expireTimestamp\": 1659084466000,\n \"message\": 1659084466000\n }", "{\n \"quoteId\": 123123123,\n \"counterPartyId\": \"\",\n \"rftAccepted\": 1 // 1 -> success; 2 -> processing; 3 -> fail\n }", "{\n \"quoteId\": 12,\n \"buyAsset\": \"\",\n \"sellAsset\": \"\",\n \"buyAmount\": 12.11,\n \"sellAmount\": 12.11,\n \"tradeStatus\": 12,\n \"createdTime\": \"\"\n }" ], "line_end" => 4182, "line_start" => 4129, "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, 'quoteId')" }, %{ "comment" => nil, "key" => "fromCurrency", "value" => "fromCode" }, %{ "comment" => nil, "key" => "fromAmount", "value" => "this.safeNumber2 (conversion, 'sellQuantity', 'sellAmount')" }, %{ "comment" => nil, "key" => "toCurrency", "value" => "toCode" }, %{ "comment" => nil, "key" => "toAmount", "value" => "this.safeNumber2 (conversion, 'buyQuantity', 'buyAmount')" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeNumber (conversion, 'buyPrice')" }, %{ "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 // \"quoteId\": 123123123,\n // \"counterPartyId\": \"\",\n // \"sellToken\": \"ETH\",\n // \"sellQuantity\": \"0.0445\",\n // \"buyToken\": \"USDT\",\n // \"buyQuantity\": \"33.45\",\n // \"buyPrice\": \"6.77\",\n // \"expireTimestamp\": 1659084466000,\n // \"message\": 1659084466000\n // }\n //\n // createConvertTrade\n //\n // {\n // \"quoteId\": 123123123,\n // \"counterPartyId\": \"\",\n // \"rftAccepted\": 1 // 1 -> success; 2 -> processing; 3 -> fail\n // }\n //\n // fetchConvertTrade, fetchConvertTradeHistory\n //\n // {\n // \"quoteId\": 12,\n // \"buyAsset\": \"\",\n // \"sellAsset\": \"\",\n // \"buyAmount\": 12.11,\n // \"sellAmount\": 12.11,\n // \"tradeStatus\": 12,\n // \"createdTime\": \"\"\n // }\n //\n const timestamp = this.safeInteger2 (conversion, 'expireTimestamp', 'createdTime');\n const fromCurr = this.safeString2 (conversion, 'sellToken', 'buyAsset');\n const fromCode = this.safeCurrencyCode (fromCurr, fromCurrency);\n const to = this.safeString2 (conversion, 'buyToken', 'sellAsset');\n const toCode = this.safeCurrencyCode (to, toCurrency);\n return {\n 'info': conversion,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'id': this.safeString (conversion, 'quoteId'),\n 'fromCurrency': fromCode,\n 'fromAmount': this.safeNumber2 (conversion, 'sellQuantity', 'sellAmount'),\n 'toCurrency': toCode,\n 'toAmount': this.safeNumber2 (conversion, 'buyQuantity', 'buyAmount'),\n 'price': this.safeNumber (conversion, 'buyPrice'),\n 'fee': undefined,\n } as Conversion;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2533, "line_start" => 2523, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositEntry" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeString (currency, 'code')" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "tag", "value" => "this.safeString (depositEntry, 'extra')" } ], "name" => "parseDepositAddress", "signature" => "parseDepositAddress (depositEntry, currency: Currency = undefined): DepositAddress", "source" => "parseDepositAddress (depositEntry, currency: Currency = undefined): DepositAddress {\n const address = this.safeString (depositEntry, 'address');\n this.checkAddress (address);\n return {\n 'info': depositEntry,\n 'currency': this.safeString (currency, 'code'),\n 'network': undefined,\n 'address': address,\n 'tag': this.safeString (depositEntry, 'extra'),\n } as DepositAddress;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"symbol\": \"PERP_BTC_USDT\",\n \"estFundingRate\": \"-0.00000441\",\n \"estFundingRateTimestamp\": 1751623979022,\n \"lastFundingRate\": \"-0.00004953\",\n \"lastFundingRateTimestamp\": 1751616000000,\n \"nextFundingTime\": 1751644800000,\n \"lastFundingIntervalHours\": 8,\n \"estFundingIntervalHours\": 8\n }" ], "line_end" => 3344, "line_start" => 3305, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "fundingRate" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "interestRate", "value" => "this.parseNumber ('0')" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "estFundingRateTimestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (estFundingRateTimestamp)" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (fundingRate, 'estFundingRate')" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "nextFundingTimestamp" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "this.iso8601 (nextFundingTimestamp)" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "this.safeNumber (fundingRate, 'lastFundingRate')" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "lastFundingRateTimestamp" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "this.iso8601 (lastFundingRateTimestamp)" }, %{ "comment" => nil, "key" => "interval", "value" => "intervalString + 'h'" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (fundingRate, market: Market = undefined): FundingRate", "source" => "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n //\n // {\n // \"symbol\": \"PERP_BTC_USDT\",\n // \"estFundingRate\": \"-0.00000441\",\n // \"estFundingRateTimestamp\": 1751623979022,\n // \"lastFundingRate\": \"-0.00004953\",\n // \"lastFundingRateTimestamp\": 1751616000000,\n // \"nextFundingTime\": 1751644800000,\n // \"lastFundingIntervalHours\": 8,\n // \"estFundingIntervalHours\": 8\n // }\n //\n const symbol = this.safeString (fundingRate, 'symbol');\n market = this.market (symbol);\n const nextFundingTimestamp = this.safeInteger (fundingRate, 'nextFundingTime');\n const estFundingRateTimestamp = this.safeInteger (fundingRate, 'estFundingRateTimestamp');\n const lastFundingRateTimestamp = this.safeInteger (fundingRate, 'lastFundingRateTimestamp');\n const intervalString = this.safeString (fundingRate, 'estFundingIntervalHours');\n return {\n 'info': fundingRate,\n 'symbol': market['symbol'],\n 'markPrice': undefined,\n 'indexPrice': undefined,\n 'interestRate': this.parseNumber ('0'),\n 'estimatedSettlePrice': undefined,\n 'timestamp': estFundingRateTimestamp,\n 'datetime': this.iso8601 (estFundingRateTimestamp),\n 'fundingRate': this.safeNumber (fundingRate, 'estFundingRate'),\n 'fundingTimestamp': nextFundingTimestamp,\n 'fundingDatetime': this.iso8601 (nextFundingTimestamp),\n 'nextFundingRate': undefined,\n 'nextFundingTimestamp': undefined,\n 'nextFundingDatetime': undefined,\n 'previousFundingRate': this.safeNumber (fundingRate, 'lastFundingRate'),\n 'previousFundingTimestamp': lastFundingRateTimestamp,\n 'previousFundingDatetime': this.iso8601 (lastFundingRateTimestamp),\n 'interval': intervalString + 'h',\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": 1286360,\n \"symbol\": \"PERP_BTC_USDT\",\n \"fundingRate\": -0.00001445,\n \"markPrice\": \"26930.60000000\",\n \"fundingFee\": \"9.56021744\",\n \"fundingIntervalHours\": 8,\n \"paymentType\": \"Pay\",\n \"status\": \"COMPLETED\",\n \"createdTime\": 1696060873259,\n \"updatedTime\": 1696060873286\n }" ], "line_end" => 3234, "line_start" => 3200, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "income" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "code", "value" => "code" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "amount", "value" => "this.parseNumber (amount)" }, %{ "comment" => nil, "key" => "rate", "value" => "rate" } ], "name" => "parseIncome", "signature" => "parseIncome (income, market: Market = undefined)", "source" => "parseIncome (income, market: Market = undefined) {\n //\n // {\n // \"id\": 1286360,\n // \"symbol\": \"PERP_BTC_USDT\",\n // \"fundingRate\": -0.00001445,\n // \"markPrice\": \"26930.60000000\",\n // \"fundingFee\": \"9.56021744\",\n // \"fundingIntervalHours\": 8,\n // \"paymentType\": \"Pay\",\n // \"status\": \"COMPLETED\",\n // \"createdTime\": 1696060873259,\n // \"updatedTime\": 1696060873286\n // }\n //\n const marketId = this.safeString (income, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\n let amount = this.safeString (income, 'fundingFee');\n const code = this.safeCurrencyCode ('USD');\n const id = this.safeString (income, 'id');\n const timestamp = this.safeInteger (income, 'updatedTime');\n const rate = this.safeNumber (income, 'fundingRate');\n const paymentType = this.safeString (income, 'paymentType');\n amount = (paymentType === 'Pay') ? Precise.stringNeg (amount) : amount;\n return {\n 'info': income,\n 'symbol': symbol,\n 'code': code,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'id': id,\n 'amount': this.parseNumber (amount),\n 'rate': rate,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"createdTime\": \"1734964440.523\",\n \"updatedTime\": \"1734964614.081\",\n \"id\": \"24122314340000585\",\n \"externalId\": \"241223143600621\",\n \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n \"token\": \"ARB_USDCNATIVE\",\n \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n \"extra\": \"\",\n \"type\": \"BALANCE\",\n \"tokenSide\": \"WITHDRAW\",\n \"amount\": \"10.00000000\",\n \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n \"feeToken\": \"USDC\",\n \"feeAmount\": \"2\",\n \"status\": \"COMPLETED\",\n \"confirmingThreshold\": null,\n \"confirmedNumber\": null\n }" ], "line_end" => 2665, "line_start" => 2617, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "item" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (item, 'id')" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "account", "value" => "this.safeString (item, 'account')" }, %{ "comment" => nil, "key" => "referenceAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "referenceId", "value" => "this.safeString (item, 'txId')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransactionStatus (this.safeString (item, 'status'))" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "before", "value" => "undefined" }, %{ "comment" => nil, "key" => "after", "value" => "undefined" }, %{ "comment" => nil, "key" => "direction", "value" => "direction" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "type", "value" => "this.parseLedgerEntryType (this.safeString (item, 'type'))" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" } ], "name" => "parseLedgerEntry", "signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry", "source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n //\n // {\n // \"createdTime\": \"1734964440.523\",\n // \"updatedTime\": \"1734964614.081\",\n // \"id\": \"24122314340000585\",\n // \"externalId\": \"241223143600621\",\n // \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n // \"token\": \"ARB_USDCNATIVE\",\n // \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n // \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n // \"extra\": \"\",\n // \"type\": \"BALANCE\",\n // \"tokenSide\": \"WITHDRAW\",\n // \"amount\": \"10.00000000\",\n // \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n // \"feeToken\": \"USDC\",\n // \"feeAmount\": \"2\",\n // \"status\": \"COMPLETED\",\n // \"confirmingThreshold\": null,\n // \"confirmedNumber\": null\n // }\n //\n const networkizedCode = this.safeString (item, 'token');\n const code = this.safeCurrencyCode (networkizedCode, currency);\n currency = this.safeCurrency (code, currency);\n const amount = this.safeNumber (item, 'amount');\n const side = this.safeString (item, 'tokenSide');\n const direction = (side === 'DEPOSIT') ? 'in' : 'out';\n const timestamp = this.safeTimestamp (item, 'createdTime');\n const fee = this.parseTokenAndFeeTemp (item, [ 'feeToken' ], [ 'feeAmount' ]);\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': this.safeString (item, 'id'),\n 'currency': code,\n 'account': this.safeString (item, 'account'),\n 'referenceAccount': undefined,\n 'referenceId': this.safeString (item, 'txId'),\n 'status': this.parseTransactionStatus (this.safeString (item, 'status')),\n 'amount': amount,\n 'before': undefined,\n 'after': undefined,\n 'direction': direction,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'type': this.parseLedgerEntryType (this.safeString (item, 'type')),\n 'fee': fee,\n }, currency) as LedgerEntry;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2673, "line_start" => 2667, "mappings" => [], "name" => "parseLedgerEntryType", "signature" => "parseLedgerEntryType (type)", "source" => "parseLedgerEntryType (type) {\n const types: Dict = {\n 'BALANCE': 'transaction', // Funds moved in/out wallet\n 'COLLATERAL': 'transfer', // Funds moved between portfolios\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3676, "line_start" => 3645, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "leverage" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "marginMode", "value" => "marginMode" }, %{ "comment" => nil, "key" => "longLeverage", "value" => "longLeverage" }, %{ "comment" => nil, "key" => "shortLeverage", "value" => "shortLeverage" } ], "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 market = this.safeMarket (marketId, market);\n const marginMode = this.safeStringLower (leverage, 'marginMode');\n let spotLeverage = this.safeInteger (leverage, 'leverage');\n if (spotLeverage === 0) {\n spotLeverage = null;\n }\n let longLeverage = spotLeverage;\n let shortLeverage = spotLeverage;\n const details = this.safeList (leverage, 'details', []);\n for (let i = 0; i < details.length; i++) {\n const position = this.safeDict (details, i, {});\n const positionLeverage = this.safeInteger (position, 'leverage');\n const side = this.safeString (position, 'positionSide');\n if (side === 'BOTH') {\n longLeverage = positionLeverage;\n shortLeverage = positionLeverage;\n } else if (side === 'LONG') {\n longLeverage = positionLeverage;\n } else if (side === 'SHORT') {\n shortLeverage = positionLeverage;\n }\n }\n return {\n 'info': leverage,\n 'symbol': market['symbol'],\n 'marginMode': marginMode,\n 'longLeverage': longLeverage,\n 'shortLeverage': shortLeverage,\n } as Leverage;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"success\": true,\n }" ], "line_end" => 3105, "line_start" => 3090, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (undefined, currency)" }, %{ "comment" => nil, "key" => "amount", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "info" } ], "name" => "parseMarginLoan", "signature" => "parseMarginLoan (info, currency: Currency = undefined)", "source" => "parseMarginLoan (info, currency: Currency = undefined) {\n //\n // {\n // \"success\": true,\n // }\n //\n return {\n 'id': undefined,\n 'currency': this.safeCurrencyCode (undefined, currency),\n 'amount': undefined,\n 'symbol': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'info': info,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 698, "line_start" => 613, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "marketId" }, %{ "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" => "marketType" }, %{ "comment" => nil, "key" => "spot", "value" => "spot" }, %{ "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" => "contractSize", "value" => "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': this.safeNumber (market, 'baseTick'),\n 'price': this.safeNumber (market, 'quoteTick'),\n }" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'baseMin'),\n 'max': this.safeNumber (market, 'baseMax'),\n },\n 'price': {\n 'min': this.safeNumber (market, 'quoteMin'),\n 'max': this.safeNumber (market, 'quoteMax'),\n },\n 'cost': {\n 'min': this.safeNumber (market, 'minNotional'),\n 'max': undefined,\n },\n }" }, %{ "comment" => 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, 'baseMin'),\n 'max': this.safeNumber (market, 'baseMax'),\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': this.safeNumber (market, 'quoteMin'),\n 'max': this.safeNumber (market, 'quoteMax'),\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': this.safeNumber (market, 'minNotional'),\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "min", "value" => "this.safeNumber (market, 'quoteMin')" }, %{ "comment" => nil, "key" => "max", "value" => "this.safeNumber (market, 'quoteMax')" }, %{ "comment" => nil, "key" => "min", "value" => "this.safeNumber (market, 'minNotional')" }, %{ "comment" => nil, "key" => "max", "value" => "undefined" } ], "name" => "parseMarket", "signature" => "parseMarket (market: Dict): Market", "source" => "parseMarket (market: Dict): Market {\n const marketId = this.safeString (market, 'symbol');\n const parts = marketId.split ('_');\n const first = this.safeString (parts, 0);\n let marketType: MarketType;\n let spot = false;\n let swap = false;\n if (first === 'SPOT') {\n spot = true;\n marketType = 'spot';\n } else if (first === 'PERP') {\n swap = true;\n marketType = 'swap';\n }\n const baseId = this.safeString (parts, 1);\n const quoteId = this.safeString (parts, 2);\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n let settleId: Str = undefined;\n let settle: Str = undefined;\n let symbol = base + '/' + quote;\n let contractSize: Num = undefined;\n let linear: Bool = undefined;\n let inverse: Bool = undefined;\n let margin = true;\n const contract = swap;\n if (contract) {\n margin = false;\n settleId = this.safeString (parts, 2);\n settle = this.safeCurrencyCode (settleId);\n symbol = base + '/' + quote + ':' + settle;\n contractSize = this.parseNumber ('1');\n linear = true;\n inverse = false;\n }\n const active = this.safeString (market, 'status') === 'TRADING';\n return {\n 'id': marketId,\n 'symbol': symbol,\n 'base': base,\n 'quote': quote,\n 'settle': settle,\n 'baseId': baseId,\n 'quoteId': quoteId,\n 'settleId': settleId,\n 'type': marketType,\n 'spot': spot,\n 'margin': margin,\n 'swap': swap,\n 'future': false,\n 'option': false,\n 'active': active,\n 'contract': contract,\n 'linear': linear,\n 'inverse': inverse,\n 'contractSize': contractSize,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.safeNumber (market, 'baseTick'),\n 'price': this.safeNumber (market, 'quoteTick'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'baseMin'),\n 'max': this.safeNumber (market, 'baseMax'),\n },\n 'price': {\n 'min': this.safeNumber (market, 'quoteMin'),\n 'max': this.safeNumber (market, 'quoteMax'),\n },\n 'cost': {\n 'min': this.safeNumber (market, 'minNotional'),\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': market,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2199, "line_start" => 2190, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n return [\n this.safeInteger (ohlcv, 'startTimestamp'),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'volume'),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"orderId\": 60667653330,\n \"clientOrderId\": 0,\n \"type\": \"LIMIT\",\n \"price\": 60,\n \"quantity\": 0.1,\n \"amount\": null,\n \"bidAskLevel\": null,\n \"timestamp\": 1751871779855\n }", "{\n \"orderId\": \"1578938\",\n \"clientOrderId\": \"0\",\n \"algoType\": \"STOP_LOSS\",\n \"quantity\": \"0.1\",\n \"timestamp\": \"1686149372216\"\n }", "{\n \"orderId\": 60780315704,\n \"clientOrderId\": 0,\n \"symbol\": \"SPOT_LTC_USDT\",\n \"orderTag\": \"default\",\n \"side\": \"BUY\",\n \"quantity\": 0.1,\n \"amount\": null,\n \"type\": \"LIMIT\",\n \"status\": \"NEW\",\n \"price\": 60,\n \"executed\": 0,\n \"visible\": 0.1,\n \"averageExecutedPrice\": 0,\n \"totalFee\": 0,\n \"feeAsset\": \"LTC\",\n \"totalRebate\": 0,\n \"rebateAsset\": \"USDT\",\n \"reduceOnly\": false,\n \"createdTime\": \"1752049062.496\",\n \"realizedPnl\": null,\n \"positionSide\": \"BOTH\",\n \"bidAskLevel\": null\n }", "{\n \"algoOrderId\": 10399260,\n \"clientAlgoOrderId\": 0,\n \"rootAlgoOrderId\": 10399260,\n \"parentAlgoOrderId\": 0,\n \"symbol\": \"SPOT_LTC_USDT\",\n \"algoOrderTag\": \"default\",\n \"algoType\": \"TAKE_PROFIT\",\n \"side\": \"BUY\",\n \"quantity\": 0.1,\n \"isTriggered\": false,\n \"triggerPrice\": 65,\n \"triggerStatus\": \"USELESS\",\n \"type\": \"LIMIT\",\n \"rootAlgoStatus\": \"NEW\",\n \"algoStatus\": \"NEW\",\n \"triggerPriceType\": \"MARKET_PRICE\",\n \"price\": 60,\n \"triggerTime\": \"0\",\n \"totalExecutedQuantity\": 0,\n \"visibleQuantity\": 0.1,\n \"averageExecutedPrice\": 0,\n \"totalFee\": 0,\n \"feeAsset\": \"\",\n \"totalRebate\": 0,\n \"rebateAsset\": \"\",\n \"reduceOnly\": false,\n \"createdTime\": \"1752049747.732\",\n \"updatedTime\": \"1752049747.732\",\n \"positionSide\": \"BOTH\"\n }" ], "line_end" => 2065, "line_start" => 1915, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "orderId" }, %{ "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" => "undefined" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "lastUpdateTimestamp" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseOrderStatus (status)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "orderType" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "this.parseTimeInForce (orderType)" }, %{ "comment" => nil, "key" => "postOnly", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "average" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "filled", "value" => "filled" }, %{ "comment" => nil, "key" => "remaining", "value" => "undefined" }, %{ "comment" => nil, "key" => "trades", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'cost': fee,\n 'currency': feeCurrency,\n }" }, %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "cost", "value" => "fee" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrency" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n // {\n // \"orderId\": 60667653330,\n // \"clientOrderId\": 0,\n // \"type\": \"LIMIT\",\n // \"price\": 60,\n // \"quantity\": 0.1,\n // \"amount\": null,\n // \"bidAskLevel\": null,\n // \"timestamp\": 1751871779855\n // }\n //\n // createOrder - algo\n // {\n // \"orderId\": \"1578938\",\n // \"clientOrderId\": \"0\",\n // \"algoType\": \"STOP_LOSS\",\n // \"quantity\": \"0.1\",\n // \"timestamp\": \"1686149372216\"\n // }\n //\n // fetchOrder\n // {\n // \"orderId\": 60780315704,\n // \"clientOrderId\": 0,\n // \"symbol\": \"SPOT_LTC_USDT\",\n // \"orderTag\": \"default\",\n // \"side\": \"BUY\",\n // \"quantity\": 0.1,\n // \"amount\": null,\n // \"type\": \"LIMIT\",\n // \"status\": \"NEW\",\n // \"price\": 60,\n // \"executed\": 0,\n // \"visible\": 0.1,\n // \"averageExecutedPrice\": 0,\n // \"totalFee\": 0,\n // \"feeAsset\": \"LTC\",\n // \"totalRebate\": 0,\n // \"rebateAsset\": \"USDT\",\n // \"reduceOnly\": false,\n // \"createdTime\": \"1752049062.496\",\n // \"realizedPnl\": null,\n // \"positionSide\": \"BOTH\",\n // \"bidAskLevel\": null\n // }\n //\n // fetchOrder - algo\n // {\n // \"algoOrderId\": 10399260,\n // \"clientAlgoOrderId\": 0,\n // \"rootAlgoOrderId\": 10399260,\n // \"parentAlgoOrderId\": 0,\n // \"symbol\": \"SPOT_LTC_USDT\",\n // \"algoOrderTag\": \"default\",\n // \"algoType\": \"TAKE_PROFIT\",\n // \"side\": \"BUY\",\n // \"quantity\": 0.1,\n // \"isTriggered\": false,\n // \"triggerPrice\": 65,\n // \"triggerStatus\": \"USELESS\",\n // \"type\": \"LIMIT\",\n // \"rootAlgoStatus\": \"NEW\",\n // \"algoStatus\": \"NEW\",\n // \"triggerPriceType\": \"MARKET_PRICE\",\n // \"price\": 60,\n // \"triggerTime\": \"0\",\n // \"totalExecutedQuantity\": 0,\n // \"visibleQuantity\": 0.1,\n // \"averageExecutedPrice\": 0,\n // \"totalFee\": 0,\n // \"feeAsset\": \"\",\n // \"totalRebate\": 0,\n // \"rebateAsset\": \"\",\n // \"reduceOnly\": false,\n // \"createdTime\": \"1752049747.732\",\n // \"updatedTime\": \"1752049747.732\",\n // \"positionSide\": \"BOTH\"\n // }\n //\n let timestamp = undefined;\n const timestrampString = this.safeString (order, 'createdTime');\n if (timestrampString !== undefined) {\n if (timestrampString.indexOf ('.') >= 0) {\n timestamp = this.safeTimestamp (order, 'createdTime'); // algo orders\n } else {\n timestamp = this.safeInteger (order, 'createdTime'); // regular orders\n }\n }\n if (timestamp === undefined) {\n timestamp = this.safeInteger (order, 'timestamp');\n }\n const orderId = this.safeString2 (order, 'orderId', 'algoOrderId');\n const clientOrderId = this.omitZero (this.safeString2 (order, 'clientOrderId', 'clientAlgoOrderId')); // Somehow, this always returns 0 for limit order\n const marketId = this.safeString (order, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'quantity'); // This is base amount\n const cost = this.safeString (order, 'amount'); // This is quote amount\n const orderType = this.safeStringLower (order, 'type');\n const status = this.safeValue2 (order, 'status', 'algoStatus');\n const side = this.safeStringLower (order, 'side');\n const filled = this.omitZero (this.safeValue2 (order, 'executed', 'totalExecutedQuantity'));\n const average = this.omitZero (this.safeString (order, 'averageExecutedPrice'));\n // const remaining = Precise.stringSub (cost, filled);\n const fee = this.safeNumber (order, 'totalFee');\n const feeCurrency = this.safeString (order, 'feeAsset');\n const triggerPrice = this.safeNumber (order, 'triggerPrice');\n const lastUpdateTimestampString = this.safeString (order, 'updatedTime');\n let lastUpdateTimestamp = undefined;\n if (lastUpdateTimestampString !== undefined) {\n if (lastUpdateTimestampString.indexOf ('.') >= 0) {\n lastUpdateTimestamp = this.safeTimestamp (order, 'updatedTime'); // algo orders\n } else {\n lastUpdateTimestamp = this.safeInteger (order, 'updatedTime'); // regular orders\n }\n }\n return this.safeOrder ({\n 'id': orderId,\n 'clientOrderId': clientOrderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'lastUpdateTimestamp': lastUpdateTimestamp,\n 'status': this.parseOrderStatus (status),\n 'symbol': symbol,\n 'type': orderType,\n 'timeInForce': this.parseTimeInForce (orderType),\n 'postOnly': undefined, // TO_DO\n 'reduceOnly': this.safeBool (order, 'reduceOnly'),\n 'side': side,\n 'price': price,\n 'triggerPrice': triggerPrice,\n 'takeProfitPrice': undefined,\n 'stopLossPrice': undefined,\n 'average': average,\n 'amount': amount,\n 'filled': filled,\n 'remaining': undefined, // TO_DO\n 'cost': cost,\n 'trades': undefined,\n 'fee': {\n 'cost': fee,\n 'currency': feeCurrency,\n },\n 'info': order,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2083, "line_start" => 2067, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n if (status !== undefined) {\n const statuses: Dict = {\n 'NEW': 'open',\n 'FILLED': 'closed',\n 'CANCEL_SENT': 'canceled',\n 'CANCEL_ALL_SENT': 'canceled',\n 'CANCELLED': 'canceled',\n 'PARTIAL_FILLED': 'open',\n 'REJECTED': 'rejected',\n 'INCOMPLETE': 'open',\n 'COMPLETED': 'closed',\n };\n return this.safeString (statuses, status, status);\n }\n return status;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"symbol\": \"PERP_ETH_USDT\",\n \"position_side\": \"BOTH\",\n \"leverage\": 10,\n \"margin_mode\": \"CROSS\",\n \"average_open_price\": 3139.9,\n \"isolated_margin_amount\": 0.0,\n \"isolated_margin_token\": \"\",\n \"opening_time\": \"1720627963.094\",\n \"mark_price\": 3155.19169891,\n \"pending_short_qty\": 0.0,\n \"pending_long_qty\": 0.0,\n \"holding\": -0.7,\n \"pnl_24_h\": 0.0,\n \"est_liq_price\": 9107.40055552,\n \"settle_price\": 3151.0319904,\n \"success\": true,\n \"fee_24_h\": 0.0,\n \"isolated_frozen_long\": 0.0,\n \"isolated_frozen_short\": 0.0,\n \"timestamp\": \"1720867502.544\"\n }", "{\n \"symbol\": \"PERP_LTC_USDT\",\n \"holding\": \"0.1\",\n \"pendingLongQty\": \"0\",\n \"pendingShortQty\": \"0\",\n \"settlePrice\": \"96.87\",\n \"averageOpenPrice\": \"96.87\",\n \"pnl24H\": \"0\",\n \"fee24H\": \"0.0048435\",\n \"markPrice\": \"96.83793449\",\n \"estLiqPrice\": \"0\",\n \"timestamp\": 1752500555823,\n \"adlQuantile\": 2,\n \"positionSide\": \"BOTH\",\n \"marginMode\": \"CROSS\",\n \"isolatedMarginToken\": \"\",\n \"isolatedMarginAmount\": \"0\",\n \"isolatedFrozenLong\": \"0\",\n \"isolatedFrozenShort\": \"0\",\n \"leverage\": 10\n }" ], "line_end" => 3960, "line_start" => 3856, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeString (market, 'symbol')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.parseNumber (entryPrice)" }, %{ "comment" => nil, "key" => "notional", "value" => "this.parseNumber (notional)" }, %{ "comment" => nil, "key" => "leverage", "value" => "this.safeNumber (position, 'leverage')" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.parseNumber (unrealisedPnl)" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.parseNumber (size)" }, %{ "comment" => nil, "key" => "contractSize", "value" => "this.parseNumber (contractSize)" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "this.safeNumber2 (position, 'estLiqPrice', 'est_liq_price')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.parseNumber (markPrice)" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "this.safeStringLower2 (position, 'marginMode', 'margin_mode')" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "hedged", "value" => "positionSide !== 'BOTH'" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "undefined" } ], "name" => "parsePosition", "signature" => "parsePosition (position: Dict, market: Market = undefined)", "source" => "parsePosition (position: Dict, market: Market = undefined) {\n //\n // v1PrivateGetPositionSymbol\n // {\n // \"symbol\": \"PERP_ETH_USDT\",\n // \"position_side\": \"BOTH\",\n // \"leverage\": 10,\n // \"margin_mode\": \"CROSS\",\n // \"average_open_price\": 3139.9,\n // \"isolated_margin_amount\": 0.0,\n // \"isolated_margin_token\": \"\",\n // \"opening_time\": \"1720627963.094\",\n // \"mark_price\": 3155.19169891,\n // \"pending_short_qty\": 0.0,\n // \"pending_long_qty\": 0.0,\n // \"holding\": -0.7,\n // \"pnl_24_h\": 0.0,\n // \"est_liq_price\": 9107.40055552,\n // \"settle_price\": 3151.0319904,\n // \"success\": true,\n // \"fee_24_h\": 0.0,\n // \"isolated_frozen_long\": 0.0,\n // \"isolated_frozen_short\": 0.0,\n // \"timestamp\": \"1720867502.544\"\n // }\n //\n // v3PrivateGetPositions\n // {\n // \"symbol\": \"PERP_LTC_USDT\",\n // \"holding\": \"0.1\",\n // \"pendingLongQty\": \"0\",\n // \"pendingShortQty\": \"0\",\n // \"settlePrice\": \"96.87\",\n // \"averageOpenPrice\": \"96.87\",\n // \"pnl24H\": \"0\",\n // \"fee24H\": \"0.0048435\",\n // \"markPrice\": \"96.83793449\",\n // \"estLiqPrice\": \"0\",\n // \"timestamp\": 1752500555823,\n // \"adlQuantile\": 2,\n // \"positionSide\": \"BOTH\",\n // \"marginMode\": \"CROSS\",\n // \"isolatedMarginToken\": \"\",\n // \"isolatedMarginAmount\": \"0\",\n // \"isolatedFrozenLong\": \"0\",\n // \"isolatedFrozenShort\": \"0\",\n // \"leverage\": 10\n // }\n //\n const contract = this.safeString (position, 'symbol');\n market = this.safeMarket (contract, market);\n let size = this.safeString (position, 'holding');\n let side: Str = undefined;\n if (Precise.stringGt (size, '0')) {\n side = 'long';\n } else {\n side = 'short';\n }\n const contractSize = this.safeString (market, 'contractSize');\n const markPrice = this.safeString2 (position, 'markPrice', 'mark_price');\n const timestampString = this.safeString (position, 'timestamp');\n let timestamp = undefined;\n if (timestampString !== undefined) {\n if (timestampString.indexOf ('.') > -1) {\n timestamp = this.safeTimestamp (position, 'timestamp');\n } else {\n timestamp = this.safeInteger (position, 'timestamp');\n }\n }\n const entryPrice = this.safeString2 (position, 'averageOpenPrice', 'average_open_price');\n const priceDifference = Precise.stringSub (markPrice, entryPrice);\n const unrealisedPnl = Precise.stringMul (priceDifference, size);\n size = Precise.stringAbs (size);\n const notional = Precise.stringMul (size, markPrice);\n const positionSide = this.safeString (position, 'positionSide'); // 'SHORT' or 'LONG' for hedged, 'BOTH' for non-hedged\n return this.safePosition ({\n 'info': position,\n 'id': undefined,\n 'symbol': this.safeString (market, 'symbol'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastUpdateTimestamp': undefined,\n 'initialMargin': undefined,\n 'initialMarginPercentage': undefined,\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'entryPrice': this.parseNumber (entryPrice),\n 'notional': this.parseNumber (notional),\n 'leverage': this.safeNumber (position, 'leverage'),\n 'unrealizedPnl': this.parseNumber (unrealisedPnl),\n 'contracts': this.parseNumber (size),\n 'contractSize': this.parseNumber (contractSize),\n 'marginRatio': undefined,\n 'liquidationPrice': this.safeNumber2 (position, 'estLiqPrice', 'est_liq_price'),\n 'markPrice': this.parseNumber (markPrice),\n 'lastPrice': undefined,\n 'collateral': undefined,\n 'marginMode': this.safeStringLower2 (position, 'marginMode', 'margin_mode'),\n 'side': side,\n 'percentage': undefined,\n 'hedged': positionSide !== 'BOTH',\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1913, "line_start" => 1906, "mappings" => [], "name" => "parseTimeInForce", "signature" => "parseTimeInForce (timeInForce: Str)", "source" => "parseTimeInForce (timeInForce: Str) {\n const timeInForces: Dict = {\n 'ioc': 'IOC',\n 'fok': 'FOK',\n 'post_only': 'PO',\n };\n return this.safeString (timeInForces, timeInForce, undefined);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 832, "line_start" => 820, "mappings" => [ %{ "comment" => nil, "key" => "cost", "value" => "feeCost" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrencyCode" } ], "name" => "parseTokenAndFeeTemp", "signature" => "parseTokenAndFeeTemp (item, feeTokenKeys, feeAmountKeys)", "source" => "parseTokenAndFeeTemp (item, feeTokenKeys, feeAmountKeys) {\n const feeCost = this.safeStringN (item, feeAmountKeys);\n let fee = undefined;\n if (feeCost !== undefined) {\n const feeCurrencyId = this.safeStringN (item, feeTokenKeys);\n const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n fee = {\n 'cost': feeCost,\n 'currency': feeCurrencyCode,\n };\n }\n return fee;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"symbol\": \"SPOT_BTC_USDT\",\n \"side\": \"SELL\",\n \"source\": 0,\n \"executedPrice\": \"108741.01\",\n \"executedQuantity\": \"0.02477\",\n \"executedTimestamp\": 1751513940144\n }", "{\n \"id\": 1734947821,\n \"symbol\": \"SPOT_LTC_USDT\",\n \"orderId\": 60780383217,\n \"executedPrice\": 87.86,\n \"executedQuantity\": 0.1,\n \"fee\": 0.0001,\n \"realizedPnl\": null,\n \"feeAsset\": \"LTC\",\n \"orderTag\": \"default\",\n \"side\": \"BUY\",\n \"executedTimestamp\": \"1752055173.630\",\n \"isMaker\": 0\n }" ], "line_end" => 818, "line_start" => 744, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "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" => "order", "value" => "order_id" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "info", "value" => "trade" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // public/market_trades\n //\n // {\n // \"symbol\": \"SPOT_BTC_USDT\",\n // \"side\": \"SELL\",\n // \"source\": 0,\n // \"executedPrice\": \"108741.01\",\n // \"executedQuantity\": \"0.02477\",\n // \"executedTimestamp\": 1751513940144\n // }\n //\n // fetchOrderTrades, fetchOrder\n //\n // {\n // \"id\": 1734947821,\n // \"symbol\": \"SPOT_LTC_USDT\",\n // \"orderId\": 60780383217,\n // \"executedPrice\": 87.86,\n // \"executedQuantity\": 0.1,\n // \"fee\": 0.0001,\n // \"realizedPnl\": null,\n // \"feeAsset\": \"LTC\",\n // \"orderTag\": \"default\",\n // \"side\": \"BUY\",\n // \"executedTimestamp\": \"1752055173.630\",\n // \"isMaker\": 0\n // }\n //\n const isFromFetchOrder = ('id' in trade);\n const timestampString = this.safeString2 (trade, 'executed_timestamp', 'executedTimestamp');\n let timestamp = undefined;\n if (timestampString !== undefined) {\n if (timestampString.indexOf ('.') > -1) {\n timestamp = this.safeTimestamp2 (trade, 'executed_timestamp', 'executedTimestamp');\n } else {\n timestamp = this.safeInteger (trade, 'executedTimestamp');\n }\n }\n const marketId = this.safeString (trade, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const price = this.safeString2 (trade, 'executed_price', 'executedPrice');\n const amount = this.safeString2 (trade, 'executed_quantity', 'executedQuantity');\n const order_id = this.safeString2 (trade, 'order_id', 'orderId');\n const fee = this.parseTokenAndFeeTemp (trade, [ 'fee_asset', 'feeAsset' ], [ 'fee' ]);\n const feeCost = this.safeString (fee, 'cost');\n if (feeCost !== undefined) {\n fee['cost'] = feeCost;\n }\n const cost = Precise.stringMul (price, amount);\n const side = this.safeStringLower (trade, 'side');\n const id = this.safeString (trade, 'id');\n let takerOrMaker: Str = undefined;\n if (isFromFetchOrder) {\n const isMaker = this.safeString2 (trade, 'is_maker', 'isMaker') === '1';\n takerOrMaker = isMaker ? 'maker' : 'taker';\n }\n return this.safeTrade ({\n 'id': id,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'side': side,\n 'price': price,\n 'amount': amount,\n 'cost': cost,\n 'order': order_id,\n 'takerOrMaker': takerOrMaker,\n 'type': undefined,\n 'fee': fee,\n 'info': trade,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 845, "line_start" => 834, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "fee" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "maker", "value" => "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'makerFee'), '100'))" }, %{ "comment" => nil, "key" => "taker", "value" => "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'takerFee'), '100'))" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "tierBased", "value" => "undefined" } ], "name" => "parseTradingFee", "signature" => "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface", "source" => "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n const marketId = this.safeString (fee, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\n return {\n 'info': fee,\n 'symbol': symbol,\n 'maker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'makerFee'), '100')),\n 'taker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'takerFee'), '100')),\n 'percentage': undefined,\n 'tierBased': undefined,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"createdTime\": \"1734964440.523\",\n \"updatedTime\": \"1734964614.081\",\n \"id\": \"24122314340000585\",\n \"externalId\": \"241223143600621\",\n \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n \"token\": \"ARB_USDCNATIVE\",\n \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n \"extra\": \"\",\n \"type\": \"BALANCE\",\n \"tokenSide\": \"WITHDRAW\",\n \"amount\": \"10.00000000\",\n \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n \"feeToken\": \"USDC\",\n \"feeAmount\": \"2\",\n \"status\": \"COMPLETED\",\n \"confirmingThreshold\": null,\n \"confirmedNumber\": null\n }" ], "line_end" => 2804, "line_start" => 2748, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeStringN (transaction, [ 'id', 'withdraw_id', 'withdrawId' ])" }, %{ "comment" => nil, "key" => "txid", "value" => "this.safeString2 (transaction, 'tx_id', 'txId')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "address", "value" => "undefined" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "addressFrom" }, %{ "comment" => nil, "key" => "addressTo", "value" => "addressTo" }, %{ "comment" => nil, "key" => "tag", "value" => "this.safeString2 (transaction, 'extra', 'tag')" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagTo", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "movementDirection" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transaction, 'amount')" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransactionStatus (this.safeString (transaction, 'status'))" }, %{ "comment" => nil, "key" => "updated", "value" => "this.safeTimestamp2 (transaction, 'updated_time', 'updatedTime')" }, %{ "comment" => nil, "key" => "comment", "value" => "undefined" }, %{ "comment" => nil, "key" => "internal", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "network", "value" => "this.networkIdToCode (this.safeString (transaction, 'network'))" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // {\n // \"createdTime\": \"1734964440.523\",\n // \"updatedTime\": \"1734964614.081\",\n // \"id\": \"24122314340000585\",\n // \"externalId\": \"241223143600621\",\n // \"applicationId\": \"251bf5c4-f3c8-4544-bb8b-80001007c3c0\",\n // \"token\": \"ARB_USDCNATIVE\",\n // \"targetAddress\": \"0x4d6802d2736daa85e6242ef0dc0f00aa0e68f635\",\n // \"sourceAddress\": \"0x63DFE4e34A3bFC00eB0220786238a7C6cEF8Ffc4\",\n // \"extra\": \"\",\n // \"type\": \"BALANCE\",\n // \"tokenSide\": \"WITHDRAW\",\n // \"amount\": \"10.00000000\",\n // \"txId\": \"0x891ade0a47fd55466bb9d06702bea4edcb75ed9367d9afbc47b93a84f496d2e6\",\n // \"feeToken\": \"USDC\",\n // \"feeAmount\": \"2\",\n // \"status\": \"COMPLETED\",\n // \"confirmingThreshold\": null,\n // \"confirmedNumber\": null\n // }\n //\n const networkizedCode = this.safeString (transaction, 'token');\n const currencyDefined = this.getCurrencyFromChaincode (networkizedCode, currency);\n const code = currencyDefined['code'];\n let movementDirection = this.safeStringLowerN (transaction, [ 'token_side', 'tokenSide', 'type' ]);\n if (movementDirection === 'withdraw') {\n movementDirection = 'withdrawal';\n }\n const fee = this.parseTokenAndFeeTemp (transaction, [ 'fee_token', 'feeToken' ], [ 'fee_amount', 'feeAmount' ]);\n const addressTo = this.safeStringN (transaction, [ 'target_address', 'targetAddress', 'addressTo' ]);\n const addressFrom = this.safeString2 (transaction, 'source_address', 'sourceAddress');\n const timestamp = this.safeTimestampN (transaction, [ 'created_time', 'createdTime' ], this.safeInteger (transaction, 'timestamp'));\n return {\n 'info': transaction,\n 'id': this.safeStringN (transaction, [ 'id', 'withdraw_id', 'withdrawId' ]),\n 'txid': this.safeString2 (transaction, 'tx_id', 'txId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': undefined,\n 'addressFrom': addressFrom,\n 'addressTo': addressTo,\n 'tag': this.safeString2 (transaction, 'extra', 'tag'),\n 'tagFrom': undefined,\n 'tagTo': undefined,\n 'type': movementDirection,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'currency': code,\n 'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n 'updated': this.safeTimestamp2 (transaction, 'updated_time', 'updatedTime'),\n 'comment': undefined,\n 'internal': undefined,\n 'fee': fee,\n 'network': this.networkIdToCode (this.safeString (transaction, 'network')),\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2815, "line_start" => 2806, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'NEW': 'pending',\n 'CONFIRMING': 'pending',\n 'PROCESSING': 'pending',\n 'COMPLETED': 'ok',\n 'CANCELED': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": 46704,\n \"token\": \"USDT\",\n \"amount\": 30000.00000000,\n \"status\": \"COMPLETED\",\n \"from_application_id\": \"0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3\",\n \"to_application_id\": \"c01e6940-a735-4022-9b6c-9d3971cdfdfa\",\n \"from_user\": \"LeverageLow\",\n \"to_user\": \"dev\",\n \"created_time\": \"1709022325.427\",\n \"updated_time\": \"1709022325.542\"\n }", "{\n \"id\": 225,\n \"token\": \"USDT\",\n \"amount\": \"1000000\",\n \"status\": \"COMPLETED\",\n \"from\": {\n \"applicationId\": \"046b5c5c-5b44-4d27-9593-ddc32c0a08ae\",\n \"accountName\": \"Main\"\n },\n \"to\": {\n \"applicationId\": \"082ae5ae-e26a-4fb1-be5b-03e5b4867663\",\n \"accountName\": \"sub001\"\n },\n \"createdTime\": \"1642660941.534\",\n \"updatedTime\": \"1642660941.950\"\n }", "{\n \"success\": true,\n \"id\": 200\n }" ], "line_end" => 2988, "line_start" => 2930, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transfer, 'id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transfer, 'amount')" }, %{ "comment" => nil, "key" => "fromAccount", "value" => "this.safeString (fromAccount, 'applicationId')" }, %{ "comment" => nil, "key" => "toAccount", "value" => "this.safeString (toAccount, 'applicationId')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransferStatus (this.safeString (transfer, 'status', status))" }, %{ "comment" => nil, "key" => "info", "value" => "transfer" } ], "name" => "parseTransfer", "signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry", "source" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n //\n // fetchTransfers\n // {\n // \"id\": 46704,\n // \"token\": \"USDT\",\n // \"amount\": 30000.00000000,\n // \"status\": \"COMPLETED\",\n // \"from_application_id\": \"0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3\",\n // \"to_application_id\": \"c01e6940-a735-4022-9b6c-9d3971cdfdfa\",\n // \"from_user\": \"LeverageLow\",\n // \"to_user\": \"dev\",\n // \"created_time\": \"1709022325.427\",\n // \"updated_time\": \"1709022325.542\"\n // }\n // {\n // \"id\": 225,\n // \"token\": \"USDT\",\n // \"amount\": \"1000000\",\n // \"status\": \"COMPLETED\",\n // \"from\": {\n // \"applicationId\": \"046b5c5c-5b44-4d27-9593-ddc32c0a08ae\",\n // \"accountName\": \"Main\"\n // },\n // \"to\": {\n // \"applicationId\": \"082ae5ae-e26a-4fb1-be5b-03e5b4867663\",\n // \"accountName\": \"sub001\"\n // },\n // \"createdTime\": \"1642660941.534\",\n // \"updatedTime\": \"1642660941.950\"\n // }\n //\n // transfer\n // {\n // \"success\": true,\n // \"id\": 200\n // }\n //\n const code = this.safeCurrencyCode (this.safeString (transfer, 'token'), currency);\n const timestamp = this.safeTimestamp2 (transfer, 'createdTime', 'timestamp');\n const success = this.safeBool (transfer, 'success');\n let status: Str = undefined;\n if (success !== undefined) {\n status = success ? 'ok' : 'failed';\n }\n const fromAccount = this.safeDict (transfer, 'from', {});\n const toAccount = this.safeDict (transfer, 'to', {});\n return {\n 'id': this.safeString (transfer, 'id'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'currency': code,\n 'amount': this.safeNumber (transfer, 'amount'),\n 'fromAccount': this.safeString (fromAccount, 'applicationId'),\n 'toAccount': this.safeString (toAccount, 'applicationId'),\n 'status': this.parseTransferStatus (this.safeString (transfer, 'status', status)),\n 'info': transfer,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2999, "line_start" => 2990, "mappings" => [], "name" => "parseTransferStatus", "signature" => "parseTransferStatus (status: Str): Str", "source" => "parseTransferStatus (status: Str): Str {\n const statuses: Dict = {\n 'NEW': 'pending',\n 'CONFIRMING': 'pending',\n 'PROCESSING': 'pending',\n 'COMPLETED': 'ok',\n 'CANCELED': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 100, period: 1000, requests: 10, 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: "error", field: "success", message_field: "message", success_values: nil, type: :success_bool }, signing: %{ api_key_header: "x-api-key", confidence: :high, pattern: :hmac_sha256_headers, signature_header: "x-api-signature", timestamp_header: "x-api-timestamp" }, 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" => 4000, "min" => 0.001 }, "cost" => %{ "min" => 1 }, "price" => %{ "max" => 100000, "min" => 0 } }, sample_precision: %{ "amount" => 0.001, "price" => 0.01 }, spot: %{ base: "ETH", base_id: "ETH", case: :upper, contract: false, id: "SPOT_ETH_USDC", limits: %{ "amount" => %{ "max" => 4000, "min" => 0.001 }, "cost" => %{ "min" => 1 }, "leverage" => %{}, "price" => %{ "max" => 100000, "min" => 0 } }, maker: 0.0002, precision: %{ "amount" => 0.001, "price" => 0.01 }, quote: "USDC", quote_id: "USDC", separator: "_", symbol: "ETH/USDC", taker: 0.0005 }, swap: %{ base: "CHZ", base_id: "CHZ", case: :upper, contract: true, contract_size: 1, id: "PERP_CHZ_USDT", inverse: false, limits: %{ "amount" => %{ "max" => 5000000, "min" => 1 }, "cost" => %{ "min" => 0 }, "leverage" => %{}, "price" => %{ "max" => 100000, "min" => 0 } }, linear: true, maker: 0.0002, precision: %{ "amount" => 1, "price" => 1.0e-5 }, quote: "USDT", quote_id: "USDT", separator: "_", settle: "USDT", settle_id: "USDT", symbol: "CHZ/USDT:USDT", taker: 0.0005 } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :underscore_upper, separator: "_", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :implicit, separator: "_", suffix: nil } }, timeframes: %{ "12h" => "12h", "15m" => "15m", "1M" => "1mon", "1d" => "1d", "1h" => "1h", "1m" => "1m", "1w" => "1w", "1y" => "1y", "30m" => "30m", "4h" => "4h", "5m" => "5m" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://api.woox.io", api_sections: %{ "private" => "https://api.woox.io", "pub" => "https://api-pub.woox.io", "public" => "https://api.woox.io" }, doc: [ "https://docs.woox.io/" ], other: nil, sandbox: %{ "private" => "https://api.staging.woox.io", "pub" => "https://api-pub.staging.woox.io", "public" => "https://api.staging.woox.io" }, www: "https://woox.io/" }, version: "v1", ws: %{ auth: %{ algorithm: :sha256, encoding: :hex, market_specific: false, message_format: :event_auth, op_field: "event", 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: :event_based }, watch_bids_asks: %{ channel_name: "bbos", market_id_format: :native, params: [], pattern: :event_based }, watch_my_trades: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_ohlcv: %{ channel_name: "kline", market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_order_book: %{ channel_name: "orderbook", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_orders: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_positions: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_private: %{ auth_required: true, market_id_format: :native, params: [], pattern: :event_based }, watch_private_multiple: %{ auth_required: true, market_id_format: :native, params: [], pattern: :event_based }, watch_public: %{ market_id_format: :native, params: [], pattern: :event_based }, watch_ticker: %{ channel_name: "ticker", market_id_format: :native, params: [], pattern: :event_based }, watch_tickers: %{ channel_name: "tickers", market_id_format: :native, params: [], pattern: :event_based }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based } }, has: %{ watch_balance: true, watch_bids_asks: true, 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: true, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: false }, hostname: "woox.io", message_patterns: [ %{ args_field: "params", format: :event, keys: [ "event", "params" ], kind_field: "event", kind_value: "auth", sources: [ :send, :watch ] }, %{ format: :event, keys: [ "event" ], kind_field: "event", kind_value: "ping", sources: [ :ping ] }, %{ args_field: "topic", format: :event, id_field: "id", keys: [ "event", "id", "topic" ], kind_field: "event", kind_value: "subscribe", sources: [ :send, :watch ] }, %{ args_field: "topic", format: :event, id_field: "id", keys: [ "event", "id", "topic" ], kind_field: "event", kind_value: "unsubscribe", sources: [ :send, :watch ] } ], options: %{ "watchPositions" => %{ "awaitPositionsSnapshot" => true, "fetchPositionsSnapshot" => true } }, streaming: %{ keep_alive: 9000 }, subscription_config: %{ args_field: "channel", args_format: :string, market_id_format: :native, op_field: "event" }, subscription_pattern: :event_subscribe, test_urls: %{ "private" => "wss://wss.staging.woox.io/v2/ws/private/stream", "public" => "wss://wss.staging.woox.io/ws/stream" }, urls: %{ "private" => "wss://wss.woox.io/v2/ws/private/stream", "public" => "wss://wss.woox.io/ws/stream" }, watch_methods: [ "watchBalance", "watchBidsAsks", "watchMyTrades", "watchOHLCV", "watchOrderBook", "watchOrders", "watchPositions", "watchPrivate", "watchPrivateMultiple", "watchPublic", "watchTicker", "watchTickers", "watchTrades" ] } }