# p2b Exchange Specification # # Auto-generated by: mix ccxt.extract p2b # 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: [ "LT" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 14, "coveragePercent" => 100, "enabledMethods" => 17, "excluded" => [ %{ "method" => "editOrder", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchCurrencies", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 2, "extractableMethods" => 15, "failures" => [ %{ "error" => "p2b fetchTrades () requires an extra parameter params[\"lastId\"]", "method" => "fetchTrades" } ] }, endpoints: [ %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :cancel_order, param_mappings: %{ "id" => "orderId", "symbol" => "market" }, params: [ :id, :symbol ], path: "/order/cancel", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :side, :amount, :price ], path: "/order/new", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/order/new", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :fetch_balance, param_mappings: %{}, params: [], path: "/account/balances", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "endTime" => "" }, market_type: :spot, method: :post, name: :fetch_closed_orders, param_mappings: %{ "since" => "startTime", "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/account/order_history", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :limit ], path: "/depth/result", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/markets", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "endTime" => "" }, market_type: :spot, method: :post, name: :fetch_my_trades, param_mappings: %{ "since" => "startTime", "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/account/market_deal_history", response_transformer: {:extract_path, ["result", "deals"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "symbol" => "market", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/market/kline", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :fetch_open_orders, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :since, :limit ], path: "/orders", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "symbol" => "market" }, params: [ :symbol, :limit ], path: "/depth/result", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :fetch_order_trades, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol, :since, :limit ], path: "/account/order", response_transformer: {:extract_path, ["result", "records"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "market" }, params: [ :symbol ], path: "/ticker", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/tickers", response_transformer: {:extract_path, ["result"]}, source: :intercepted } ], error_code_details: %{ 1001 => %{ description: "Key not provided. X-TXC-APIKEY header is missing in the request or empty.", type: :invalid_credentials }, 1002 => %{ description: "Payload not provided. X-TXC-PAYLOAD header is missing in the request or empty.", type: :invalid_credentials }, 1003 => %{ description: "Signature not provided. X-TXC-SIGNATURE header is missing in the request or empty.", type: :invalid_credentials }, 1004 => %{ description: "Nonce and url not provided. Request body is empty. Missing required parameters \"request\", \"nonce\".", type: :invalid_credentials }, 1005 => %{ description: "Invalid body data. Invalid request body", type: :invalid_credentials }, 1006 => %{ description: "Nonce not provided. Request body missing required parameter \"nonce\".", type: :invalid_credentials }, 1007 => %{ description: "Request not provided. Request body missing required parameter \"request\".", type: :invalid_credentials }, 1008 => %{ description: "Invalid request in body. The passed request parameter does not match the URL of this request.", type: :invalid_credentials }, 1009 => %{ description: "Invalid payload. The transmitted payload value (X-TXC-PAYLOAD header) does not match the request body.", type: :invalid_credentials }, 1010 => %{ description: "This action is unauthorized. - API key passed in the X-TXC-APIKEY header does not exist. - Access to API is not activated. Go to profile and activate access.", type: :invalid_credentials }, 1011 => %{ description: "This action is unauthorized. Please, enable two-factor authentication. Two-factor authentication is not activated for the user.", type: :invalid_credentials }, 1012 => %{ description: "Invalid nonce. Parameter \"nonce\" is not a number.", type: :invalid_credentials }, 1013 => %{ description: "Too many requests. - A request came with a repeated value of nonce. - Received more than the limited value of requests (10) within one second.", type: :invalid_credentials }, 1014 => %{ description: "Unauthorized request. Signature value passed (in the X-TXC-SIGNATURE header) does not match the request body.", type: :invalid_credentials }, 1015 => %{ description: "Temporary block. Temporary blocking. There is a cancellation of orders.", type: :invalid_credentials }, 1016 => %{ description: "Not unique nonce. The request was sent with a repeated parameter \"nonce\" within 10 seconds.", type: :invalid_credentials }, 2010 => %{ description: "Currency not found. Currency not found.", type: :invalid_parameters }, 2020 => %{ description: "Market is not available. Market is not available.", type: :invalid_parameters }, 2021 => %{ description: "Unknown market. Unknown market.", type: :invalid_parameters }, 2030 => %{ description: "Order not found. Order not found.", type: :invalid_parameters }, 2040 => %{ description: "Balance not enough. Insufficient balance.", type: :insufficient_balance }, 2050 => %{ description: "Amount less than the permitted minimum. Amount less than the permitted minimum.", type: :invalid_parameters }, 2051 => %{ description: "Amount is greater than the maximum allowed. Amount exceeds the allowed maximum.", type: :invalid_parameters }, 2052 => %{ description: "Amount step size error. Amount step size error.", type: :invalid_parameters }, 2060 => %{ description: "Price less than the permitted minimum. Price is less than the permitted minimum.", type: :invalid_parameters }, 2061 => %{ description: "Price is greater than the maximum allowed. Price exceeds the allowed maximum.", type: :invalid_parameters }, 2062 => %{ description: "Price pick size error. Price pick size error.", type: :invalid_parameters }, 2070 => %{ description: "Total less than the permitted minimum. Total less than the permitted minimum.", type: :invalid_parameters }, 3001 => %{ description: "Validation exception. The given data was invalid.", type: :invalid_parameters }, 3020 => %{ description: "Invalid currency value. Incorrect parameter, check your request.", type: :invalid_parameters }, 3030 => %{ description: "Invalid market value. Incorrect \"market\" parameter, check your request.", type: :invalid_parameters }, 3040 => %{ description: "Invalid amount value. Incorrect \"amount\" parameter, check your request.", type: :invalid_parameters }, 3050 => %{ description: "Invalid price value. Incorrect \"price\" parameter, check your request.", type: :invalid_parameters }, 3060 => %{ description: "Invalid limit value. Incorrect \"limit\" parameter, check your request.", type: :invalid_parameters }, 3070 => %{ description: "Invalid offset value. Incorrect \"offset\" parameter, check your request.", type: :invalid_parameters }, 3080 => %{ description: "Invalid orderId value. Incorrect \"orderId\" parameter, check your request.", type: :invalid_parameters }, 3090 => %{ description: "Invalid lastId value. Incorrect \"lastId\" parameter, check your request.", type: :invalid_parameters }, 3100 => %{ description: "Invalid side value. Incorrect \"side\" parameter, check your request.", type: :invalid_parameters }, 3110 => %{ description: "Invalid interval value. Incorrect \"interval\" parameter, check your request.", type: :invalid_parameters }, 4001 => %{ description: "Service temporary unavailable. An unexpected system error has occurred. Try again after a while. If the error persists, please contact support.", type: :network_error }, 6010 => %{ description: "Balance not enough. Insufficient balance.", type: :insufficient_balance } }, error_codes: %{ 1001 => :invalid_credentials, 1002 => :invalid_credentials, 1003 => :invalid_credentials, 1004 => :invalid_credentials, 1005 => :invalid_credentials, 1006 => :invalid_credentials, 1007 => :invalid_credentials, 1008 => :invalid_credentials, 1009 => :invalid_credentials, 1010 => :invalid_credentials, 1011 => :invalid_credentials, 1012 => :invalid_credentials, 1013 => :invalid_credentials, 1014 => :invalid_credentials, 1015 => :invalid_credentials, 1016 => :invalid_credentials, 2010 => :invalid_parameters, 2020 => :invalid_parameters, 2021 => :invalid_parameters, 2030 => :invalid_parameters, 2040 => :insufficient_balance, 2050 => :invalid_parameters, 2051 => :invalid_parameters, 2052 => :invalid_parameters, 2060 => :invalid_parameters, 2061 => :invalid_parameters, 2062 => :invalid_parameters, 2070 => :invalid_parameters, 3001 => :invalid_parameters, 3020 => :invalid_parameters, 3030 => :invalid_parameters, 3040 => :invalid_parameters, 3050 => :invalid_parameters, 3060 => :invalid_parameters, 3070 => :invalid_parameters, 3080 => :invalid_parameters, 3090 => :invalid_parameters, 3100 => :invalid_parameters, 3110 => :invalid_parameters, 4001 => :network_error, 6010 => :insufficient_balance }, exceptions: nil, exchange_options: %{ "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "networksById" => %{} }, extended_metadata: %{ fees_url: "https://p2pb2b.com/fee-schedule/", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/ccxt/ccxt/assets/43336371/8da13a80-1f0a-49be-bb90-ff8b25164755", referral_url: "https://p2pb2b.com?referral=ee784c53" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ future: %{}, spot: %{ create_order: %{ hedged: false, iceberg: false, leverage: false, margin_mode: false, market_buy_by_cost: false, market_buy_requires_price: false, self_trade_prevention: false, stop_loss_price: false, take_profit_price: false, time_in_force: %{ fok: true, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: false }, fetch_closed_orders: %{ days_back: 100000, days_back_canceled: 0.08333333333333333, limit: 100, margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 1 }, fetch_my_trades: %{ days_back: 100000, limit: 100, margin_mode: false, symbol_required: true, until_days: 1 }, fetch_ohlcv: %{ limit: 500 }, fetch_open_orders: %{ limit: 100, margin_mode: false, symbol_required: true, trailing: false, trigger: false }, sandbox: false }, swap: %{} }, fees: %{ trading: %{ percentage: true, tier_based: true } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined;\n }\n if (code === 400) {\n const error = this.safeValue(response, 'error');\n const errorCode = this.safeString(error, 'code');\n const feedback = this.id + ' ' + this.json(response);\n this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);\n // fallback to default error handler\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: false, cancel_all_orders_ws: false, cancel_order: true, cancel_order_with_client_order_id: false, cancel_order_ws: false, cancel_orders: false, cancel_orders_with_client_order_id: false, cancel_orders_ws: false, close_all_positions: false, close_position: false, create_deposit_address: false, create_limit_buy_order: false, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: false, create_limit_sell_order_ws: false, create_market_buy_order: false, create_market_buy_order_with_cost: false, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: false, create_market_order_with_cost: false, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: false, create_market_sell_order_with_cost: false, create_market_sell_order_with_cost_ws: false, create_market_sell_order_ws: false, create_order: true, create_order_with_take_profit_and_stop_loss: false, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: false, create_post_only_order: false, create_post_only_order_ws: false, create_reduce_only_order: false, create_reduce_only_order_ws: false, create_stop_limit_order: 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: false, create_stop_order_ws: false, create_take_profit_order: false, create_take_profit_order_ws: false, create_trailing_amount_order: false, create_trailing_amount_order_ws: false, create_trailing_percent_order: false, create_trailing_percent_order_ws: false, create_trigger_order: false, create_trigger_order_ws: false, deposit: false, edit_order: true, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: false, fetch_accounts: false, fetch_all_greeks: false, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: false, fetch_borrow_interest: false, fetch_borrow_rate: false, fetch_borrow_rate_histories: false, fetch_borrow_rate_history: false, fetch_borrow_rates: false, fetch_borrow_rates_per_symbol: false, fetch_canceled_and_closed_orders: false, fetch_canceled_orders: false, fetch_closed_order: false, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: false, fetch_convert_quote: false, fetch_convert_trade: false, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: true, fetch_currencies_ws: true, fetch_deposit: false, fetch_deposit_address: false, fetch_deposit_addresses: false, fetch_deposit_addresses_by_network: false, fetch_deposit_withdraw_fee: false, fetch_deposit_withdraw_fees: false, fetch_deposits: false, fetch_deposits_withdrawals: false, fetch_deposits_ws: false, fetch_funding_history: false, fetch_funding_interval: false, fetch_funding_intervals: false, fetch_funding_rate: false, fetch_funding_rate_history: false, fetch_funding_rates: false, fetch_greeks: false, fetch_index_ohlcv: false, fetch_isolated_borrow_rate: false, fetch_isolated_borrow_rates: false, fetch_isolated_positions: false, fetch_l2_order_book: true, fetch_l3_order_book: false, fetch_last_prices: false, fetch_ledger: false, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: false, fetch_leverages: false, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: false, fetch_margin_modes: false, fetch_mark_ohlcv: false, fetch_mark_price: false, fetch_mark_prices: false, fetch_market_leverage_tiers: false, fetch_markets: true, fetch_markets_ws: false, fetch_my_liquidations: false, fetch_my_settlement_history: false, fetch_my_trades: true, fetch_my_trades_ws: false, fetch_ohlcv: true, fetch_ohlcv_ws: false, fetch_open_interest: false, fetch_open_interest_history: false, fetch_open_interests: false, fetch_open_order: false, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: false, fetch_option_chain: false, fetch_order: false, fetch_order_book: true, fetch_order_book_ws: false, fetch_order_books: false, fetch_order_trades: true, fetch_order_with_client_order_id: false, fetch_order_ws: false, fetch_orders: false, fetch_orders_by_status: false, fetch_orders_ws: false, fetch_position: false, fetch_position_history: false, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: false, fetch_positions_for_symbol: false, fetch_positions_for_symbol_ws: false, fetch_positions_history: false, fetch_positions_risk: false, fetch_positions_ws: false, fetch_premium_index_ohlcv: false, fetch_settlement_history: false, fetch_status: false, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: false, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: false, fetch_trading_fees: false, fetch_trading_fees_ws: false, fetch_trading_limits: false, fetch_transaction_fee: false, fetch_transaction_fees: false, fetch_transactions: false, fetch_transfer: false, fetch_transfers: false, fetch_underlying_assets: false, fetch_volatility_history: false, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: false, fetch_withdrawals_ws: false, future: false, margin: false, option: false, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: false, set_leverage: false, set_margin: false, set_margin_mode: false, set_position_mode: false, sign_in: false, spot: true, swap: false, transfer: false, un_watch_my_trades: false, un_watch_ohlcv: false, un_watch_ohlcv_for_symbols: false, un_watch_order_book: false, un_watch_order_book_for_symbols: false, un_watch_orders: false, un_watch_positions: false, un_watch_ticker: false, un_watch_tickers: false, un_watch_trades: false, un_watch_trades_for_symbols: false, watch_balance: false, watch_bids_asks: false, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: false, watch_ohlcv: true, watch_ohlcv_for_symbols: false, watch_order_book: true, watch_order_book_for_symbols: false, watch_orders: false, watch_orders_for_symbols: false, watch_position: false, watch_positions: false, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true, withdraw: false, ws: false }, http_config: nil, id: "p2b", markets: nil, name: "p2b", ohlcv_timestamp_resolution: :unknown, options: %{}, order_mappings: %{ side_format: :lowercase, side_key: "side", type_format: nil, type_key: nil }, param_mappings: %{ "id" => "orderId", "since" => "startTime", "symbol" => "market", "timeframe" => "interval" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"USDT\": {\n \"available\": \"71.81328046\",\n \"freeze\": \"10.46103091\"\n },\n \"BTC\": {\n \"available\": \"0.00135674\",\n \"freeze\": \"0.00020003\"\n }\n }" ], "line_end" => 890, "line_start" => 860, "mappings" => [ %{ "comment" => nil, "key" => "free", "value" => "available" }, %{ "comment" => nil, "key" => "used", "value" => "used" } ], "name" => "parseBalance", "signature" => "parseBalance (response)", "source" => "parseBalance (response) {\n //\n // {\n // \"USDT\": {\n // \"available\": \"71.81328046\",\n // \"freeze\": \"10.46103091\"\n // },\n // \"BTC\": {\n // \"available\": \"0.00135674\",\n // \"freeze\": \"0.00020003\"\n // }\n // }\n //\n const result: Dict = {\n 'info': response,\n };\n const keys = Object.keys (response);\n for (let i = 0; i < keys.length; i++) {\n const currencyId = keys[i];\n const balance = response[currencyId];\n const code = this.safeCurrencyCode (currencyId);\n const used = this.safeString (balance, 'freeze');\n const available = this.safeString (balance, 'available');\n const account: Dict = {\n 'free': available,\n 'used': used,\n };\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 436, "line_start" => 378, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "marketId" }, %{ "comment" => nil, "key" => "symbol", "value" => "base + '/' + quote" }, %{ "comment" => nil, "key" => "base", "value" => "base" }, %{ "comment" => nil, "key" => "quote", "value" => "quote" }, %{ "comment" => nil, "key" => "settle", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseId", "value" => "baseId" }, %{ "comment" => nil, "key" => "quoteId", "value" => "quoteId" }, %{ "comment" => nil, "key" => "settleId", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "'spot'" }, %{ "comment" => nil, "key" => "spot", "value" => "true" }, %{ "comment" => nil, "key" => "margin", "value" => "false" }, %{ "comment" => nil, "key" => "swap", "value" => "false" }, %{ "comment" => nil, "key" => "future", "value" => "false" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "true" }, %{ "comment" => nil, "key" => "contract", "value" => "false" }, %{ "comment" => nil, "key" => "linear", "value" => "undefined" }, %{ "comment" => nil, "key" => "inverse", "value" => "undefined" }, %{ "comment" => nil, "key" => "contractSize", "value" => "undefined" }, %{ "comment" => nil, "key" => "expiry", "value" => "undefined" }, %{ "comment" => nil, "key" => "expiryDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "strike", "value" => "undefined" }, %{ "comment" => nil, "key" => "optionType", "value" => "undefined" }, %{ "comment" => nil, "key" => "precision", "value" => "{\n 'amount': this.safeNumber (limits, 'step_size'),\n 'price': this.safeNumber (limits, 'tick_size'),\n }" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (limits, 'min_amount'),\n 'max': this.parseNumber (this.omitZero (maxAmount)),\n },\n 'price': {\n 'min': this.safeNumber (limits, 'min_price'),\n 'max': this.parseNumber (this.omitZero (maxPrice)),\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n }" }, %{ "comment" => nil, "key" => "created", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "market" }, %{ "comment" => nil, "key" => "leverage", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "amount", "value" => "{\n 'min': this.safeNumber (limits, 'min_amount'),\n 'max': this.parseNumber (this.omitZero (maxAmount)),\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': this.safeNumber (limits, 'min_price'),\n 'max': this.parseNumber (this.omitZero (maxPrice)),\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "min", "value" => "this.safeNumber (limits, 'min_price')" }, %{ "comment" => nil, "key" => "max", "value" => "this.parseNumber (this.omitZero (maxPrice))" }, %{ "comment" => nil, "key" => "min", "value" => "undefined" }, %{ "comment" => nil, "key" => "max", "value" => "undefined" } ], "name" => "parseMarket", "signature" => "parseMarket (market: Dict): Market", "source" => "parseMarket (market: Dict): Market {\n const marketId = this.safeString (market, 'name');\n const baseId = this.safeString (market, 'stock');\n const quoteId = this.safeString (market, 'money');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const limits = this.safeValue (market, 'limits');\n const maxAmount = this.safeString (limits, 'max_amount');\n const maxPrice = this.safeString (limits, 'max_price');\n return {\n 'id': marketId,\n 'symbol': base + '/' + quote,\n 'base': base,\n 'quote': quote,\n 'settle': undefined,\n 'baseId': baseId,\n 'quoteId': quoteId,\n 'settleId': undefined,\n 'type': 'spot',\n 'spot': true,\n 'margin': false,\n 'swap': false,\n 'future': false,\n 'option': false,\n 'active': true,\n 'contract': false,\n 'linear': undefined,\n 'inverse': undefined,\n 'contractSize': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.safeNumber (limits, 'step_size'),\n 'price': this.safeNumber (limits, 'tick_size'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (limits, 'min_amount'),\n 'max': this.parseNumber (this.omitZero (maxAmount)),\n },\n 'price': {\n 'min': this.safeNumber (limits, 'min_price'),\n 'max': this.parseNumber (this.omitZero (maxPrice)),\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': market,\n };\n }" }, %{ "comment" => nil, "examples" => [ "[\n 1699253400, // Kline open time\n '0.3429', // Open price\n '0.3427', // Close price\n '0.3429', // Highest price\n '0.3427', // Lowest price\n '1900.4', // Volume for stock currency\n '651.46278', // Volume for money currency\n 'ADA_USDT' // Market name\n ]," ], "line_end" => 826, "line_start" => 805, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined) : OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined) : OHLCV {\n //\n // [\n // 1699253400, // Kline open time\n // '0.3429', // Open price\n // '0.3427', // Close price\n // '0.3429', // Highest price\n // '0.3427', // Lowest price\n // '1900.4', // Volume for stock currency\n // '651.46278', // Volume for money currency\n // 'ADA_USDT' // Market name\n // ],\n //\n return [\n this.safeIntegerProduct (ohlcv, 0, 1000),\n this.safeNumber (ohlcv, 1),\n this.safeNumber (ohlcv, 3),\n this.safeNumber (ohlcv, 4),\n this.safeNumber (ohlcv, 2),\n this.safeNumber (ohlcv, 5),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"orderId\": 171906478744,\n \"market\": \"ETH_BTC\",\n \"price\": \"0.04348\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"timestamp\": 1698484861.746517,\n \"dealMoney\": \"0\",\n \"dealStock\": \"0\",\n \"amount\": \"0.0277\",\n \"takerFee\": \"0.002\",\n \"makerFee\": \"0.002\",\n \"left\": \"0.0277\",\n \"dealFee\": \"0\"\n }", "{\n \"id\": 171366547790, // Order id\n \"amount\": \"0.00032\", // Original amount\n \"price\": \"34293.92\", // Order price\n \"type\": \"limit\", // Order type\n \"side\": \"sell\", // Order side\n \"ctime\": 1698237533.497241, // Order creation time\n \"ftime\": 1698237535.41196, // Order fill time\n \"market\": \"BTC_USDT\", // Market name\n \"takerFee\": \"0.0018\", // Taker fee\n \"makerFee\": \"0.0016\", // Market fee\n \"dealFee\": \"0.01755848704\", // Deal fee\n \"dealStock\": \"0.00032\", // Filled amount\n \"dealMoney\": \"10.9740544\" // Filled total\n }" ], "line_end" => 1328, "line_start" => 1261, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString2 (order, 'id', 'orderId')" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeString (order, 'type')" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "undefined" }, %{ "comment" => nil, "key" => "postOnly", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeString (order, 'side')" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeString (order, 'price')" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeString (order, 'amount')" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "filled", "value" => "this.safeString (order, 'dealStock')" }, %{ "comment" => nil, "key" => "remaining", "value" => "this.safeString (order, 'left')" }, %{ "comment" => nil, "key" => "status", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': market['quote'],\n 'cost': this.safeString (order, 'dealFee'),\n }" }, %{ "comment" => nil, "key" => "trades", "value" => "undefined" }, %{ "comment" => nil, "key" => "currency", "value" => "market['quote']" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeString (order, 'dealFee')" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // cancelOrder, fetchOpenOrders, createOrder\n //\n // {\n // \"orderId\": 171906478744,\n // \"market\": \"ETH_BTC\",\n // \"price\": \"0.04348\",\n // \"side\": \"buy\",\n // \"type\": \"limit\",\n // \"timestamp\": 1698484861.746517,\n // \"dealMoney\": \"0\",\n // \"dealStock\": \"0\",\n // \"amount\": \"0.0277\",\n // \"takerFee\": \"0.002\",\n // \"makerFee\": \"0.002\",\n // \"left\": \"0.0277\",\n // \"dealFee\": \"0\"\n // }\n //\n // fetchClosedOrders\n //\n // {\n // \"id\": 171366547790, // Order id\n // \"amount\": \"0.00032\", // Original amount\n // \"price\": \"34293.92\", // Order price\n // \"type\": \"limit\", // Order type\n // \"side\": \"sell\", // Order side\n // \"ctime\": 1698237533.497241, // Order creation time\n // \"ftime\": 1698237535.41196, // Order fill time\n // \"market\": \"BTC_USDT\", // Market name\n // \"takerFee\": \"0.0018\", // Taker fee\n // \"makerFee\": \"0.0016\", // Market fee\n // \"dealFee\": \"0.01755848704\", // Deal fee\n // \"dealStock\": \"0.00032\", // Filled amount\n // \"dealMoney\": \"10.9740544\" // Filled total\n // }\n //\n const timestamp = this.safeIntegerProduct2 (order, 'timestamp', 'ctime', 1000);\n const marketId = this.safeString (order, 'market');\n market = this.safeMarket (marketId, market);\n return this.safeOrder ({\n 'info': order,\n 'id': this.safeString2 (order, 'id', 'orderId'),\n 'clientOrderId': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'symbol': market['symbol'],\n 'type': this.safeString (order, 'type'),\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': this.safeString (order, 'side'),\n 'price': this.safeString (order, 'price'),\n 'triggerPrice': undefined,\n 'amount': this.safeString (order, 'amount'),\n 'cost': undefined,\n 'average': undefined,\n 'filled': this.safeString (order, 'dealStock'),\n 'remaining': this.safeString (order, 'left'),\n 'status': undefined,\n 'fee': {\n 'currency': market['quote'],\n 'cost': this.safeString (order, 'dealFee'),\n },\n 'trades': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n at: '1699252631',\n ticker: {\n bid: '0.0000332',\n ask: '0.0000333',\n low: '0.0000301',\n high: '0.0000338',\n last: '0.0000333',\n vol: '15.66',\n deal: '0.000501828',\n change: '10.63'\n }\n }", "{\n bid: '0.342',\n ask: '0.3421',\n open: '0.3317',\n high: '0.3499',\n low: '0.3311',\n last: '0.3421',\n volume: '17855383.1',\n deal: '6107478.3423',\n change: '3.13'\n }" ], "line_end" => 582, "line_start" => 523, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "this.safeString (market, 'symbol')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "high", "value" => "this.safeString (ticker, 'high')" }, %{ "comment" => nil, "key" => "low", "value" => "this.safeString (ticker, 'low')" }, %{ "comment" => nil, "key" => "bid", "value" => "this.safeString (ticker, 'bid')" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeString (ticker, 'ask')" }, %{ "comment" => nil, "key" => "askVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "this.safeString (ticker, 'open')" }, %{ "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, 'change')" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "this.safeString2 (ticker, 'vol', 'volume')" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "this.safeString (ticker, 'deal')" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker, market: Market = undefined)", "source" => "parseTicker (ticker, market: Market = undefined) {\n //\n // parseTickers\n //\n // {\n // at: '1699252631',\n // ticker: {\n // bid: '0.0000332',\n // ask: '0.0000333',\n // low: '0.0000301',\n // high: '0.0000338',\n // last: '0.0000333',\n // vol: '15.66',\n // deal: '0.000501828',\n // change: '10.63'\n // }\n // }\n //\n // parseTicker\n //\n // {\n // bid: '0.342',\n // ask: '0.3421',\n // open: '0.3317',\n // high: '0.3499',\n // low: '0.3311',\n // last: '0.3421',\n // volume: '17855383.1',\n // deal: '6107478.3423',\n // change: '3.13'\n // }\n //\n const timestamp = this.safeIntegerProduct (ticker, 'at', 1000);\n if ('ticker' in ticker) {\n ticker = this.safeValue (ticker, 'ticker');\n }\n const last = this.safeString (ticker, 'last');\n return this.safeTicker ({\n 'symbol': this.safeString (market, 'symbol'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high'),\n 'low': this.safeString (ticker, 'low'),\n 'bid': this.safeString (ticker, 'bid'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'ask'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': this.safeString (ticker, 'open'),\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': this.safeString (ticker, 'change'),\n 'average': undefined,\n 'baseVolume': this.safeString2 (ticker, 'vol', 'volume'),\n 'quoteVolume': this.safeString (ticker, 'deal'),\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n id: '7495738622',\n type: 'sell',\n time: '1699255565.445418',\n amount: '252.6',\n price: '0.3422'\n }", "{\n \"deal_id\": 7450617292, // Deal id\n \"deal_time\": 1698506956.66224, // Deal execution time\n \"deal_order_id\": 171955225751, // Deal order id\n \"opposite_order_id\": 171955110512, // Opposite order id\n \"side\": \"sell\", // Deal side\n \"price\": \"0.05231\", // Deal price\n \"amount\": \"0.002\", // Deal amount\n \"deal\": \"0.00010462\", // Total (price * amount)\n \"deal_fee\": \"0.000000188316\", // Deal fee\n \"role\": \"taker\", // Role. Taker or maker\n \"isSelfTrade\": false // is self trade\n }", "{\n \"id\": 7429883128, // Deal id\n \"time\": 1698237535.41196, // Deal execution time\n \"fee\": \"0.01755848704\", // Deal fee\n \"price\": \"34293.92\", // Deal price\n \"amount\": \"0.00032\", // Deal amount\n \"dealOrderId\": 171366551416, // Deal order id\n \"role\": 1, // Deal role (1 - maker, 2 - taker)\n \"deal\": \"10.9740544\" // Total (price * amount)\n }" ], "line_end" => 753, "line_start" => 687, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString2 (trade, 'id', 'deal_id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeString (market, 'symbol')" }, %{ "comment" => nil, "key" => "order", "value" => "this.safeString2 (trade, 'dealOrderId', 'deal_order_id')" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeString2 (trade, 'type', 'side')" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeString (trade, 'price')" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeString (trade, 'amount')" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeString (trade, 'deal')" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': market['quote'],\n 'cost': this.safeString2 (trade, 'fee', 'deal_fee'),\n }" }, %{ "comment" => nil, "key" => "currency", "value" => "market['quote']" }, %{ "comment" => nil, "key" => "cost", "value" => "this.safeString2 (trade, 'fee', 'deal_fee')" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined)", "source" => "parseTrade (trade: Dict, market: Market = undefined) {\n //\n // fetchTrades\n //\n // {\n // id: '7495738622',\n // type: 'sell',\n // time: '1699255565.445418',\n // amount: '252.6',\n // price: '0.3422'\n // }\n //\n // fetchMyTrades\n //\n // {\n // \"deal_id\": 7450617292, // Deal id\n // \"deal_time\": 1698506956.66224, // Deal execution time\n // \"deal_order_id\": 171955225751, // Deal order id\n // \"opposite_order_id\": 171955110512, // Opposite order id\n // \"side\": \"sell\", // Deal side\n // \"price\": \"0.05231\", // Deal price\n // \"amount\": \"0.002\", // Deal amount\n // \"deal\": \"0.00010462\", // Total (price * amount)\n // \"deal_fee\": \"0.000000188316\", // Deal fee\n // \"role\": \"taker\", // Role. Taker or maker\n // \"isSelfTrade\": false // is self trade\n // }\n //\n // fetchOrderTrades\n //\n // {\n // \"id\": 7429883128, // Deal id\n // \"time\": 1698237535.41196, // Deal execution time\n // \"fee\": \"0.01755848704\", // Deal fee\n // \"price\": \"34293.92\", // Deal price\n // \"amount\": \"0.00032\", // Deal amount\n // \"dealOrderId\": 171366551416, // Deal order id\n // \"role\": 1, // Deal role (1 - maker, 2 - taker)\n // \"deal\": \"10.9740544\" // Total (price * amount)\n // }\n //\n const timestamp = this.safeIntegerProduct2 (trade, 'time', 'deal_time', 1000);\n let takerOrMaker = this.safeString (trade, 'role');\n if (takerOrMaker === '1') {\n takerOrMaker = 'maker';\n } else if (takerOrMaker === '2') {\n takerOrMaker = 'taker';\n }\n return this.safeTrade ({\n 'info': trade,\n 'id': this.safeString2 (trade, 'id', 'deal_id'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': this.safeString (market, 'symbol'),\n 'order': this.safeString2 (trade, 'dealOrderId', 'deal_order_id'),\n 'type': undefined,\n 'side': this.safeString2 (trade, 'type', 'side'),\n 'takerOrMaker': takerOrMaker,\n 'price': this.safeString (trade, 'price'),\n 'amount': this.safeString (trade, 'amount'),\n 'cost': this.safeString (trade, 'deal'),\n 'fee': {\n 'currency': market['quote'],\n 'cost': this.safeString2 (trade, 'fee', 'deal_fee'),\n },\n }, market);\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 100, period: 1000, requests: 10, rolling_window_size: 60000 }, raw_endpoints: %{ private: [ %{ auth: false, cost: 1, method: :post, path: "/account/balance" }, %{ auth: false, cost: 1, method: :post, path: "/account/balances" }, %{ auth: false, cost: 1, method: :post, path: "/account/executed_history" }, %{ auth: false, cost: 1, method: :post, path: "/account/market_deal_history" }, %{ auth: false, cost: 1, method: :post, path: "/account/market_order_history" }, %{ auth: false, cost: 1, method: :post, path: "/account/order" }, %{ auth: false, cost: 1, method: :post, path: "/account/order_history" }, %{ auth: false, cost: 1, method: :post, path: "/order/cancel" }, %{ auth: false, cost: 1, method: :post, path: "/order/new" }, %{ auth: false, cost: 1, method: :post, path: "/orders" } ], public: [ %{ auth: false, cost: 1, method: :get, path: "/book" }, %{ auth: false, cost: 1, method: :get, path: "/depth/result" }, %{ auth: false, cost: 1, method: :get, path: "/history" }, %{ auth: false, cost: 1, method: :get, path: "/market" }, %{ auth: false, cost: 1, method: :get, path: "/market/kline" }, %{ auth: false, cost: 1, method: :get, path: "/markets" }, %{ auth: false, cost: 1, method: :get, path: "/ticker" }, %{ auth: false, cost: 1, method: :get, path: "/tickers" } ] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: nil, signing: %{ api_key_header: "X-TXC-APIKEY", confidence: :medium, pattern: :hmac_sha512_nonce }, 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" => 100000, "min" => 0.01 }, "cost" => %{}, "price" => %{ "max" => 100000, "min" => 1.0e-6 } }, sample_precision: %{ "amount" => 0.001, "price" => 1.0e-6 }, spot: %{ base: "LTC", base_id: "LTC", case: :upper, contract: false, id: "LTC_BTC", limits: %{ "amount" => %{ "max" => 100000, "min" => 0.01 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "max" => 100000, "min" => 1.0e-6 } }, maker: [ [ 0, 0.2 ], [ 1, 0.18 ], [ 5, 0.16 ], [ 10, 0.14 ], [ 25, 0.12 ], [ 75, 0.1 ], [ 100, 0.08 ], [ 150, 0.06 ], [ 300, 0.04 ], [ 450, 0.02 ], [ 500, 0.01 ] ], precision: %{ "amount" => 0.001, "price" => 1.0e-6 }, quote: "BTC", quote_id: "BTC", separator: "_", symbol: "LTC/BTC", taker: [ [ 0, 0.2 ], [ 1, 0.19 ], [ 5, 0.18 ], [ 10, 0.17 ], [ 25, 0.16 ], [ 75, 0.15 ], [ 100, 0.14 ], [ 150, 0.13 ], [ 300, 0.12 ], [ 450, 0.11 ], [ 500, 0.1 ] ] } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :underscore_upper, separator: "_", suffix: nil } }, timeframes: %{ "1d" => "1d", "1h" => "1h", "1m" => "1m" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://api.p2pb2b.com/api/v2/public", api_sections: %{ "private" => "https://api.p2pb2b.com/api/v2", "public" => "https://api.p2pb2b.com/api/v2/public" }, doc: "https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md", other: %{ "extension" => ".json" }, sandbox: nil, www: "https://p2pb2b.com/" }, version: "v2", ws: %{ channel_templates: %{ watch_ohlcv: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_order_book: %{ channel_name: "depth.subscribe", market_id_format: :native, params: [ %{ "default" => "0.001", "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_ticker: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_tickers: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_trades_for_symbols: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic } }, has: %{ watch_balance: false, watch_bids_asks: nil, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: false, watch_ohlcv: true, watch_ohlcv_for_symbols: nil, watch_order_book: true, watch_order_book_for_symbols: nil, watch_orders: false, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: nil, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true }, message_patterns: [ %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "deals.subscribe", sources: [ :send, :watch_multiple ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "depth.subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "server.ping", sources: [ :ping ] }, %{ args_field: "params", format: :method, id_field: "id", keys: [ "id", "method", "params" ], kind_field: "method", kind_value: "state.subscribe", sources: [ :send, :watch, :watch_multiple ] } ], options: %{ "watchTicker" => %{ "name" => "state" }, "watchTickers" => %{ "name" => "state" } }, subscription_config: %{ args_field: "params", args_format: :string_list, market_id_format: :native, op_field: "method" }, subscription_pattern: :method_as_topic, urls: "wss://apiws.p2pb2b.com/", watch_methods: [ "watchOHLCV", "watchOrderBook", "watchTicker", "watchTickers", "watchTrades", "watchTradesForSymbols" ] } }