Current section
Files
Jump to
Current section
Files
priv/specs/extracted/upbit.exs
# Upbit Exchange Specification
#
# Auto-generated by: mix ccxt.extract upbit
# 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: [
"KR",
"ID",
"SG",
"TH"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"TON" => "Tokamak Network",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 26,
"coveragePercent" => 100,
"enabledMethods" => 29,
"excluded" => [],
"excludedMethods" => 0,
"extractableMethods" => 29,
"failures" => [
%{
"error" => "upbit createOrder() requires the price and amount 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 (quote quantity) in the amount argument",
"method" => "createMarketOrder"
},
%{
"error" => "upbit fetchDepositAddress requires params[\"network\"]",
"method" => "fetchDepositAddress"
},
%{
"error" => "upbit withdraw() requires a network argument",
"method" => "withdraw"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{
"id" => "uuid"
},
params: [
:id,
:symbol
],
path: "/order",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :post,
name: :create_deposit_address,
param_mappings: %{
"code" => "currency"
},
params: [
:code
],
path: "/deposits/generate_coin_address",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 2.5,
default_params: %{
"ord_type" => "limit",
"side" => "bid"
},
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"amount" => "volume",
"symbol" => "market"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 2.5,
default_params: %{
"ord_type" => "price",
"side" => "bid"
},
market_type: :spot,
method: :post,
name: :create_market_buy_order_with_cost,
param_mappings: %{
"cost" => "price",
"symbol" => "market"
},
params: [
:symbol,
:cost
],
path: "/orders",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 2.5,
default_params: %{
"side" => "bid"
},
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "volume",
"symbol" => "market",
"type" => "ord_type"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 2.5,
market_type: :spot,
method: :post,
name: :edit_order,
param_mappings: %{
"amount" => "new_volume",
"id" => "prev_order_uuid",
"price" => "new_price",
"type" => "new_ord_type"
},
params: [
:id,
:symbol,
:type,
:side,
:amount,
:price
],
path: "/orders/cancel_and_new",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/accounts",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
default_params: %{
"state" => "cancel"
},
market_type: :spot,
method: :get,
name: :fetch_canceled_orders,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/closed",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
default_params: %{
"state" => "done"
},
market_type: :spot,
method: :get,
name: :fetch_closed_orders,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/closed",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_deposit,
param_mappings: %{
"arg0" => "uuid"
},
params: [],
path: "/deposit",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_deposit_addresses,
param_mappings: %{},
params: [
:codes
],
path: "/deposits/coin_addresses",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:since,
:limit
],
path: "/deposits",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "markets"
},
params: [
:symbol,
:limit
],
path: "/orderbook",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/market/all",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
default_params: %{
"timeframe" => "minutes",
"to" => "<generated>",
"unit" => 60
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"limit" => "count",
"symbol" => "market"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/candles/{timeframe}/{unit}",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/open",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{
"id" => "uuid"
},
params: [
:id,
:symbol
],
path: "/order",
response_transformer: {:extract_path_unwrap, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"limit" => "count",
"symbol" => "markets"
},
params: [
:symbol,
:limit
],
path: "/orderbook",
response_transformer: {:extract_path_unwrap, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
default_params: %{
"markets" => "BTCUSDT"
},
market_type: :spot,
method: :get,
name: :fetch_order_books,
param_mappings: %{},
params: [
:symbols,
:limit
],
path: "/orderbook",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "markets"
},
params: [
:symbol
],
path: "/ticker",
response_transformer: {:extract_path_unwrap, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
default_params: %{
"markets" => "BTCUSDT"
},
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/ticker",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"limit" => "count",
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/trades/ticks",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_trading_fee,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol
],
path: "/orders/chance",
response_transformer: {:extract_path_unwrap, ["message"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 2,
market_type: :spot,
method: :get,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/market/all",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_withdrawal,
param_mappings: %{
"arg0" => "uuid"
},
params: [],
path: "/withdraw",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.67,
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:since,
:limit
],
path: "/withdraws",
response_transformer: {:extract_path, ["message"]},
source: :intercepted
}
],
error_code_details: %{
"Missing request parameter error. Check the required parameters!" => %{
description: nil,
type: :invalid_parameters
},
"This key has expired." => %{
description: nil,
type: :invalid_credentials
},
"create_ask_error" => %{
description: nil,
type: :exchange_error
},
"create_bid_error" => %{
description: nil,
type: :exchange_error
},
"insufficient_funds" => %{
description: nil,
type: :insufficient_balance
},
"invalid_access_key" => %{
description: nil,
type: :invalid_credentials
},
"invalid_funds" => %{
description: nil,
type: :invalid_order
},
"jwt_verification" => %{
description: nil,
type: :invalid_credentials
},
"order_not_found" => %{
description: nil,
type: :order_not_found
},
"out_of_scope" => %{
description: nil,
type: :access_restricted
},
"side is missing, side does not have a valid value" => %{
description: nil,
type: :invalid_order
},
"thirdparty_agreement_required" => %{
description: nil,
type: :access_restricted
},
"volume_too_large" => %{
description: nil,
type: :invalid_order
}
},
error_codes: %{
"Missing request parameter error. Check the required parameters!" => :invalid_parameters,
"This key has expired." => :invalid_credentials,
"create_ask_error" => :exchange_error,
"create_bid_error" => :exchange_error,
"insufficient_funds" => :insufficient_balance,
"invalid_access_key" => :invalid_credentials,
"invalid_funds" => :invalid_order,
"jwt_verification" => :invalid_credentials,
"order_not_found" => :order_not_found,
"out_of_scope" => :access_restricted,
"side is missing, side does not have a valid value" => :invalid_order,
"thirdparty_agreement_required" => :access_restricted,
"volume_too_large" => :invalid_order
},
exceptions: %{
broad: %{
"create_ask_error" => :exchange_error,
"create_bid_error" => :exchange_error,
"insufficient_funds" => :insufficient_funds,
"invalid_access_key" => :authentication_error,
"invalid_funds" => :invalid_order,
"jwt_verification" => :authentication_error,
"order_not_found" => :order_not_found,
"out_of_scope" => :permission_denied,
"thirdparty_agreement_required" => :permission_denied,
"volume_too_large" => :invalid_order
},
exact: %{
"Missing request parameter error. Check the required parameters!" => :bad_request,
"This key has expired." => :authentication_error,
"side is missing, side does not have a valid value" => :invalid_order
}
},
exchange_options: %{
"createMarketBuyOrderRequiresPrice" => true,
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networksById" => %{},
"tradingFeesByQuoteCurrency" => %{
"KRW" => 0.0005
}
},
extended_metadata: %{
fees_url: "https://upbit.com/service_center/guide",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/49245610-eeaabe00-f423-11e8-9cba-4b0aed794799.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: false,
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: true
},
trailing: false,
trigger_direction: false,
trigger_price: false
},
fetch_closed_orders: %{
days_back: 100000,
days_back_canceled: 1,
limit: 1000,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false,
until_days: 7
},
fetch_ohlcv: %{
limit: 200
},
fetch_open_orders: %{
limit: 100,
margin_mode: true,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
funding: %{
percentage: false,
tier_based: false
},
trading: %{
maker: 0.0025,
percentage: true,
taker: 0.0025,
tier_based: false
}
},
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined; // fallback to default error handler\n }\n //\n // { 'error': { 'message': \"Missing request parameter error. Check the required parameters!\", 'name': 400 } },\n // { 'error': { 'message': \"side is missing, side does not have a valid value\", 'name': \"validation_error\" } },\n // { 'error': { 'message': \"개인정보 제 3자 제공 동의가 필요합니다.\", 'name': \"thirdparty_agreement_required\" } },\n // { 'error': { 'message': \"권한이 부족합니다.\", 'name': \"out_of_scope\" } },\n // { 'error': { 'message': \"주문을 찾지 못했습니다.\", 'name': \"order_not_found\" } },\n // { 'error': { 'message': \"주문가능한 금액(ETH)이 부족합니다.\", 'name': \"insufficient_funds_ask\" } },\n // { 'error': { 'message': \"주문가능한 금액(BTC)이 부족합니다.\", 'name': \"insufficient_funds_bid\" } },\n // { 'error': { 'message': \"잘못된 엑세스 키입니다.\", 'name': \"invalid_access_key\" } },\n // { 'error': { 'message': \"Jwt 토큰 검증에 실패했습니다.\", 'name': \"jwt_verification\" } }\n //\n const error = this.safeValue(response, 'error');\n if (error !== undefined) {\n const message = this.safeString(error, 'message');\n const name = this.safeString(error, 'name');\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], name, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], name, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: true,
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: true,
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: 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_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: true,
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: false,
fetch_currencies_ws: true,
fetch_deposit: true,
fetch_deposit_address: true,
fetch_deposit_addresses: true,
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: false,
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: true,
fetch_order_trades: false,
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: 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: true,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: true,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
sandbox: false,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: true,
swap: false,
transfer: false,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: true,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: true,
watch_ohlcv: true,
watch_ohlcv_for_symbols: false,
watch_order_book: true,
watch_order_book_for_symbols: false,
watch_orders: true,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: true,
watch_tickers: true,
watch_trades: true,
watch_trades_for_symbols: true,
withdraw: true,
ws: false
},
http_config: nil,
id: "upbit",
markets: nil,
name: "Upbit",
ohlcv_timestamp_resolution: :unknown,
options: %{
create_market_buy_order_requires_price: true,
trading_fees_by_quote_currency: %{
"KRW" => 0.0005
}
},
order_mappings: nil,
param_mappings: %{
"amount" => "new_volume",
"arg0" => "uuid",
"code" => "currency",
"cost" => "price",
"id" => "uuid",
"limit" => "count",
"price" => "new_price",
"symbol" => "market",
"type" => "new_ord_type"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 594,
"line_start" => 578,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n for (let i = 0; i < response.length; i++) {\n const balance = response[i];\n const currencyId = this.safeString (balance, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['free'] = this.safeString (balance, 'balance');\n account['used'] = this.safeString (balance, 'locked');\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n currency: 'XRP',\n net_type: 'XRP',\n deposit_address: 'raQwCVAJVqjrVm1Nj5SFRcX8i22BhdC9WA',\n secondary_address: '167029435'\n }"
],
"line_end" => 2180,
"line_start" => 2158,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "depositAddress"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "network",
"value" => "this.networkIdToCode (networkId)"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "tag"
}
],
"name" => "parseDepositAddress",
"signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
"source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n //\n // {\n // currency: 'XRP',\n // net_type: 'XRP',\n // deposit_address: 'raQwCVAJVqjrVm1Nj5SFRcX8i22BhdC9WA',\n // secondary_address: '167029435'\n // }\n //\n const address = this.safeString (depositAddress, 'deposit_address');\n const tag = this.safeString (depositAddress, 'secondary_address');\n const currencyId = this.safeString (depositAddress, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const networkId = this.safeString (depositAddress, 'net_type');\n this.checkAddress (address);\n return {\n 'info': depositAddress,\n 'currency': code,\n 'network': this.networkIdToCode (networkId),\n 'address': address,\n 'tag': tag,\n } as DepositAddress;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 576,
"line_start" => 520,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"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" => "taker",
"value" => "this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['taker'])"
},
%{
"comment" => nil,
"key" => "maker",
"value" => "this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['maker'])"
},
%{
"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 'price': this.parseNumber ('1e-8'),\n 'amount': this.parseNumber ('1e-8'),\n }"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n }"
},
%{
"comment" => nil,
"key" => "created",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "market"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.parseNumber ('1e-8')"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.parseNumber ('1e-8')"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (market: Dict): Market",
"source" => "parseMarket (market: Dict): Market {\n const id = this.safeString (market, 'market');\n const [ quoteId, baseId ] = id.split ('-');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n return this.safeMarketStructure ({\n 'id': id,\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 'taker': this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['taker']),\n 'maker': this.safeNumber (this.options['tradingFeesByQuoteCurrency'], quote, this.fees['trading']['maker']),\n 'contractSize': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'price': this.parseNumber ('1e-8'),\n 'amount': this.parseNumber ('1e-8'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': market,\n });\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"market\": \"BTC-ETH\",\n \"candle_date_time_utc\": \"2018-11-22T13:47:00\",\n \"candle_date_time_kst\": \"2018-11-22T22:47:00\",\n \"opening_price\": 0.02915963,\n \"high_price\": 0.02915963,\n \"low_price\": 0.02915448,\n \"trade_price\": 0.02915448,\n \"timestamp\": 1542894473674,\n \"candle_acc_trade_price\": 0.0981629437535248,\n \"candle_acc_trade_volume\": 3.36693173,\n \"unit\": 1\n }"
],
"line_end" => 1081,
"line_start" => 1057,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"market\": \"BTC-ETH\",\n // \"candle_date_time_utc\": \"2018-11-22T13:47:00\",\n // \"candle_date_time_kst\": \"2018-11-22T22:47:00\",\n // \"opening_price\": 0.02915963,\n // \"high_price\": 0.02915963,\n // \"low_price\": 0.02915448,\n // \"trade_price\": 0.02915448,\n // \"timestamp\": 1542894473674,\n // \"candle_acc_trade_price\": 0.0981629437535248,\n // \"candle_acc_trade_volume\": 3.36693173,\n // \"unit\": 1\n // }\n //\n return [\n this.parse8601 (this.safeString (ohlcv, 'candle_date_time_utc')),\n this.safeNumber (ohlcv, 'opening_price'),\n this.safeNumber (ohlcv, 'high_price'),\n this.safeNumber (ohlcv, 'low_price'),\n this.safeNumber (ohlcv, 'trade_price'),\n this.safeNumber (ohlcv, 'candle_acc_trade_volume'), // base volume\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"market\": \"KRW-USDT\",\n \"uuid\": \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n \"side\": \"ask\",\n \"ord_type\": \"market\",\n \"state\": \"done\",\n \"created_at\": \"2025-08-09T16:44:00+09:00\",\n \"volume\": \"5.377594\",\n \"remaining_volume\": \"0\",\n \"executed_volume\": \"5.377594\",\n \"reserved_fee\": \"0\",\n \"remaining_fee\": \"0\",\n \"paid_fee\": \"3.697095875\",\n \"locked\": \"0\",\n \"prevented_volume\": \"0\",\n \"prevented_locked\": \"0\",\n \"trades_count\": 1,\n \"trades\": [\n {\n \"market\": \"KRW-USDT\",\n \"uuid\": \"795dff29-bba6-49b2-baab-63473ab7931c\",\n \"price\": \"1375\",\n \"volume\": \"5.377594\",\n \"funds\": \"7394.19175\",\n \"trend\": \"down\",\n \"created_at\": \"2025-08-09T16:44:00.597751+09:00\",\n \"side\": \"ask\"\n }\n ]\n }",
"{\n \"uuid\": \"637fd66-d019-4d77-bee6-8e0cff28edd9\",\n \"side\": \"ask\",\n \"ord_type\": \"limit\",\n \"price\": \"1.5\",\n \"state\": \"wait\",\n \"market\": \"SGD-XRP\",\n \"created_at\": \"2024-06-05T09:37:10Z\",\n \"volume\": \"10\",\n \"remaining_volume\": \"10\",\n \"reserved_fee\": \"0\",\n \"remaining_fee\": \"0\",\n \"paid_fee\": \"0\",\n \"locked\": \"10\",\n \"executed_volume\": \"0\",\n \"executed_funds\": \"0\",\n \"trades_count\": 0,\n \"time_in_force\": \"ioc\"\n }",
"{\n uuid: '63b38774-27db-4439-ac20-1be16a24d18e',\n side: 'bid',\n ord_type: 'limit',\n price: '100000000',\n state: 'wait',\n market: 'KRW-BTC',\n created_at: '2025-04-01T15:30:47+09:00',\n volume: '0.00008',\n remaining_volume: '0.00008',\n reserved_fee: '4',\n remaining_fee: '4',\n paid_fee: '0',\n locked: '8004',\n executed_volume: '0',\n trades_count: '0',\n identifier: '21',\n new_order_uuid: 'cb1cce56-6237-4a78-bc11-4cfffc1bb4c2',\n new_order_identifier: '22'\n }"
],
"line_end" => 1894,
"line_start" => 1736,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "identifier"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "lastTradeTimestamp"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "this.safeStringUpper (order, 'time_in_force')"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.parseNumber (cost)"
},
%{
"comment" => nil,
"key" => "average",
"value" => "this.parseNumber (average)"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "filled"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "remaining"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "trades"
},
%{
"comment" => nil,
"key" => "order",
"value" => "id"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n // {\n // \"market\": \"KRW-USDT\",\n // \"uuid\": \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n // \"side\": \"ask\",\n // \"ord_type\": \"market\",\n // \"state\": \"done\",\n // \"created_at\": \"2025-08-09T16:44:00+09:00\",\n // \"volume\": \"5.377594\",\n // \"remaining_volume\": \"0\",\n // \"executed_volume\": \"5.377594\",\n // \"reserved_fee\": \"0\",\n // \"remaining_fee\": \"0\",\n // \"paid_fee\": \"3.697095875\",\n // \"locked\": \"0\",\n // \"prevented_volume\": \"0\",\n // \"prevented_locked\": \"0\",\n // \"trades_count\": 1,\n // \"trades\": [\n // {\n // \"market\": \"KRW-USDT\",\n // \"uuid\": \"795dff29-bba6-49b2-baab-63473ab7931c\",\n // \"price\": \"1375\",\n // \"volume\": \"5.377594\",\n // \"funds\": \"7394.19175\",\n // \"trend\": \"down\",\n // \"created_at\": \"2025-08-09T16:44:00.597751+09:00\",\n // \"side\": \"ask\"\n // }\n // ]\n // }\n //\n // fetchOpenOrders, fetchClosedOrders, fetchCanceledOrders\n //\n // {\n // \"uuid\": \"637fd66-d019-4d77-bee6-8e0cff28edd9\",\n // \"side\": \"ask\",\n // \"ord_type\": \"limit\",\n // \"price\": \"1.5\",\n // \"state\": \"wait\",\n // \"market\": \"SGD-XRP\",\n // \"created_at\": \"2024-06-05T09:37:10Z\",\n // \"volume\": \"10\",\n // \"remaining_volume\": \"10\",\n // \"reserved_fee\": \"0\",\n // \"remaining_fee\": \"0\",\n // \"paid_fee\": \"0\",\n // \"locked\": \"10\",\n // \"executed_volume\": \"0\",\n // \"executed_funds\": \"0\",\n // \"trades_count\": 0,\n // \"time_in_force\": \"ioc\"\n // }\n //\n // {\n // uuid: '63b38774-27db-4439-ac20-1be16a24d18e',\n // side: 'bid',\n // ord_type: 'limit',\n // price: '100000000',\n // state: 'wait',\n // market: 'KRW-BTC',\n // created_at: '2025-04-01T15:30:47+09:00',\n // volume: '0.00008',\n // remaining_volume: '0.00008',\n // reserved_fee: '4',\n // remaining_fee: '4',\n // paid_fee: '0',\n // locked: '8004',\n // executed_volume: '0',\n // trades_count: '0',\n // identifier: '21',\n // new_order_uuid: 'cb1cce56-6237-4a78-bc11-4cfffc1bb4c2',\n // new_order_identifier: '22'\n // }\n const id = this.safeString (order, 'uuid');\n let side = this.safeString (order, 'side');\n if (side === 'bid') {\n side = 'buy';\n } else {\n side = 'sell';\n }\n const identifier = this.safeString (order, 'identifier');\n let type = this.safeString (order, 'ord_type');\n const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n const status = this.parseOrderStatus (this.safeString (order, 'state'));\n let lastTradeTimestamp = undefined;\n let price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'volume');\n const remaining = this.safeString (order, 'remaining_volume');\n const filled = this.safeString (order, 'executed_volume');\n let cost = undefined;\n if (type === 'price') {\n type = 'market';\n cost = price;\n price = undefined;\n }\n let average = undefined;\n let fee = undefined;\n let feeCost = this.safeString (order, 'paid_fee');\n const marketId = this.safeString (order, 'market');\n market = this.safeMarket (marketId, market);\n let trades = this.safeValue (order, 'trades', []);\n trades = this.parseTrades (trades, market, undefined, undefined, {\n 'order': id,\n 'type': type,\n });\n const numTrades = trades.length;\n if (numTrades > 0) {\n // the timestamp in fetchOrder trades is missing\n lastTradeTimestamp = trades[numTrades - 1]['timestamp'];\n let getFeesFromTrades = false;\n if (feeCost === undefined) {\n getFeesFromTrades = true;\n feeCost = '0';\n }\n cost = '0';\n for (let i = 0; i < numTrades; i++) {\n const trade = trades[i];\n cost = Precise.stringAdd (cost, this.safeString (trade, 'cost'));\n if (getFeesFromTrades) {\n const tradeFee = this.safeValue (trades[i], 'fee', {});\n const tradeFeeCost = this.safeString (tradeFee, 'cost');\n if (tradeFeeCost !== undefined) {\n feeCost = Precise.stringAdd (feeCost, tradeFeeCost);\n }\n }\n }\n average = Precise.stringDiv (cost, filled);\n }\n if (feeCost !== undefined) {\n fee = {\n 'currency': market['quote'],\n 'cost': feeCost,\n };\n }\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': identifier,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': lastTradeTimestamp,\n 'symbol': market['symbol'],\n 'type': type,\n 'timeInForce': this.safeStringUpper (order, 'time_in_force'),\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': this.parseNumber (cost),\n 'average': this.parseNumber (average),\n 'amount': amount,\n 'filled': filled,\n 'remaining': remaining,\n 'status': status,\n 'fee': fee,\n 'trades': trades,\n });\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1734,
"line_start" => 1727,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'wait': 'open',\n 'done': 'closed',\n 'cancel': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{ market: \"BTC-ETH\",\n \"trade_date\": \"20181122\",\n \"trade_time\": \"104543\",\n \"trade_date_kst\": \"20181122\",\n \"trade_time_kst\": \"194543\",\n \"trade_timestamp\": 1542883543096,\n \"opening_price\": 0.02976455,\n \"high_price\": 0.02992577,\n \"low_price\": 0.02934283,\n \"trade_price\": 0.02947773,\n \"prev_closing_price\": 0.02966,\n \"change\": \"FALL\",\n \"change_price\": 0.00018227,\n \"change_rate\": 0.0061453136,\n \"signed_change_price\": -0.00018227,\n \"signed_change_rate\": -0.0061453136,\n \"trade_volume\": 1.00000005,\n \"acc_trade_price\": 100.95825586,\n \"acc_trade_price_24h\": 289.58650166,\n \"acc_trade_volume\": 3409.85311036,\n \"acc_trade_volume_24h\": 9754.40510513,\n \"highest_52_week_price\": 0.12345678,\n \"highest_52_week_date\": \"2018-02-01\",\n \"lowest_52_week_price\": 0.023936,\n \"lowest_52_week_date\": \"2017-12-08\",\n \"timestamp\": 1542883543813 }"
],
"line_end" => 768,
"line_start" => 713,
"mappings" => [
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "high",
"value" => "this.safeString (ticker, 'high_price')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeString (ticker, 'low_price')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "this.safeString (ticker, 'opening_price')"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "this.safeString (ticker, 'prev_closing_price')"
},
%{
"comment" => nil,
"key" => "change",
"value" => "this.safeString (ticker, 'signed_change_price')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "this.safeString (ticker, 'signed_change_rate')"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'acc_trade_volume_24h')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "this.safeString (ticker, 'acc_trade_price_24h')"
},
%{
"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 // { market: \"BTC-ETH\",\n // \"trade_date\": \"20181122\",\n // \"trade_time\": \"104543\",\n // \"trade_date_kst\": \"20181122\",\n // \"trade_time_kst\": \"194543\",\n // \"trade_timestamp\": 1542883543096,\n // \"opening_price\": 0.02976455,\n // \"high_price\": 0.02992577,\n // \"low_price\": 0.02934283,\n // \"trade_price\": 0.02947773,\n // \"prev_closing_price\": 0.02966,\n // \"change\": \"FALL\",\n // \"change_price\": 0.00018227,\n // \"change_rate\": 0.0061453136,\n // \"signed_change_price\": -0.00018227,\n // \"signed_change_rate\": -0.0061453136,\n // \"trade_volume\": 1.00000005,\n // \"acc_trade_price\": 100.95825586,\n // \"acc_trade_price_24h\": 289.58650166,\n // \"acc_trade_volume\": 3409.85311036,\n // \"acc_trade_volume_24h\": 9754.40510513,\n // \"highest_52_week_price\": 0.12345678,\n // \"highest_52_week_date\": \"2018-02-01\",\n // \"lowest_52_week_price\": 0.023936,\n // \"lowest_52_week_date\": \"2017-12-08\",\n // \"timestamp\": 1542883543813 }\n //\n const timestamp = this.safeInteger (ticker, 'trade_timestamp');\n const marketId = this.safeString2 (ticker, 'market', 'code');\n market = this.safeMarket (marketId, market, '-');\n const last = this.safeString (ticker, 'trade_price');\n return this.safeTicker ({\n 'symbol': market['symbol'],\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high_price'),\n 'low': this.safeString (ticker, 'low_price'),\n 'bid': undefined,\n 'bidVolume': undefined,\n 'ask': undefined,\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': this.safeString (ticker, 'opening_price'),\n 'close': last,\n 'last': last,\n 'previousClose': this.safeString (ticker, 'prev_closing_price'),\n 'change': this.safeString (ticker, 'signed_change_price'),\n 'percentage': this.safeString (ticker, 'signed_change_rate'),\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'acc_trade_volume_24h'),\n 'quoteVolume': this.safeString (ticker, 'acc_trade_price_24h'),\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{ market: \"BTC-ETH\",\n \"trade_date_utc\": \"2018-11-22\",\n \"trade_time_utc\": \"13:55:24\",\n \"timestamp\": 1542894924397,\n \"trade_price\": 0.02914289,\n \"trade_volume\": 0.20074397,\n \"prev_closing_price\": 0.02966,\n \"change_price\": -0.00051711,\n \"ask_bid\": \"ASK\",\n \"sequential_id\": 15428949259430000 }",
"{\n \"market\": \"KRW-BTC\",\n \"uuid\": \"78162304-1a4d-4524-b9e6-c9a9e14d76c3\",\n \"price\": \"101000.0\",\n \"volume\": \"0.77368323\",\n \"funds\": \"78142.00623\",\n \"ask_fee\": \"117.213009345\",\n \"bid_fee\": \"117.213009345\",\n \"created_at\": \"2018-04-05T14:09:15+09:00\",\n \"side\": \"bid\",\n }"
],
"line_end" => 916,
"line_start" => 846,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"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" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "cost"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades\n //\n // { market: \"BTC-ETH\",\n // \"trade_date_utc\": \"2018-11-22\",\n // \"trade_time_utc\": \"13:55:24\",\n // \"timestamp\": 1542894924397,\n // \"trade_price\": 0.02914289,\n // \"trade_volume\": 0.20074397,\n // \"prev_closing_price\": 0.02966,\n // \"change_price\": -0.00051711,\n // \"ask_bid\": \"ASK\",\n // \"sequential_id\": 15428949259430000 }\n //\n // fetchOrder trades\n //\n // {\n // \"market\": \"KRW-BTC\",\n // \"uuid\": \"78162304-1a4d-4524-b9e6-c9a9e14d76c3\",\n // \"price\": \"101000.0\",\n // \"volume\": \"0.77368323\",\n // \"funds\": \"78142.00623\",\n // \"ask_fee\": \"117.213009345\",\n // \"bid_fee\": \"117.213009345\",\n // \"created_at\": \"2018-04-05T14:09:15+09:00\",\n // \"side\": \"bid\",\n // }\n //\n const id = this.safeString2 (trade, 'sequential_id', 'uuid');\n const orderId = undefined;\n let timestamp = this.safeInteger (trade, 'timestamp');\n if (timestamp === undefined) {\n timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n }\n let side = undefined;\n const askOrBid = this.safeStringLower2 (trade, 'ask_bid', 'side');\n if (askOrBid === 'ask') {\n side = 'sell';\n } else if (askOrBid === 'bid') {\n side = 'buy';\n }\n const cost = this.safeString (trade, 'funds');\n const price = this.safeString2 (trade, 'trade_price', 'price');\n const amount = this.safeString2 (trade, 'trade_volume', 'volume');\n const marketId = this.safeString2 (trade, 'market', 'code');\n market = this.safeMarket (marketId, market, '-');\n let fee = undefined;\n const feeCost = this.safeString (trade, askOrBid + '_fee');\n if (feeCost !== undefined) {\n fee = {\n 'currency': market['quote'],\n 'cost': feeCost,\n };\n }\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'order': orderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'type': undefined,\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': price,\n 'amount': amount,\n 'cost': cost,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"type\": \"deposit\",\n \"uuid\": \"94332e99-3a87-4a35-ad98-28b0c969f830\",\n \"currency\": \"KRW\",\n \"txid\": \"9e37c537-6849-4c8b-a134-57313f5dfc5a\",\n \"state\": \"ACCEPTED\",\n \"created_at\": \"2017-12-08T15:38:02+09:00\",\n \"done_at\": \"2017-12-08T15:38:02+09:00\",\n \"amount\": \"100000.0\",\n \"fee\": \"0.0\"\n }",
"{\n \"type\": \"withdraw\",\n \"uuid\": \"9f432943-54e0-40b7-825f-b6fec8b42b79\",\n \"currency\": \"BTC\",\n \"txid\": \"cd81e9b45df8da29f936836e58c907a106057e454a45767a7b06fcb19b966bba\",\n \"state\": \"processing\",\n \"created_at\": \"2018-04-13T11:24:01+09:00\",\n \"done_at\": null,\n \"amount\": \"0.01\",\n \"fee\": \"0.0\",\n \"krw_amount\": \"80420.0\"\n }"
],
"line_end" => 1725,
"line_start" => 1659,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'uuid')"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'amount')"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "tag"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (this.safeStringLower (transaction, 'state'))"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "this.parse8601 (updatedRaw)"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString (transaction, 'txid')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "{\n 'currency': code,\n 'cost': this.safeNumber (transaction, 'fee'),\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeNumber (transaction, 'fee')"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits, fetchDeposit\n //\n // {\n // \"type\": \"deposit\",\n // \"uuid\": \"94332e99-3a87-4a35-ad98-28b0c969f830\",\n // \"currency\": \"KRW\",\n // \"txid\": \"9e37c537-6849-4c8b-a134-57313f5dfc5a\",\n // \"state\": \"ACCEPTED\",\n // \"created_at\": \"2017-12-08T15:38:02+09:00\",\n // \"done_at\": \"2017-12-08T15:38:02+09:00\",\n // \"amount\": \"100000.0\",\n // \"fee\": \"0.0\"\n // }\n //\n // fetchWithdrawals, fetchWithdrawal\n //\n // {\n // \"type\": \"withdraw\",\n // \"uuid\": \"9f432943-54e0-40b7-825f-b6fec8b42b79\",\n // \"currency\": \"BTC\",\n // \"txid\": \"cd81e9b45df8da29f936836e58c907a106057e454a45767a7b06fcb19b966bba\",\n // \"state\": \"processing\",\n // \"created_at\": \"2018-04-13T11:24:01+09:00\",\n // \"done_at\": null,\n // \"amount\": \"0.01\",\n // \"fee\": \"0.0\",\n // \"krw_amount\": \"80420.0\"\n // }\n //\n const address = undefined; // not present in the data structure received from the exchange\n const tag = undefined; // not present in the data structure received from the exchange\n const updatedRaw = this.safeString (transaction, 'done_at');\n const timestamp = this.parse8601 (this.safeString (transaction, 'created_at', updatedRaw));\n let type = this.safeString (transaction, 'type');\n if (type === 'withdraw') {\n type = 'withdrawal';\n }\n const currencyId = this.safeString (transaction, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'uuid'),\n 'currency': code,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'network': undefined,\n 'address': address,\n 'addressTo': undefined,\n 'addressFrom': undefined,\n 'tag': tag,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'status': this.parseTransactionStatus (this.safeStringLower (transaction, 'state')),\n 'type': type,\n 'updated': this.parse8601 (updatedRaw),\n 'txid': this.safeString (transaction, 'txid'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'internal': undefined,\n 'comment': undefined,\n 'fee': {\n 'currency': code,\n 'cost': this.safeNumber (transaction, 'fee'),\n },\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1657,
"line_start" => 1645,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'submitting': 'pending', // 처리 중\n 'submitted': 'pending', // 처리 완료\n 'almost_accepted': 'pending', // 출금대기중\n 'rejected': 'failed', // 거부\n 'accepted': 'ok', // 승인됨\n 'processing': 'pending', // 처리 중\n 'done': 'ok', // 완료\n 'canceled': 'canceled', // 취소됨\n };\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "/v1/",
pro: true,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 50,
period: 1000,
requests: 20,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 0.67,
method: :get,
path: "/accounts"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/api_keys"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/deposit"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/deposits"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/deposits/chance/coin"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/deposits/coin_address"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/deposits/coin_addresses"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/order"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/orders/chance"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/orders/closed"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/orders/open"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/orders/uuids"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/status/wallet"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/travel_rule/vasps"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/withdraw"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/withdraws"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/withdraws/chance"
},
%{
auth: false,
cost: 0.67,
method: :get,
path: "/withdraws/coin_addresses"
},
%{
auth: false,
cost: 0.67,
method: :post,
path: "/deposits/generate_coin_address"
},
%{
auth: false,
cost: 0.67,
method: :post,
path: "/deposits/krw"
},
%{
auth: false,
cost: 2.5,
method: :post,
path: "/orders"
},
%{
auth: false,
cost: 2.5,
method: :post,
path: "/orders/cancel_and_new"
},
%{
auth: false,
cost: 2.5,
method: :post,
path: "/orders/test"
},
%{
auth: false,
cost: 0.67,
method: :post,
path: "/travel_rule/deposit/txid"
},
%{
auth: false,
cost: 0.67,
method: :post,
path: "/travel_rule/deposit/uuid"
},
%{
auth: false,
cost: 0.67,
method: :post,
path: "/withdraws/coin"
},
%{
auth: false,
cost: 0.67,
method: :post,
path: "/withdraws/krw"
},
%{
auth: false,
cost: 0.67,
method: :delete,
path: "/order"
},
%{
auth: false,
cost: 40,
method: :delete,
path: "/orders/open"
},
%{
auth: false,
cost: 0.67,
method: :delete,
path: "/orders/uuids"
},
%{
auth: false,
cost: 0.67,
method: :delete,
path: "/withdraws/coin"
}
],
public: [
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/days"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/1"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/10"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/15"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/240"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/3"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/30"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/5"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/60"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/minutes/{unit}"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/months"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/seconds"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/weeks"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/years"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/{timeframe}"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/candles/{timeframe}/{unit}"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/market/all"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/orderbook"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/orderbook/instruments"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/ticker"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/ticker/all"
},
%{
auth: false,
cost: 2,
method: :get,
path: "/trades/ticks"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: %{
code_field: [
"error",
"code"
],
field: "error",
message_field: [
"error",
"message"
],
success_values: nil,
type: :error_present
},
signing: %{
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" => %{},
"cost" => %{},
"price" => %{}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 1.0e-8
},
spot: %{
base: "BERA",
base_id: "BERA",
case: :upper,
contract: false,
id: "BTC-BERA",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
maker: 0.0025,
precision: %{
"amount" => 1.0e-8,
"price" => 1.0e-8
},
quote: "BTC",
quote_id: "BTC",
separator: "-",
symbol: "BERA/BTC",
taker: 0.0025
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :dash_upper,
separator: "-",
suffix: nil
}
},
timeframes: %{
"10m" => "minutes",
"15m" => "minutes",
"1M" => "months",
"1d" => "days",
"1h" => "minutes",
"1m" => "minutes",
"1s" => "seconds",
"1w" => "weeks",
"1y" => "years",
"30m" => "minutes",
"3m" => "minutes",
"4h" => "minutes",
"5m" => "minutes"
},
url_strategy: %{
detected_from: "sign_method",
pattern: :version_slash,
prefix: "/v1/"
},
urls: %{
api: "https://api.upbit.com",
api_sections: %{
"private" => "https://api.upbit.com",
"public" => "https://api.upbit.com"
},
doc: [
"https://docs.upbit.com/kr",
"https://global-docs.upbit.com"
],
other: nil,
sandbox: nil,
www: "https://upbit.com"
},
version: "v1",
ws: %{
channel_templates: %{
watch_balance: %{
channel_name: "myAsset",
market_id_format: :native,
params: [],
pattern: :custom
},
watch_my_trades: %{
channel_name: "myOrder",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_ohlcv: %{
market_id_format: :native,
params: [],
pattern: :custom
},
watch_order_book: %{
channel_name: "orderbook",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_orders: %{
channel_name: "myOrder",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_private: %{
auth_required: true,
market_id_format: :native,
params: [],
pattern: :custom
},
watch_public_multiple: %{
market_id_format: :native,
params: [],
pattern: :custom
},
watch_ticker: %{
channel_name: "ticker",
market_id_format: :native,
params: [],
pattern: :custom
},
watch_tickers: %{
channel_name: "ticker",
market_id_format: :native,
params: [],
pattern: :custom
},
watch_trades: %{
channel_name: "trade",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_trades_for_symbols: %{
channel_name: "trade",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
}
},
has: %{
watch_balance: true,
watch_bids_asks: nil,
watch_liquidations: nil,
watch_liquidations_for_symbols: nil,
watch_my_liquidations: nil,
watch_my_liquidations_for_symbols: nil,
watch_my_trades: true,
watch_ohlcv: true,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: nil,
watch_orders: true,
watch_orders_for_symbols: nil,
watch_position: nil,
watch_positions: nil,
watch_status: nil,
watch_ticker: true,
watch_tickers: true,
watch_trades: true,
watch_trades_for_symbols: true
},
hostname: "api.upbit.com",
message_patterns: [
%{
element_keys: [
"ticket"
],
format: :array,
sources: [
:send,
:watch,
:watch_multiple
]
}
],
subscription_config: %{
args_field: "type",
args_format: :object_list,
market_id_format: :native
},
subscription_pattern: :custom,
urls: "wss://{hostname}/websocket/v1",
watch_methods: [
"watchBalance",
"watchMyTrades",
"watchOHLCV",
"watchOrderBook",
"watchOrders",
"watchPrivate",
"watchPublicMultiple",
"watchTicker",
"watchTickers",
"watchTrades",
"watchTradesForSymbols"
]
}
}