# Crypto.com Exchange Specification # # Auto-generated by: mix ccxt.extract cryptocom # 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: [ "MT" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "USD_STABLE_COIN" => "USDC", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 38, "coveragePercent" => 100, "enabledMethods" => 41, "excluded" => [ %{ "method" => "fetchClosedOrders", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchDepositWithdrawFee", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 2, "extractableMethods" => 39, "failures" => [ %{ "error" => "cryptocom fetchSettlementHistory() requires a type argument, one of (future, option, WARRANT, FUTURE)", "method" => "fetchSettlementHistory" } ] }, endpoints: [ %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :cancel_all_orders, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/private/cancel-all-orders", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :cancel_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/private/cancel-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "contingency_type" => "LIST", "order_list" => [ %{ "instrument_name" => "BTCUSDT", "order_id" => "test-order-id" } ] }, market_type: :spot, method: :post, name: :cancel_orders, param_mappings: %{}, params: [ :ids, :symbol ], path: "/private/cancel-order-list", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "contingency_type" => "LIST", "order_list" => [ %{ "instrument_name" => "BTCUSDT", "order_id" => "test-order-id" } ] }, market_type: :spot, method: :post, name: :cancel_orders_for_symbols, param_mappings: %{}, params: [ :orders ], path: "/private/cancel-order-list", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "broker_id" => "CCXT", "spot_margin" => "SPOT", "type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "amount" => "quantity", "symbol" => "instrument_name" }, params: [ :symbol, :side, :amount, :price ], path: "/private/create-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "broker_id" => "CCXT", "spot_margin" => "SPOT", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "amount" => "quantity", "symbol" => "instrument_name" }, params: [ :symbol, :side, :amount, :price ], path: "/private/create-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "broker_id" => "CCXT", "spot_margin" => "SPOT" }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "amount" => "quantity", "symbol" => "instrument_name" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/private/create-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "contingency_type" => "LIST", "order_list" => [ %{ "broker_id" => "CCXT", "instrument_name" => "BTCUSDT", "price" => "50000", "quantity" => "0.001", "side" => "BUY", "type" => "LIMIT" } ] }, market_type: :spot, method: :post, name: :create_orders, param_mappings: %{}, params: [ :orders ], path: "/private/create-order-list", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "broker_id" => "CCXT", "instrument_name" => "BTCUSDT", "triggerDirection" => "below", "type" => "STOP_LIMIT" }, market_type: :swap, method: :post, name: :create_stop_order, param_mappings: %{ "amount" => "quantity", "triggerPrice" => "ref_price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/private/create-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "broker_id" => "CCXT", "instrument_name" => "BTCUSDT", "triggerDirection" => "below", "type" => "STOP_LIMIT" }, market_type: :swap, method: :post, name: :create_trigger_order, param_mappings: %{ "amount" => "quantity", "triggerPrice" => "ref_price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/private/create-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :edit_order, param_mappings: %{ "amount" => "new_quantity", "id" => "order_id", "price" => "new_price" }, params: [ :id, :symbol, :type, :side, :amount, :price ], path: "/private/amend-order", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/private/get-accounts", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_balance, param_mappings: %{}, params: [], path: "/private/user-balance", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/private/get-currency-networks", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_deposit_address, param_mappings: %{ "code" => "currency" }, params: [ :code ], path: "/private/get-deposit-address", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_deposit_addresses_by_network, param_mappings: %{ "code" => "currency" }, params: [ :code ], path: "/private/get-deposit-address", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_deposit_withdraw_fees, param_mappings: %{}, params: [ :codes ], path: "/private/get-currency-networks", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_deposits, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/private/get-deposit-history", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, default_params: %{ "count" => 1, "instrument_name" => "BTCUSDT", "valuation_type" => "estimated_funding_rate" }, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{}, params: [ :symbol ], path: "/public/get-valuations", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, default_params: %{ "instrument_name" => "BTCUSDT", "valuation_type" => "funding_hist" }, market_type: :swap, method: :get, name: :fetch_funding_rate_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/public/get-valuations", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :limit ], path: "/public/get-book", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_ledger, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/private/get-transactions", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/public/get-instruments", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_my_trades, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get-trades", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, default_params: %{ "end_ts" => "", "start_ts" => "" }, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "limit" => "count", "symbol" => "instrument_name" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/public/get-candlestick", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_open_orders, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get-open-orders", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/private/get-order-detail", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "limit" => "depth", "symbol" => "instrument_name" }, params: [ :symbol, :limit ], path: "/public/get-book", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_orders, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get-order-history", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "instrument_name" => "BTCUSDT" }, market_type: :swap, method: :post, name: :fetch_position, param_mappings: %{}, params: [ :symbol ], path: "/private/get-positions", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, default_params: %{ "instrument_name" => "BTCUSDT" }, market_type: :swap, method: :post, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/private/get-positions", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/public/get-tickers", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, default_params: %{ "instrument_name" => "BTCUSDT" }, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/public/get-tickers", source: :intercepted }, %{ api_section: "v1/public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "limit" => "count", "since" => "start_ts", "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/public/get-trades", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_trading_fee, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/private/get-instrument-fee-rate", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/private/get-fee-rate", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :fetch_withdrawals, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/private/get-withdrawal-history", source: :intercepted }, %{ api_section: "v1/private", auth: true, cost: 1.0, market_type: :spot, method: :post, name: :withdraw, param_mappings: %{ "code" => "currency" }, params: [ :code, :amount, :address, :tag ], path: "/private/create-withdrawal", source: :intercepted } ], error_code_details: %{ 10001 => %{ description: nil, type: :exchange_error }, 10002 => %{ description: nil, type: :access_restricted }, 10003 => %{ description: nil, type: :access_restricted }, 10004 => %{ description: nil, type: :invalid_parameters }, 10005 => %{ description: nil, type: :access_restricted }, 10006 => %{ description: nil, type: :rate_limited }, 10007 => %{ description: nil, type: :invalid_credentials }, 10008 => %{ description: nil, type: :invalid_parameters }, 10009 => %{ description: nil, type: :invalid_parameters }, 20001 => %{ description: nil, type: :invalid_parameters }, 20002 => %{ description: nil, type: :insufficient_balance }, 20005 => %{ description: "ACCOUNT_NOT_FOUND", type: :access_restricted }, 219 => %{ description: nil, type: :invalid_order }, 30003 => %{ description: nil, type: :invalid_order }, 30004 => %{ description: nil, type: :invalid_parameters }, 30005 => %{ description: nil, type: :invalid_parameters }, 30006 => %{ description: nil, type: :invalid_order }, 30007 => %{ description: nil, type: :invalid_order }, 30008 => %{ description: nil, type: :invalid_order }, 30009 => %{ description: nil, type: :invalid_order }, 30010 => %{ description: nil, type: :invalid_parameters }, 30013 => %{ description: nil, type: :invalid_order }, 30014 => %{ description: nil, type: :invalid_order }, 30016 => %{ description: nil, type: :invalid_order }, 30017 => %{ description: nil, type: :invalid_order }, 30023 => %{ description: nil, type: :invalid_order }, 30024 => %{ description: nil, type: :invalid_order }, 30025 => %{ description: nil, type: :invalid_order }, 306 => %{ description: "{ \"id\" : 1753xxx, \"method\" : \"private/amend-order\", \"code\" : 306, \"message\" : \"INSUFFICIENT_AVAILABLE_BALANCE\", \"result\" : { \"client_oid\" : \"1753xxx\", \"order_id\" : \"6530xxx\" } }", type: :insufficient_balance }, 314 => %{ description: "{ \"id\" : 1700xxx, \"method\" : \"private/create-order\", \"code\" : 314, \"message\" : \"EXCEEDS_MAX_ORDER_SIZE\", \"result\" : { \"client_oid\" : \"1700xxx\", \"order_id\" : \"6530xxx\" } }", type: :invalid_order }, 325 => %{ description: "{ \"id\" : 1741xxx, \"method\" : \"private/create-order\", \"code\" : 325, \"message\" : \"EXCEED_DAILY_VOL_LIMIT\", \"result\" : { \"client_oid\" : \"1741xxx\", \"order_id\" : \"6530xxx\" } }", type: :invalid_order }, 40001 => %{ description: nil, type: :invalid_parameters }, 40002 => %{ description: nil, type: :invalid_parameters }, 40003 => %{ description: nil, type: :invalid_parameters }, 40004 => %{ description: nil, type: :invalid_parameters }, 40005 => %{ description: nil, type: :invalid_parameters }, 40006 => %{ description: nil, type: :invalid_parameters }, 40007 => %{ description: nil, type: :invalid_parameters }, 40101 => %{ description: nil, type: :invalid_credentials }, 40102 => %{ description: "Nonce value differs by more than 60 seconds from server", type: :invalid_credentials }, 40103 => %{ description: "IP address not whitelisted", type: :invalid_credentials }, 40104 => %{ description: "Disallowed based on user tier", type: :invalid_credentials }, 40107 => %{ description: "Session subscription limit has been exceeded", type: :invalid_parameters }, 40401 => %{ description: nil, type: :order_not_found }, 40801 => %{ description: nil, type: :network_error }, 415 => %{ description: "{ \"id\" : 1741xxx, \"method\" : \"private/create-order\", \"code\" : 415, \"message\" : \"BELOW_MIN_ORDER_SIZE\", \"result\" : { \"client_oid\" : \"1741xxx\", \"order_id\" : \"6530xxx\" } }", type: :invalid_order }, 42901 => %{ description: nil, type: :rate_limited }, 43003 => %{ description: "FOK order has not been filled and cancelled", type: :invalid_order }, 43004 => %{ description: "IOC order has not been filled and cancelled", type: :invalid_order }, 43005 => %{ description: "Rejected POST_ONLY create-order request (normally happened when exec_inst contains POST_ONLY but time_in_force is NOT GOOD_TILL_CANCEL)", type: :invalid_order }, 43012 => %{ description: "Canceled due to Self Trade Prevention", type: :invalid_parameters }, 50001 => %{ description: nil, type: :exchange_error }, 9010001 => %{ description: "SYSTEM_MAINTENANCE", type: :network_error } }, error_codes: %{ 10001 => :exchange_error, 10002 => :access_restricted, 10003 => :access_restricted, 10004 => :invalid_parameters, 10005 => :access_restricted, 10006 => :rate_limited, 10007 => :invalid_credentials, 10008 => :invalid_parameters, 10009 => :invalid_parameters, 20001 => :invalid_parameters, 20002 => :insufficient_balance, 20005 => :access_restricted, 219 => :invalid_order, 30003 => :invalid_order, 30004 => :invalid_parameters, 30005 => :invalid_parameters, 30006 => :invalid_order, 30007 => :invalid_order, 30008 => :invalid_order, 30009 => :invalid_order, 30010 => :invalid_parameters, 30013 => :invalid_order, 30014 => :invalid_order, 30016 => :invalid_order, 30017 => :invalid_order, 30023 => :invalid_order, 30024 => :invalid_order, 30025 => :invalid_order, 306 => :insufficient_balance, 314 => :invalid_order, 325 => :invalid_order, 40001 => :invalid_parameters, 40002 => :invalid_parameters, 40003 => :invalid_parameters, 40004 => :invalid_parameters, 40005 => :invalid_parameters, 40006 => :invalid_parameters, 40007 => :invalid_parameters, 40101 => :invalid_credentials, 40102 => :invalid_credentials, 40103 => :invalid_credentials, 40104 => :invalid_credentials, 40107 => :invalid_parameters, 40401 => :order_not_found, 40801 => :network_error, 415 => :invalid_order, 42901 => :rate_limited, 43003 => :invalid_order, 43004 => :invalid_order, 43005 => :invalid_order, 43012 => :invalid_parameters, 50001 => :exchange_error, 9010001 => :network_error }, exceptions: %{ exact: %{ "10001" => :exchange_error, "10002" => :permission_denied, "10003" => :permission_denied, "10004" => :bad_request, "10005" => :permission_denied, "10006" => :ddos_protection, "10007" => :invalid_nonce, "10008" => :bad_request, "10009" => :bad_request, "20001" => :bad_request, "20002" => :insufficient_funds, "20005" => :account_not_enabled, "219" => :invalid_order, "30003" => :bad_symbol, "30004" => :bad_request, "30005" => :bad_request, "30006" => :invalid_order, "30007" => :invalid_order, "30008" => :invalid_order, "30009" => :invalid_order, "30010" => :bad_request, "30013" => :invalid_order, "30014" => :invalid_order, "30016" => :invalid_order, "30017" => :invalid_order, "30023" => :invalid_order, "30024" => :invalid_order, "30025" => :invalid_order, "306" => :insufficient_funds, "314" => :invalid_order, "325" => :invalid_order, "40001" => :bad_request, "40002" => :bad_request, "40003" => :bad_request, "40004" => :bad_request, "40005" => :bad_request, "40006" => :bad_request, "40007" => :bad_request, "40101" => :authentication_error, "40102" => :invalid_nonce, "40103" => :authentication_error, "40104" => :authentication_error, "40107" => :bad_request, "40401" => :order_not_found, "40801" => :request_timeout, "415" => :invalid_order, "42901" => :rate_limit_exceeded, "43003" => :invalid_order, "43004" => :invalid_order, "43005" => :invalid_order, "43012" => :bad_request, "50001" => :exchange_error, "9010001" => :on_maintenance } }, exchange_options: %{ "accountsById" => %{ "derivatives" => "DERIVATIVES", "funding" => "SPOT", "future" => "DERIVATIVES", "margin" => "MARGIN", "spot" => "SPOT", "swap" => "DERIVATIVES" }, "broker" => "CCXT", "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "defaultType" => "spot", "networks" => %{ "BEP20" => "BSC", "ERC20" => "ETH", "TRC20" => "TRON" }, "networksById" => %{ "BSC" => "BEP20", "ETH" => "ERC20", "TRON" => "TRC20" } }, extended_metadata: %{ fees_url: "https://crypto.com/exchange/document/fees-limits", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://user-images.githubusercontent.com/1294454/147792121-38ed5e36-c229-48d6-b49a-48d05fc19ed4.jpeg", referral_discount: 0.75, referral_url: "https://crypto.com/exch/kdacthrnxt" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: false, leverage: false, margin_mode: true, market_buy_by_cost: true, market_buy_requires_price: true, self_trade_prevention: true, stop_loss_price: true, take_profit_price: true, time_in_force: %{ fok: true, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: true, trigger_price_type: %{ index: true, last: true, mark: true } }, create_orders: %{ max: 10 }, fetch_closed_orders: %{ limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 1 }, fetch_my_trades: %{ limit: 100, margin_mode: false, symbol_required: false, until_days: 1 }, fetch_ohlcv: %{ limit: 300 }, fetch_open_orders: %{ limit: 100, margin_mode: true, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_orders: %{ limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 1 }, sandbox: true }, future: %{ inverse: %{ extends: "default" }, linear: %{ extends: "default" } }, spot: %{ extends: "default", fetch_currencies: %{ private: true } }, swap: %{ inverse: %{ extends: "default" }, linear: %{ extends: "default" } } }, fees: %{ trading: %{ maker: 0.0025, taker: 0.005, tiers: %{ maker: [ %{ fee: 0.0025, volume: 0 }, %{ fee: 0.002, volume: 10000 }, %{ fee: 0.0015, volume: 50000 }, %{ fee: 0.001, volume: 250000 }, %{ fee: 0.0008, volume: 500000 }, %{ fee: 6.5e-4, volume: 2500000 }, %{ fee: 0, volume: 10000000 }, %{ fee: 0, volume: 25000000 }, %{ fee: 0, volume: 100000000 }, %{ fee: 0, volume: 250000000 }, %{ fee: 0, volume: 500000000 } ], taker: [ %{ fee: 0.005, volume: 0 }, %{ fee: 0.004, volume: 10000 }, %{ fee: 0.0025, volume: 50000 }, %{ fee: 0.002, volume: 250000 }, %{ fee: 0.0018, volume: 500000 }, %{ fee: 0.001, volume: 2500000 }, %{ fee: 0.0005, volume: 10000000 }, %{ fee: 0.0004, volume: 25000000 }, %{ fee: 3.5e-4, volume: 100000000 }, %{ fee: 3.1e-4, volume: 250000000 }, %{ fee: 2.5e-4, volume: 500000000 } ] } } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n const errorCode = this.safeString(response, 'code');\n if (errorCode !== '0') {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n throw new errors.ExchangeError(this.id + ' ' + body);\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_for_symbols: true, cancel_orders_with_client_order_id: false, cancel_orders_ws: false, close_all_positions: false, close_position: 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: false, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: true, create_market_order_with_cost: false, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: false, create_market_sell_order_with_cost: false, create_market_sell_order_with_cost_ws: false, create_market_sell_order_ws: false, create_order: true, create_order_with_take_profit_and_stop_loss: false, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: true, create_post_only_order: false, create_post_only_order_ws: false, create_reduce_only_order: false, create_reduce_only_order_ws: false, create_stop_limit_order: false, 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: 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: false, fetch_convert_quote: false, fetch_convert_trade: false, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: false, fetch_deposit_address: true, fetch_deposit_addresses: false, fetch_deposit_addresses_by_network: true, fetch_deposit_withdraw_fee: true, fetch_deposit_withdraw_fees: true, fetch_deposits: true, fetch_deposits_withdrawals: false, fetch_deposits_ws: false, fetch_funding_history: false, fetch_funding_interval: false, fetch_funding_intervals: false, fetch_funding_rate: true, fetch_funding_rate_history: true, 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: true, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: false, fetch_leverages: false, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: false, fetch_margin_modes: false, fetch_mark_ohlcv: false, fetch_mark_prices: false, fetch_market_leverage_tiers: false, fetch_markets: true, fetch_markets_ws: false, fetch_my_liquidations: false, fetch_my_settlement_history: false, fetch_my_trades: true, fetch_my_trades_ws: false, fetch_ohlcv: true, fetch_ohlcv_ws: false, fetch_open_interest: false, fetch_open_interest_history: false, fetch_open_interests: false, fetch_open_order: false, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: false, fetch_option_chain: false, fetch_order: true, fetch_order_book: true, fetch_order_book_ws: false, fetch_order_books: false, fetch_order_trades: false, 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: true, fetch_status: false, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: false, 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: 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: true, fetch_withdrawals_ws: false, future: true, margin: true, option: true, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: true, set_leverage: false, set_margin: false, set_margin_mode: false, set_position_mode: false, sign_in: false, spot: true, swap: true, 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: 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: true, 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: true, withdraw: true, ws: false }, http_config: nil, id: "cryptocom", markets: nil, name: "Crypto.com", ohlcv_timestamp_resolution: :unknown, options: %{ accounts_by_id: %{ "derivatives" => "DERIVATIVES", "funding" => "SPOT", "future" => "DERIVATIVES", "margin" => "MARGIN", "spot" => "SPOT", "swap" => "DERIVATIVES" }, broker: "CCXT", default_account_type: "spot", default_type: "spot", networks: %{ "BEP20" => "BSC", "ERC20" => "ETH", "TRC20" => "TRON" } }, order_mappings: %{ side_format: :uppercase, side_key: "side", type_format: :uppercase, type_key: "type" }, param_mappings: %{ "amount" => "new_quantity", "code" => "currency", "id" => "order_id", "limit" => "count", "price" => "new_price", "since" => "start_ts", "symbol" => "instrument_name", "triggerPrice" => "ref_price" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n \"user_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n \"master_account_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n \"label\": \"FORMER_MASTER_MARGIN\",\n \"enabled\": true,\n \"tradable\": true,\n \"name\": \"YOUR_NAME\",\n \"country_code\": \"YOUR_COUNTRY_CODE\",\n \"incorp_country_code\": \"\",\n \"margin_access\": \"DEFAULT\",\n \"derivatives_access\": \"DEFAULT\",\n \"create_time\": 1656481992000,\n \"update_time\": 1667272884594,\n \"two_fa_enabled\": false,\n \"kyc_level\": \"ADVANCED\",\n \"suspended\": false,\n \"terminated\": false,\n \"spot_enabled\": false,\n \"margin_enabled\": false,\n \"derivatives_enabled\": false,\n \"system_label\": \"FORMER_MASTER_MARGIN\"\n }" ], "line_end" => 2922, "line_start" => 2890, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (account, 'uuid')" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeString (account, 'label')" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "account" } ], "name" => "parseAccount", "signature" => "parseAccount (account)", "source" => "parseAccount (account) {\n //\n // {\n // \"uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n // \"user_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n // \"master_account_uuid\": \"a1234abc-1234-4321-q5r7-b1ab0a0b12b\",\n // \"label\": \"FORMER_MASTER_MARGIN\",\n // \"enabled\": true,\n // \"tradable\": true,\n // \"name\": \"YOUR_NAME\",\n // \"country_code\": \"YOUR_COUNTRY_CODE\",\n // \"incorp_country_code\": \"\",\n // \"margin_access\": \"DEFAULT\",\n // \"derivatives_access\": \"DEFAULT\",\n // \"create_time\": 1656481992000,\n // \"update_time\": 1667272884594,\n // \"two_fa_enabled\": false,\n // \"kyc_level\": \"ADVANCED\",\n // \"suspended\": false,\n // \"terminated\": false,\n // \"spot_enabled\": false,\n // \"margin_enabled\": false,\n // \"derivatives_enabled\": false,\n // \"system_label\": \"FORMER_MASTER_MARGIN\"\n // }\n //\n return {\n 'id': this.safeString (account, 'uuid'),\n 'type': this.safeString (account, 'label'),\n 'code': undefined,\n 'info': account,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1971, "line_start" => 1959, "mappings" => [], "name" => "parseAddress", "signature" => "parseAddress (addressString)", "source" => "parseAddress (addressString) {\n let address = undefined;\n let tag = undefined;\n let rawTag = undefined;\n if (addressString.indexOf ('?') > 0) {\n [ address, rawTag ] = addressString.split ('?');\n const splitted = rawTag.split ('=');\n tag = splitted[1];\n } else {\n address = addressString;\n }\n return [ address, tag ];\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1212, "line_start" => 1197, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "response" } ], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "source" => "parseBalance (response): Balances {\n const responseResult = this.safeDict (response, 'result', {});\n const data = this.safeList (responseResult, 'data', []);\n const positionBalances = this.safeValue (data[0], 'position_balances', []);\n const result: Dict = { 'info': response };\n for (let i = 0; i < positionBalances.length; i++) {\n const balance = positionBalances[i];\n const currencyId = this.safeString (balance, 'instrument_name');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['total'] = this.safeString (balance, 'quantity');\n account['used'] = this.safeString (balance, 'reserved_qty');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2499, "line_start" => 2491, "mappings" => [], "name" => "parseDepositStatus", "signature" => "parseDepositStatus (status)", "source" => "parseDepositStatus (status) {\n const statuses: Dict = {\n '0': 'pending',\n '1': 'ok',\n '2': 'failed',\n '3': 'pending',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"full_name\": \"Alchemix\",\n \"default_network\": \"ETH\",\n \"network_list\": [\n {\n \"network_id\": \"ETH\",\n \"withdrawal_fee\": \"0.25000000\",\n \"withdraw_enabled\": true,\n \"min_withdrawal_amount\": \"0.5\",\n \"deposit_enabled\": true,\n \"confirmation_required\": \"0\"\n }\n ]\n }" ], "line_end" => 2675, "line_start" => 2627, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "fee" }, %{ "comment" => nil, "key" => "withdraw", "value" => "{\n 'fee': undefined,\n 'percentage': undefined,\n }" }, %{ "comment" => nil, "key" => "deposit", "value" => "{\n 'fee': undefined,\n 'percentage': undefined,\n }" }, %{ "comment" => nil, "key" => "networks", "value" => "{}" }, %{ "comment" => nil, "key" => "deposit", "value" => "{ 'fee': undefined, 'percentage': undefined }" }, %{ "comment" => nil, "key" => "withdraw", "value" => "{ 'fee': this.safeNumber (networkInfo, 'withdrawal_fee'), 'percentage': false }" } ], "name" => "parseDepositWithdrawFee", "signature" => "parseDepositWithdrawFee (fee, currency: Currency = undefined)", "source" => "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n //\n // {\n // \"full_name\": \"Alchemix\",\n // \"default_network\": \"ETH\",\n // \"network_list\": [\n // {\n // \"network_id\": \"ETH\",\n // \"withdrawal_fee\": \"0.25000000\",\n // \"withdraw_enabled\": true,\n // \"min_withdrawal_amount\": \"0.5\",\n // \"deposit_enabled\": true,\n // \"confirmation_required\": \"0\"\n // }\n // ]\n // }\n //\n const networkList = this.safeList (fee, 'network_list', []);\n const networkListLength = networkList.length;\n const result: Dict = {\n 'info': fee,\n 'withdraw': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'deposit': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'networks': {},\n };\n if (networkList !== undefined) {\n for (let i = 0; i < networkListLength; i++) {\n const networkInfo = networkList[i];\n const networkId = this.safeString (networkInfo, 'network_id');\n const currencyCode = this.safeString (currency, 'code');\n const networkCode = this.networkIdToCode (networkId, currencyCode);\n result['networks'][networkCode] = {\n 'deposit': { 'fee': undefined, 'percentage': undefined },\n 'withdraw': { 'fee': this.safeNumber (networkInfo, 'withdrawal_fee'), 'percentage': false },\n };\n if (networkListLength === 1) {\n result['withdraw']['fee'] = this.safeNumber (networkInfo, 'withdrawal_fee');\n result['withdraw']['percentage'] = false;\n }\n }\n }\n return result;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"v\": \"-0.000001884\",\n \"t\": 1687892400000\n }," ], "line_end" => 3089, "line_start" => 3057, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (undefined, market)" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "interestRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (contract, 'v')" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "fundingTimestamp" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "this.iso8601 (fundingTimestamp)" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "interval", "value" => "'1h'" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (contract, market: Market = undefined): FundingRate", "source" => "parseFundingRate (contract, market: Market = undefined): FundingRate {\n //\n // {\n // \"v\": \"-0.000001884\",\n // \"t\": 1687892400000\n // },\n //\n const timestamp = this.safeInteger (contract, 't');\n let fundingTimestamp = undefined;\n if (timestamp !== undefined) {\n fundingTimestamp = Math.ceil (timestamp / 3600000) * 3600000; // end of the next hour\n }\n return {\n 'info': contract,\n 'symbol': this.safeSymbol (undefined, market),\n 'markPrice': undefined,\n 'indexPrice': undefined,\n 'interestRate': undefined,\n 'estimatedSettlePrice': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'fundingRate': this.safeNumber (contract, 'v'),\n 'fundingTimestamp': fundingTimestamp,\n 'fundingDatetime': this.iso8601 (fundingTimestamp),\n 'nextFundingRate': undefined,\n 'nextFundingTimestamp': undefined,\n 'nextFundingDatetime': undefined,\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'interval': '1h',\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"account_id\": \"ce075cef-1234-4321-bd6e-gf9007351e64\",\n \"event_date\": \"2023-06-15\",\n \"journal_type\": \"TRADING\",\n \"journal_id\": \"6530219460124075091\",\n \"transaction_qty\": \"6.0091224\",\n \"transaction_cost\": \"6.0091224\",\n \"realized_pnl\": \"0\",\n \"order_id\": \"6530219477766741833\",\n \"trade_id\": \"6530219495775954765\",\n \"trade_match_id\": \"4611686018455865176\",\n \"event_timestamp_ms\": 1686804665013,\n \"event_timestamp_ns\": \"1686804665013642422\",\n \"client_oid\": \"CCXT_d6ea7c5db6c1495aa8b758\",\n \"taker_side\": \"\",\n \"side\": \"BUY\",\n \"instrument_name\": \"USD\"\n }" ], "line_end" => 2812, "line_start" => 2759, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "item" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (item, 'order_id')" }, %{ "comment" => nil, "key" => "direction", "value" => "direction" }, %{ "comment" => nil, "key" => "account", "value" => "this.safeString (item, 'account_id')" }, %{ "comment" => nil, "key" => "referenceId", "value" => "this.safeString (item, 'trade_id')" }, %{ "comment" => nil, "key" => "referenceAccount", "value" => "this.safeString (item, 'trade_match_id')" }, %{ "comment" => nil, "key" => "type", "value" => "this.parseLedgerEntryType (this.safeString (item, 'journal_type'))" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "amount", "value" => "this.parseNumber (amount)" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "before", "value" => "undefined" }, %{ "comment" => nil, "key" => "after", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': undefined,\n 'cost': undefined,\n }" }, %{ "comment" => nil, "key" => "currency", "value" => "undefined" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" } ], "name" => "parseLedgerEntry", "signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry", "source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n //\n // {\n // \"account_id\": \"ce075cef-1234-4321-bd6e-gf9007351e64\",\n // \"event_date\": \"2023-06-15\",\n // \"journal_type\": \"TRADING\",\n // \"journal_id\": \"6530219460124075091\",\n // \"transaction_qty\": \"6.0091224\",\n // \"transaction_cost\": \"6.0091224\",\n // \"realized_pnl\": \"0\",\n // \"order_id\": \"6530219477766741833\",\n // \"trade_id\": \"6530219495775954765\",\n // \"trade_match_id\": \"4611686018455865176\",\n // \"event_timestamp_ms\": 1686804665013,\n // \"event_timestamp_ns\": \"1686804665013642422\",\n // \"client_oid\": \"CCXT_d6ea7c5db6c1495aa8b758\",\n // \"taker_side\": \"\",\n // \"side\": \"BUY\",\n // \"instrument_name\": \"USD\"\n // }\n //\n const timestamp = this.safeInteger (item, 'event_timestamp_ms');\n const currencyId = this.safeString (item, 'instrument_name');\n const code = this.safeCurrencyCode (currencyId, currency);\n currency = this.safeCurrency (currencyId, currency);\n let amount = this.safeString (item, 'transaction_qty');\n let direction = undefined;\n if (Precise.stringLt (amount, '0')) {\n direction = 'out';\n amount = Precise.stringAbs (amount);\n } else {\n direction = 'in';\n }\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': this.safeString (item, 'order_id'),\n 'direction': direction,\n 'account': this.safeString (item, 'account_id'),\n 'referenceId': this.safeString (item, 'trade_id'),\n 'referenceAccount': this.safeString (item, 'trade_match_id'),\n 'type': this.parseLedgerEntryType (this.safeString (item, 'journal_type')),\n 'currency': code,\n 'amount': this.parseNumber (amount),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'before': undefined,\n 'after': undefined,\n 'status': undefined,\n 'fee': {\n 'currency': undefined,\n 'cost': undefined,\n },\n }, currency) as LedgerEntry;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2839, "line_start" => 2814, "mappings" => [], "name" => "parseLedgerEntryType", "signature" => "parseLedgerEntryType (type)", "source" => "parseLedgerEntryType (type) {\n const ledgerType: Dict = {\n 'TRADING': 'trade',\n 'TRADE_FEE': 'fee',\n 'WITHDRAW_FEE': 'fee',\n 'WITHDRAW': 'withdrawal',\n 'DEPOSIT': 'deposit',\n 'ROLLBACK_WITHDRAW': 'rollback',\n 'ROLLBACK_DEPOSIT': 'rollback',\n 'FUNDING': 'fee',\n 'REALIZED_PNL': 'trade',\n 'INSURANCE_FUND': 'insurance',\n 'SOCIALIZED_LOSS': 'trade',\n 'LIQUIDATION_FEE': 'fee',\n 'SESSION_RESET': 'reset',\n 'ADJUSTMENT': 'adjustment',\n 'SESSION_SETTLE': 'settlement',\n 'UNCOVERED_LOSS': 'trade',\n 'ADMIN_ADJUSTMENT': 'adjustment',\n 'DELIST': 'delist',\n 'SETTLEMENT_FEE': 'fee',\n 'AUTO_CONVERSION': 'conversion',\n 'MANUAL_CONVERSION': 'conversion',\n };\n return this.safeString (ledgerType, type, type);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"o\": \"26949.89\",\n \"h\": \"26957.64\",\n \"l\": \"26948.24\",\n \"c\": \"26950.00\",\n \"v\": \"0.0670\",\n \"t\": 1687237080000\n }" ], "line_end" => 2370, "line_start" => 2351, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"o\": \"26949.89\",\n // \"h\": \"26957.64\",\n // \"l\": \"26948.24\",\n // \"c\": \"26950.00\",\n // \"v\": \"0.0670\",\n // \"t\": 1687237080000\n // }\n //\n return [\n this.safeInteger (ohlcv, 't'),\n this.safeNumber (ohlcv, 'o'),\n this.safeNumber (ohlcv, 'h'),\n this.safeNumber (ohlcv, 'l'),\n this.safeNumber (ohlcv, 'c'),\n this.safeNumber (ohlcv, 'v'),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"order_id\": \"6540219377766741832\",\n \"client_oid\": \"CCXT_d6ef7c3db6c1495aa8b757\"\n }", "{\n \"account_id\": \"ce075bef-1234-4321-bd6g-ff9007252e63\",\n \"order_id\": \"6530219477767564494\",\n \"client_oid\": \"CCXT_7ce730f0388441df9bc218\",\n \"order_type\": \"LIMIT\",\n \"time_in_force\": \"GOOD_TILL_CANCEL\",\n \"side\": \"BUY\",\n \"exec_inst\": [ ],\n \"quantity\": \"0.00020\",\n \"limit_price\": \"20000.00\",\n \"order_value\": \"4\",\n \"avg_price\": \"0\",\n \"trigger_price\": \"0\",\n \"ref_price\": \"0\",\n \"cumulative_quantity\": \"0\",\n \"cumulative_value\": \"0\",\n \"cumulative_fee\": \"0\",\n \"status\": \"ACTIVE\",\n \"update_user_id\": \"ce075bef-1234-4321-bd6g-gg9007252e63\",\n \"order_date\": \"2023-06-15\",\n \"instrument_name\": \"BTC_USD\",\n \"fee_instrument_name\": \"BTC\",\n \"create_time\": 1686806053992,\n \"create_time_ns\": \"1686806053992921880\",\n \"update_time\": 1686806053993\n }", "{\n \"code\" : 306,\n \"index\" : 1,\n \"client_oid\" : \"1698068111133_1\",\n \"message\" : \"INSUFFICIENT_AVAILABLE_BALANCE\",\n \"order_id\" : \"6142909896519488207\"\n }" ], "line_end" => 2489, "line_start" => 2392, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (order, 'order_id')" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "this.safeString (order, 'client_oid')" }, %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "status", "value" => "'rejected'" }, %{ "comment" => nil, "key" => "timestamp", "value" => "created" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (created)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "this.safeInteger (order, 'update_time')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseOrderStatus (this.safeString (order, 'status'))" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeStringLower (order, 'order_type')" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "this.parseTimeInForce (this.safeString (order, 'time_in_force'))" }, %{ "comment" => nil, "key" => "postOnly", "value" => "postOnly" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeStringLower (order, 'side')" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeNumber (order, 'limit_price')" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (order, 'quantity')" }, %{ "comment" => nil, "key" => "filled", "value" => "this.safeNumber (order, 'cumulative_quantity')" }, %{ "comment" => nil, "key" => "remaining", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "this.safeNumber (order, 'avg_price')" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeNumber (order, 'cumulative_value')" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': this.safeCurrencyCode (feeCurrency),\n 'cost': this.safeNumber (order, 'cumulative_fee'),\n }" }, %{ "comment" => nil, "key" => "trades", "value" => "[]" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (feeCurrency)" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeNumber (order, 'cumulative_fee')" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder, cancelOrder\n //\n // {\n // \"order_id\": \"6540219377766741832\",\n // \"client_oid\": \"CCXT_d6ef7c3db6c1495aa8b757\"\n // }\n //\n // fetchOpenOrders, fetchOrder, fetchOrders\n //\n // {\n // \"account_id\": \"ce075bef-1234-4321-bd6g-ff9007252e63\",\n // \"order_id\": \"6530219477767564494\",\n // \"client_oid\": \"CCXT_7ce730f0388441df9bc218\",\n // \"order_type\": \"LIMIT\",\n // \"time_in_force\": \"GOOD_TILL_CANCEL\",\n // \"side\": \"BUY\",\n // \"exec_inst\": [ ],\n // \"quantity\": \"0.00020\",\n // \"limit_price\": \"20000.00\",\n // \"order_value\": \"4\",\n // \"avg_price\": \"0\",\n // \"trigger_price\": \"0\",\n // \"ref_price\": \"0\",\n // \"cumulative_quantity\": \"0\",\n // \"cumulative_value\": \"0\",\n // \"cumulative_fee\": \"0\",\n // \"status\": \"ACTIVE\",\n // \"update_user_id\": \"ce075bef-1234-4321-bd6g-gg9007252e63\",\n // \"order_date\": \"2023-06-15\",\n // \"instrument_name\": \"BTC_USD\",\n // \"fee_instrument_name\": \"BTC\",\n // \"create_time\": 1686806053992,\n // \"create_time_ns\": \"1686806053992921880\",\n // \"update_time\": 1686806053993\n // }\n //\n // createOrders\n // {\n // \"code\" : 306,\n // \"index\" : 1,\n // \"client_oid\" : \"1698068111133_1\",\n // \"message\" : \"INSUFFICIENT_AVAILABLE_BALANCE\",\n // \"order_id\" : \"6142909896519488207\"\n // }\n //\n const code = this.safeInteger (order, 'code');\n if ((code !== undefined) && (code !== 0)) {\n return this.safeOrder ({\n 'id': this.safeString (order, 'order_id'),\n 'clientOrderId': this.safeString (order, 'client_oid'),\n 'info': order,\n 'status': 'rejected',\n });\n }\n const created = this.safeInteger (order, 'create_time');\n const marketId = this.safeString (order, 'instrument_name');\n const symbol = this.safeSymbol (marketId, market);\n const execInst = this.safeValue (order, 'exec_inst');\n let postOnly = undefined;\n if (execInst !== undefined) {\n postOnly = false;\n for (let i = 0; i < execInst.length; i++) {\n const inst = execInst[i];\n if (inst === 'POST_ONLY') {\n postOnly = true;\n break;\n }\n }\n }\n const feeCurrency = this.safeString (order, 'fee_instrument_name');\n return this.safeOrder ({\n 'info': order,\n 'id': this.safeString (order, 'order_id'),\n 'clientOrderId': this.safeString (order, 'client_oid'),\n 'timestamp': created,\n 'datetime': this.iso8601 (created),\n 'lastTradeTimestamp': this.safeInteger (order, 'update_time'),\n 'status': this.parseOrderStatus (this.safeString (order, 'status')),\n 'symbol': symbol,\n 'type': this.safeStringLower (order, 'order_type'),\n 'timeInForce': this.parseTimeInForce (this.safeString (order, 'time_in_force')),\n 'postOnly': postOnly,\n 'side': this.safeStringLower (order, 'side'),\n 'price': this.safeNumber (order, 'limit_price'),\n 'amount': this.safeNumber (order, 'quantity'),\n 'filled': this.safeNumber (order, 'cumulative_quantity'),\n 'remaining': undefined,\n 'average': this.safeNumber (order, 'avg_price'),\n 'cost': this.safeNumber (order, 'cumulative_value'),\n 'fee': {\n 'currency': this.safeCurrencyCode (feeCurrency),\n 'cost': this.safeNumber (order, 'cumulative_fee'),\n },\n 'trades': [],\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2381, "line_start" => 2372, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'ACTIVE': 'open',\n 'CANCELED': 'canceled',\n 'FILLED': 'closed',\n 'REJECTED': 'rejected',\n 'EXPIRED': 'expired',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"account_id\": \"ce075bef-b600-4277-bd6e-ff9007251e63\",\n \"quantity\": \"0.0001\",\n \"cost\": \"3.02392\",\n \"open_pos_cost\": \"3.02392\",\n \"open_position_pnl\": \"-0.0010281328\",\n \"session_pnl\": \"-0.0010281328\",\n \"update_timestamp_ms\": 1688015919091,\n \"instrument_name\": \"BTCUSD-PERP\",\n \"type\": \"PERPETUAL_SWAP\"\n }" ], "line_end" => 3321, "line_start" => 3275, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "hedged", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "Precise.stringGt (amount, '0') ? 'buy' : 'sell'" }, %{ "comment" => nil, "key" => "contracts", "value" => "Precise.stringAbs (amount)" }, %{ "comment" => nil, "key" => "contractSize", "value" => "market['contractSize']" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "notional", "value" => "undefined" }, %{ "comment" => nil, "key" => "leverage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "this.safeNumber (position, 'open_pos_cost')" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "this.safeNumber (position, 'cost')" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.safeNumber (position, 'open_position_pnl')" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "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 // {\n // \"account_id\": \"ce075bef-b600-4277-bd6e-ff9007251e63\",\n // \"quantity\": \"0.0001\",\n // \"cost\": \"3.02392\",\n // \"open_pos_cost\": \"3.02392\",\n // \"open_position_pnl\": \"-0.0010281328\",\n // \"session_pnl\": \"-0.0010281328\",\n // \"update_timestamp_ms\": 1688015919091,\n // \"instrument_name\": \"BTCUSD-PERP\",\n // \"type\": \"PERPETUAL_SWAP\"\n // }\n //\n const marketId = this.safeString (position, 'instrument_name');\n market = this.safeMarket (marketId, market, undefined, 'contract');\n const symbol = this.safeSymbol (marketId, market, undefined, 'contract');\n const timestamp = this.safeInteger (position, 'update_timestamp_ms');\n const amount = this.safeString (position, 'quantity');\n return this.safePosition ({\n 'info': position,\n 'id': undefined,\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'hedged': undefined,\n 'side': Precise.stringGt (amount, '0') ? 'buy' : 'sell',\n 'contracts': Precise.stringAbs (amount),\n 'contractSize': market['contractSize'],\n 'entryPrice': undefined,\n 'markPrice': undefined,\n 'notional': undefined,\n 'leverage': undefined,\n 'collateral': this.safeNumber (position, 'open_pos_cost'),\n 'initialMargin': this.safeNumber (position, 'cost'),\n 'maintenanceMargin': undefined,\n 'initialMarginPercentage': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'unrealizedPnl': this.safeNumber (position, 'open_position_pnl'),\n 'liquidationPrice': undefined,\n 'marginMode': undefined,\n 'percentage': undefined,\n 'marginRatio': undefined,\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"i\": \"BTCUSD-230526\",\n \"x\": 1685088000000,\n \"v\": \"26464.1\",\n \"t\": 1685087999500\n }" ], "line_end" => 2994, "line_start" => 2976, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "settlement" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeNumber (settlement, 'v')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" } ], "name" => "parseSettlement", "signature" => "parseSettlement (settlement, market)", "source" => "parseSettlement (settlement, market) {\n //\n // {\n // \"i\": \"BTCUSD-230526\",\n // \"x\": 1685088000000,\n // \"v\": \"26464.1\",\n // \"t\": 1685087999500\n // }\n //\n const timestamp = this.safeInteger (settlement, 'x');\n const marketId = this.safeString (settlement, 'i');\n return {\n 'info': settlement,\n 'symbol': this.safeSymbol (marketId, market),\n 'price': this.safeNumber (settlement, 'v'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n };\n }" }, %{ "comment" => nil, "examples" => [ "[\n {\n \"i\": \"BTCUSD-230526\",\n \"x\": 1685088000000,\n \"v\": \"26464.1\",\n \"t\": 1685087999500\n }\n ]" ], "line_end" => 3012, "line_start" => 2996, "mappings" => [], "name" => "parseSettlements", "signature" => "parseSettlements (settlements, market)", "source" => "parseSettlements (settlements, market) {\n //\n // [\n // {\n // \"i\": \"BTCUSD-230526\",\n // \"x\": 1685088000000,\n // \"v\": \"26464.1\",\n // \"t\": 1685087999500\n // }\n // ]\n //\n const result = [];\n for (let i = 0; i < settlements.length; i++) {\n result.push (this.parseSettlement (settlements[i], market));\n }\n return result;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"i\": \"BTC_USD\",\n \"h\": \"30821.45\",\n \"l\": \"28685.11\",\n \"a\": \"30446.00\",\n \"v\": \"1767.8734\",\n \"vv\": \"52436726.42\",\n \"c\": \"0.0583\",\n \"b\": \"30442.00\",\n \"k\": \"30447.66\",\n \"t\": 1687403045415\n }", "{\n \"i\": \"AVAXUSD-PERP\",\n \"h\": \"13.209\",\n \"l\": \"12.148\",\n \"a\": \"13.209\",\n \"v\": \"1109.8\",\n \"vv\": \"14017.33\",\n \"c\": \"0.0732\",\n \"b\": \"13.210\",\n \"k\": \"13.230\",\n \"oi\": \"10888.9\",\n \"t\": 1687402657575\n }" ], "line_end" => 2289, "line_start" => 2229, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "high", "value" => "this.safeNumber (ticker, 'h')" }, %{ "comment" => nil, "key" => "low", "value" => "this.safeNumber (ticker, 'l')" }, %{ "comment" => nil, "key" => "bid", "value" => "this.safeNumber (ticker, 'b')" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeNumber (ticker, 'k')" }, %{ "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" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "this.safeString (ticker, 'c')" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "this.safeString (ticker, 'v')" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "(quote === 'USD') ? this.safeString (ticker, 'vv') : undefined" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker", "source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // fetchTicker\n //\n // {\n // \"i\": \"BTC_USD\",\n // \"h\": \"30821.45\",\n // \"l\": \"28685.11\",\n // \"a\": \"30446.00\",\n // \"v\": \"1767.8734\",\n // \"vv\": \"52436726.42\",\n // \"c\": \"0.0583\",\n // \"b\": \"30442.00\",\n // \"k\": \"30447.66\",\n // \"t\": 1687403045415\n // }\n //\n // fetchTickers\n //\n // {\n // \"i\": \"AVAXUSD-PERP\",\n // \"h\": \"13.209\",\n // \"l\": \"12.148\",\n // \"a\": \"13.209\",\n // \"v\": \"1109.8\",\n // \"vv\": \"14017.33\",\n // \"c\": \"0.0732\",\n // \"b\": \"13.210\",\n // \"k\": \"13.230\",\n // \"oi\": \"10888.9\",\n // \"t\": 1687402657575\n // }\n //\n const timestamp = this.safeInteger (ticker, 't');\n const marketId = this.safeString (ticker, 'i');\n market = this.safeMarket (marketId, market, '_');\n const quote = this.safeString (market, 'quote');\n const last = this.safeString (ticker, 'a');\n return this.safeTicker ({\n 'symbol': market['symbol'],\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeNumber (ticker, 'h'),\n 'low': this.safeNumber (ticker, 'l'),\n 'bid': this.safeNumber (ticker, 'b'),\n 'bidVolume': undefined,\n 'ask': this.safeNumber (ticker, 'k'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': this.safeString (ticker, 'c'),\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'v'),\n 'quoteVolume': (quote === 'USD') ? this.safeString (ticker, 'vv') : undefined,\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2390, "line_start" => 2383, "mappings" => [], "name" => "parseTimeInForce", "signature" => "parseTimeInForce (timeInForce: Str)", "source" => "parseTimeInForce (timeInForce: Str) {\n const timeInForces: Dict = {\n 'GOOD_TILL_CANCEL': 'GTC',\n 'IMMEDIATE_OR_CANCEL': 'IOC',\n 'FILL_OR_KILL': 'FOK',\n };\n return this.safeString (timeInForces, timeInForce, timeInForce);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"s\": \"sell\",\n \"p\": \"26386.00\",\n \"q\": \"0.00453\",\n \"tn\": 1686944282062,\n \"tn\": 1704476468851524373,\n \"d\": \"4611686018455979970\",\n \"i\": \"BTC_USD\"\n }", "{\n \"account_id\": \"ds075abc-1234-4321-bd6g-ff9007252r63\",\n \"event_date\": \"2023-06-16\",\n \"journal_type\": \"TRADING\",\n \"side\": \"BUY\",\n \"instrument_name\": \"BTC_USD\",\n \"fees\": \"-0.0000000525\",\n \"trade_id\": \"6142909898247428343\",\n \"trade_match_id\": \"4611686018455978480\",\n \"create_time\": 1686941992887,\n \"traded_price\": \"26347.16\",\n \"traded_quantity\": \"0.00021\",\n \"fee_instrument_name\": \"BTC\",\n \"client_oid\": \"d1c70a60-1234-4c92-b2a0-72b931cb31e0\",\n \"taker_side\": \"TAKER\",\n \"order_id\": \"6142909895036331486\",\n \"create_time_ns\": \"1686941992887207066\"\n }" ], "line_end" => 2349, "line_start" => 2291, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString2 (trade, 'd', 'trade_id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "order", "value" => "this.safeString (trade, 'order_id')" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeStringLower2 (trade, 's', 'side')" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "this.safeStringLower (trade, 'taker_side')" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeNumber2 (trade, 'p', 'traded_price')" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber2 (trade, 'q', 'traded_quantity')" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': this.safeCurrencyCode (feeCurrency),\n 'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n }" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (feeCurrency)" }, %{ "comment" => nil, "key" => "cost", "value" => "this.parseNumber (Precise.stringNeg (feeCostString))" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades\n //\n // {\n // \"s\": \"sell\",\n // \"p\": \"26386.00\",\n // \"q\": \"0.00453\",\n // \"tn\": 1686944282062,\n // \"tn\": 1704476468851524373,\n // \"d\": \"4611686018455979970\",\n // \"i\": \"BTC_USD\"\n // }\n //\n // fetchMyTrades\n //\n // {\n // \"account_id\": \"ds075abc-1234-4321-bd6g-ff9007252r63\",\n // \"event_date\": \"2023-06-16\",\n // \"journal_type\": \"TRADING\",\n // \"side\": \"BUY\",\n // \"instrument_name\": \"BTC_USD\",\n // \"fees\": \"-0.0000000525\",\n // \"trade_id\": \"6142909898247428343\",\n // \"trade_match_id\": \"4611686018455978480\",\n // \"create_time\": 1686941992887,\n // \"traded_price\": \"26347.16\",\n // \"traded_quantity\": \"0.00021\",\n // \"fee_instrument_name\": \"BTC\",\n // \"client_oid\": \"d1c70a60-1234-4c92-b2a0-72b931cb31e0\",\n // \"taker_side\": \"TAKER\",\n // \"order_id\": \"6142909895036331486\",\n // \"create_time_ns\": \"1686941992887207066\"\n // }\n //\n const timestamp = this.safeInteger2 (trade, 't', 'create_time');\n const marketId = this.safeString2 (trade, 'i', 'instrument_name');\n market = this.safeMarket (marketId, market, '_');\n const feeCurrency = this.safeString (trade, 'fee_instrument_name');\n const feeCostString = this.safeString (trade, 'fees');\n return this.safeTrade ({\n 'info': trade,\n 'id': this.safeString2 (trade, 'd', 'trade_id'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'order': this.safeString (trade, 'order_id'),\n 'side': this.safeStringLower2 (trade, 's', 'side'),\n 'takerOrMaker': this.safeStringLower (trade, 'taker_side'),\n 'price': this.safeNumber2 (trade, 'p', 'traded_price'),\n 'amount': this.safeNumber2 (trade, 'q', 'traded_quantity'),\n 'cost': undefined,\n 'type': undefined,\n 'fee': {\n 'currency': this.safeCurrencyCode (feeCurrency),\n 'cost': this.parseNumber (Precise.stringNeg (feeCostString)),\n },\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"instrument_name\": \"BTC_USD\",\n \"effective_maker_rate_bps\": \"6.5\",\n \"effective_taker_rate_bps\": \"6.9\"\n }" ], "line_end" => 3520, "line_start" => 3502, "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, 'effective_maker_rate_bps'), '10000'))" }, %{ "comment" => nil, "key" => "taker", "value" => "this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_taker_rate_bps'), '10000'))" }, %{ "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 //\n // {\n // \"instrument_name\": \"BTC_USD\",\n // \"effective_maker_rate_bps\": \"6.5\",\n // \"effective_taker_rate_bps\": \"6.9\"\n // }\n //\n const marketId = this.safeString (fee, 'instrument_name');\n const symbol = this.safeSymbol (marketId, market);\n return {\n 'info': fee,\n 'symbol': symbol,\n 'maker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_maker_rate_bps'), '10000')),\n 'taker': this.parseNumber (Precise.stringDiv (this.safeString (fee, 'effective_taker_rate_bps'), '10000')),\n 'percentage': undefined,\n 'tierBased': undefined,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"spot_tier\": \"3\",\n \"deriv_tier\": \"3\",\n \"effective_spot_maker_rate_bps\": \"6.5\",\n \"effective_spot_taker_rate_bps\": \"6.9\",\n \"effective_deriv_maker_rate_bps\": \"1.1\",\n \"effective_deriv_taker_rate_bps\": \"3\"\n }" ], "line_end" => 3500, "line_start" => 3470, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "response" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "maker", "value" => "this.parseNumber (Precise.stringDiv (this.safeString (response, makerFeeKey), '10000'))" }, %{ "comment" => nil, "key" => "taker", "value" => "this.parseNumber (Precise.stringDiv (this.safeString (response, takerFeeKey), '10000'))" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "tierBased", "value" => "undefined" } ], "name" => "parseTradingFees", "signature" => "parseTradingFees (response)", "source" => "parseTradingFees (response) {\n //\n // {\n // \"spot_tier\": \"3\",\n // \"deriv_tier\": \"3\",\n // \"effective_spot_maker_rate_bps\": \"6.5\",\n // \"effective_spot_taker_rate_bps\": \"6.9\",\n // \"effective_deriv_maker_rate_bps\": \"1.1\",\n // \"effective_deriv_taker_rate_bps\": \"3\"\n // }\n //\n const result: Dict = {};\n result['info'] = response;\n for (let i = 0; i < this.symbols.length; i++) {\n const symbol = this.symbols[i];\n const market = this.market (symbol);\n const isSwap = market['swap'];\n const takerFeeKey = isSwap ? 'effective_deriv_taker_rate_bps' : 'effective_spot_taker_rate_bps';\n const makerFeeKey = isSwap ? 'effective_deriv_maker_rate_bps' : 'effective_spot_maker_rate_bps';\n const tradingFee = {\n 'info': response,\n 'symbol': symbol,\n 'maker': this.parseNumber (Precise.stringDiv (this.safeString (response, makerFeeKey), '10000')),\n 'taker': this.parseNumber (Precise.stringDiv (this.safeString (response, takerFeeKey), '10000')),\n 'percentage': undefined,\n 'tierBased': undefined,\n };\n result[symbol] = tradingFee;\n }\n return result;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"currency\": \"BTC\",\n \"fee\": 0,\n \"create_time\": 1688023659000,\n \"id\": \"6201135\",\n \"update_time\": 1688178509000,\n \"amount\": 0.00114571,\n \"address\": \"1234fggxTSmJ3H4jaMQuWyEiLBzZdAbK6d\",\n \"status\": \"1\",\n \"txid\": \"f0ae4202b76eb999c301eccdde44dc639bee42d1fdd5974105286ca3393f6065/2\"\n }", "{\n \"currency\": \"BTC\",\n \"client_wid\": \"\",\n \"fee\": 0.0005,\n \"create_time\": 1688613850000,\n \"id\": \"5775977\",\n \"update_time\": 1688613850000,\n \"amount\": 0.0005,\n \"address\": \"1234NMEWbiF8ZkwUMxmfzMxi2A1MQ44bMn\",\n \"status\": \"1\",\n \"txid\": \"\",\n \"network_id\": \"BTC\"\n }", "{\n \"id\": 2220,\n \"amount\": 1,\n \"fee\": 0.0004,\n \"symbol\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBf\",\n \"client_wid\": \"my_withdrawal_002\",\n \"create_time\":1607063412000\n }" ], "line_end" => 2600, "line_start" => 2514, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transaction, 'id')" }, %{ "comment" => nil, "key" => "txid", "value" => "this.safeString (transaction, 'txid')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "addressTo", "value" => "address" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "tag", "value" => "tag" }, %{ "comment" => nil, "key" => "tagTo", "value" => "tag" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transaction, 'amount')" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "updated", "value" => "this.safeInteger (transaction, 'update_time')" }, %{ "comment" => nil, "key" => "internal", "value" => "undefined" }, %{ "comment" => nil, "key" => "comment", "value" => "this.safeString (transaction, 'client_wid')" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n //\n // {\n // \"currency\": \"BTC\",\n // \"fee\": 0,\n // \"create_time\": 1688023659000,\n // \"id\": \"6201135\",\n // \"update_time\": 1688178509000,\n // \"amount\": 0.00114571,\n // \"address\": \"1234fggxTSmJ3H4jaMQuWyEiLBzZdAbK6d\",\n // \"status\": \"1\",\n // \"txid\": \"f0ae4202b76eb999c301eccdde44dc639bee42d1fdd5974105286ca3393f6065/2\"\n // }\n //\n // fetchWithdrawals\n //\n // {\n // \"currency\": \"BTC\",\n // \"client_wid\": \"\",\n // \"fee\": 0.0005,\n // \"create_time\": 1688613850000,\n // \"id\": \"5775977\",\n // \"update_time\": 1688613850000,\n // \"amount\": 0.0005,\n // \"address\": \"1234NMEWbiF8ZkwUMxmfzMxi2A1MQ44bMn\",\n // \"status\": \"1\",\n // \"txid\": \"\",\n // \"network_id\": \"BTC\"\n // }\n //\n // withdraw\n //\n // {\n // \"id\": 2220,\n // \"amount\": 1,\n // \"fee\": 0.0004,\n // \"symbol\": \"BTC\",\n // \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBf\",\n // \"client_wid\": \"my_withdrawal_002\",\n // \"create_time\":1607063412000\n // }\n //\n let type = undefined;\n const rawStatus = this.safeString (transaction, 'status');\n let status = undefined;\n if ('client_wid' in transaction) {\n type = 'withdrawal';\n status = this.parseWithdrawalStatus (rawStatus);\n } else {\n type = 'deposit';\n status = this.parseDepositStatus (rawStatus);\n }\n const addressString = this.safeString (transaction, 'address');\n const [ address, tag ] = this.parseAddress (addressString);\n const currencyId = this.safeString (transaction, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.safeInteger (transaction, 'create_time');\n const feeCost = this.safeNumber (transaction, 'fee');\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = { 'currency': code, 'cost': feeCost };\n }\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'id'),\n 'txid': this.safeString (transaction, 'txid'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': undefined,\n 'address': address,\n 'addressTo': address,\n 'addressFrom': undefined,\n 'tag': tag,\n 'tagTo': tag,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'currency': code,\n 'status': status,\n 'updated': this.safeInteger (transaction, 'update_time'),\n 'internal': undefined,\n 'comment': this.safeString (transaction, 'client_wid'),\n 'fee': fee,\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2512, "line_start" => 2501, "mappings" => [], "name" => "parseWithdrawalStatus", "signature" => "parseWithdrawalStatus (status)", "source" => "parseWithdrawalStatus (status) {\n const statuses: Dict = {\n '0': 'pending',\n '1': 'pending',\n '2': 'failed',\n '3': 'pending',\n '4': 'failed',\n '5': 'ok',\n '6': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 10, period: 1000, requests: 100, rolling_window_size: 60000 }, raw_endpoints: %{ private: [], public: [] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: %{ code_field: "code", field: "code", message_field: "msg", success_values: [ "0" ], type: :success_code }, signing: %{ confidence: :high, pattern: :hmac_sha256_headers }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ future: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, contract_size: 1, expiry: 1769760000000, expiry_datetime: "2026-01-30T08:00:00.000Z", id: "BTCUSD-260130", inverse: false, limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{ "max" => 100, "min" => 1 }, "price" => %{} }, linear: true, maker: 0.0025, precision: %{ "amount" => 0.0001, "price" => 0.1 }, quote: "USD", quote_id: "USD", separator: "-", settle: "USD", settle_id: "USD", symbol: "BTC/USD:USD-260130", taker: 0.005 }, precision_mode: 4, sample_limits: %{ "amount" => %{}, "cost" => %{}, "price" => %{} }, sample_precision: %{ "amount" => 0.1, "price" => 1.0e-5 }, spot: %{ base: "1INCH", base_id: "1INCH", case: :upper, contract: false, id: "1INCH_USD", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{ "max" => 50, "min" => 1 }, "price" => %{} }, maker: 0.0025, precision: %{ "amount" => 0.1, "price" => 1.0e-5 }, quote: "USD", quote_id: "USD", separator: "_", symbol: "1INCH/USD", taker: 0.005 }, swap: %{ base: "1INCH", base_id: "1INCH", case: :upper, contract: true, contract_size: 1, id: "1INCHUSD-PERP", inverse: false, limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{ "max" => 50, "min" => 1 }, "price" => %{} }, linear: true, maker: 0.0025, precision: %{ "amount" => 1, "price" => 1.0e-5 }, quote: "USD", quote_id: "USD", separator: "-", settle: "USD", settle_id: "USD", symbol: "1INCH/USD:USD", taker: 0.005 } }, symbol_patterns: %{ future: %{ case: :upper, component_order: [ :base, :quote, :date ], date_format: :yymmdd, pattern: :future_yymmdd, separator: "-", suffix: nil }, 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: :suffix_perp, separator: "", suffix: "-PERP" } }, timeframes: %{ "12h" => "12h", "15m" => "15m", "1M" => "1M", "1d" => "1D", "1h" => "1h", "1m" => "1m", "1w" => "7D", "2w" => "14D", "30m" => "30m", "4h" => "4h", "5m" => "5m", "6h" => "6h" }, url_strategy: %{ detected_from: "api_structure", note: "paths_already_versioned", pattern: :version_in_path, prefix: nil }, urls: %{ api: "https://api.crypto.com", doc: [ "https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html", "https://exchange-docs.crypto.com/spot/index.html", "https://exchange-docs.crypto.com/derivatives/index.html" ], other: nil, sandbox: %{ "derivatives" => "https://uat-api.3ona.co/v2", "v1" => "https://uat-api.3ona.co/exchange/v1", "v2" => "https://uat-api.3ona.co/v2" }, www: "https://crypto.com/" }, version: "v2", ws: %{ auth: %{ algorithm: :sha256, encoding: :hex, market_specific: false, message_format: :op_args, op_field: "op", op_value: "auth", pattern: :generic_hmac, payload_format: "custom", requires_passphrase: false, timestamp_unit: :milliseconds }, channel_templates: %{ watch_balance: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_bids_asks: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_my_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_ohlcv: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_order_book: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_order_book_for_symbols: %{ channel_name: "SNAPSHOT_AND_UPDATE", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_orders: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_positions: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_private_request: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_private_subscribe: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_public: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_public_multiple: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_ticker: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_tickers: %{ market_id_format: :native, params: [], pattern: :method_params_subscribe }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe }, watch_trades_for_symbols: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_params_subscribe } }, 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: true, 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: true }, message_patterns: [ %{ format: :method, id_field: "id", keys: [ "api_key", "id", "method", "nonce", "sig" ], kind_field: "method", kind_value: "public/auth", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, keys: [ "method", "nonce", "params" ], kind_field: "method", kind_value: "subscribe", sources: [ :send, :watch, :watch_multiple ] } ], options: %{ "watchOrderBook" => %{ "checksum" => true }, "watchPositions" => %{ "awaitPositionsSnapshot" => true, "fetchPositionsSnapshot" => true } }, subscription_config: %{ args_field: "params", args_format: :params_object, market_id_format: :native, op_field: "method" }, subscription_pattern: :method_params_subscribe, urls: %{ "private" => "wss://stream.crypto.com/exchange/v1/user", "public" => "wss://stream.crypto.com/exchange/v1/market" }, watch_methods: [ "watchBalance", "watchBidsAsks", "watchMyTrades", "watchOHLCV", "watchOrderBook", "watchOrderBookForSymbols", "watchOrders", "watchPositions", "watchPrivateRequest", "watchPrivateSubscribe", "watchPublic", "watchPublicMultiple", "watchTicker", "watchTickers", "watchTrades", "watchTradesForSymbols" ] } }