# One Trading Exchange Specification # # Auto-generated by: mix ccxt.extract onetrading # CCXT version: 4.5.34 # Spec format version: 1 # # Review before use: # - signing: Detected from sign() method, verify with testnet # - endpoints: Raw paths extracted, map to unified API as needed # - exceptions: Extracted (exact, broad, HTTP status codes) # - features/options: Extracted from describe() # - classification: Set to :supported initially, promote after validation # %{ api_param_requirements: nil, certified: false, classification: :pro, comment: nil, countries: [ "AT" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "MIOTA" => "IOTA", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 23, "coveragePercent" => 100, "enabledMethods" => 24, "excluded" => [ %{ "method" => "editOrder", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 1, "extractableMethods" => 23, "failures" => [] }, endpoints: [ %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_all_orders, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/account/orders/{order_id}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "ids" => "test-order-id" }, market_type: :spot, method: :delete, name: :cancel_orders, param_mappings: %{}, params: [ :ids, :symbol ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "time_in_force" => "GOOD_TILL_CANCELLED", "type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :side, :amount, :price ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "time_in_force" => "GOOD_TILL_CANCELLED", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :side, :amount, :price ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "time_in_force" => "GOOD_TILL_CANCELLED" }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "instrument_code" => "BTCUSDT", "time_in_force" => "GOOD_TILL_CANCELLED", "triggerDirection" => "below", "type" => "STOP" }, market_type: :swap, method: :post, name: :create_stop_limit_order, param_mappings: %{ "triggerPrice" => "trigger_price" }, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "instrument_code" => "BTCUSDT", "time_in_force" => "GOOD_TILL_CANCELLED", "triggerDirection" => "below", "type" => "STOP" }, market_type: :swap, method: :post, name: :create_stop_order, param_mappings: %{ "triggerPrice" => "trigger_price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/account/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/account/balances", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "with_cancelled_and_rejected" => true }, market_type: :spot, method: :get, name: :fetch_closed_orders, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :since, :limit ], path: "/account/orders", response_transformer: {:extract_path, ["order_history"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/currencies", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :limit ], path: "/order-book/{instrument_code}", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/instruments", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :since, :limit ], path: "/account/trades", response_transformer: {:extract_path, ["trade_history"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "period" => "1", "to" => "", "unit" => "HOURS" }, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "from", "symbol" => "instrument_code", "timeframe" => "period" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/candlesticks/{instrument_code}", response_transformer: {:extract_path, ["candlesticks"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_open_orders, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol, :since, :limit ], path: "/account/orders", response_transformer: {:extract_path, ["order_history"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/account/orders/{order_id}", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "limit" => "depth", "symbol" => "instrument_code" }, params: [ :symbol, :limit ], path: "/order-book/{instrument_code}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_order_trades, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol, :since, :limit ], path: "/account/orders/{order_id}/trades", response_transformer: {:extract_path, ["trade_history"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "instrument_code" }, params: [ :symbol ], path: "/market-ticker/{instrument_code}", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/market-ticker", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/time", response_transformer: {:extract_path, ["epoch_millis"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/account/fees", source: :intercepted } ], error_code_details: %{ "ACCOUNT_HISTORY_TIME_RANGE_TOO_BIG" => %{ description: nil, type: :invalid_parameters }, "APIKEY_EXPIRED" => %{ description: nil, type: :invalid_credentials }, "APIKEY_REVOKED" => %{ description: nil, type: :invalid_credentials }, "BAD_AMOUNT_PRECISION" => %{ description: nil, type: :invalid_order }, "BAD_PRICE_PRECISION" => %{ description: nil, type: :invalid_order }, "BAD_TRIGGER_PRICE_PRECISION" => %{ description: nil, type: :invalid_order }, "CANDLESTICKS_TIME_RANGE_TOO_BIG" => %{ description: nil, type: :invalid_parameters }, "CF_RATELIMIT" => %{ description: nil, type: :rate_limited }, "CLIENT_IP_BLOCKED" => %{ description: nil, type: :access_restricted }, "DEPOSIT_ADDRESS_NOT_USED" => %{ description: nil, type: :invalid_parameters }, "GATEWAY_TIMEOUT" => %{ description: nil, type: :network_error }, "ILLEGAL_CHARS" => %{ description: nil, type: :invalid_parameters }, "INSUFFICIENT_FUNDS" => %{ description: nil, type: :insufficient_balance }, "INSUFFICIENT_LIQUIDITY" => %{ description: nil, type: :insufficient_balance }, "INTERNAL_ERROR" => %{ description: nil, type: :invalid_credentials }, "INTERNAL_SERVER_ERROR" => %{ description: nil, type: :exchange_error }, "INVALID_ACCOUNT_HISTORY_FROM_TIME" => %{ description: nil, type: :invalid_parameters }, "INVALID_ACCOUNT_HISTORY_MAX_PAGE_SIZE" => %{ description: nil, type: :invalid_parameters }, "INVALID_ACCOUNT_HISTORY_TIME_PERIOD" => %{ description: nil, type: :invalid_parameters }, "INVALID_ACCOUNT_HISTORY_TO_TIME" => %{ description: nil, type: :invalid_parameters }, "INVALID_ACCOUNT_ID" => %{ description: nil, type: :invalid_parameters }, "INVALID_AMOUNT" => %{ description: nil, type: :invalid_parameters }, "INVALID_APIKEY" => %{ description: nil, type: :invalid_credentials }, "INVALID_AUDIENCE" => %{ description: nil, type: :invalid_credentials }, "INVALID_CANDLESTICKS_GRANULARITY" => %{ description: nil, type: :invalid_parameters }, "INVALID_CANDLESTICKS_UNIT" => %{ description: nil, type: :invalid_parameters }, "INVALID_CLIENT_UUID" => %{ description: nil, type: :invalid_order }, "INVALID_CREDENTIALS" => %{ description: nil, type: :invalid_credentials }, "INVALID_CURRENCY" => %{ description: nil, type: :invalid_parameters }, "INVALID_CURSOR" => %{ description: nil, type: :invalid_parameters }, "INVALID_DATE" => %{ description: nil, type: :invalid_parameters }, "INVALID_DEVICE_ID" => %{ description: nil, type: :invalid_credentials }, "INVALID_INSTRUMENT_CODE" => %{ description: nil, type: :invalid_parameters }, "INVALID_IP_RESTRICTION" => %{ description: nil, type: :invalid_credentials }, "INVALID_ISSUER" => %{ description: nil, type: :invalid_credentials }, "INVALID_LIMIT" => %{ description: nil, type: :invalid_parameters }, "INVALID_ORDER_BOOK_DEPTH" => %{ description: nil, type: :invalid_parameters }, "INVALID_ORDER_BOOK_LEVEL" => %{ description: nil, type: :invalid_parameters }, "INVALID_ORDER_ID" => %{ description: nil, type: :order_not_found }, "INVALID_ORDER_TYPE" => %{ description: nil, type: :invalid_parameters }, "INVALID_PAGE_CURSOR" => %{ description: nil, type: :invalid_parameters }, "INVALID_PERIOD" => %{ description: nil, type: :invalid_parameters }, "INVALID_PRICE" => %{ description: nil, type: :invalid_parameters }, "INVALID_QUERY" => %{ description: nil, type: :invalid_parameters }, "INVALID_SCOPES" => %{ description: nil, type: :invalid_credentials }, "INVALID_SIDE" => %{ description: nil, type: :invalid_order }, "INVALID_SUBJECT" => %{ description: nil, type: :invalid_credentials }, "INVALID_TIME" => %{ description: nil, type: :invalid_parameters }, "INVALID_TIME_RANGE" => %{ description: nil, type: :invalid_parameters }, "INVALID_TRADE_ID" => %{ description: nil, type: :invalid_parameters }, "INVALID_UI_ACCOUNT_SETTINGS" => %{ description: nil, type: :invalid_parameters }, "INVALID_UNIT" => %{ description: nil, type: :invalid_parameters }, "MAX_OPEN_ORDERS_EXCEEDED" => %{ description: nil, type: :invalid_parameters }, "MIN_SIZE_NOT_SATISFIED" => %{ description: nil, type: :invalid_order }, "MISSING_CANDLESTICKS_PERIOD_PARAM" => %{ description: nil, type: :invalid_parameters }, "MISSING_CANDLESTICKS_UNIT_PARAM" => %{ description: nil, type: :invalid_parameters }, "MISSING_CREDENTIALS" => %{ description: nil, type: :invalid_credentials }, "MISSING_FROM_PARAM" => %{ description: nil, type: :invalid_parameters }, "MISSING_INSTRUMENT_CODE" => %{ description: nil, type: :invalid_parameters }, "MISSING_ORDER_ID" => %{ description: nil, type: :invalid_order }, "MISSING_ORDER_TYPE" => %{ description: nil, type: :invalid_order }, "MISSING_PERMISSION" => %{ description: nil, type: :access_restricted }, "MISSING_PRICE" => %{ description: nil, type: :invalid_order }, "MISSING_SIDE" => %{ description: nil, type: :invalid_order }, "MISSING_TO_PARAM" => %{ description: nil, type: :invalid_parameters }, "MISSING_TRADE_ID" => %{ description: nil, type: :invalid_parameters }, "NEGATIVE_AMOUNT" => %{ description: nil, type: :invalid_order }, "NEGATIVE_PRICE" => %{ description: nil, type: :invalid_order }, "NOT_FOUND" => %{ description: nil, type: :order_not_found }, "NO_TRADING" => %{ description: nil, type: :network_error }, "ONLY_ONE_ERC20_ADDRESS_ALLOWED" => %{ description: nil, type: :invalid_parameters }, "ORDER_NOT_FOUND" => %{ description: nil, type: :order_not_found }, "Order not found." => %{ description: nil, type: :order_not_found }, "RATELIMIT" => %{ description: nil, type: :rate_limited }, "SERVICE_UNAVAILABLE" => %{ description: nil, type: :network_error }, "SESSION_EXPIRED" => %{ description: nil, type: :invalid_credentials }, "SYNCHRONIZER_TOKEN_MISMATCH" => %{ description: nil, type: :invalid_credentials }, "UNSUPPORTED_MEDIA_TYPE" => %{ description: nil, type: :invalid_parameters } }, error_codes: %{ "ACCOUNT_HISTORY_TIME_RANGE_TOO_BIG" => :invalid_parameters, "APIKEY_EXPIRED" => :invalid_credentials, "APIKEY_REVOKED" => :invalid_credentials, "BAD_AMOUNT_PRECISION" => :invalid_order, "BAD_PRICE_PRECISION" => :invalid_order, "BAD_TRIGGER_PRICE_PRECISION" => :invalid_order, "CANDLESTICKS_TIME_RANGE_TOO_BIG" => :invalid_parameters, "CF_RATELIMIT" => :rate_limited, "CLIENT_IP_BLOCKED" => :access_restricted, "DEPOSIT_ADDRESS_NOT_USED" => :invalid_parameters, "GATEWAY_TIMEOUT" => :network_error, "ILLEGAL_CHARS" => :invalid_parameters, "INSUFFICIENT_FUNDS" => :insufficient_balance, "INSUFFICIENT_LIQUIDITY" => :insufficient_balance, "INTERNAL_ERROR" => :invalid_credentials, "INTERNAL_SERVER_ERROR" => :exchange_error, "INVALID_ACCOUNT_HISTORY_FROM_TIME" => :invalid_parameters, "INVALID_ACCOUNT_HISTORY_MAX_PAGE_SIZE" => :invalid_parameters, "INVALID_ACCOUNT_HISTORY_TIME_PERIOD" => :invalid_parameters, "INVALID_ACCOUNT_HISTORY_TO_TIME" => :invalid_parameters, "INVALID_ACCOUNT_ID" => :invalid_parameters, "INVALID_AMOUNT" => :invalid_parameters, "INVALID_APIKEY" => :invalid_credentials, "INVALID_AUDIENCE" => :invalid_credentials, "INVALID_CANDLESTICKS_GRANULARITY" => :invalid_parameters, "INVALID_CANDLESTICKS_UNIT" => :invalid_parameters, "INVALID_CLIENT_UUID" => :invalid_order, "INVALID_CREDENTIALS" => :invalid_credentials, "INVALID_CURRENCY" => :invalid_parameters, "INVALID_CURSOR" => :invalid_parameters, "INVALID_DATE" => :invalid_parameters, "INVALID_DEVICE_ID" => :invalid_credentials, "INVALID_INSTRUMENT_CODE" => :invalid_parameters, "INVALID_IP_RESTRICTION" => :invalid_credentials, "INVALID_ISSUER" => :invalid_credentials, "INVALID_LIMIT" => :invalid_parameters, "INVALID_ORDER_BOOK_DEPTH" => :invalid_parameters, "INVALID_ORDER_BOOK_LEVEL" => :invalid_parameters, "INVALID_ORDER_ID" => :order_not_found, "INVALID_ORDER_TYPE" => :invalid_parameters, "INVALID_PAGE_CURSOR" => :invalid_parameters, "INVALID_PERIOD" => :invalid_parameters, "INVALID_PRICE" => :invalid_parameters, "INVALID_QUERY" => :invalid_parameters, "INVALID_SCOPES" => :invalid_credentials, "INVALID_SIDE" => :invalid_order, "INVALID_SUBJECT" => :invalid_credentials, "INVALID_TIME" => :invalid_parameters, "INVALID_TIME_RANGE" => :invalid_parameters, "INVALID_TRADE_ID" => :invalid_parameters, "INVALID_UI_ACCOUNT_SETTINGS" => :invalid_parameters, "INVALID_UNIT" => :invalid_parameters, "MAX_OPEN_ORDERS_EXCEEDED" => :invalid_parameters, "MIN_SIZE_NOT_SATISFIED" => :invalid_order, "MISSING_CANDLESTICKS_PERIOD_PARAM" => :invalid_parameters, "MISSING_CANDLESTICKS_UNIT_PARAM" => :invalid_parameters, "MISSING_CREDENTIALS" => :invalid_credentials, "MISSING_FROM_PARAM" => :invalid_parameters, "MISSING_INSTRUMENT_CODE" => :invalid_parameters, "MISSING_ORDER_ID" => :invalid_order, "MISSING_ORDER_TYPE" => :invalid_order, "MISSING_PERMISSION" => :access_restricted, "MISSING_PRICE" => :invalid_order, "MISSING_SIDE" => :invalid_order, "MISSING_TO_PARAM" => :invalid_parameters, "MISSING_TRADE_ID" => :invalid_parameters, "NEGATIVE_AMOUNT" => :invalid_order, "NEGATIVE_PRICE" => :invalid_order, "NOT_FOUND" => :order_not_found, "NO_TRADING" => :network_error, "ONLY_ONE_ERC20_ADDRESS_ALLOWED" => :invalid_parameters, "ORDER_NOT_FOUND" => :order_not_found, "Order not found." => :order_not_found, "RATELIMIT" => :rate_limited, "SERVICE_UNAVAILABLE" => :network_error, "SESSION_EXPIRED" => :invalid_credentials, "SYNCHRONIZER_TOKEN_MISMATCH" => :invalid_credentials, "UNSUPPORTED_MEDIA_TYPE" => :invalid_parameters }, exceptions: %{ broad: %{ "Order not found." => :order_not_found }, exact: %{ "ACCOUNT_HISTORY_TIME_RANGE_TOO_BIG" => :bad_request, "APIKEY_EXPIRED" => :authentication_error, "APIKEY_REVOKED" => :authentication_error, "BAD_AMOUNT_PRECISION" => :invalid_order, "BAD_PRICE_PRECISION" => :invalid_order, "BAD_TRIGGER_PRICE_PRECISION" => :invalid_order, "CANDLESTICKS_TIME_RANGE_TOO_BIG" => :bad_request, "CF_RATELIMIT" => :ddos_protection, "CLIENT_IP_BLOCKED" => :permission_denied, "DEPOSIT_ADDRESS_NOT_USED" => :invalid_address, "GATEWAY_TIMEOUT" => :exchange_not_available, "ILLEGAL_CHARS" => :bad_request, "INSUFFICIENT_FUNDS" => :insufficient_funds, "INSUFFICIENT_LIQUIDITY" => :insufficient_funds, "INTERNAL_ERROR" => :authentication_error, "INTERNAL_SERVER_ERROR" => :exchange_error, "INVALID_ACCOUNT_HISTORY_FROM_TIME" => :bad_request, "INVALID_ACCOUNT_HISTORY_MAX_PAGE_SIZE" => :bad_request, "INVALID_ACCOUNT_HISTORY_TIME_PERIOD" => :bad_request, "INVALID_ACCOUNT_HISTORY_TO_TIME" => :bad_request, "INVALID_ACCOUNT_ID" => :bad_request, "INVALID_AMOUNT" => :bad_request, "INVALID_APIKEY" => :authentication_error, "INVALID_AUDIENCE" => :authentication_error, "INVALID_CANDLESTICKS_GRANULARITY" => :bad_request, "INVALID_CANDLESTICKS_UNIT" => :bad_request, "INVALID_CLIENT_UUID" => :invalid_order, "INVALID_CREDENTIALS" => :authentication_error, "INVALID_CURRENCY" => :bad_request, "INVALID_CURSOR" => :bad_request, "INVALID_DATE" => :bad_request, "INVALID_DEVICE_ID" => :authentication_error, "INVALID_INSTRUMENT_CODE" => :bad_request, "INVALID_IP_RESTRICTION" => :authentication_error, "INVALID_ISSUER" => :authentication_error, "INVALID_LIMIT" => :bad_request, "INVALID_ORDER_BOOK_DEPTH" => :bad_request, "INVALID_ORDER_BOOK_LEVEL" => :bad_request, "INVALID_ORDER_ID" => :order_not_found, "INVALID_ORDER_TYPE" => :bad_request, "INVALID_PAGE_CURSOR" => :bad_request, "INVALID_PERIOD" => :bad_request, "INVALID_PRICE" => :bad_request, "INVALID_QUERY" => :bad_request, "INVALID_SCOPES" => :authentication_error, "INVALID_SIDE" => :invalid_order, "INVALID_SUBJECT" => :authentication_error, "INVALID_TIME" => :bad_request, "INVALID_TIME_RANGE" => :bad_request, "INVALID_TRADE_ID" => :bad_request, "INVALID_UI_ACCOUNT_SETTINGS" => :bad_request, "INVALID_UNIT" => :bad_request, "MAX_OPEN_ORDERS_EXCEEDED" => :bad_request, "MIN_SIZE_NOT_SATISFIED" => :invalid_order, "MISSING_CANDLESTICKS_PERIOD_PARAM" => :arguments_required, "MISSING_CANDLESTICKS_UNIT_PARAM" => :arguments_required, "MISSING_CREDENTIALS" => :authentication_error, "MISSING_FROM_PARAM" => :arguments_required, "MISSING_INSTRUMENT_CODE" => :arguments_required, "MISSING_ORDER_ID" => :invalid_order, "MISSING_ORDER_TYPE" => :invalid_order, "MISSING_PERMISSION" => :permission_denied, "MISSING_PRICE" => :invalid_order, "MISSING_SIDE" => :invalid_order, "MISSING_TO_PARAM" => :arguments_required, "MISSING_TRADE_ID" => :arguments_required, "NEGATIVE_AMOUNT" => :invalid_order, "NEGATIVE_PRICE" => :invalid_order, "NOT_FOUND" => :order_not_found, "NO_TRADING" => :exchange_not_available, "ONLY_ONE_ERC20_ADDRESS_ALLOWED" => :invalid_address, "ORDER_NOT_FOUND" => :order_not_found, "RATELIMIT" => :ddos_protection, "SERVICE_UNAVAILABLE" => :exchange_not_available, "SESSION_EXPIRED" => :authentication_error, "SYNCHRONIZER_TOKEN_MISMATCH" => :authentication_error, "UNSUPPORTED_MEDIA_TYPE" => :bad_request } }, exchange_options: %{ "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "fetchTradingFees" => %{ "method" => "fetchPrivateTradingFees" }, "fiat" => [ "EUR", "CHF" ], "networksById" => %{} }, extended_metadata: %{ fees_url: "https://onetrading.com/fees", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/ccxt/ccxt/assets/43336371/bdbc26fd-02f2-4ca7-9f1e-17333690bb1c" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ future: %{}, spot: %{ create_order: %{ hedged: false, iceberg: false, leverage: false, margin_mode: false, market_buy_by_cost: false, market_buy_requires_price: false, self_trade_prevention: false, stop_loss_price: false, take_profit_price: false, time_in_force: %{ fok: true, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: false }, fetch_closed_orders: %{ days_back: 100000, days_back_canceled: 0.08333333333333333, limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 100000 }, fetch_my_trades: %{ days_back: 100000, limit: 100, margin_mode: false, symbol_required: false, until_days: 100000 }, fetch_ohlcv: %{ limit: 5000 }, fetch_open_orders: %{ limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false }, sandbox: false }, swap: %{} }, fees: %{ trading: %{ maker: 0.001, percentage: true, taker: 0.0015, tier_based: true } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined;\n }\n //\n // {\"error\":\"MISSING_FROM_PARAM\"}\n // {\"error\":\"MISSING_TO_PARAM\"}\n // {\"error\":\"CANDLESTICKS_TIME_RANGE_TOO_BIG\"}\n //\n const message = this.safeString(response, 'error');\n if (message !== undefined) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\n }\n return undefined;\n }", has: %{ add_margin: false, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: false, cancel_all_orders: true, cancel_all_orders_ws: false, cancel_order: true, cancel_order_with_client_order_id: false, cancel_order_ws: false, cancel_orders: true, cancel_orders_with_client_order_id: false, cancel_orders_ws: false, close_all_positions: false, close_position: false, create_deposit_address: false, create_limit_buy_order: false, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: false, create_limit_sell_order_ws: false, create_market_buy_order: false, create_market_buy_order_with_cost: false, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: true, create_market_order_with_cost: false, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: false, create_market_sell_order_with_cost: false, create_market_sell_order_with_cost_ws: false, create_market_sell_order_ws: false, create_order: true, create_order_with_take_profit_and_stop_loss: false, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: false, create_post_only_order: false, create_post_only_order_ws: false, create_reduce_only_order: false, create_reduce_only_order_ws: false, create_stop_limit_order: true, create_stop_limit_order_ws: false, create_stop_loss_order: false, create_stop_loss_order_ws: false, create_stop_market_order: false, create_stop_market_order_ws: false, create_stop_order: true, create_stop_order_ws: false, create_take_profit_order: false, create_take_profit_order_ws: false, create_trailing_amount_order: false, create_trailing_amount_order_ws: false, create_trailing_percent_order: false, create_trailing_percent_order_ws: false, create_trigger_order: false, create_trigger_order_ws: false, deposit: false, edit_order: true, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: false, fetch_accounts: false, fetch_all_greeks: false, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: false, fetch_borrow_interest: false, fetch_borrow_rate: false, fetch_borrow_rate_histories: false, fetch_borrow_rate_history: false, fetch_borrow_rates: false, fetch_borrow_rates_per_symbol: false, fetch_canceled_and_closed_orders: false, fetch_canceled_orders: false, fetch_closed_order: false, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: false, fetch_convert_quote: false, fetch_convert_trade: false, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: false, fetch_deposit_address: false, fetch_deposit_addresses: false, fetch_deposit_addresses_by_network: false, fetch_deposit_withdraw_fee: false, fetch_deposit_withdraw_fees: false, fetch_deposits: false, fetch_deposits_withdrawals: false, fetch_deposits_ws: false, fetch_funding_history: false, fetch_funding_interval: false, fetch_funding_intervals: false, fetch_funding_rate: false, fetch_funding_rate_history: false, fetch_funding_rates: false, fetch_greeks: false, fetch_index_ohlcv: false, fetch_isolated_borrow_rate: false, fetch_isolated_borrow_rates: false, fetch_isolated_positions: false, fetch_l2_order_book: true, fetch_l3_order_book: false, fetch_last_prices: false, fetch_ledger: false, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: false, fetch_leverages: false, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: false, fetch_margin_modes: false, fetch_mark_ohlcv: false, fetch_mark_price: 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: false, fetch_orders_by_status: false, fetch_orders_ws: false, fetch_position: false, fetch_position_history: false, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: false, fetch_positions_for_symbol: false, fetch_positions_for_symbol_ws: false, fetch_positions_history: false, fetch_positions_risk: false, fetch_positions_ws: false, fetch_premium_index_ohlcv: false, fetch_settlement_history: false, fetch_status: false, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: true, fetch_trades: false, fetch_trades_ws: false, fetch_trading_fee: false, fetch_trading_fees: true, fetch_trading_fees_ws: false, fetch_trading_limits: false, fetch_transaction_fee: false, fetch_transaction_fees: false, fetch_transactions: false, fetch_transfer: false, fetch_transfers: false, fetch_underlying_assets: false, fetch_volatility_history: false, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: false, fetch_withdrawals_ws: false, future: false, margin: false, option: false, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: false, set_leverage: false, set_margin: false, set_margin_mode: false, set_position_mode: false, sign_in: false, spot: true, swap: false, transfer: false, un_watch_my_trades: false, un_watch_ohlcv: false, un_watch_ohlcv_for_symbols: false, un_watch_order_book: false, un_watch_order_book_for_symbols: false, un_watch_orders: false, un_watch_positions: false, un_watch_ticker: false, un_watch_tickers: false, un_watch_trades: false, un_watch_trades_for_symbols: false, watch_balance: true, watch_bids_asks: false, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: false, watch_order_book: true, watch_order_book_for_symbols: false, watch_orders: true, watch_orders_for_symbols: false, watch_position: false, watch_positions: false, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: false, watch_trades_for_symbols: false, withdraw: false, ws: false }, http_config: nil, id: "onetrading", markets: nil, name: "One Trading", ohlcv_timestamp_resolution: :unknown, options: %{ "fetch_trading_fees" => %{ "method" => "fetchPrivateTradingFees" }, "fiat" => [ "EUR", "CHF" ] }, order_mappings: %{ side_format: :uppercase, side_key: "side", type_format: :uppercase, type_key: "type" }, param_mappings: %{ "id" => "order_id", "limit" => "depth", "since" => "from", "symbol" => "instrument_code", "timeframe" => "period", "triggerPrice" => "trigger_price" }, parse_methods: [ %{ "comment" => nil, "examples" => [], "line_end" => 1182, "line_start" => 1169, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "response" } ], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "source" => "parseBalance (response): Balances {\n const balances = this.safeValue (response, 'balances', []);\n const result: Dict = { 'info': response };\n for (let i = 0; i < balances.length; i++) {\n const balance = balances[i];\n const currencyId = this.safeString (balance, 'currency_code');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['free'] = this.safeString (balance, 'available');\n account['used'] = this.safeString (balance, 'locked');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 776, "line_start" => 759, "mappings" => [ %{ "comment" => nil, "key" => "maker", "value" => "makerFees" }, %{ "comment" => nil, "key" => "taker", "value" => "takerFees" } ], "name" => "parseFeeTiers", "signature" => "parseFeeTiers (feeTiers, market: Market = undefined)", "source" => "parseFeeTiers (feeTiers, market: Market = undefined) {\n const takerFees = [];\n const makerFees = [];\n for (let i = 0; i < feeTiers.length; i++) {\n const tier = feeTiers[i];\n const volume = this.safeNumber (tier, 'volume');\n let taker = this.safeString (tier, 'taker_fee');\n let maker = this.safeString (tier, 'maker_fee');\n maker = Precise.stringDiv (maker, '100');\n taker = Precise.stringDiv (taker, '100');\n makerFees.push ([ volume, this.parseNumber (maker) ]);\n takerFees.push ([ volume, this.parseNumber (taker) ]);\n }\n return {\n 'maker': makerFees,\n 'taker': takerFees,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"base\":{\n \"code\":\"BTC\",\n \"precision\":\"5\"\n },\n \"quote\":{\n \"code\":\"USDC\",\n \"precision\":\"2\"\n },\n \"amount_precision\":\"5\",\n \"market_precision\":\"2\",\n \"min_size\":\"10.0\",\n \"min_price\":\"1000\",\n \"max_price\":\"10000000\",\n \"id\":\"BTC_USDC\",\n \"type\":\"SPOT\",\n \"state\":\"ACTIVE\"\n }", "{\n \"base\": {\n \"code\": \"BTC\",\n \"precision\": 5\n },\n \"quote\": {\n \"code\": \"EUR\",\n \"precision\": 2\n },\n \"amount_precision\": 5,\n \"market_precision\": 2,\n \"min_size\": \"10.0\",\n \"min_price\": \"1000\",\n \"max_price\": \"10000000\",\n \"id\": \"BTC_EUR_P\",\n \"type\": \"PERP\",\n \"state\": \"ACTIVE\"\n }" ], "line_end" => 594, "line_start" => 490, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "base", "value" => "base" }, %{ "comment" => nil, "key" => "quote", "value" => "quote" }, %{ "comment" => nil, "key" => "settle", "value" => "isPerp ? quote : undefined" }, %{ "comment" => nil, "key" => "baseId", "value" => "baseId" }, %{ "comment" => nil, "key" => "quoteId", "value" => "quoteId" }, %{ "comment" => nil, "key" => "settleId", "value" => "isPerp ? quoteId : undefined" }, %{ "comment" => nil, "key" => "type", "value" => "isPerp ? 'swap' : 'spot'" }, %{ "comment" => nil, "key" => "spot", "value" => "!isPerp" }, %{ "comment" => nil, "key" => "margin", "value" => "false" }, %{ "comment" => nil, "key" => "swap", "value" => "isPerp" }, %{ "comment" => nil, "key" => "future", "value" => "false" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "(state === 'ACTIVE')" }, %{ "comment" => nil, "key" => "contract", "value" => "isPerp" }, %{ "comment" => nil, "key" => "linear", "value" => "isPerp ? true : undefined" }, %{ "comment" => nil, "key" => "inverse", "value" => "isPerp ? false : undefined" }, %{ "comment" => nil, "key" => "contractSize", "value" => "isPerp ? this.parseNumber ('1') : undefined" }, %{ "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.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'market_precision'))),\n }" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': this.safeNumber (market, 'min_size'),\n 'max': undefined,\n },\n }" }, %{ "comment" => 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': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': this.safeNumber (market, 'min_size'),\n 'max': undefined,\n }" } ], "name" => "parseMarket", "signature" => "parseMarket (market: Dict): Market", "source" => "parseMarket (market: Dict): Market {\n //\n // {\n // \"base\":{\n // \"code\":\"BTC\",\n // \"precision\":\"5\"\n // },\n // \"quote\":{\n // \"code\":\"USDC\",\n // \"precision\":\"2\"\n // },\n // \"amount_precision\":\"5\",\n // \"market_precision\":\"2\",\n // \"min_size\":\"10.0\",\n // \"min_price\":\"1000\",\n // \"max_price\":\"10000000\",\n // \"id\":\"BTC_USDC\",\n // \"type\":\"SPOT\",\n // \"state\":\"ACTIVE\"\n // }\n //\n //\n // {\n // \"base\": {\n // \"code\": \"BTC\",\n // \"precision\": 5\n // },\n // \"quote\": {\n // \"code\": \"EUR\",\n // \"precision\": 2\n // },\n // \"amount_precision\": 5,\n // \"market_precision\": 2,\n // \"min_size\": \"10.0\",\n // \"min_price\": \"1000\",\n // \"max_price\": \"10000000\",\n // \"id\": \"BTC_EUR_P\",\n // \"type\": \"PERP\",\n // \"state\": \"ACTIVE\"\n // }\n //\n const baseAsset = this.safeDict (market, 'base', {});\n const quoteAsset = this.safeDict (market, 'quote', {});\n const baseId = this.safeString (baseAsset, 'code');\n const quoteId = this.safeString (quoteAsset, 'code');\n const id = this.safeString (market, 'id');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const state = this.safeString (market, 'state');\n const type = this.safeString (market, 'type');\n const isPerp = type === 'PERP';\n let symbol = base + '/' + quote;\n if (isPerp) {\n symbol = symbol + ':' + quote;\n }\n return {\n 'id': id,\n 'symbol': symbol,\n 'base': base,\n 'quote': quote,\n 'settle': isPerp ? quote : undefined,\n 'baseId': baseId,\n 'quoteId': quoteId,\n 'settleId': isPerp ? quoteId : undefined,\n 'type': isPerp ? 'swap' : 'spot',\n 'spot': !isPerp,\n 'margin': false,\n 'swap': isPerp,\n 'future': false,\n 'option': false,\n 'active': (state === 'ACTIVE'),\n 'contract': isPerp,\n 'linear': isPerp ? true : undefined,\n 'inverse': isPerp ? false : undefined,\n 'contractSize': isPerp ? this.parseNumber ('1') : undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'amount_precision'))),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'market_precision'))),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': this.safeNumber (market, 'min_size'),\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': market,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"instrument_code\":\"BTC_EUR\",\n \"granularity\":{\"unit\":\"HOURS\",\"period\":1},\n \"high\":\"9252.65\",\n \"low\":\"9115.27\",\n \"open\":\"9250.0\",\n \"close\":\"9132.35\",\n \"total_amount\":\"33.85924\",\n \"volume\":\"311958.9635744\",\n \"time\":\"2020-05-08T22:59:59.999Z\",\n \"last_sequence\":461123\n }" ], "line_end" => 1036, "line_start" => 995, "mappings" => [ %{ "comment" => nil, "key" => "MINUTES", "value" => "'m'" }, %{ "comment" => nil, "key" => "HOURS", "value" => "'h'" }, %{ "comment" => nil, "key" => "DAYS", "value" => "'d'" }, %{ "comment" => nil, "key" => "WEEKS", "value" => "'w'" }, %{ "comment" => nil, "key" => "MONTHS", "value" => "'M'" } ], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"instrument_code\":\"BTC_EUR\",\n // \"granularity\":{\"unit\":\"HOURS\",\"period\":1},\n // \"high\":\"9252.65\",\n // \"low\":\"9115.27\",\n // \"open\":\"9250.0\",\n // \"close\":\"9132.35\",\n // \"total_amount\":\"33.85924\",\n // \"volume\":\"311958.9635744\",\n // \"time\":\"2020-05-08T22:59:59.999Z\",\n // \"last_sequence\":461123\n // }\n //\n const granularity = this.safeValue (ohlcv, 'granularity');\n const unit = this.safeString (granularity, 'unit');\n const period = this.safeString (granularity, 'period');\n const units: Dict = {\n 'MINUTES': 'm',\n 'HOURS': 'h',\n 'DAYS': 'd',\n 'WEEKS': 'w',\n 'MONTHS': 'M',\n };\n const lowercaseUnit = this.safeString (units, unit);\n const timeframe = period + lowercaseUnit;\n const durationInSeconds = this.parseTimeframe (timeframe);\n const duration = durationInSeconds * 1000;\n const timestamp = this.parse8601 (this.safeString (ohlcv, 'time'));\n const alignedTimestamp = duration * this.parseToInt (timestamp / duration);\n const options = this.safeValue (this.options, 'fetchOHLCV', {});\n const volumeField = this.safeString (options, 'volume', 'total_amount');\n return [\n alignedTimestamp,\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, volumeField),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"order_id\": \"d5492c24-2995-4c18-993a-5b8bf8fffc0d\",\n \"client_id\": \"d75fb03b-b599-49e9-b926-3f0b6d103206\",\n \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n \"instrument_code\": \"BTC_EUR\",\n \"time\": \"2019-08-01T08:00:44.026Z\",\n \"side\": \"BUY\",\n \"price\": \"5000\",\n \"amount\": \"1\",\n \"filled_amount\": \"0.5\",\n \"type\": \"LIMIT\",\n \"time_in_force\": \"GOOD_TILL_CANCELLED\"\n }", "{\n \"order\": {\n \"order_id\": \"66756a10-3e86-48f4-9678-b634c4b135b2\",\n \"account_id\": \"1eb2ad5d-55f1-40b5-bc92-7dc05869e905\",\n \"instrument_code\": \"BTC_EUR\",\n \"amount\": \"1234.5678\",\n \"filled_amount\": \"1234.5678\",\n \"side\": \"BUY\",\n \"type\": \"LIMIT\",\n \"status\": \"OPEN\",\n \"sequence\": 123456789,\n \"price\": \"1234.5678\",\n \"average_price\": \"1234.5678\",\n \"reason\": \"INSUFFICIENT_FUNDS\",\n \"time\": \"2019-08-24T14:15:22Z\",\n \"time_in_force\": \"GOOD_TILL_CANCELLED\",\n \"time_last_updated\": \"2019-08-24T14:15:22Z\",\n \"expire_after\": \"2019-08-24T14:15:22Z\",\n \"is_post_only\": false,\n \"time_triggered\": \"2019-08-24T14:15:22Z\",\n \"trigger_price\": \"1234.5678\"\n },\n \"trades\": [\n {\n \"fee\": {\n \"fee_amount\": \"0.0014\",\n \"fee_currency\": \"BTC\",\n \"fee_percentage\": \"0.1\",\n \"fee_group_id\": \"default\",\n \"fee_type\": \"TAKER\",\n \"running_trading_volume\": \"0.0\"\n },\n \"trade\": {\n \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n \"amount\": \"1.4\",\n \"side\": \"BUY\",\n \"instrument_code\": \"BTC_EUR\",\n \"price\": \"7341.4\",\n \"time\": \"2019-09-27T15:05:32.564Z\",\n \"sequence\": 48670\n }\n }\n ]\n }" ], "line_end" => 1336, "line_start" => 1230, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "clientOrderId" }, %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "this.parseOrderType (type)" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "timeInForce" }, %{ "comment" => nil, "key" => "postOnly", "value" => "postOnly" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "this.safeNumber (rawOrder, 'trigger_price')" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "filled", "value" => "filled" }, %{ "comment" => nil, "key" => "remaining", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "status" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n //\n // {\n // \"order_id\": \"d5492c24-2995-4c18-993a-5b8bf8fffc0d\",\n // \"client_id\": \"d75fb03b-b599-49e9-b926-3f0b6d103206\",\n // \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n // \"instrument_code\": \"BTC_EUR\",\n // \"time\": \"2019-08-01T08:00:44.026Z\",\n // \"side\": \"BUY\",\n // \"price\": \"5000\",\n // \"amount\": \"1\",\n // \"filled_amount\": \"0.5\",\n // \"type\": \"LIMIT\",\n // \"time_in_force\": \"GOOD_TILL_CANCELLED\"\n // }\n //\n // fetchOrder, fetchOpenOrders, fetchClosedOrders\n //\n // {\n // \"order\": {\n // \"order_id\": \"66756a10-3e86-48f4-9678-b634c4b135b2\",\n // \"account_id\": \"1eb2ad5d-55f1-40b5-bc92-7dc05869e905\",\n // \"instrument_code\": \"BTC_EUR\",\n // \"amount\": \"1234.5678\",\n // \"filled_amount\": \"1234.5678\",\n // \"side\": \"BUY\",\n // \"type\": \"LIMIT\",\n // \"status\": \"OPEN\",\n // \"sequence\": 123456789,\n // \"price\": \"1234.5678\",\n // \"average_price\": \"1234.5678\",\n // \"reason\": \"INSUFFICIENT_FUNDS\",\n // \"time\": \"2019-08-24T14:15:22Z\",\n // \"time_in_force\": \"GOOD_TILL_CANCELLED\",\n // \"time_last_updated\": \"2019-08-24T14:15:22Z\",\n // \"expire_after\": \"2019-08-24T14:15:22Z\",\n // \"is_post_only\": false,\n // \"time_triggered\": \"2019-08-24T14:15:22Z\",\n // \"trigger_price\": \"1234.5678\"\n // },\n // \"trades\": [\n // {\n // \"fee\": {\n // \"fee_amount\": \"0.0014\",\n // \"fee_currency\": \"BTC\",\n // \"fee_percentage\": \"0.1\",\n // \"fee_group_id\": \"default\",\n // \"fee_type\": \"TAKER\",\n // \"running_trading_volume\": \"0.0\"\n // },\n // \"trade\": {\n // \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n // \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n // \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n // \"amount\": \"1.4\",\n // \"side\": \"BUY\",\n // \"instrument_code\": \"BTC_EUR\",\n // \"price\": \"7341.4\",\n // \"time\": \"2019-09-27T15:05:32.564Z\",\n // \"sequence\": 48670\n // }\n // }\n // ]\n // }\n //\n const rawOrder = this.safeValue (order, 'order', order);\n const id = this.safeString (rawOrder, 'order_id');\n const clientOrderId = this.safeString (rawOrder, 'client_id');\n const timestamp = this.parse8601 (this.safeString (rawOrder, 'time'));\n const rawStatus = this.parseOrderStatus (this.safeString (rawOrder, 'status'));\n const status = this.parseOrderStatus (rawStatus);\n const marketId = this.safeString (rawOrder, 'instrument_code');\n const symbol = this.safeSymbol (marketId, market, '_');\n const price = this.safeString (rawOrder, 'price');\n const amount = this.safeString (rawOrder, 'amount');\n const filled = this.safeString (rawOrder, 'filled_amount');\n const side = this.safeStringLower (rawOrder, 'side');\n const type = this.safeStringLower (rawOrder, 'type');\n const timeInForce = this.parseTimeInForce (this.safeString (rawOrder, 'time_in_force'));\n const postOnly = this.safeValue (rawOrder, 'is_post_only');\n const rawTrades = this.safeValue (order, 'trades', []);\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': clientOrderId,\n 'info': order,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'symbol': symbol,\n 'type': this.parseOrderType (type),\n 'timeInForce': timeInForce,\n 'postOnly': postOnly,\n 'side': side,\n 'price': price,\n 'triggerPrice': this.safeNumber (rawOrder, 'trigger_price'),\n 'amount': amount,\n 'cost': undefined,\n 'average': undefined,\n 'filled': filled,\n 'remaining': undefined,\n 'status': status,\n // 'fee': undefined,\n 'trades': rawTrades,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1228, "line_start" => 1214, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'FILLED': 'open',\n 'FILLED_FULLY': 'closed',\n 'FILLED_CLOSED': 'canceled',\n 'FILLED_REJECTED': 'rejected',\n 'OPEN': 'open',\n 'REJECTED': 'rejected',\n 'CLOSED': 'canceled',\n 'FAILED': 'failed',\n 'STOP_TRIGGERED': 'triggered',\n 'DONE': 'closed',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1343, "line_start" => 1338, "mappings" => [], "name" => "parseOrderType", "signature" => "parseOrderType (type: Str)", "source" => "parseOrderType (type: Str) {\n const types: Dict = {\n 'booked': 'limit',\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"instrument_code\":\"BTC_EUR\",\n \"sequence\":602562,\n \"time\":\"2020-07-10T06:27:34.951Z\",\n \"state\":\"ACTIVE\",\n \"is_frozen\":0,\n \"quote_volume\":\"1695555.1783768\",\n \"base_volume\":\"205.67436\",\n \"last_price\":\"8143.91\",\n \"best_bid\":\"8143.71\",\n \"best_ask\":\"8156.9\",\n \"price_change\":\"-147.47\",\n \"price_change_percentage\":\"-1.78\",\n \"high\":\"8337.45\",\n \"low\":\"8110.0\"\n }" ], "line_end" => 829, "line_start" => 778, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "high", "value" => "this.safeString (ticker, 'high')" }, %{ "comment" => nil, "key" => "low", "value" => "this.safeString (ticker, 'low')" }, %{ "comment" => nil, "key" => "bid", "value" => "this.safeString (ticker, 'best_bid')" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeString (ticker, 'best_ask')" }, %{ "comment" => nil, "key" => "askVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "undefined" }, %{ "comment" => nil, "key" => "close", "value" => "last" }, %{ "comment" => nil, "key" => "last", "value" => "last" }, %{ "comment" => nil, "key" => "previousClose", "value" => "undefined" }, %{ "comment" => nil, "key" => "change", "value" => "change" }, %{ "comment" => nil, "key" => "percentage", "value" => "percentage" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "baseVolume" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "quoteVolume" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker", "source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // fetchTicker, fetchTickers\n //\n // {\n // \"instrument_code\":\"BTC_EUR\",\n // \"sequence\":602562,\n // \"time\":\"2020-07-10T06:27:34.951Z\",\n // \"state\":\"ACTIVE\",\n // \"is_frozen\":0,\n // \"quote_volume\":\"1695555.1783768\",\n // \"base_volume\":\"205.67436\",\n // \"last_price\":\"8143.91\",\n // \"best_bid\":\"8143.71\",\n // \"best_ask\":\"8156.9\",\n // \"price_change\":\"-147.47\",\n // \"price_change_percentage\":\"-1.78\",\n // \"high\":\"8337.45\",\n // \"low\":\"8110.0\"\n // }\n //\n const timestamp = this.parse8601 (this.safeString (ticker, 'time'));\n const marketId = this.safeString (ticker, 'instrument_code');\n const symbol = this.safeSymbol (marketId, market, '_');\n const last = this.safeString (ticker, 'last_price');\n const percentage = this.safeString (ticker, 'price_change_percentage');\n const change = this.safeString (ticker, 'price_change');\n const baseVolume = this.safeString (ticker, 'base_volume');\n const quoteVolume = this.safeString (ticker, 'quote_volume');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high'),\n 'low': this.safeString (ticker, 'low'),\n 'bid': this.safeString (ticker, 'best_bid'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'best_ask'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': change,\n 'percentage': percentage,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1353, "line_start" => 1345, "mappings" => [], "name" => "parseTimeInForce", "signature" => "parseTimeInForce (timeInForce: Str)", "source" => "parseTimeInForce (timeInForce: Str) {\n const timeInForces: Dict = {\n 'GOOD_TILL_CANCELLED': 'GTC',\n 'GOOD_TILL_TIME': 'GTT',\n 'IMMEDIATE_OR_CANCELLED': 'IOC',\n 'FILL_OR_KILL': 'FOK',\n };\n return this.safeString (timeInForces, timeInForce, timeInForce);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"instrument_code\":\"BTC_EUR\",\n \"price\":\"8137.28\",\n \"amount\":\"0.22269\",\n \"taker_side\":\"BUY\",\n \"volume\":\"1812.0908832\",\n \"time\":\"2020-07-10T14:44:32.299Z\",\n \"trade_timestamp\":1594392272299,\n \"sequence\":603047\n }", "{\n \"fee\": {\n \"fee_amount\": \"0.0014\",\n \"fee_currency\": \"BTC\",\n \"fee_percentage\": \"0.1\",\n \"fee_group_id\": \"default\",\n \"fee_type\": \"TAKER\",\n \"running_trading_volume\": \"0.0\"\n },\n \"trade\": {\n \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n \"amount\": \"1.4\",\n \"side\": \"BUY\",\n \"instrument_code\": \"BTC_EUR\",\n \"price\": \"7341.4\",\n \"time\": \"2019-09-27T15:05:32.564Z\",\n \"sequence\": 48670\n }\n }" ], "line_end" => 1167, "line_start" => 1087, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString2 (trade, 'trade_id', 'sequence')" }, %{ "comment" => nil, "key" => "order", "value" => "this.safeString (trade, 'order_id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "priceString" }, %{ "comment" => nil, "key" => "amount", "value" => "amountString" }, %{ "comment" => nil, "key" => "cost", "value" => "costString" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "cost", "value" => "feeCostString" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrencyCode" }, %{ "comment" => nil, "key" => "rate", "value" => "feeRateString" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades (public)\n //\n // {\n // \"instrument_code\":\"BTC_EUR\",\n // \"price\":\"8137.28\",\n // \"amount\":\"0.22269\",\n // \"taker_side\":\"BUY\",\n // \"volume\":\"1812.0908832\",\n // \"time\":\"2020-07-10T14:44:32.299Z\",\n // \"trade_timestamp\":1594392272299,\n // \"sequence\":603047\n // }\n //\n // fetchMyTrades, fetchOrder, fetchOpenOrders, fetchClosedOrders trades (private)\n //\n // {\n // \"fee\": {\n // \"fee_amount\": \"0.0014\",\n // \"fee_currency\": \"BTC\",\n // \"fee_percentage\": \"0.1\",\n // \"fee_group_id\": \"default\",\n // \"fee_type\": \"TAKER\",\n // \"running_trading_volume\": \"0.0\"\n // },\n // \"trade\": {\n // \"trade_id\": \"fdff2bcc-37d6-4a2d-92a5-46e09c868664\",\n // \"order_id\": \"36bb2437-7402-4794-bf26-4bdf03526439\",\n // \"account_id\": \"a4c699f6-338d-4a26-941f-8f9853bfc4b9\",\n // \"amount\": \"1.4\",\n // \"side\": \"BUY\",\n // \"instrument_code\": \"BTC_EUR\",\n // \"price\": \"7341.4\",\n // \"time\": \"2019-09-27T15:05:32.564Z\",\n // \"sequence\": 48670\n // }\n // }\n //\n const feeInfo = this.safeValue (trade, 'fee', {});\n trade = this.safeValue (trade, 'trade', trade);\n let timestamp = this.safeInteger (trade, 'trade_timestamp');\n if (timestamp === undefined) {\n timestamp = this.parse8601 (this.safeString (trade, 'time'));\n }\n const side = this.safeStringLower2 (trade, 'side', 'taker_side');\n const priceString = this.safeString (trade, 'price');\n const amountString = this.safeString (trade, 'amount');\n const costString = this.safeString (trade, 'volume');\n const marketId = this.safeString (trade, 'instrument_code');\n const symbol = this.safeSymbol (marketId, market, '_');\n const feeCostString = this.safeString (feeInfo, 'fee_amount');\n let takerOrMaker = undefined;\n let fee = undefined;\n if (feeCostString !== undefined) {\n const feeCurrencyId = this.safeString (feeInfo, 'fee_currency');\n const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n const feeRateString = this.safeString (feeInfo, 'fee_percentage');\n fee = {\n 'cost': feeCostString,\n 'currency': feeCurrencyCode,\n 'rate': feeRateString,\n };\n takerOrMaker = this.safeStringLower (feeInfo, 'fee_type');\n }\n return this.safeTrade ({\n 'id': this.safeString2 (trade, 'trade_id', 'sequence'),\n 'order': this.safeString (trade, 'order_id'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'type': undefined,\n 'side': side,\n 'price': priceString,\n 'amount': amountString,\n 'cost': costString,\n 'takerOrMaker': takerOrMaker,\n 'fee': fee,\n 'info': trade,\n }, market);\n }" } ], path_prefix: "/v1/", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 300, period: 1000, requests: 3, rolling_window_size: 60000 }, raw_endpoints: %{ private: [], public: [] }, required_credentials: %{ api_key: true, password: false, secret: false, uid: false }, requires_eddsa: false, response_error: nil, signing: %{ confidence: :medium, pattern: :hmac_sha256_headers }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ precision_mode: 4, sample_limits: %{ "amount" => %{}, "cost" => %{ "min" => 10 }, "price" => %{} }, sample_precision: %{ "amount" => 1.0e-5, "price" => 0.01 }, spot: %{ base: "BTC", base_id: "BTC", case: :upper, contract: false, id: "BTC_USDC", limits: %{ "amount" => %{}, "cost" => %{ "min" => 10 }, "leverage" => %{}, "price" => %{} }, maker: 0.001, precision: %{ "amount" => 1.0e-5, "price" => 0.01 }, quote: "USDC", quote_id: "USDC", separator: "_", symbol: "BTC/USDC", taker: 0.0015 }, swap: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, contract_size: 1, id: "BTC_USD_P", inverse: false, limits: %{ "amount" => %{}, "cost" => %{ "min" => 10 }, "leverage" => %{}, "price" => %{} }, linear: true, maker: 0.001, precision: %{ "amount" => 1.0e-5, "price" => 0.01 }, quote: "USD", quote_id: "USD", separator: "_", settle: "USD", settle_id: "USD", symbol: "BTC/USD:USD", taker: 0.0015 } }, 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: %{ "15m" => "15/MINUTES", "1M" => "1/MONTHS", "1d" => "1/DAYS", "1h" => "1/HOURS", "1m" => "1/MINUTES", "1w" => "1/WEEKS", "30m" => "30/MINUTES", "4h" => "4/HOURS", "5m" => "5/MINUTES" }, url_strategy: %{ detected_from: "sign_method", pattern: :version_slash, prefix: "/v1/" }, urls: %{ api: "https://api.onetrading.com/fast", api_sections: %{ "private" => "https://api.onetrading.com/fast", "public" => "https://api.onetrading.com/fast" }, doc: [ "https://docs.onetrading.com" ], other: nil, sandbox: nil, www: "https://onetrading.com/" }, version: "v1", ws: %{ channel_templates: %{ watch_balance: %{ auth_required: true, market_id_format: :native, params: [], pattern: :type_subscribe }, watch_my_trades: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_ohlcv: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_order_book: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_orders: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => "ACCOUNT_HISTORY", "name" => "channel" }, %{ "default" => nil, "name" => "limit" } ], pattern: :type_subscribe }, watch_ticker: %{ market_id_format: :native, params: [], pattern: :type_subscribe }, watch_tickers: %{ market_id_format: :native, params: [], pattern: :type_subscribe } }, has: %{ watch_balance: true, watch_bids_asks: nil, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: nil, watch_order_book: true, watch_order_book_for_symbols: nil, watch_orders: true, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: nil, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: false, watch_trades_for_symbols: false }, message_patterns: [ %{ format: :type, keys: [ "api_token", "type" ], kind_field: "type", kind_value: "AUTHENTICATE", sources: [ :send, :watch ] }, %{ args_field: "channels", format: :type, keys: [ "bp_remaining_quota", "channels", "type" ], kind_field: "type", kind_value: "SUBSCRIBE", sources: [ :send, :watch ] }, %{ args_field: "channels", format: :type, keys: [ "channels", "type" ], kind_field: "type", kind_value: "SUBSCRIBE", sources: [ :send, :watch ] } ], subscription_config: %{ args_field: "channels", args_format: :object_list, market_id_format: :native, op_field: "type" }, subscription_pattern: :type_subscribe, urls: "wss://streams.onetrading.com/", watch_methods: [ "watchBalance", "watchMany", "watchMyTrades", "watchOHLCV", "watchOrderBook", "watchOrders", "watchTicker", "watchTickers" ] } }