# Binance US Exchange Specification # # Auto-generated by: mix ccxt.extract binanceus # 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: [ "US" ], currencies: %{ "BNFCR" => %{ "code" => "BNFCR", "fees" => %{}, "id" => "BNFCR", "limits" => %{ "deposit" => %{}, "withdraw" => %{} }, "networks" => %{}, "precision" => 0.001 } }, currency_aliases: %{ "BCC" => "BCC", "BCHSV" => "BSV", "XBT" => "BTC", "YOYO" => "YOYOW" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 55, "coveragePercent" => 100, "enabledMethods" => 69, "excluded" => [ %{ "method" => "fetchCanceledAndClosedOrders", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchCanceledOrders", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchClosedOrders", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchDepositWithdrawFee", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchTradingLimits", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchTransactionFee", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 6, "extractableMethods" => 63, "failures" => [ %{ "error" => "binanceus triggerPrice parameter is not allowed for BTC/USDT:USDT limit orders", "method" => "createStopLimitOrder" }, %{ "error" => "binanceus triggerPrice parameter is not allowed for BTC/USDT:USDT limit orders", "method" => "createStopOrder" }, %{ "error" => "binanceus triggerPrice parameter is not allowed for BTC/USDT:USDT limit orders", "method" => "createTrailingPercentOrder" }, %{ "error" => "binanceus triggerPrice parameter is not allowed for BTC/USDT:USDT limit orders", "method" => "createTriggerOrder" }, %{ "error" => "binanceus editContractOrder() does not support spot orders", "method" => "editOrders" }, %{ "error" => "binanceus fetchLedger() supports contract wallets only", "method" => "fetchLedger" }, %{ "error" => "binanceus fetchLedgerEntry() can only be used for type option", "method" => "fetchLedgerEntry" }, %{ "error" => "binanceus fetchOpenOrder() does not support spot markets", "method" => "fetchOpenOrder" } ] }, endpoints: [ %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :delete, name: :cancel_all_orders, param_mappings: %{}, params: [ :symbol ], path: "/openOrders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :delete, name: :cancel_order, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol ], path: "/order", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, default_params: %{ "orderidlist" => [ "test-order-id" ], "symbol" => "BTCUSDT" }, market_type: :spot, method: :delete, name: :cancel_orders, param_mappings: %{}, params: [ :ids, :symbol ], path: "/batchOrders", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :post, name: :create_convert_trade, param_mappings: %{ "id" => "quoteId" }, params: [ :id, :fromCode, :toCode, :amount ], path: "/convert/acceptQuote", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "side" => "BUY", "timeInForce" => "GTC", "type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_buy_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount, :price ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "timeInForce" => "GTC", "type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :side, :amount, :price ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "side" => "SELL", "timeInForce" => "GTC", "type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_sell_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount, :price ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "side" => "BUY", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_buy_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "side" => "BUY", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_buy_order_with_cost, param_mappings: %{ "cost" => "quantity" }, params: [ :symbol, :cost ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :side, :amount, :price ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_order_with_cost, param_mappings: %{ "cost" => "quantity" }, params: [ :symbol, :side, :cost ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "side" => "SELL", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_sell_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "side" => "SELL", "type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_sell_order_with_cost, param_mappings: %{ "cost" => "quantity" }, params: [ :symbol, :cost ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "timeInForce" => "GTC" }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/order", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, default_params: %{ "batchOrders" => [ %{ "newClientOrderId" => "", "newOrderRespType" => "RESULT", "price" => "50000", "quantity" => "0.001", "side" => "BUY", "symbol" => "BTCUSDT", "timeInForce" => "GTC", "type" => "LIMIT" } ] }, market_type: :spot, method: :post, name: :create_orders, param_mappings: %{}, params: [ :orders ], path: "/batchOrders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "newClientOrderId" => "", "newOrderRespType" => "FULL", "type" => "LIMIT_MAKER" }, market_type: :spot, method: :post, name: :create_post_only_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, default_params: %{ "cancelReplaceMode" => "STOP_ON_FAILURE", "newClientOrderId" => "", "newOrderRespType" => "FULL", "timeInForce" => "GTC" }, market_type: :spot, method: :post, name: :edit_order, param_mappings: %{ "amount" => "quantity", "id" => "cancelOrderId" }, params: [ :id, :symbol, :type, :side, :amount, :price ], path: "/order/cancelReplace", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/account", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, default_params: %{ "symbols" => "[\"BTCUSDT\"]" }, market_type: :spot, method: :get, name: :fetch_bids_asks, param_mappings: %{}, params: [ :symbols ], path: "/ticker/bookTicker", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_convert_currencies, param_mappings: %{}, params: [], path: "/convert/assetInfo", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :post, name: :fetch_convert_quote, param_mappings: %{ "amount" => "fromAmount", "fromCode" => "fromAsset", "toCode" => "toAsset" }, params: [ :fromCode, :toCode, :amount ], path: "/convert/getQuote", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_convert_trade, param_mappings: %{ "id" => "orderId" }, params: [ :id, :code ], path: "/convert/orderStatus", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, default_params: %{ "endTime" => "", "startTime" => "" }, market_type: :spot, method: :get, name: :fetch_convert_trade_history, param_mappings: %{ "since" => "startTime" }, params: [ :code, :since, :limit ], path: "/convert/tradeFlow", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/capital/config/getall", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_deposit_address, param_mappings: %{ "code" => "coin" }, params: [ :code ], path: "/capital/deposit/address", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_deposit_withdraw_fees, param_mappings: %{}, params: [ :codes ], path: "/capital/config/getall", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{ "code" => "coin" }, params: [ :code, :since, :limit ], path: "/capital/deposit/hisrec", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/depth", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_last_prices, param_mappings: %{}, params: [ :symbols ], path: "/ticker/price", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, market_type: :swap, method: :get, name: :fetch_leverages, param_mappings: %{}, params: [ :symbols ], path: "/leverageBracket", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_margin_adjustment_history, param_mappings: %{}, params: [ :symbol, :type, :since, :limit ], path: "/positionMargin/history", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_margin_mode, param_mappings: %{}, params: [ :symbol ], path: "/symbolConfig", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, market_type: :swap, method: :get, name: :fetch_margin_modes, param_mappings: %{}, params: [ :symbols ], path: "/symbolConfig", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/exchangeInfo", source: :intercepted }, %{ api_section: "fapiPrivate", auth: true, cost: 1.0, default_params: %{ "autoCloseType" => "LIQUIDATION", "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_my_liquidations, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/forceOrders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/myTrades", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "startTime", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/klines", source: :intercepted }, %{ api_section: "fapiPublic", auth: false, cost: 1.0, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_open_interest, param_mappings: %{}, params: [ :symbol ], path: "/openInterest", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :get, name: :fetch_open_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/openOrders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :get, name: :fetch_order, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol ], path: "/order", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/depth", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :get, name: :fetch_order_trades, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol, :since, :limit ], path: "/myTrades", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1.0, market_type: :spot, method: :get, name: :fetch_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/allOrders", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_status, param_mappings: %{}, params: [], path: "/system/status", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{}, params: [ :symbol ], path: "/ticker/24hr", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, default_params: %{ "symbols" => "[\"BTCUSDT\"]" }, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/ticker/24hr", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/time", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1.0, default_params: %{ "endTime" => "" }, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "since" => "startTime" }, params: [ :symbol, :since, :limit ], path: "/aggTrades", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_trading_fee, param_mappings: %{}, params: [ :symbol ], path: "/asset/tradeFee", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/asset/tradeFee", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_transaction_fees, param_mappings: %{}, params: [ :codes ], path: "/capital/config/getall", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, default_params: %{ "type" => "MAIN_UMFUTURE" }, market_type: :spot, method: :get, name: :fetch_transfers, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/asset/transfer", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{ "code" => "coin" }, params: [ :code, :since, :limit ], path: "/capital/withdraw/history", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, default_params: %{ "type" => "MAIN_UMFUTURE" }, market_type: :spot, method: :post, name: :transfer, param_mappings: %{ "code" => "asset" }, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/asset/transfer", source: :intercepted }, %{ api_section: "sapi", auth: true, base_url: "https://api.binance.us/sapi/v1", cost: 1.0, market_type: :spot, method: :post, name: :withdraw, param_mappings: %{ "code" => "coin" }, params: [ :code, :amount, :address, :tag ], path: "/capital/withdraw/apply", source: :intercepted } ], error_code_details: %{ -1000 => %{ description: nil, type: :exchange_error }, -1001 => %{ description: nil, type: :exchange_error }, -1002 => %{ description: nil, type: :invalid_credentials }, -1003 => %{ description: nil, type: :rate_limited }, -1004 => %{ description: nil, type: :exchange_error }, -1006 => %{ description: nil, type: :exchange_error }, -1007 => %{ description: nil, type: :network_error }, -1010 => %{ description: nil, type: :exchange_error }, -1013 => %{ description: nil, type: :invalid_parameters }, -1014 => %{ description: nil, type: :invalid_order }, -1015 => %{ description: nil, type: :rate_limited }, -1016 => %{ description: nil, type: :invalid_parameters }, -1020 => %{ description: nil, type: :invalid_parameters }, -1021 => %{ description: nil, type: :invalid_credentials }, -1022 => %{ description: nil, type: :invalid_credentials }, -1100 => %{ description: nil, type: :invalid_parameters }, -1101 => %{ description: nil, type: :invalid_parameters }, -1102 => %{ description: nil, type: :invalid_parameters }, -1103 => %{ description: nil, type: :invalid_parameters }, -1104 => %{ description: nil, type: :invalid_parameters }, -1105 => %{ description: nil, type: :invalid_parameters }, -1106 => %{ description: nil, type: :invalid_parameters }, -1108 => %{ description: nil, type: :invalid_order }, -1111 => %{ description: nil, type: :invalid_parameters }, -1112 => %{ description: nil, type: :exchange_error }, -1114 => %{ description: nil, type: :invalid_parameters }, -1115 => %{ description: nil, type: :invalid_parameters }, -1116 => %{ description: nil, type: :invalid_parameters }, -1117 => %{ description: nil, type: :invalid_parameters }, -1118 => %{ description: nil, type: :invalid_parameters }, -1119 => %{ description: nil, type: :invalid_parameters }, -1120 => %{ description: nil, type: :invalid_parameters }, -1121 => %{ description: nil, type: :invalid_order }, -1125 => %{ description: nil, type: :invalid_credentials }, -1127 => %{ description: nil, type: :invalid_parameters }, -1128 => %{ description: nil, type: :invalid_parameters }, -1130 => %{ description: nil, type: :invalid_parameters }, -2010 => %{ description: nil, type: :invalid_order }, -2011 => %{ description: nil, type: :order_not_found }, -20121 => %{ description: nil, type: :invalid_order }, -20124 => %{ description: nil, type: :invalid_parameters }, -2013 => %{ description: nil, type: :order_not_found }, -20130 => %{ description: nil, type: :invalid_parameters }, -20132 => %{ description: nil, type: :invalid_parameters }, -2014 => %{ description: nil, type: :invalid_credentials }, -2015 => %{ description: nil, type: :invalid_credentials }, -20194 => %{ description: nil, type: :invalid_parameters }, -20195 => %{ description: nil, type: :invalid_parameters }, -20196 => %{ description: nil, type: :invalid_parameters }, -20198 => %{ description: nil, type: :exchange_error }, -20204 => %{ description: nil, type: :invalid_parameters }, -4000 => %{ description: nil, type: :invalid_order }, -4001 => %{ description: nil, type: :invalid_parameters }, -4002 => %{ description: nil, type: :invalid_parameters }, -4003 => %{ description: nil, type: :invalid_parameters }, -4004 => %{ description: nil, type: :invalid_parameters }, -4005 => %{ description: nil, type: :invalid_parameters }, -4006 => %{ description: nil, type: :invalid_parameters }, -4007 => %{ description: nil, type: :invalid_parameters }, -4008 => %{ description: nil, type: :invalid_parameters }, -4009 => %{ description: nil, type: :invalid_parameters }, -4010 => %{ description: nil, type: :invalid_parameters }, -4011 => %{ description: nil, type: :invalid_parameters }, -4012 => %{ description: nil, type: :invalid_parameters }, -4013 => %{ description: nil, type: :invalid_parameters }, -4014 => %{ description: nil, type: :invalid_parameters }, -4015 => %{ description: nil, type: :invalid_parameters }, -4016 => %{ description: nil, type: :invalid_parameters }, -4017 => %{ description: nil, type: :invalid_parameters }, -4018 => %{ description: nil, type: :invalid_parameters }, -4019 => %{ description: nil, type: :exchange_error }, -4020 => %{ description: nil, type: :invalid_parameters }, -4021 => %{ description: nil, type: :invalid_parameters }, -4022 => %{ description: nil, type: :invalid_parameters }, -4023 => %{ description: nil, type: :invalid_parameters }, -4024 => %{ description: nil, type: :invalid_parameters }, -4025 => %{ description: nil, type: :invalid_parameters }, -4026 => %{ description: nil, type: :invalid_parameters }, -4027 => %{ description: nil, type: :invalid_parameters }, -4028 => %{ description: nil, type: :invalid_parameters }, -4029 => %{ description: nil, type: :invalid_parameters }, -4030 => %{ description: nil, type: :invalid_parameters }, -4031 => %{ description: nil, type: :invalid_parameters }, -4032 => %{ description: nil, type: :exchange_error }, -4033 => %{ description: nil, type: :invalid_parameters }, -4044 => %{ description: nil, type: :invalid_parameters }, -4045 => %{ description: nil, type: :exchange_error }, -4046 => %{ description: nil, type: :exchange_error }, -4047 => %{ description: nil, type: :exchange_error }, -4048 => %{ description: nil, type: :exchange_error }, -4049 => %{ description: nil, type: :invalid_parameters }, -4050 => %{ description: nil, type: :insufficient_balance }, -4051 => %{ description: nil, type: :insufficient_balance }, -4052 => %{ description: nil, type: :exchange_error }, -4053 => %{ description: nil, type: :invalid_parameters }, -4054 => %{ description: nil, type: :exchange_error }, -4055 => %{ description: nil, type: :invalid_parameters }, -4056 => %{ description: nil, type: :invalid_credentials }, -4057 => %{ description: nil, type: :invalid_credentials }, -4058 => %{ description: nil, type: :invalid_parameters }, -4059 => %{ description: nil, type: :exchange_error }, -4060 => %{ description: nil, type: :invalid_parameters }, -4061 => %{ description: nil, type: :exchange_error }, -4062 => %{ description: nil, type: :invalid_parameters }, -4067 => %{ description: nil, type: :exchange_error }, -4068 => %{ description: nil, type: :exchange_error }, -4082 => %{ description: nil, type: :invalid_parameters }, -4083 => %{ description: nil, type: :exchange_error }, -4084 => %{ description: nil, type: :invalid_parameters }, -4086 => %{ description: nil, type: :invalid_parameters }, -4104 => %{ description: nil, type: :invalid_parameters }, -4135 => %{ description: nil, type: :invalid_parameters }, -4137 => %{ description: nil, type: :invalid_parameters }, -4138 => %{ description: nil, type: :invalid_parameters }, -4139 => %{ description: nil, type: :invalid_parameters }, -4142 => %{ description: nil, type: :invalid_order }, "API key does not exist" => %{ description: nil, type: :invalid_credentials }, "Account has insufficient balance for requested action." => %{ description: nil, type: :insufficient_balance }, "Limit orders require GTC for this phase." => %{ description: nil, type: :invalid_parameters }, "Market is closed." => %{ description: nil, type: :market_closed }, "Order would immediately match and take." => %{ description: nil, type: :invalid_order }, "Order would trigger immediately." => %{ description: nil, type: :invalid_order }, "Rest API trading is not enabled." => %{ description: nil, type: :access_restricted }, "Stop price would trigger immediately." => %{ description: nil, type: :invalid_order }, "System abnormality" => %{ description: nil, type: :exchange_error }, "System is under maintenance." => %{ description: nil, type: :network_error }, "This account may not place or cancel orders." => %{ description: nil, type: :access_restricted }, "This action is disabled on this account." => %{ description: nil, type: :access_restricted }, "This order type is not possible in this trading phase." => %{ description: nil, type: :invalid_parameters }, "This symbol is not permitted for this account." => %{ description: nil, type: :access_restricted }, "This symbol is restricted for this account." => %{ description: nil, type: :access_restricted }, "This type of sub-account exceeds the maximum number limit" => %{ description: nil, type: :exchange_error }, "Too many requests. Please try again later." => %{ description: nil, type: :rate_limited }, "You are not authorized to execute this request." => %{ description: nil, type: :access_restricted }, "You don't have permission." => %{ description: nil, type: :access_restricted } }, error_codes: %{ -1000 => :exchange_error, -1001 => :exchange_error, -1002 => :invalid_credentials, -1003 => :rate_limited, -1004 => :exchange_error, -1006 => :exchange_error, -1007 => :network_error, -1010 => :exchange_error, -1013 => :invalid_parameters, -1014 => :invalid_order, -1015 => :rate_limited, -1016 => :invalid_parameters, -1020 => :invalid_parameters, -1021 => :invalid_credentials, -1022 => :invalid_credentials, -1100 => :invalid_parameters, -1101 => :invalid_parameters, -1102 => :invalid_parameters, -1103 => :invalid_parameters, -1104 => :invalid_parameters, -1105 => :invalid_parameters, -1106 => :invalid_parameters, -1108 => :invalid_order, -1111 => :invalid_parameters, -1112 => :exchange_error, -1114 => :invalid_parameters, -1115 => :invalid_parameters, -1116 => :invalid_parameters, -1117 => :invalid_parameters, -1118 => :invalid_parameters, -1119 => :invalid_parameters, -1120 => :invalid_parameters, -1121 => :invalid_order, -1125 => :invalid_credentials, -1127 => :invalid_parameters, -1128 => :invalid_parameters, -1130 => :invalid_parameters, -2010 => :invalid_order, -2011 => :order_not_found, -20121 => :invalid_order, -20124 => :invalid_parameters, -2013 => :order_not_found, -20130 => :invalid_parameters, -20132 => :invalid_parameters, -2014 => :invalid_credentials, -2015 => :invalid_credentials, -20194 => :invalid_parameters, -20195 => :invalid_parameters, -20196 => :invalid_parameters, -20198 => :exchange_error, -20204 => :invalid_parameters, -4000 => :invalid_order, -4001 => :invalid_parameters, -4002 => :invalid_parameters, -4003 => :invalid_parameters, -4004 => :invalid_parameters, -4005 => :invalid_parameters, -4006 => :invalid_parameters, -4007 => :invalid_parameters, -4008 => :invalid_parameters, -4009 => :invalid_parameters, -4010 => :invalid_parameters, -4011 => :invalid_parameters, -4012 => :invalid_parameters, -4013 => :invalid_parameters, -4014 => :invalid_parameters, -4015 => :invalid_parameters, -4016 => :invalid_parameters, -4017 => :invalid_parameters, -4018 => :invalid_parameters, -4019 => :exchange_error, -4020 => :invalid_parameters, -4021 => :invalid_parameters, -4022 => :invalid_parameters, -4023 => :invalid_parameters, -4024 => :invalid_parameters, -4025 => :invalid_parameters, -4026 => :invalid_parameters, -4027 => :invalid_parameters, -4028 => :invalid_parameters, -4029 => :invalid_parameters, -4030 => :invalid_parameters, -4031 => :invalid_parameters, -4032 => :exchange_error, -4033 => :invalid_parameters, -4044 => :invalid_parameters, -4045 => :exchange_error, -4046 => :exchange_error, -4047 => :exchange_error, -4048 => :exchange_error, -4049 => :invalid_parameters, -4050 => :insufficient_balance, -4051 => :insufficient_balance, -4052 => :exchange_error, -4053 => :invalid_parameters, -4054 => :exchange_error, -4055 => :invalid_parameters, -4056 => :invalid_credentials, -4057 => :invalid_credentials, -4058 => :invalid_parameters, -4059 => :exchange_error, -4060 => :invalid_parameters, -4061 => :exchange_error, -4062 => :invalid_parameters, -4067 => :exchange_error, -4068 => :exchange_error, -4082 => :invalid_parameters, -4083 => :exchange_error, -4084 => :invalid_parameters, -4086 => :invalid_parameters, -4104 => :invalid_parameters, -4135 => :invalid_parameters, -4137 => :invalid_parameters, -4138 => :invalid_parameters, -4139 => :invalid_parameters, -4142 => :invalid_order, "API key does not exist" => :invalid_credentials, "Account has insufficient balance for requested action." => :insufficient_balance, "Limit orders require GTC for this phase." => :invalid_parameters, "Market is closed." => :market_closed, "Order would immediately match and take." => :invalid_order, "Order would trigger immediately." => :invalid_order, "Rest API trading is not enabled." => :access_restricted, "Stop price would trigger immediately." => :invalid_order, "System abnormality" => :exchange_error, "System is under maintenance." => :network_error, "This account may not place or cancel orders." => :access_restricted, "This action is disabled on this account." => :access_restricted, "This order type is not possible in this trading phase." => :invalid_parameters, "This symbol is not permitted for this account." => :access_restricted, "This symbol is restricted for this account." => :access_restricted, "This type of sub-account exceeds the maximum number limit" => :exchange_error, "Too many requests. Please try again later." => :rate_limited, "You are not authorized to execute this request." => :access_restricted, "You don't have permission." => :access_restricted }, exceptions: %{ broad: %{ "MAX_POSITION" => :bad_request, "PERCENT_PRICE_BY_SIDE" => :invalid_order, "has no operation privilege" => :permission_denied }, exact: %{ "-1000" => :operation_failed, "-1001" => :operation_failed, "-1002" => :authentication_error, "-1003" => :rate_limit_exceeded, "-1004" => :operation_rejected, "-1006" => :operation_failed, "-1007" => :request_timeout, "-1010" => :operation_failed, "-1013" => :bad_request, "-1014" => :invalid_order, "-1015" => :rate_limit_exceeded, "-1016" => :bad_request, "-1020" => :bad_request, "-1021" => :invalid_nonce, "-1022" => :authentication_error, "-1100" => :bad_request, "-1101" => :bad_request, "-1102" => :bad_request, "-1103" => :bad_request, "-1104" => :bad_request, "-1105" => :bad_request, "-1106" => :bad_request, "-1108" => :bad_symbol, "-1111" => :bad_request, "-1112" => :operation_failed, "-1114" => :bad_request, "-1115" => :bad_request, "-1116" => :bad_request, "-1117" => :bad_request, "-1118" => :bad_request, "-1119" => :bad_request, "-1120" => :bad_request, "-1121" => :bad_symbol, "-1125" => :authentication_error, "-1127" => :bad_request, "-1128" => :bad_request, "-1130" => :bad_request, "-2010" => :invalid_order, "-2011" => :order_not_found, "-20121" => :bad_symbol, "-20124" => :bad_request, "-2013" => :order_not_found, "-20130" => :bad_request, "-20132" => :bad_request, "-2014" => :authentication_error, "-2015" => :authentication_error, "-20194" => :bad_request, "-20195" => :bad_request, "-20196" => :bad_request, "-20198" => :operation_rejected, "-20204" => :bad_request, "-4000" => :invalid_order, "-4001" => :bad_request, "-4002" => :bad_request, "-4003" => :bad_request, "-4004" => :bad_request, "-4005" => :bad_request, "-4006" => :bad_request, "-4007" => :bad_request, "-4008" => :bad_request, "-4009" => :bad_request, "-4010" => :bad_request, "-4011" => :bad_request, "-4012" => :bad_request, "-4013" => :bad_request, "-4014" => :bad_request, "-4015" => :bad_request, "-4016" => :bad_request, "-4017" => :bad_request, "-4018" => :bad_request, "-4019" => :operation_rejected, "-4020" => :bad_request, "-4021" => :bad_request, "-4022" => :bad_request, "-4023" => :bad_request, "-4024" => :bad_request, "-4025" => :bad_request, "-4026" => :bad_request, "-4027" => :bad_request, "-4028" => :bad_request, "-4029" => :bad_request, "-4030" => :bad_request, "-4031" => :bad_request, "-4032" => :operation_rejected, "-4033" => :bad_request, "-4044" => :bad_request, "-4045" => :operation_rejected, "-4046" => :operation_rejected, "-4047" => :operation_rejected, "-4048" => :operation_rejected, "-4049" => :bad_request, "-4050" => :insufficient_funds, "-4051" => :insufficient_funds, "-4052" => :operation_rejected, "-4053" => :bad_request, "-4054" => :operation_rejected, "-4055" => :bad_request, "-4056" => :authentication_error, "-4057" => :authentication_error, "-4058" => :bad_request, "-4059" => :operation_rejected, "-4060" => :bad_request, "-4061" => :operation_rejected, "-4062" => :bad_request, "-4067" => :operation_rejected, "-4068" => :operation_rejected, "-4082" => :bad_request, "-4083" => :operation_rejected, "-4084" => :bad_request, "-4086" => :bad_request, "-4104" => :bad_request, "-4135" => :bad_request, "-4137" => :bad_request, "-4138" => :bad_request, "-4139" => :bad_request, "-4142" => :order_immediately_fillable, "API key does not exist" => :authentication_error, "Account has insufficient balance for requested action." => :insufficient_funds, "Limit orders require GTC for this phase." => :bad_request, "Market is closed." => :market_closed, "Order would immediately match and take." => :order_immediately_fillable, "Order would trigger immediately." => :order_immediately_fillable, "Rest API trading is not enabled." => :permission_denied, "Stop price would trigger immediately." => :order_immediately_fillable, "System abnormality" => :operation_failed, "System is under maintenance." => :on_maintenance, "This account may not place or cancel orders." => :permission_denied, "This action is disabled on this account." => :account_suspended, "This order type is not possible in this trading phase." => :bad_request, "This symbol is not permitted for this account." => :permission_denied, "This symbol is restricted for this account." => :permission_denied, "This type of sub-account exceeds the maximum number limit" => :operation_rejected, "Too many requests. Please try again later." => :rate_limit_exceeded, "You are not authorized to execute this request." => :permission_denied, "You don't have permission." => :permission_denied } }, exchange_options: %{ "accountsById" => %{ "CMFUTURE" => "inverse", "FUNDING" => "funding", "MAIN" => "spot", "MARGIN" => "margin", "OPTION" => "option", "UMFUTURE" => "linear" }, "accountsByType" => %{ "cross" => "MARGIN", "delivery" => "CMFUTURE", "funding" => "FUNDING", "future" => "UMFUTURE", "inverse" => "CMFUTURE", "linear" => "UMFUTURE", "main" => "MAIN", "margin" => "MARGIN", "option" => "OPTION", "spot" => "MAIN", "swap" => "UMFUTURE" }, "adjustForTimeDifference" => false, "broker" => %{ "delivery" => "x-xcKtGhcu", "future" => "x-cvBPrNm9", "inverse" => "x-xcKtGhcu", "margin" => "x-TKT5PX2F", "option" => "x-xcKtGhcu", "spot" => "x-TKT5PX2F", "swap" => "x-cvBPrNm9" }, "currencyToPrecisionRoundingMode" => 0, "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "defaultSubType" => nil, "defaultTimeInForce" => "GTC", "defaultType" => "spot", "defaultWithdrawPrecision" => 1.0e-8, "fetchCurrencies" => true, "fetchMargins" => false, "fetchMarkets" => %{ "types" => [ "spot" ] }, "fetchPositions" => "positionRisk", "hasAlreadyAuthenticatedSuccessfully" => false, "impliedNetworks" => %{ "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "legalMoney" => %{ "AED" => true, "ARS" => true, "AUD" => true, "BRL" => true, "CAD" => true, "CHF" => true, "CZK" => true, "DKK" => true, "EUR" => true, "GBP" => true, "GHS" => true, "HKD" => true, "HUF" => true, "INR" => true, "JPY" => true, "KES" => true, "KZT" => true, "MXN" => true, "NGN" => true, "NOK" => true, "NZD" => true, "PEN" => true, "PHP" => true, "PLN" => true, "RUB" => true, "SEK" => true, "TRY" => true, "UAH" => true, "UGX" => true, "USD" => true, "VND" => true, "ZAR" => true }, "legalMoneyCurrenciesById" => %{ "BUSD" => "USD" }, "loadAllOptions" => false, "networks" => %{ "BEP2" => "BNB", "BEP20" => "BSC", "EOS" => "EOS", "ERC20" => "ETH", "OMNI" => "OMNI", "SOL" => "SOL", "SPL" => "SOL", "TRC20" => "TRX" }, "networksById" => %{ "BNB" => "BEP2", "BSC" => "BEP20", "EOS" => "EOS", "ETH" => "ERC20", "OMNI" => "OMNI", "SOL" => "SOL", "TRX" => "TRC20" }, "newOrderRespType" => %{ "limit" => "FULL", "market" => "FULL" }, "quoteOrderQty" => false, "recvWindow" => 10000, "sandboxMode" => false, "throwMarginModeAlreadySet" => false, "timeDifference" => 0, "warnOnFetchOpenOrdersWithoutSymbol" => true }, extended_metadata: %{ fees_url: "https://www.binance.us/en/fee/schedule", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/user-attachments/assets/a9667919-b632-4d52-a832-df89f8a35e8c", referral_url: "https://www.binance.us/?ref=35005074" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ for_derivatives: %{ create_order: %{ hedged: true, iceberg: false, leverage: false, margin_mode: false, market_buy_by_cost: true, market_buy_requires_price: false, self_trade_prevention: true, stop_loss_price: true, take_profit_price: true, time_in_force: %{ fok: true, gtd: true, ioc: true, po: true }, trailing: true, trigger_price: true, trigger_price_type: %{ index: false, last: true, mark: true } }, create_orders: %{ max: 5 }, fetch_closed_orders: %{ days_back: 90, days_back_canceled: 3, limit: 1000, margin_mode: true, symbol_required: true, trailing: false, trigger: false, until_days: 7 }, fetch_my_trades: %{ limit: 1000, margin_mode: false, symbol_required: true, until_days: 7 }, fetch_ohlcv: %{ limit: 1500 }, fetch_open_orders: %{ limit: 500, margin_mode: true, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: true, trailing: false, trigger: false }, fetch_orders: %{ days_back: 90, limit: 1000, margin_mode: true, symbol_required: true, trailing: false, trigger: false, until_days: 7 }, sandbox: true }, future: %{}, spot: %{ create_order: %{ hedged: true, iceberg_amount: true, leverage: false, margin_mode: true, market_buy_by_cost: true, market_buy_requires_price: false, self_trade_prevention: %{ e_x_p_i_r_e__b_o_t_h: true, e_x_p_i_r_e__m_a_k_e_r: true, e_x_p_i_r_e__t_a_k_e_r: true, n_o_n_e: 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 }, fetch_closed_orders: %{ limit: 1000, margin_mode: true, symbol_required: true, trailing: false, trigger: false, until_days: 10000 }, fetch_currencies: %{ private: true }, fetch_my_trades: %{ limit: 1000, margin_mode: false, symbol_required: true, until_days: 1 }, fetch_ohlcv: %{ limit: 1000 }, fetch_open_orders: %{ margin_mode: true, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: true, symbol_required: true, trailing: false, trigger: false }, fetch_orders: %{ limit: 1000, margin_mode: true, symbol_required: true, trailing: false, trigger: false, until_days: 10000 }, sandbox: true }, swap: %{} }, fees: %{ inverse: %{ trading: %{ fee_side: "base", maker: 0.0001, percentage: true, taker: 0.0005, tier_based: true, tiers: %{ maker: [ %{ fee: 0.0001, volume: 0 }, %{ fee: 8.0e-5, volume: 250 }, %{ fee: 5.0e-5, volume: 2500 }, %{ fee: 3.0e-6, volume: 7500 }, %{ fee: 0, volume: 22500 }, %{ fee: -5.0e-5, volume: 50000 }, %{ fee: -6.0e-5, volume: 100000 }, %{ fee: -7.0e-5, volume: 200000 }, %{ fee: -8.0e-5, volume: 400000 }, %{ fee: -9.0e-5, volume: 750000 } ], taker: [ %{ fee: 0.0005, volume: 0 }, %{ fee: 4.5e-4, volume: 250 }, %{ fee: 0.0004, volume: 2500 }, %{ fee: 0.0003, volume: 7500 }, %{ fee: 2.5e-4, volume: 22500 }, %{ fee: 2.4e-4, volume: 50000 }, %{ fee: 2.4e-4, volume: 100000 }, %{ fee: 2.4e-4, volume: 200000 }, %{ fee: 2.4e-4, volume: 400000 }, %{ fee: 2.4e-4, volume: 750000 } ] } } }, linear: %{ trading: %{ fee_side: "quote", maker: 0.0002, percentage: true, taker: 0.0005, tier_based: true, tiers: %{ maker: [ %{ fee: 0.0002, volume: 0 }, %{ fee: 1.6e-4, volume: 250 }, %{ fee: 1.4e-4, volume: 2500 }, %{ fee: 1.2e-4, volume: 7500 }, %{ fee: 0.0001, volume: 22500 }, %{ fee: 8.0e-5, volume: 50000 }, %{ fee: 6.0e-5, volume: 100000 }, %{ fee: 4.0e-5, volume: 200000 }, %{ fee: 2.0e-5, volume: 400000 }, %{ fee: 0, volume: 750000 } ], taker: [ %{ fee: 0.0004, volume: 0 }, %{ fee: 0.0004, volume: 250 }, %{ fee: 3.5e-4, volume: 2500 }, %{ fee: 3.2e-4, volume: 7500 }, %{ fee: 0.0003, volume: 22500 }, %{ fee: 2.7e-4, volume: 50000 }, %{ fee: 2.5e-4, volume: 100000 }, %{ fee: 2.2e-4, volume: 200000 }, %{ fee: 0.0002, volume: 400000 }, %{ fee: 1.7e-4, volume: 750000 } ] } } }, trading: %{ fee_side: "get", maker: 0.001, percentage: true, taker: 0.001, tier_based: true } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if ((code === 418) || (code === 429)) {\n throw new errors.DDoSProtection(this.id + ' ' + code.toString() + ' ' + reason + ' ' + body);\n }\n // error response in a form: { \"code\": -1013, \"msg\": \"Invalid quantity.\" }\n // following block cointains legacy checks against message patterns in \"msg\" property\n // will switch \"code\" checks eventually, when we know all of them\n if (code >= 400) {\n if (body.indexOf('Price * QTY is zero or less') >= 0) {\n throw new errors.InvalidOrder(this.id + ' order cost = amount * price is zero or less ' + body);\n }\n if (body.indexOf('LOT_SIZE') >= 0) {\n throw new errors.InvalidOrder(this.id + ' order amount should be evenly divisible by lot size ' + body);\n }\n if (body.indexOf('PRICE_FILTER') >= 0) {\n throw new errors.InvalidOrder(this.id + ' order price is invalid, i.e. exceeds allowed price precision, exceeds min price or max price limits or is invalid value in general, use this.priceToPrecision (symbol, amount) ' + body);\n }\n }\n if (response === undefined) {\n return undefined; // fallback to default error handler\n }\n // response in format {'msg': 'The coin does not exist.', 'success': true/false}\n const success = this.safeBool(response, 'success', true);\n if (!success) {\n const messageNew = this.safeString(response, 'msg');\n let parsedMessage = undefined;\n if (messageNew !== undefined) {\n try {\n parsedMessage = JSON.parse(messageNew);\n }\n catch (e) {\n // do nothing\n parsedMessage = undefined;\n }\n if (parsedMessage !== undefined) {\n response = parsedMessage;\n }\n }\n }\n const message = this.safeString(response, 'msg');\n if (message !== undefined) {\n this.throwExactlyMatchedException(this.getExceptionsByUrl(url, 'exact'), message, this.id + ' ' + message);\n this.throwExactlyMatchedException(this.exceptions['exact'], message, this.id + ' ' + message);\n this.throwBroadlyMatchedException(this.getExceptionsByUrl(url, 'broad'), message, this.id + ' ' + message);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, this.id + ' ' + message);\n }\n // checks against error codes\n const error = this.safeString(response, 'code');\n if (error !== undefined) {\n // https://github.com/ccxt/ccxt/issues/6501\n // https://github.com/ccxt/ccxt/issues/7742\n if ((error === '200') || Precise[\"default\"].stringEquals(error, '0')) {\n return undefined;\n }\n // a workaround for {\"code\":-2015,\"msg\":\"Invalid API-key, IP, or permissions for action.\"}\n // despite that their message is very confusing, it is raised by Binance\n // on a temporary ban, the API key is valid, but disabled for a while\n if ((error === '-2015') && this.options['hasAlreadyAuthenticatedSuccessfully']) {\n throw new errors.DDoSProtection(this.id + ' ' + body);\n }\n const feedback = this.id + ' ' + body;\n if (message === 'No need to change margin type.') {\n // not an error\n // https://github.com/ccxt/ccxt/issues/11268\n // https://github.com/ccxt/ccxt/pull/11624\n // POST https://fapi.binance.com/fapi/v1/marginType 400 Bad Request\n // binanceusdm {\"code\":-4046,\"msg\":\"No need to change margin type.\"}\n throw new errors.MarginModeAlreadySet(feedback);\n }\n this.throwExactlyMatchedException(this.getExceptionsByUrl(url, 'exact'), error, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], error, feedback);\n throw new errors.ExchangeError(feedback);\n }\n if (!success) {\n throw new errors.ExchangeError(this.id + ' ' + body);\n }\n if (Array.isArray(response)) {\n // cancelOrders returns an array like this: [{\"code\":-2011,\"msg\":\"Unknown order sent.\"}]\n const arrayLength = response.length;\n if (arrayLength === 1) { // when there's a single error we can throw, otherwise we have a partial success\n const element = response[0];\n const errorCode = this.safeString(element, 'code');\n if (errorCode !== undefined) {\n this.throwExactlyMatchedException(this.getExceptionsByUrl(url, 'exact'), errorCode, this.id + ' ' + body);\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, this.id + ' ' + body);\n }\n }\n }\n return undefined;\n }", has: %{ add_margin: false, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: false, cancel_all_orders: true, cancel_all_orders_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_convert_trade: true, create_deposit_address: false, create_limit_buy_order: true, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: true, create_limit_sell_order_ws: false, create_market_buy_order: true, create_market_buy_order_with_cost: true, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: true, create_market_order_with_cost: true, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: true, create_market_sell_order_with_cost: true, create_market_sell_order_with_cost_ws: false, create_market_sell_order_ws: false, create_order: true, create_order_with_take_profit_and_stop_loss: false, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: true, create_post_only_order: true, create_post_only_order_ws: false, create_reduce_only_order: 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: true, create_trailing_percent_order_ws: false, create_trigger_order: true, create_trigger_order_ws: false, deposit: false, edit_order: true, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: true, fetch_accounts: false, fetch_all_greeks: false, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: true, 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: true, fetch_canceled_orders: true, fetch_closed_order: false, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: true, fetch_convert_quote: true, fetch_convert_trade: true, fetch_convert_trade_history: true, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: false, fetch_deposit_address: true, fetch_deposit_addresses: false, fetch_deposit_addresses_by_network: false, fetch_deposit_withdraw_fee: 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: 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: true, fetch_ledger: true, fetch_ledger_entry: true, fetch_leverage: false, fetch_leverage_tiers: false, fetch_leverages: true, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: true, fetch_margin_mode: true, fetch_margin_modes: true, 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: true, fetch_my_settlement_history: false, fetch_my_trades: true, fetch_my_trades_ws: false, fetch_ohlcv: true, fetch_ohlcv_ws: false, fetch_open_interest: true, fetch_open_interest_history: false, fetch_open_interests: false, fetch_open_order: true, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: false, fetch_option_chain: false, fetch_order: true, fetch_order_book: true, fetch_order_book_ws: false, fetch_order_books: false, fetch_order_trades: true, fetch_order_with_client_order_id: false, fetch_order_ws: false, fetch_orders: true, fetch_orders_by_status: false, fetch_orders_ws: false, fetch_position: 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: true, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: true, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: true, fetch_trading_fees: true, fetch_trading_fees_ws: false, fetch_trading_limits: true, fetch_transaction_fee: true, fetch_transaction_fees: true, fetch_transactions: false, fetch_transfer: false, fetch_transfers: true, fetch_underlying_assets: false, fetch_volatility_history: false, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: true, fetch_withdrawals_ws: false, future: false, margin: false, option: false, 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: false, transfer: true, un_watch_my_trades: false, un_watch_ohlcv: false, un_watch_ohlcv_for_symbols: false, un_watch_order_book: false, un_watch_order_book_for_symbols: false, un_watch_orders: false, un_watch_positions: false, un_watch_ticker: false, un_watch_tickers: false, un_watch_trades: false, un_watch_trades_for_symbols: false, watch_balance: true, watch_bids_asks: true, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_mark_price: false, watch_mark_prices: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: true, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: true, watch_position: false, watch_positions: false, 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: "binanceus", markets: nil, name: "Binance US", ohlcv_timestamp_resolution: :milliseconds, options: %{ accounts_by_id: %{ "CMFUTURE" => "inverse", "FUNDING" => "funding", "MAIN" => "spot", "MARGIN" => "margin", "OPTION" => "option", "UMFUTURE" => "linear" }, accounts_by_type: %{ "cross" => "MARGIN", "delivery" => "CMFUTURE", "funding" => "FUNDING", "future" => "UMFUTURE", "inverse" => "CMFUTURE", "linear" => "UMFUTURE", "main" => "MAIN", "margin" => "MARGIN", "option" => "OPTION", "spot" => "MAIN", "swap" => "UMFUTURE" }, adjust_for_time_difference: false, broker: %{ "delivery" => "x-xcKtGhcu", "future" => "x-cvBPrNm9", "inverse" => "x-xcKtGhcu", "margin" => "x-TKT5PX2F", "option" => "x-xcKtGhcu", "spot" => "x-TKT5PX2F", "swap" => "x-cvBPrNm9" }, currency_to_precision_rounding_mode: 0, default_account_type: "spot", default_sub_type: nil, default_time_in_force: "GTC", default_type: "spot", default_withdraw_precision: 1.0e-8, fetch_currencies: true, fetch_margins: false, fetch_markets: %{ "types" => [ "spot" ] }, fetch_positions: "positionRisk", has_already_authenticated_successfully: false, implied_networks: %{ "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, legal_money: %{ "AED" => true, "ARS" => true, "AUD" => true, "BRL" => true, "CAD" => true, "CHF" => true, "CZK" => true, "DKK" => true, "EUR" => true, "GBP" => true, "GHS" => true, "HKD" => true, "HUF" => true, "INR" => true, "JPY" => true, "KES" => true, "KZT" => true, "MXN" => true, "NGN" => true, "NOK" => true, "NZD" => true, "PEN" => true, "PHP" => true, "PLN" => true, "RUB" => true, "SEK" => true, "TRY" => true, "UAH" => true, "UGX" => true, "USD" => true, "VND" => true, "ZAR" => true }, legal_money_currencies_by_id: %{ "BUSD" => "USD" }, load_all_options: false, networks: %{ "BEP2" => "BNB", "BEP20" => "BSC", "EOS" => "EOS", "ERC20" => "ETH", "OMNI" => "OMNI", "SOL" => "SOL", "SPL" => "SOL", "TRC20" => "TRX" }, networks_by_id: %{ "SOL" => "SOL" }, new_order_resp_type: %{ "limit" => "FULL", "market" => "FULL" }, quote_order_qty: false, recv_window: 10000, sandbox_mode: false, throw_margin_mode_already_set: false, time_difference: 0, warn_on_fetch_open_orders_without_symbol: true }, order_mappings: %{ side_format: :uppercase, side_key: "side", type_format: :uppercase, type_key: "type" }, param_mappings: %{ "amount" => "fromAmount", "code" => "coin", "cost" => "quantity", "fromCode" => "fromAsset", "id" => "orderId", "since" => "startTime", "timeframe" => "interval", "toCode" => "toAsset" }, parse_methods: [], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 50, period: 1000, requests: 20, rolling_window_size: 60000 }, raw_endpoints: %{ private: [ %{ auth: false, cost: 10, method: :get, path: "/account" }, %{ auth: false, cost: 4, method: :get, path: "/account/commission" }, %{ auth: false, cost: 10, method: :get, path: "/allOrderList" }, %{ auth: false, cost: 10, method: :get, path: "/allOrders" }, %{ auth: false, cost: 4, method: :get, path: "/myAllocations" }, %{ auth: false, cost: 10, method: :get, path: "/myPreventedMatches" }, %{ auth: false, cost: 10, method: :get, path: "/myTrades" }, %{ auth: false, cost: 3, method: :get, path: "/openOrderList" }, %{ auth: false, cost: 1, method: :get, path: "/openOrders" }, %{ auth: false, cost: 2, method: :get, path: "/order" }, %{ auth: false, cost: 2, method: :get, path: "/orderList" }, %{ auth: false, cost: 20, method: :get, path: "/rateLimit/order" }, %{ auth: false, cost: 1, method: :post, path: "/order" }, %{ auth: false, cost: 1, method: :post, path: "/order/cancelReplace" }, %{ auth: false, cost: 1, method: :post, path: "/order/oco" }, %{ auth: false, cost: 1, method: :post, path: "/order/test" }, %{ auth: false, cost: 0.2, method: :post, path: "/orderList/oco" }, %{ auth: false, cost: 0.2, method: :post, path: "/orderList/opo" }, %{ auth: false, cost: 0.2, method: :post, path: "/orderList/opoco" }, %{ auth: false, cost: 0.2, method: :post, path: "/orderList/oto" }, %{ auth: false, cost: 0.2, method: :post, path: "/orderList/otoco" }, %{ auth: false, cost: 0.2, method: :post, path: "/sor/order" }, %{ auth: false, cost: 0.2, method: :post, path: "/sor/order/test" }, %{ auth: false, cost: 1, method: :delete, path: "/openOrders" }, %{ auth: false, cost: 1, method: :delete, path: "/order" }, %{ auth: false, cost: 1, method: :delete, path: "/orderList" } ], public: [ %{ auth: false, cost: 1, method: :get, path: "/aggTrades" }, %{ auth: false, cost: 1, method: :get, path: "/avgPrice" }, %{ auth: false, cost: 1, method: :get, path: "/depth" }, %{ auth: false, cost: 10, method: :get, path: "/exchangeInfo" }, %{ auth: false, cost: 5, method: :get, path: "/historicalTrades" }, %{ auth: false, cost: 1, method: :get, path: "/klines" }, %{ auth: false, cost: 1, method: :get, path: "/ping" }, %{ auth: false, cost: 1, method: :get, path: "/ticker" }, %{ auth: false, cost: 1, method: :get, path: "/ticker/24hr" }, %{ auth: false, cost: 1, method: :get, path: "/ticker/bookTicker" }, %{ auth: false, cost: 1, method: :get, path: "/ticker/price" }, %{ auth: false, cost: 0.8, method: :get, path: "/ticker/tradingDay" }, %{ auth: false, cost: 1, method: :get, path: "/time" }, %{ auth: false, cost: 1, method: :get, path: "/trades" }, %{ auth: false, cost: 0.4, method: :get, path: "/uiKlines" }, %{ auth: false, cost: 0.4, method: :post, path: "/userDataStream" }, %{ auth: false, cost: 0.4, method: :put, path: "/userDataStream" }, %{ auth: false, cost: 0.4, method: :delete, path: "/userDataStream" } ] }, 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: [ "200", "0" ], type: :error_field_present }, signing: %{ api_key_header: "X-MBX-APIKEY", confidence: :high, pattern: :hmac_sha256_query, recv_window: 5000, recv_window_key: "recvWindow", uses_recv_window: true }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ precision_mode: 4, sample_limits: %{ "amount" => %{ "max" => 9000, "min" => 1.0e-5 }, "cost" => %{ "min" => 1 }, "price" => %{ "max" => 1000000, "min" => 0.01 } }, sample_precision: %{ "amount" => 1.0e-5, "base" => 1.0e-8, "price" => 0.01, "quote" => 1.0e-8 }, spot: %{ base: "BTC", base_id: "BTC", case: :upper, contract: false, id: "BTCUSDT", limits: %{ "amount" => %{ "max" => 9000, "min" => 1.0e-5 }, "cost" => %{ "min" => 1 }, "leverage" => %{}, "market" => %{ "max" => 5.47296895, "min" => 0 }, "price" => %{ "max" => 1000000, "min" => 0.01 } }, maker: 0.001, precision: %{ "amount" => 1.0e-5, "base" => 1.0e-8, "price" => 0.01, "quote" => 1.0e-8 }, quote: "USDT", quote_id: "USDT", separator: "", symbol: "BTC/USDT", taker: 0.001 } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :no_separator_upper, separator: "", suffix: nil } }, timeframes: %{ "12h" => "12h", "15m" => "15m", "1M" => "1M", "1d" => "1d", "1h" => "1h", "1m" => "1m", "1s" => "1s", "1w" => "1w", "2h" => "2h", "30m" => "30m", "3d" => "3d", "3m" => "3m", "4h" => "4h", "5m" => "5m", "6h" => "6h", "8h" => "8h" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://api.binance.us/api/v3", doc: "https://github.com/binance-us/binance-official-api-docs", other: %{ "api_management" => "https://www.binance.com/en/usercenter/settings/api-management" }, sandbox: %{ "dapiPrivate" => "https://testnet.binancefuture.com/dapi/v1", "dapiPrivateV2" => "https://testnet.binancefuture.com/dapi/v2", "dapiPublic" => "https://testnet.binancefuture.com/dapi/v1", "fapiPrivate" => "https://testnet.binancefuture.com/fapi/v1", "fapiPrivateV2" => "https://testnet.binancefuture.com/fapi/v2", "fapiPrivateV3" => "https://testnet.binancefuture.com/fapi/v3", "fapiPublic" => "https://testnet.binancefuture.com/fapi/v1", "fapiPublicV2" => "https://testnet.binancefuture.com/fapi/v2", "fapiPublicV3" => "https://testnet.binancefuture.com/fapi/v3", "private" => "https://testnet.binance.vision/api/v3", "public" => "https://testnet.binance.vision/api/v3", "v1" => "https://testnet.binance.vision/api/v1" }, www: "https://www.binance.us" }, version: nil, ws: %{ has: %{ watch_balance: true, watch_bids_asks: true, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_mark_price: false, watch_mark_prices: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: true, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: true, watch_position: false, watch_positions: false, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true }, hostname: "binance.us", message_patterns: [ %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "SUBSCRIBE", sources: [ :send, :watch_multiple ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "UNSUBSCRIBE", sources: [ :send, :watch_multiple ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "userDataStream.subscribe.signature", sources: [ :send, :watch ] } ], options: %{ "streamBySubscriptionsHash" => %{}, "streamIndex" => -1, "streamLimits" => %{ "delivery" => 50, "future" => 50, "margin" => 50, "spot" => 50 }, "subscriptionLimitByStream" => %{ "delivery" => 200, "future" => 200, "margin" => 200, "spot" => 200 }, "tickerChannelsMap" => %{ "1dTicker" => "ticker_1d", "1hTicker" => "ticker_1h", "24hrMiniTicker" => "miniTicker", "24hrTicker" => "ticker", "4hTicker" => "ticker_4h", "bookTicker" => "bookTicker", "markPriceUpdate" => "markPrice" }, "watchBalance" => %{ "awaitBalanceSnapshot" => true, "fetchBalanceSnapshot" => false }, "watchLiquidationsForSymbols" => %{ "defaultType" => "swap" }, "watchOHLCV" => %{ "name" => "kline" }, "watchOrderBook" => %{ "checksum" => true, "maxRetries" => 3 }, "watchOrderBookLimit" => 1000, "watchOrderBookRate" => 100, "watchPositions" => %{ "awaitPositionsSnapshot" => true, "fetchPositionsSnapshot" => true }, "watchTicker" => %{ "name" => "ticker" }, "watchTickers" => %{ "name" => "ticker" }, "watchTrades" => %{ "name" => "trade" }, "ws" => %{ "cost" => 5 } }, streaming: %{ keep_alive: 180000 }, subscription_pattern: :custom, test_urls: %{ "delivery" => "wss://dstream.binancefuture.com/ws", "future" => "wss://fstream.binancefuture.com/ws", "margin" => "wss://stream.testnet.binance.vision/ws", "spot" => "wss://stream.testnet.binance.vision/ws", "ws-api" => %{ "delivery" => "wss://testnet.binancefuture.com/ws-dapi/v1", "future" => "wss://testnet.binancefuture.com/ws-fapi/v1", "spot" => "wss://ws-api.testnet.binance.vision/ws-api/v3" } }, urls: %{ "delivery" => "wss://dstream.binance.com/ws", "future" => "wss://fstream.binance.com/ws", "margin" => "wss://stream.binance.com:9443/ws", "papi" => "wss://fstream.binance.com/pm/ws", "spot" => "wss://stream.binance.us:9443/ws", "ws-api" => %{ "delivery" => "wss://ws-dapi.binance.com/ws-dapi/v1", "future" => "wss://ws-fapi.binance.com/ws-fapi/v1", "spot" => "wss://ws-api.binance.com:443/ws-api/v3" } } } }