Current section
Files
Jump to
Current section
Files
priv/specs/extracted/coinsph.exs
# Coins.ph Exchange Specification
#
# Auto-generated by: mix ccxt.extract coinsph
# 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: :supported,
comment: nil,
countries: [
"PH"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 27,
"coveragePercent" => 100,
"enabledMethods" => 31,
"excluded" => [],
"excludedMethods" => 0,
"extractableMethods" => 31,
"failures" => [
%{
"error" => "coinsph createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument",
"method" => "createMarketOrder"
},
%{
"error" => "coinsph createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument",
"method" => "createStopMarketOrder"
},
%{
"error" => "coinsph fetchDepositAddress() require network parameter",
"method" => "fetchDepositAddress"
},
%{
"error" => "coinsph withdraw() require network parameter",
"method" => "withdraw"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :delete,
name: :cancel_all_orders,
param_mappings: %{},
params: [
:symbol
],
path: "/openapi/v1/openOrders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol
],
path: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"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: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newOrderRespType" => "FULL",
"side" => "BUY",
"type" => "MARKET"
},
market_type: :spot,
method: :post,
name: :create_market_buy_order_with_cost,
param_mappings: %{
"cost" => "quoteOrderQty"
},
params: [
:symbol,
:cost
],
path: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newOrderRespType" => "FULL",
"timeInForce" => "GTC"
},
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "quantity"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newOrderRespType" => "FULL",
"timeInForce" => "GTC",
"triggerDirection" => "below",
"type" => "LIMIT"
},
market_type: :swap,
method: :post,
name: :create_stop_limit_order,
param_mappings: %{
"amount" => "quantity"
},
params: [
:symbol,
:side,
:amount,
:price,
:triggerPrice
],
path: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newOrderRespType" => "FULL",
"timeInForce" => "GTC",
"triggerDirection" => "below"
},
market_type: :swap,
method: :post,
name: :create_stop_order,
param_mappings: %{
"amount" => "quantity"
},
params: [
:symbol,
:type,
:side,
:amount,
:price,
:triggerPrice
],
path: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/openapi/v1/account",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_closed_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/openapi/v1/historyOrders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/openapi/wallet/v1/config/getall",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{
"code" => "coin"
},
params: [
:code,
:since,
:limit
],
path: "/openapi/wallet/v1/deposit/history",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/openapi/quote/v1/depth",
response_transformer: {:extract_path, ["lastUpdateId"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/openapi/v1/exchangeInfo",
response_transformer: {:extract_path, ["symbols"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/openapi/v1/myTrades",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"endTime" => "<generated>"
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"since" => "startTime",
"timeframe" => "interval"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/openapi/quote/v1/klines",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 3,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/openapi/v1/openOrders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol
],
path: "/openapi/v1/order",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/openapi/quote/v1/depth",
response_transformer: {:extract_path_unwrap, ["lastUpdateId"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :get,
name: :fetch_order_trades,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol,
:since,
:limit
],
path: "/openapi/v1/myTrades",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_status,
param_mappings: %{},
params: [],
path: "/openapi/v1/ping",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{},
params: [
:symbol
],
path: "/openapi/quote/v1/ticker/24hr",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"symbols" => [
"BTCUSDT"
]
},
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/openapi/quote/v1/ticker/24hr",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_time,
param_mappings: %{},
params: [],
path: "/openapi/v1/time",
response_transformer: {:extract_path, ["serverTime"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"limit" => 1000
},
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/openapi/quote/v1/trades",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trading_fee,
param_mappings: %{},
params: [
:symbol
],
path: "/openapi/v1/asset/tradeFee",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/openapi/v1/asset/tradeFee",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{
"code" => "coin"
},
params: [
:code,
:since,
:limit
],
path: "/openapi/wallet/v1/withdraw/history",
source: :intercepted
}
],
error_code_details: %{
-1000 => %{
description: "An unknown error occured while processing the request.",
type: :invalid_parameters
},
-100011 => %{
description: "Not supported symbols",
type: :invalid_order
},
-100012 => %{
description: "Parameter symbol [String] missing!",
type: :invalid_order
},
-1001 => %{
description: "Internal error.",
type: :invalid_parameters
},
-1002 => %{
description: "You are not authorized to execute this request. Request need API Key included in . We suggest that API Key be included in any request.",
type: :invalid_credentials
},
-1003 => %{
description: "Too many requests; please use the websocket for live updates. Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API. Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans.",
type: :rate_limited
},
-1004 => %{
description: "Missing required parameter 'symbol'",
type: :invalid_order
},
-1006 => %{
description: "An unexpected response was received from the message bus. Execution status unknown. OPEN API server find some exception in execute request .Please report to Customer service.",
type: :exchange_error
},
-1007 => %{
description: "Timeout waiting for response from backend server. Send status unknown; execution status unknown.",
type: :exchange_error
},
-1014 => %{
description: "Unsupported order combination.",
type: :invalid_order
},
-1015 => %{
description: "Reach the rate limit .Please slow down your request speed. Too many new orders. Too many new orders; current limit is %s orders per %s.",
type: :rate_limited
},
-1016 => %{
description: "This service is no longer available.",
type: :exchange_error
},
-1020 => %{
description: "This operation is not supported.",
type: :exchange_error
},
-1021 => %{
description: "Timestamp for this request is outside of the recvWindow.",
type: :invalid_parameters
},
-1022 => %{
description: "Signature for this request is not valid.",
type: :invalid_parameters
},
-1023 => %{
description: "Please set IP whitelist before using API.",
type: :invalid_credentials
},
-1024 => %{
description: "recvWindow is not valid.",
type: :invalid_parameters
},
-1025 => %{
description: "recvWindow cannot be greater than 60000",
type: :invalid_parameters
},
-1030 => %{
description: "Business error.",
type: :exchange_error
},
-1100 => %{
description: "Illegal characters found in a parameter. Illegal characters found in parameter ‘%s’; legal range is ‘%s’.",
type: :invalid_parameters
},
-1101 => %{
description: "Too many parameters sent for this endpoint. Too many parameters; expected ‘%s’ and received ‘%s’. Duplicate values for a parameter detected.",
type: :invalid_parameters
},
-1102 => %{
description: "A mandatory parameter was not sent, was empty/null, or malformed. Mandatory parameter ‘%s’ was not sent, was empty/null, or malformed. Param ‘%s’ or ‘%s’ must be sent, but both were empty/null!",
type: :invalid_parameters
},
-1103 => %{
description: "An unknown parameter was sent. In BHEx Open Api , each request requires at least one parameter. {Timestamp}.",
type: :invalid_parameters
},
-1104 => %{
description: "Not all sent parameters were read. Not all sent parameters were read; read ‘%s’ parameter(s) but was sent ‘%s’.",
type: :invalid_parameters
},
-1105 => %{
description: "Parameter 'orderId and origClientOrderId' is empty.",
type: :invalid_parameters
},
-1106 => %{
description: "A parameter was sent when not required. Parameter ‘%s’ sent when not required.",
type: :invalid_parameters
},
-1111 => %{
description: "Precision is over the maximum defined for this asset.",
type: :invalid_parameters
},
-1112 => %{
description: "No orders on book for symbol.",
type: :exchange_error
},
-1114 => %{
description: "TimeInForce parameter sent when not required.",
type: :invalid_parameters
},
-1115 => %{
description: "Invalid timeInForce.",
type: :invalid_order
},
-1116 => %{
description: "Invalid orderType.",
type: :invalid_order
},
-1117 => %{
description: "Invalid side.",
type: :invalid_order
},
-1118 => %{
description: "New client order ID was empty.",
type: :invalid_order
},
-1119 => %{
description: "Original client order ID was empty.",
type: :invalid_order
},
-1120 => %{
description: "Invalid interval.",
type: :invalid_parameters
},
-1121 => %{
description: "Invalid symbol.",
type: :invalid_order
},
-1122 => %{
description: "Invalid newOrderRespType.",
type: :invalid_order
},
-1125 => %{
description: "This listenKey does not exist.",
type: :invalid_parameters
},
-1127 => %{
description: "Lookup interval is too big. More than %s hours between startTime and endTime.",
type: :invalid_parameters
},
-1128 => %{
description: "Combination of optional parameters invalid.",
type: :invalid_parameters
},
-1130 => %{
description: "Invalid data sent for a parameter. Data sent for paramter ‘%s’ is not valid.",
type: :invalid_parameters
},
-1131 => %{
description: "Balance insufficient ",
type: :insufficient_balance
},
-1132 => %{
description: "Order price too high.",
type: :invalid_order
},
-1133 => %{
description: "Order price lower than the minimum,please check general broker info.",
type: :invalid_order
},
-1134 => %{
description: "Order price decimal too long,please check general broker info.",
type: :invalid_order
},
-1135 => %{
description: "Order quantity too large.",
type: :invalid_order
},
-1136 => %{
description: "Order quantity lower than the minimum.",
type: :invalid_order
},
-1137 => %{
description: "Order quantity decimal too long.",
type: :invalid_order
},
-1138 => %{
description: "Order price exceeds permissible range.",
type: :invalid_order
},
-1139 => %{
description: "Order has been filled.",
type: :invalid_order
},
-1140 => %{
description: "Transaction amount lower than the minimum.",
type: :invalid_order
},
-1141 => %{
description: "Duplicate clientOrderId",
type: :invalid_order
},
-1142 => %{
description: "Order has been canceled",
type: :invalid_order
},
-1143 => %{
description: "Cannot be found on order book",
type: :order_not_found
},
-1144 => %{
description: "Order has been locked",
type: :invalid_order
},
-1145 => %{
description: "This order type does not support cancellation",
type: :invalid_order
},
-1146 => %{
description: "Order creation timeout",
type: :invalid_order
},
-1147 => %{
description: "Order cancellation timeout",
type: :invalid_order
},
-1148 => %{
description: "Market order amount decimal too long",
type: :invalid_order
},
-1149 => %{
description: "Create order failed",
type: :invalid_order
},
-1150 => %{
description: "Cancel order failed",
type: :invalid_order
},
-1151 => %{
description: "The trading pair is not open yet",
type: :invalid_order
},
-1152 => %{
description: "Coming soon",
type: :exchange_error
},
-1153 => %{
description: "User not exist",
type: :invalid_credentials
},
-1154 => %{
description: "Invalid price type",
type: :invalid_parameters
},
-1155 => %{
description: "Invalid position side",
type: :invalid_parameters
},
-1156 => %{
description: "Order quantity invalid",
type: :invalid_order
},
-1157 => %{
description: "The trading pair is not available for api trading",
type: :invalid_order
},
-1158 => %{
description: "create limit maker order failed",
type: :invalid_order
},
-1159 => %{
description: "STOP_LOSS/TAKE_PROFIT order is not allowed to trade immediately",
type: :invalid_order
},
-1160 => %{
description: "Modify futures margin error",
type: :invalid_parameters
},
-1161 => %{
description: "Reduce margin forbidden",
type: :invalid_parameters
},
-2010 => %{
description: "New order rejected.",
type: :invalid_order
},
-2011 => %{
description: "CANCEL_REJECTED",
type: :invalid_parameters
},
-2013 => %{
description: "Order does not exist.",
type: :order_not_found
},
-2014 => %{
description: "API-key format invalid.",
type: :invalid_parameters
},
-2015 => %{
description: "Invalid API-key, IP, or permissions for action.",
type: :invalid_credentials
},
-2016 => %{
description: "No trading window could be found for the symbol. Try ticker/24hrs instead",
type: :exchange_error
},
-30008 => %{
description: "withdraw balance insufficient",
type: :insufficient_balance
},
-30036 => %{
description: "Available balance not enough!",
type: :insufficient_balance
},
-3126 => %{
description: "Order price lower than 72005.93415",
type: :invalid_order
},
-3127 => %{
description: "Order price higher than 1523.192",
type: :invalid_order
},
-4001 => %{
description: "start time must less than end time",
type: :invalid_parameters
},
403 => %{
description: nil,
type: :network_error
},
"Account has insufficient balance for requested action" => %{
description: "Not enough funds to complete the action",
type: :insufficient_balance
},
"BROKER_MAX_ALGO_ORDERS" => %{
description: "Account has too many open stop loss and or take profit orders on the broker.",
type: :invalid_order
},
"BROKER_MAX_NUM_ORDERS" => %{
description: "Account has too many open orders on the broker.",
type: :invalid_order
},
"Cancel order is invalid. Check origClOrdId and orderId" => %{
description: "No origClOrdId or orderId was sent in.",
type: :invalid_order
},
"Duplicate order sent" => %{
description: "The clOrdId is already in use",
type: :invalid_order
},
"ICEBERG_PARTS" => %{
description: "Iceberg order would break into too many parts; icebergQty is too small.",
type: :invalid_parameters
},
"Iceberg orders are not supported for this symbol" => %{
description: "icebergQty is not enabled on the symbol",
type: :invalid_order
},
"IcebergQty exceeds QTY" => %{
description: "icebergQty must be less than the order quantity",
type: :invalid_parameters
},
"LOT_SIZE" => %{
description: "quantity is too high, too low, and or not following the step size rule for the symbol.",
type: :invalid_order
},
"MAX_ALGO_ORDERS" => %{
description: "Account has too many open stop loss and or take profit orders on the symbol.",
type: :invalid_order
},
"MAX_NUM_ORDERS" => %{
description: "Account has too many open orders on the symbol.",
type: :invalid_order
},
"MIN_NOTIONAL" => %{
description: "price* quantity is too low to be a valid order for the symbol.",
type: :invalid_order
},
"Market is closed" => %{
description: "The symbol is not trading",
type: :invalid_order
},
"Market orders are not supported for this symbol" => %{
description: "MARKET is not enabled on the symbol",
type: :invalid_order
},
"Order would immediately match and take" => %{
description: "LIMIT_MAKER order type would immediately match and trade, and not be a pure maker order.",
type: :invalid_order
},
"Order would trigger immediately" => %{
description: "The order’s stop price is not valid when compared to the last traded price.",
type: :invalid_order
},
"PRICE_FILTER" => %{
description: "price is too high, too low, and or not following the tick size rule for the symbol.",
type: :invalid_order
},
"Price* QTY is zero or less" => %{
description: "price* quantity is too low",
type: :invalid_parameters
},
"Stop loss limit orders are not supported for this symbol" => %{
description: "STOP_LOSS_LIMIT is not enabled on the symbol",
type: :invalid_order
},
"Stop loss orders are not supported for this symbol" => %{
description: "STOP_LOSS is not enabled on the symbol",
type: :invalid_order
},
"Take profit limit orders are not supported for this symbol" => %{
description: "TAKE_PROFIT_LIMIT is not enabled on the symbol",
type: :invalid_order
},
"Take profit orders are not supported for this symbol" => %{
description: "TAKE_PROFIT is not enabled on the symbol",
type: :invalid_order
},
"This action disabled is on this account" => %{
description: "Contact customer support; some actions have been disabled on the account.",
type: :access_restricted
},
"Unknown order sent" => %{
description: "The order (by either orderId, clOrdId, origClOrdId) could not be found",
type: :order_not_found
},
"Unsupported order combination" => %{
description: "The orderType, timeInForce, stopPrice, and or icebergQty combination isn’t allowed.",
type: :invalid_order
}
},
error_codes: %{
-1000 => :invalid_parameters,
-100011 => :invalid_order,
-100012 => :invalid_order,
-1001 => :invalid_parameters,
-1002 => :invalid_credentials,
-1003 => :rate_limited,
-1004 => :invalid_order,
-1006 => :exchange_error,
-1007 => :exchange_error,
-1014 => :invalid_order,
-1015 => :rate_limited,
-1016 => :exchange_error,
-1020 => :exchange_error,
-1021 => :invalid_parameters,
-1022 => :invalid_parameters,
-1023 => :invalid_credentials,
-1024 => :invalid_parameters,
-1025 => :invalid_parameters,
-1030 => :exchange_error,
-1100 => :invalid_parameters,
-1101 => :invalid_parameters,
-1102 => :invalid_parameters,
-1103 => :invalid_parameters,
-1104 => :invalid_parameters,
-1105 => :invalid_parameters,
-1106 => :invalid_parameters,
-1111 => :invalid_parameters,
-1112 => :exchange_error,
-1114 => :invalid_parameters,
-1115 => :invalid_order,
-1116 => :invalid_order,
-1117 => :invalid_order,
-1118 => :invalid_order,
-1119 => :invalid_order,
-1120 => :invalid_parameters,
-1121 => :invalid_order,
-1122 => :invalid_order,
-1125 => :invalid_parameters,
-1127 => :invalid_parameters,
-1128 => :invalid_parameters,
-1130 => :invalid_parameters,
-1131 => :insufficient_balance,
-1132 => :invalid_order,
-1133 => :invalid_order,
-1134 => :invalid_order,
-1135 => :invalid_order,
-1136 => :invalid_order,
-1137 => :invalid_order,
-1138 => :invalid_order,
-1139 => :invalid_order,
-1140 => :invalid_order,
-1141 => :invalid_order,
-1142 => :invalid_order,
-1143 => :order_not_found,
-1144 => :invalid_order,
-1145 => :invalid_order,
-1146 => :invalid_order,
-1147 => :invalid_order,
-1148 => :invalid_order,
-1149 => :invalid_order,
-1150 => :invalid_order,
-1151 => :invalid_order,
-1152 => :exchange_error,
-1153 => :invalid_credentials,
-1154 => :invalid_parameters,
-1155 => :invalid_parameters,
-1156 => :invalid_order,
-1157 => :invalid_order,
-1158 => :invalid_order,
-1159 => :invalid_order,
-1160 => :invalid_parameters,
-1161 => :invalid_parameters,
-2010 => :invalid_order,
-2011 => :invalid_parameters,
-2013 => :order_not_found,
-2014 => :invalid_parameters,
-2015 => :invalid_credentials,
-2016 => :exchange_error,
-30008 => :insufficient_balance,
-30036 => :insufficient_balance,
-3126 => :invalid_order,
-3127 => :invalid_order,
-4001 => :invalid_parameters,
403 => :network_error,
"Account has insufficient balance for requested action" => :insufficient_balance,
"BROKER_MAX_ALGO_ORDERS" => :invalid_order,
"BROKER_MAX_NUM_ORDERS" => :invalid_order,
"Cancel order is invalid. Check origClOrdId and orderId" => :invalid_order,
"Duplicate order sent" => :invalid_order,
"ICEBERG_PARTS" => :invalid_parameters,
"Iceberg orders are not supported for this symbol" => :invalid_order,
"IcebergQty exceeds QTY" => :invalid_parameters,
"LOT_SIZE" => :invalid_order,
"MAX_ALGO_ORDERS" => :invalid_order,
"MAX_NUM_ORDERS" => :invalid_order,
"MIN_NOTIONAL" => :invalid_order,
"Market is closed" => :invalid_order,
"Market orders are not supported for this symbol" => :invalid_order,
"Order would immediately match and take" => :invalid_order,
"Order would trigger immediately" => :invalid_order,
"PRICE_FILTER" => :invalid_order,
"Price* QTY is zero or less" => :invalid_parameters,
"Stop loss limit orders are not supported for this symbol" => :invalid_order,
"Stop loss orders are not supported for this symbol" => :invalid_order,
"Take profit limit orders are not supported for this symbol" => :invalid_order,
"Take profit orders are not supported for this symbol" => :invalid_order,
"This action disabled is on this account" => :access_restricted,
"Unknown order sent" => :order_not_found,
"Unsupported order combination" => :invalid_order
},
exceptions: %{
broad: %{
"Account has insufficient balance for requested action" => :insufficient_funds,
"BROKER_MAX_ALGO_ORDERS" => :invalid_order,
"BROKER_MAX_NUM_ORDERS" => :invalid_order,
"Cancel order is invalid. Check origClOrdId and orderId" => :invalid_order,
"Duplicate order sent" => :duplicate_order_id,
"ICEBERG_PARTS" => :bad_request,
"Iceberg orders are not supported for this symbol" => :bad_symbol,
"IcebergQty exceeds QTY" => :bad_request,
"LOT_SIZE" => :invalid_order,
"MAX_ALGO_ORDERS" => :invalid_order,
"MAX_NUM_ORDERS" => :invalid_order,
"MIN_NOTIONAL" => :invalid_order,
"Market is closed" => :bad_symbol,
"Market orders are not supported for this symbol" => :bad_symbol,
"Order would immediately match and take" => :order_immediately_fillable,
"Order would trigger immediately" => :invalid_order,
"PRICE_FILTER" => :invalid_order,
"Price* QTY is zero or less" => :bad_request,
"Stop loss limit orders are not supported for this symbol" => :bad_symbol,
"Stop loss orders are not supported for this symbol" => :bad_symbol,
"Take profit limit orders are not supported for this symbol" => :bad_symbol,
"Take profit orders are not supported for this symbol" => :bad_symbol,
"This action disabled is on this account" => :permission_denied,
"Unknown order sent" => :order_not_found,
"Unsupported order combination" => :invalid_order
},
exact: %{
"-1000" => :bad_request,
"-100011" => :bad_symbol,
"-100012" => :bad_symbol,
"-1001" => :bad_request,
"-1002" => :authentication_error,
"-1003" => :rate_limit_exceeded,
"-1004" => :invalid_order,
"-1006" => :bad_response,
"-1007" => :bad_response,
"-1014" => :invalid_order,
"-1015" => :rate_limit_exceeded,
"-1016" => :not_supported,
"-1020" => :not_supported,
"-1021" => :bad_request,
"-1022" => :bad_request,
"-1023" => :authentication_error,
"-1024" => :bad_request,
"-1025" => :bad_request,
"-1030" => :exchange_error,
"-1100" => :bad_request,
"-1101" => :bad_request,
"-1102" => :bad_request,
"-1103" => :bad_request,
"-1104" => :bad_request,
"-1105" => :bad_request,
"-1106" => :bad_request,
"-1111" => :bad_request,
"-1112" => :bad_response,
"-1114" => :bad_request,
"-1115" => :invalid_order,
"-1116" => :invalid_order,
"-1117" => :invalid_order,
"-1118" => :invalid_order,
"-1119" => :invalid_order,
"-1120" => :bad_request,
"-1121" => :bad_symbol,
"-1122" => :invalid_order,
"-1125" => :bad_request,
"-1127" => :bad_request,
"-1128" => :bad_request,
"-1130" => :bad_request,
"-1131" => :insufficient_funds,
"-1132" => :invalid_order,
"-1133" => :invalid_order,
"-1134" => :invalid_order,
"-1135" => :invalid_order,
"-1136" => :invalid_order,
"-1137" => :invalid_order,
"-1138" => :invalid_order,
"-1139" => :invalid_order,
"-1140" => :invalid_order,
"-1141" => :duplicate_order_id,
"-1142" => :invalid_order,
"-1143" => :order_not_found,
"-1144" => :invalid_order,
"-1145" => :invalid_order,
"-1146" => :invalid_order,
"-1147" => :invalid_order,
"-1148" => :invalid_order,
"-1149" => :invalid_order,
"-1150" => :invalid_order,
"-1151" => :bad_symbol,
"-1152" => :not_supported,
"-1153" => :authentication_error,
"-1154" => :bad_request,
"-1155" => :bad_request,
"-1156" => :invalid_order,
"-1157" => :bad_symbol,
"-1158" => :invalid_order,
"-1159" => :invalid_order,
"-1160" => :bad_request,
"-1161" => :bad_request,
"-2010" => :invalid_order,
"-2011" => :bad_request,
"-2013" => :order_not_found,
"-2014" => :bad_request,
"-2015" => :authentication_error,
"-2016" => :bad_response,
"-30008" => :insufficient_funds,
"-30036" => :insufficient_funds,
"-3126" => :invalid_order,
"-3127" => :invalid_order,
"-4001" => :bad_request,
"403" => :exchange_not_available
}
},
exchange_options: %{
"createMarketBuyOrderRequiresPrice" => true,
"createOrder" => %{
"newOrderRespType" => %{
"limit" => "FULL",
"market" => "FULL"
},
"timeInForce" => "GTC"
},
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"deposit" => %{
"warning" => false
},
"fetchTicker" => %{
"method" => "publicGetOpenapiQuoteV1Ticker24hr"
},
"fetchTickers" => %{
"method" => "publicGetOpenapiQuoteV1Ticker24hr"
},
"networks" => %{
"ARB" => "ARBITRUM",
"BEP20" => "BSC",
"ERC20" => "ETH",
"TRC20" => "TRX"
},
"networksById" => %{
"ARBITRUM" => "ARB",
"BSC" => "BEP20",
"ETH" => "ERC20",
"TRX" => "TRC20"
},
"withdraw" => %{
"warning" => false
}
},
extended_metadata: %{
fees_url: "https://support.coins.ph/hc/en-us/sections/4407198694681-Limits-Fees",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/225719995-48ab2026-4ddb-496c-9da7-0d7566617c9b.jpg"
},
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: true,
market_buy_requires_price: false,
self_trade_prevention: true,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: true,
gtd: false,
ioc: true,
po: false
},
trailing: false,
trigger_direction: false,
trigger_price: true
},
fetch_closed_orders: %{
days_back: 100000,
days_back_canceled: 1,
limit: 1000,
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false,
until_days: 100000
},
fetch_currencies: %{
private: true
},
fetch_my_trades: %{
days_back: 100000,
limit: 1000,
margin_mode: false,
symbol_required: true,
until_days: 100000
},
fetch_ohlcv: %{
limit: 1000
},
fetch_open_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
fee_side: "get",
maker: 0.0025,
percentage: true,
taker: 0.003,
tier_based: true,
tiers: %{
maker: [
%{
fee: 0.0025,
volume: 0
},
%{
fee: 0.0022,
volume: 500000
},
%{
fee: 0.0018,
volume: 1000000
},
%{
fee: 0.0015,
volume: 2500000
},
%{
fee: 0.0012,
volume: 5000000
},
%{
fee: 0.001,
volume: 10000000
},
%{
fee: 0.0008,
volume: 100000000
},
%{
fee: 0.0007,
volume: 500000000
},
%{
fee: 0.0006,
volume: 1000000000
},
%{
fee: 0.0005,
volume: 2500000000
}
],
taker: [
%{
fee: 0.003,
volume: 0
},
%{
fee: 0.0027,
volume: 500000
},
%{
fee: 0.0024,
volume: 1000000
},
%{
fee: 0.002,
volume: 2500000
},
%{
fee: 0.0018,
volume: 5000000
},
%{
fee: 0.0015,
volume: 10000000
},
%{
fee: 0.0012,
volume: 100000000
},
%{
fee: 0.0009,
volume: 500000000
},
%{
fee: 0.0007,
volume: 1000000000
},
%{
fee: 0.0005,
volume: 2500000000
}
]
}
}
},
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 const responseCode = this.safeString(response, 'code', undefined);\n if ((responseCode !== undefined) && (responseCode !== '200') && (responseCode !== '0')) {\n const feedback = this.id + ' ' + body;\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], responseCode, feedback);\n throw new errors.ExchangeError(feedback);\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: 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: true,
create_market_buy_order_with_cost_ws: false,
create_market_buy_order_ws: false,
create_market_order: true,
create_market_order_with_cost: false,
create_market_order_with_cost_ws: false,
create_market_order_ws: true,
create_market_sell_order: false,
create_market_sell_order_with_cost: false,
create_market_sell_order_with_cost_ws: false,
create_market_sell_order_ws: false,
create_order: true,
create_order_with_take_profit_and_stop_loss: false,
create_order_with_take_profit_and_stop_loss_ws: false,
create_order_ws: false,
create_orders: false,
create_post_only_order: false,
create_post_only_order_ws: false,
create_reduce_only_order: false,
create_reduce_only_order_ws: false,
create_stop_limit_order: true,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: true,
create_stop_market_order_ws: false,
create_stop_order: true,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: true,
edit_order: false,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: 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: true,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: false,
fetch_deposit_withdraw_fees: false,
fetch_deposits: true,
fetch_deposits_withdrawals: 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_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: true,
fetch_my_trades_ws: false,
fetch_ohlcv: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: true,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: true,
fetch_order_with_client_order_id: false,
fetch_order_ws: false,
fetch_orders: false,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: false,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: 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: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: true,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
repay_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: false,
watch_ohlcv_for_symbols: false,
watch_order_book: false,
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: false,
watch_tickers: false,
watch_trades: false,
watch_trades_for_symbols: false,
withdraw: true,
ws: false
},
http_config: nil,
id: "coinsph",
markets: nil,
name: "Coins.ph",
ohlcv_timestamp_resolution: :milliseconds,
options: %{
:create_market_buy_order_requires_price => true,
:create_order => %{
"newOrderRespType" => %{
"limit" => "FULL",
"market" => "FULL"
},
"timeInForce" => "GTC"
},
"deposit" => %{
"warning" => false
},
"fetch_ticker" => %{
"method" => "publicGetOpenapiQuoteV1Ticker24hr"
},
"fetch_tickers" => %{
"method" => "publicGetOpenapiQuoteV1Ticker24hr"
},
:networks => %{
"ARB" => "ARBITRUM",
"BEP20" => "BSC",
"ERC20" => "ETH",
"TRC20" => "TRX"
},
:withdraw => %{
"warning" => false
}
},
order_mappings: %{
side_format: :uppercase,
side_key: "side",
type_format: :uppercase,
type_key: "type"
},
param_mappings: %{
"amount" => "quantity",
"code" => "coin",
"cost" => "quoteOrderQty",
"id" => "orderId",
"since" => "startTime",
"timeframe" => "interval"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 2201,
"line_start" => 2195,
"mappings" => [],
"name" => "parseArrayParam",
"signature" => "parseArrayParam (array, key)",
"source" => "parseArrayParam (array, key) {\n let stringifiedArray = this.json (array);\n stringifiedArray = stringifiedArray.replace ('[', '%5B');\n stringifiedArray = stringifiedArray.replace (']', '%5D');\n const urlEncodedParam = key + '=' + stringifiedArray;\n return urlEncodedParam;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1362,
"line_start" => 1345,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "response"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const balances = this.safeList (response, 'balances', []);\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n for (let i = 0; i < balances.length; i++) {\n const balance = balances[i];\n const currencyId = this.safeString (balance, 'asset');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['free'] = this.safeString (balance, 'free');\n account['used'] = this.safeString (balance, 'locked');\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"coin\": \"ETH\",\n \"address\": \"0xfe98628173830bf79c59f04585ce41f7de168784\",\n \"addressTag\": \"\"\n }"
],
"line_end" => 2170,
"line_start" => 2153,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "depositAddress"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "parsedCurrency"
},
%{
"comment" => nil,
"key" => "network",
"value" => "null"
},
%{
"comment" => nil,
"key" => "address",
"value" => "this.safeString (depositAddress, 'address')"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "this.safeString (depositAddress, 'addressTag')"
}
],
"name" => "parseDepositAddress",
"signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
"source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n //\n // {\n // \"coin\": \"ETH\",\n // \"address\": \"0xfe98628173830bf79c59f04585ce41f7de168784\",\n // \"addressTag\": \"\"\n // }\n //\n const currencyId = this.safeString (depositAddress, 'coin');\n const parsedCurrency = this.safeCurrencyCode (currencyId, currency);\n return {\n 'info': depositAddress,\n 'currency': parsedCurrency,\n 'network': null,\n 'address': this.safeString (depositAddress, 'address'),\n 'tag': this.safeString (depositAddress, 'addressTag'),\n } as DepositAddress;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1126,
"line_start" => 1117,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n return [\n this.safeInteger (ohlcv, 0),\n this.safeNumber (ohlcv, 1),\n this.safeNumber (ohlcv, 2),\n this.safeNumber (ohlcv, 3),\n this.safeNumber (ohlcv, 4),\n this.safeNumber (ohlcv, 5),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"symbol\": \"ETHUSDT\",\n \"orderId\": 1375445991893797391,\n \"clientOrderId\": \"1375445991893799115\",\n \"transactTime\": 1678701939513,\n \"price\": \"0\",\n \"origQty\": \"0\",\n \"executedQty\": \"0.001899\",\n \"cummulativeQuoteQty\": \"2.99948949\",\n \"status\": \"FILLED\",\n \"timeInForce\": \"GTC\",\n \"type\": \"MARKET\",\n \"side\": \"BUY\",\n \"stopPrice\": \"0\",\n \"origQuoteOrderQty\": \"3\",\n \"fills\": [\n {\n \"price\": \"1579.51\",\n \"qty\": \"0.001899\",\n \"commission\": \"0\",\n \"commissionAsset\": \"ETH\",\n \"tradeId\":1375445992035598337\n }\n ]\n }",
"{\n \"symbol\": \"DOGEPHP\",\n \"orderId\":1375465375097982423,\n \"clientOrderId\": \"1375465375098001241\",\n \"price\": \"0\",\n \"origQty\": \"0\",\n \"executedQty\": \"13\",\n \"cummulativeQuoteQty\": \"49.621\",\n \"status\": \"FILLED\",\n \"timeInForce\": \"GTC\",\n \"type\": \"MARKET\",\n \"side\": \"BUY\",\n \"stopPrice\": \"0\",\n \"time\":1678704250171,\n \"updateTime\":1678704250256,\n \"isWorking\":false,\n \"origQuoteOrderQty\": \"50\"\n }",
"{\n \"symbol\": \"ETHPHP\",\n \"orderId\":1375609441915774332,\n \"clientOrderId\": \"1375609441915899557\",\n \"price\": \"96000\",\n \"origQty\": \"0.001\",\n \"executedQty\": \"0\",\n \"cummulativeQuoteQty\": \"0\",\n \"status\": \"CANCELED\",\n \"timeInForce\": \"GTC\",\n \"type\": \"LIMIT\",\n \"side\": \"SELL\",\n \"stopPrice\": \"0\",\n \"origQuoteOrderQty\": \"0\"\n }"
],
"line_end" => 1707,
"line_start" => 1606,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "this.safeString (order, 'clientOrderId')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseOrderStatus (this.safeString (order, 'status'))"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.parseOrderType (this.safeString (order, 'type'))"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "this.parseOrderTimeInForce (this.safeString (order, 'timeInForce'))"
},
%{
"comment" => nil,
"key" => "side",
"value" => "this.parseOrderSide (this.safeString (order, 'side'))"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.safeString (order, 'price')"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "triggerPrice"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeString (order, 'origQty')"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeString (order, 'cummulativeQuoteQty')"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "this.safeString (order, 'executedQty')"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fees",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "trades"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder POST /openapi/v1/order\n // {\n // \"symbol\": \"ETHUSDT\",\n // \"orderId\": 1375445991893797391,\n // \"clientOrderId\": \"1375445991893799115\",\n // \"transactTime\": 1678701939513,\n // \"price\": \"0\",\n // \"origQty\": \"0\",\n // \"executedQty\": \"0.001899\",\n // \"cummulativeQuoteQty\": \"2.99948949\",\n // \"status\": \"FILLED\",\n // \"timeInForce\": \"GTC\",\n // \"type\": \"MARKET\",\n // \"side\": \"BUY\",\n // \"stopPrice\": \"0\",\n // \"origQuoteOrderQty\": \"3\",\n // \"fills\": [\n // {\n // \"price\": \"1579.51\",\n // \"qty\": \"0.001899\",\n // \"commission\": \"0\",\n // \"commissionAsset\": \"ETH\",\n // \"tradeId\":1375445992035598337\n // }\n // ]\n // }\n //\n // fetchOrder GET /openapi/v1/order\n // fetchOpenOrders GET /openapi/v1/openOrders\n // fetchClosedOrders GET /openapi/v1/historyOrders\n // cancelAllOrders DELETE /openapi/v1/openOrders\n // {\n // \"symbol\": \"DOGEPHP\",\n // \"orderId\":1375465375097982423,\n // \"clientOrderId\": \"1375465375098001241\",\n // \"price\": \"0\",\n // \"origQty\": \"0\",\n // \"executedQty\": \"13\",\n // \"cummulativeQuoteQty\": \"49.621\",\n // \"status\": \"FILLED\",\n // \"timeInForce\": \"GTC\",\n // \"type\": \"MARKET\",\n // \"side\": \"BUY\",\n // \"stopPrice\": \"0\",\n // \"time\":1678704250171,\n // \"updateTime\":1678704250256,\n // \"isWorking\":false,\n // \"origQuoteOrderQty\": \"50\"\n // }\n //\n // cancelOrder DELETE /openapi/v1/order\n // {\n // \"symbol\": \"ETHPHP\",\n // \"orderId\":1375609441915774332,\n // \"clientOrderId\": \"1375609441915899557\",\n // \"price\": \"96000\",\n // \"origQty\": \"0.001\",\n // \"executedQty\": \"0\",\n // \"cummulativeQuoteQty\": \"0\",\n // \"status\": \"CANCELED\",\n // \"timeInForce\": \"GTC\",\n // \"type\": \"LIMIT\",\n // \"side\": \"SELL\",\n // \"stopPrice\": \"0\",\n // \"origQuoteOrderQty\": \"0\"\n // }\n //\n const id = this.safeString (order, 'orderId');\n const marketId = this.safeString (order, 'symbol');\n market = this.safeMarket (marketId, market);\n const timestamp = this.safeInteger2 (order, 'time', 'transactTime');\n const trades = this.safeValue (order, 'fills', undefined);\n let triggerPrice = this.safeString (order, 'stopPrice');\n if (Precise.stringEq (triggerPrice, '0')) {\n triggerPrice = undefined;\n }\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': this.safeString (order, 'clientOrderId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'status': this.parseOrderStatus (this.safeString (order, 'status')),\n 'symbol': market['symbol'],\n 'type': this.parseOrderType (this.safeString (order, 'type')),\n 'timeInForce': this.parseOrderTimeInForce (this.safeString (order, 'timeInForce')),\n 'side': this.parseOrderSide (this.safeString (order, 'side')),\n 'price': this.safeString (order, 'price'),\n 'triggerPrice': triggerPrice,\n 'average': undefined,\n 'amount': this.safeString (order, 'origQty'),\n 'cost': this.safeString (order, 'cummulativeQuoteQty'),\n 'filled': this.safeString (order, 'executedQty'),\n 'remaining': undefined,\n 'fee': undefined,\n 'fees': undefined,\n 'trades': trades,\n 'info': order,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1715,
"line_start" => 1709,
"mappings" => [],
"name" => "parseOrderSide",
"signature" => "parseOrderSide (status)",
"source" => "parseOrderSide (status) {\n const statuses: Dict = {\n 'BUY': 'buy',\n 'SELL': 'sell',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1761,
"line_start" => 1751,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'NEW': 'open',\n 'FILLED': 'closed',\n 'CANCELED': 'canceled',\n 'PARTIALLY_FILLED': 'open',\n 'PARTIALLY_CANCELED': 'canceled',\n 'REJECTED': 'rejected',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1770,
"line_start" => 1763,
"mappings" => [],
"name" => "parseOrderTimeInForce",
"signature" => "parseOrderTimeInForce (status)",
"source" => "parseOrderTimeInForce (status) {\n const statuses: Dict = {\n 'GTC': 'GTC',\n 'FOK': 'FOK',\n 'IOC': 'IOC',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1736,
"line_start" => 1725,
"mappings" => [],
"name" => "parseOrderType",
"signature" => "parseOrderType (status)",
"source" => "parseOrderType (status) {\n const statuses: Dict = {\n 'MARKET': 'market',\n 'LIMIT': 'limit',\n 'LIMIT_MAKER': 'limit',\n 'STOP_LOSS': 'market',\n 'STOP_LOSS_LIMIT': 'limit',\n 'TAKE_PROFIT': 'market',\n 'TAKE_PROFIT_LIMIT': 'limit',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"symbol\": \"ETHUSDT\",\n \"priceChange\": \"41.440000000000000000\",\n \"priceChangePercent\": \"0.0259\",\n \"weightedAvgPrice\": \"1631.169825783972125436\",\n \"prevClosePrice\": \"1601.520000000000000000\",\n \"lastPrice\": \"1642.96\",\n \"lastQty\": \"0.000001000000000000\",\n \"bidPrice\": \"1638.790000000000000000\",\n \"bidQty\": \"0.280075000000000000\",\n \"askPrice\": \"1647.340000000000000000\",\n \"askQty\": \"0.165183000000000000\",\n \"openPrice\": \"1601.52\",\n \"highPrice\": \"1648.28\",\n \"lowPrice\": \"1601.52\",\n \"volume\": \"0.000287\",\n \"quoteVolume\": \"0.46814574\",\n \"openTime\": \"1677417000000\",\n \"closeTime\": \"1677503415200\",\n \"firstId\": \"1364680572697591809\",\n \"lastId\": \"1365389809203560449\",\n \"count\": \"100\"\n }",
"{ \"symbol\": \"ETHUSDT\", \"price\": \"1599.68\" }",
"{\n \"symbol\": \"ETHUSDT\",\n \"bidPrice\": \"1596.57\",\n \"bidQty\": \"0.246405\",\n \"askPrice\": \"1605.12\",\n \"askQty\": \"0.242681\"\n }"
],
"line_end" => 1012,
"line_start" => 935,
"mappings" => [
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "open",
"value" => "open"
},
%{
"comment" => nil,
"key" => "high",
"value" => "high"
},
%{
"comment" => nil,
"key" => "low",
"value" => "low"
},
%{
"comment" => nil,
"key" => "close",
"value" => "this.safeString2 (ticker, 'lastPrice', 'price')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "bid"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "bidVolume"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "ask"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "askVolume"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "vwap"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "prevClose"
},
%{
"comment" => nil,
"key" => "change",
"value" => "changeValue"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "changePcnt"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "baseVolume"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "quoteVolume"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // publicGetOpenapiQuoteV1Ticker24hr\n // {\n // \"symbol\": \"ETHUSDT\",\n // \"priceChange\": \"41.440000000000000000\",\n // \"priceChangePercent\": \"0.0259\",\n // \"weightedAvgPrice\": \"1631.169825783972125436\",\n // \"prevClosePrice\": \"1601.520000000000000000\",\n // \"lastPrice\": \"1642.96\",\n // \"lastQty\": \"0.000001000000000000\",\n // \"bidPrice\": \"1638.790000000000000000\",\n // \"bidQty\": \"0.280075000000000000\",\n // \"askPrice\": \"1647.340000000000000000\",\n // \"askQty\": \"0.165183000000000000\",\n // \"openPrice\": \"1601.52\",\n // \"highPrice\": \"1648.28\",\n // \"lowPrice\": \"1601.52\",\n // \"volume\": \"0.000287\",\n // \"quoteVolume\": \"0.46814574\",\n // \"openTime\": \"1677417000000\",\n // \"closeTime\": \"1677503415200\",\n // \"firstId\": \"1364680572697591809\",\n // \"lastId\": \"1365389809203560449\",\n // \"count\": \"100\"\n // }\n //\n // publicGetOpenapiQuoteV1TickerPrice\n // { \"symbol\": \"ETHUSDT\", \"price\": \"1599.68\" }\n //\n // publicGetOpenapiQuoteV1TickerBookTicker\n // {\n // \"symbol\": \"ETHUSDT\",\n // \"bidPrice\": \"1596.57\",\n // \"bidQty\": \"0.246405\",\n // \"askPrice\": \"1605.12\",\n // \"askQty\": \"0.242681\"\n // }\n //\n const marketId = this.safeString (ticker, 'symbol');\n market = this.safeMarket (marketId, market);\n const timestamp = this.safeInteger (ticker, 'closeTime');\n const bid = this.safeString (ticker, 'bidPrice');\n const ask = this.safeString (ticker, 'askPrice');\n const bidVolume = this.safeString (ticker, 'bidQty');\n const askVolume = this.safeString (ticker, 'askQty');\n const baseVolume = this.safeString (ticker, 'volume');\n const quoteVolume = this.safeString (ticker, 'quoteVolume');\n const open = this.safeString (ticker, 'openPrice');\n const high = this.safeString (ticker, 'highPrice');\n const low = this.safeString (ticker, 'lowPrice');\n const prevClose = this.safeString (ticker, 'prevClosePrice');\n const vwap = this.safeString (ticker, 'weightedAvgPrice');\n const changeValue = this.safeString (ticker, 'priceChange');\n let changePcnt = this.safeString (ticker, 'priceChangePercent');\n changePcnt = Precise.stringMul (changePcnt, '100');\n return this.safeTicker ({\n 'symbol': market['symbol'],\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'open': open,\n 'high': high,\n 'low': low,\n 'close': this.safeString2 (ticker, 'lastPrice', 'price'),\n 'bid': bid,\n 'bidVolume': bidVolume,\n 'ask': ask,\n 'askVolume': askVolume,\n 'vwap': vwap,\n 'previousClose': prevClose,\n 'change': changeValue,\n 'percentage': changePcnt,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"price\": \"89685.8\",\n \"id\": \"1365561108437680129\",\n \"qty\": \"0.000004\",\n \"quoteQty\": \"0.000004000000000000\", // warning: report to exchange - this is not quote quantity, this is base quantity\n \"time\": \"1677523569575\",\n \"isBuyerMaker\": false,\n \"isBestMatch\": true\n },",
"{\n \"symbol\": \"ETHUSDT\",\n \"id\": 1375426310524125185,\n \"orderId\": 1375426310415879614,\n \"price\": \"1580.91\",\n \"qty\": \"0.01\",\n \"quoteQty\": \"15.8091\",\n \"commission\": \"0\",\n \"commissionAsset\": \"USDT\",\n \"time\": 1678699593307,\n \"isBuyer\": false,\n \"isMaker\":false,\n \"isBestMatch\":false\n }",
"{\n \"price\": \"1579.51\",\n \"qty\": \"0.001899\",\n \"commission\": \"0\",\n \"commissionAsset\": \"ETH\",\n \"tradeId\":1375445992035598337\n }"
],
"line_end" => 1308,
"line_start" => 1223,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "takerOrMaker"
},
%{
"comment" => nil,
"key" => "price",
"value" => "priceString"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amountString"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "costString"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "feeCost"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "this.safeCurrencyCode (feeCurrencyId)"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades\n // {\n // \"price\": \"89685.8\",\n // \"id\": \"1365561108437680129\",\n // \"qty\": \"0.000004\",\n // \"quoteQty\": \"0.000004000000000000\", // warning: report to exchange - this is not quote quantity, this is base quantity\n // \"time\": \"1677523569575\",\n // \"isBuyerMaker\": false,\n // \"isBestMatch\": true\n // },\n //\n // fetchMyTrades\n // {\n // \"symbol\": \"ETHUSDT\",\n // \"id\": 1375426310524125185,\n // \"orderId\": 1375426310415879614,\n // \"price\": \"1580.91\",\n // \"qty\": \"0.01\",\n // \"quoteQty\": \"15.8091\",\n // \"commission\": \"0\",\n // \"commissionAsset\": \"USDT\",\n // \"time\": 1678699593307,\n // \"isBuyer\": false,\n // \"isMaker\":false,\n // \"isBestMatch\":false\n // }\n //\n // createOrder\n // {\n // \"price\": \"1579.51\",\n // \"qty\": \"0.001899\",\n // \"commission\": \"0\",\n // \"commissionAsset\": \"ETH\",\n // \"tradeId\":1375445992035598337\n // }\n //\n const marketId = this.safeString (trade, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const id = this.safeString2 (trade, 'id', 'tradeId');\n const orderId = this.safeString (trade, 'orderId');\n const timestamp = this.safeInteger (trade, 'time');\n const priceString = this.safeString (trade, 'price');\n const amountString = this.safeString (trade, 'qty');\n const type = undefined;\n let fee = undefined;\n const feeCost = this.safeString (trade, 'commission');\n if (feeCost !== undefined) {\n const feeCurrencyId = this.safeString (trade, 'commissionAsset');\n fee = {\n 'cost': feeCost,\n 'currency': this.safeCurrencyCode (feeCurrencyId),\n };\n }\n const isBuyer = this.safeBool2 (trade, 'isBuyer', 'isBuyerMaker', undefined);\n let side = undefined;\n if (isBuyer !== undefined) {\n side = (isBuyer === true) ? 'buy' : 'sell';\n }\n const isMaker = this.safeString2 (trade, 'isMaker', undefined);\n let takerOrMaker = undefined;\n if (isMaker !== undefined) {\n takerOrMaker = (isMaker === 'true') ? 'maker' : 'taker';\n }\n let costString = undefined;\n if (orderId !== undefined) {\n costString = this.safeString (trade, 'quoteQty');\n }\n return this.safeTrade ({\n 'id': id,\n 'order': orderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'type': type,\n 'side': side,\n 'takerOrMaker': takerOrMaker,\n 'price': priceString,\n 'amount': amountString,\n 'cost': costString,\n 'fee': fee,\n 'info': trade,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"symbol\": \"ETHUSDT\",\n \"makerCommission\": \"0.0025\",\n \"takerCommission\": \"0.003\"\n }"
],
"line_end" => 1854,
"line_start" => 1835,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "maker",
"value" => "this.safeNumber (fee, 'makerCommission')"
},
%{
"comment" => nil,
"key" => "taker",
"value" => "this.safeNumber (fee, 'takerCommission')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tierBased",
"value" => "undefined"
}
],
"name" => "parseTradingFee",
"signature" => "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface",
"source" => "parseTradingFee (fee: Dict, market: Market = undefined): TradingFeeInterface {\n //\n // {\n // \"symbol\": \"ETHUSDT\",\n // \"makerCommission\": \"0.0025\",\n // \"takerCommission\": \"0.003\"\n // }\n //\n const marketId = this.safeString (fee, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n return {\n 'info': fee,\n 'symbol': symbol,\n 'maker': this.safeNumber (fee, 'makerCommission'),\n 'taker': this.safeNumber (fee, 'takerCommission'),\n 'percentage': undefined,\n 'tierBased': undefined,\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"coin\": \"PHP\",\n \"address\": \"Internal Transfer\",\n \"addressTag\": \"Internal Transfer\",\n \"amount\": \"0.02\",\n \"id\": \"31312321312312312312322\",\n \"network\": \"Internal\",\n \"transferType\": \"0\",\n \"status\": 3,\n \"confirmTimes\": \"\",\n \"unlockConfirm\": \"\",\n \"txId\": \"Internal Transfer\",\n \"insertTime\": 1657623798000,\n \"depositOrderId\": \"the deposit id which created by client\"\n }",
"{\n \"coin\": \"BTC\",\n \"address\": \"Internal Transfer\",\n \"amount\": \"0.1\",\n \"id\": \"1201515362324421632\",\n \"withdrawOrderId\": null,\n \"network\": \"Internal\",\n \"transferType\": \"0\",\n \"status\": 0,\n \"transactionFee\": \"0\",\n \"confirmNo\": 0,\n \"info\": \"{}\",\n \"txId\": \"Internal Transfer\",\n \"applyTime\": 1657967792000\n }"
],
"line_end" => 2107,
"line_start" => 2017,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "txid"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "network",
"value" => "network"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "tag"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "tag"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "updated"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "internal"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n // {\n // \"coin\": \"PHP\",\n // \"address\": \"Internal Transfer\",\n // \"addressTag\": \"Internal Transfer\",\n // \"amount\": \"0.02\",\n // \"id\": \"31312321312312312312322\",\n // \"network\": \"Internal\",\n // \"transferType\": \"0\",\n // \"status\": 3,\n // \"confirmTimes\": \"\",\n // \"unlockConfirm\": \"\",\n // \"txId\": \"Internal Transfer\",\n // \"insertTime\": 1657623798000,\n // \"depositOrderId\": \"the deposit id which created by client\"\n // }\n //\n // fetchWithdrawals\n // {\n // \"coin\": \"BTC\",\n // \"address\": \"Internal Transfer\",\n // \"amount\": \"0.1\",\n // \"id\": \"1201515362324421632\",\n // \"withdrawOrderId\": null,\n // \"network\": \"Internal\",\n // \"transferType\": \"0\",\n // \"status\": 0,\n // \"transactionFee\": \"0\",\n // \"confirmNo\": 0,\n // \"info\": \"{}\",\n // \"txId\": \"Internal Transfer\",\n // \"applyTime\": 1657967792000\n // }\n //\n // todo: this is in progress\n const id = this.safeString (transaction, 'id');\n const address = this.safeString (transaction, 'address');\n let tag = this.safeString (transaction, 'addressTag');\n if (tag !== undefined) {\n if (tag.length < 1) {\n tag = undefined;\n }\n }\n const txid = this.safeString (transaction, 'txId');\n const currencyId = this.safeString (transaction, 'coin');\n const code = this.safeCurrencyCode (currencyId, currency);\n let timestamp = undefined;\n timestamp = this.safeInteger2 (transaction, 'insertTime', 'applyTime');\n const updated = undefined;\n let type = undefined;\n const withdrawOrderId = this.safeString (transaction, 'withdrawOrderId');\n const depositOrderId = this.safeString (transaction, 'depositOrderId');\n if (withdrawOrderId !== undefined) {\n type = 'withdrawal';\n } else if (depositOrderId !== undefined) {\n type = 'deposit';\n }\n const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n const amount = this.safeNumber (transaction, 'amount');\n const feeCost = this.safeNumber (transaction, 'transactionFee');\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = { 'currency': code, 'cost': feeCost };\n }\n const network = this.safeString (transaction, 'network');\n const internal = network === 'Internal';\n return {\n 'info': transaction,\n 'id': id,\n 'txid': txid,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': network,\n 'address': address,\n 'addressTo': address,\n 'addressFrom': undefined,\n 'tag': tag,\n 'tagTo': tag,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': amount,\n 'currency': code,\n 'status': status,\n 'updated': updated,\n 'internal': internal,\n 'comment': undefined,\n 'fee': fee,\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 2117,
"line_start" => 2109,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n '0': 'pending',\n '1': 'ok',\n '2': 'failed',\n '3': 'pending',\n };\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 50,
period: 1000,
requests: 20,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 1,
method: :get,
path: "/merchant-api/v1/get-invoices"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/account/v3/crypto-accounts"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/transfer/v3/transfers/{id}"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/account"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/api-keys"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/asset/tradeFee"
},
%{
auth: false,
cost: 20,
method: :get,
path: "/openapi/v1/asset/transaction/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/capital/deposit/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/capital/withdraw/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/check-sys-status"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/fund-collect/get-fund-record"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/historyOrders"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/myTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/openOrders"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/openapi/v1/order"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/sub-account/apikey/ip-restriction"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/sub-account/asset"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/sub-account/list"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/sub-account/transfer/sub-history"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/sub-account/transfer/universal-transfer-history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/sub-account/wallet/deposit/address"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/sub-account/wallet/deposit/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v3/payment-request/get-payment-request"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/wallet/v1/config/getall"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/wallet/v1/deposit/address"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/wallet/v1/deposit/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/wallet/v1/withdraw/address-whitelist"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/wallet/v1/withdraw/history"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/merchant-api/v1/invoices"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/merchant-api/v1/invoices-cancel"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/convert/v1/accpet-quote"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/convert/v1/get-quote"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/convert/v1/get-supported-trading-pairs"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/convert/v1/query-order-history"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/fiat/v1/cash-out"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/fiat/v1/history"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/fiat/v1/support-channel"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/migration/v4/sellorder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/migration/v4/validate-field"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/transfer/v3/transfers"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v1/capital/deposit/apply"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v1/capital/withdraw/apply"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v1/fund-collect/collect-from-sub-account"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v1/order"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v1/order/test"
},
%{
auth: false,
cost: 30,
method: :post,
path: "/openapi/v1/sub-account/apikey/add-ip-restriction"
},
%{
auth: false,
cost: 30,
method: :post,
path: "/openapi/v1/sub-account/apikey/delete-ip-restriction"
},
%{
auth: false,
cost: 30,
method: :post,
path: "/openapi/v1/sub-account/create"
},
%{
auth: false,
cost: 100,
method: :post,
path: "/openapi/v1/sub-account/transfer/sub-to-master"
},
%{
auth: false,
cost: 100,
method: :post,
path: "/openapi/v1/sub-account/transfer/universal-transfer"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v1/userDataStream"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v3/payment-request/delete-payment-request"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v3/payment-request/payment-request-reminder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/openapi/v3/payment-request/payment-requests"
},
%{
auth: false,
cost: 600,
method: :post,
path: "/openapi/wallet/v1/withdraw/apply"
},
%{
auth: false,
cost: 1,
method: :put,
path: "/openapi/v1/userDataStream"
},
%{
auth: false,
cost: 1,
method: :delete,
path: "/openapi/v1/openOrders"
},
%{
auth: false,
cost: 1,
method: :delete,
path: "/openapi/v1/order"
},
%{
auth: false,
cost: 1,
method: :delete,
path: "/openapi/v1/userDataStream"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/avgPrice"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/depth"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/klines"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/ticker/24hr"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/ticker/bookTicker"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/ticker/price"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/quote/v1/trades"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/openapi/v1/exchangeInfo"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/pairs"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/ping"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/time"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openapi/v1/user/ip"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
api_key_header: "X-COINS-APIKEY",
confidence: :medium,
pattern: :hmac_sha256_query,
recv_window: 5000,
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" => 99999999999,
"min" => 1.0e-7
},
"cost" => %{
"min" => 1
},
"price" => %{
"max" => 99999999999,
"min" => 0.01
}
},
sample_precision: %{
"amount" => 1.0e-7,
"price" => 0.01
},
spot: %{
base: "BTC",
base_id: "BTC",
case: :upper,
contract: false,
id: "BTCUSDC",
limits: %{
"amount" => %{
"max" => 99999999999,
"min" => 1.0e-7
},
"cost" => %{
"min" => 1
},
"leverage" => %{},
"price" => %{
"max" => 99999999999,
"min" => 0.01
}
},
precision: %{
"amount" => 1.0e-7,
"price" => 0.01
},
quote: "USDC",
quote_id: "USDC",
separator: "",
symbol: "BTC/USDC"
}
},
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",
"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.pro.coins.ph",
api_sections: %{
"private" => "https://api.pro.coins.ph",
"public" => "https://api.pro.coins.ph"
},
doc: [
"https://coins-docs.github.io/rest-api"
],
other: nil,
sandbox: nil,
www: "https://coins.ph/"
},
version: "v1",
ws: nil
}