Packages

Elixir client library for cryptocurrency exchanges — generated from CCXT specs via compile-time macros.

Current section

Files

Jump to
ccxt_client priv specs extracted cex.exs
Raw

priv/specs/extracted/cex.exs

# CEX.IO Exchange Specification
#
# Auto-generated by: mix ccxt.extract cex
# 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: [
"GB",
"EU",
"CY",
"RU"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 20,
"coveragePercent" => 100,
"enabledMethods" => 28,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 27,
"failures" => [
%{
"error" => "cex createOrder() : API trading is now allowed from main account, set params[\"accountId\"] or .options[\"createOrder\"][\"accountId\"] to the name of your sub-account",
"method" => "createLimitOrder"
},
%{
"error" => "cex createOrder() : API trading is now allowed from main account, set params[\"accountId\"] or .options[\"createOrder\"][\"accountId\"] to the name of your sub-account",
"method" => "createMarketOrder"
},
%{
"error" => "cex createOrder() : API trading is now allowed from main account, set params[\"accountId\"] or .options[\"createOrder\"][\"accountId\"] to the name of your sub-account",
"method" => "createOrder"
},
%{
"error" => "cex createOrder() : API trading is now allowed from main account, set params[\"accountId\"] or .options[\"createOrder\"][\"accountId\"] to the name of your sub-account",
"method" => "createStopOrder"
},
%{
"error" => "cex createOrder() : API trading is now allowed from main account, set params[\"accountId\"] or .options[\"createOrder\"][\"accountId\"] to the name of your sub-account",
"method" => "createTriggerOrder"
},
%{
"error" => "cex fetchDepositAddress() : main account is not allowed to fetch deposit address from api, set params[\"accountId\"] or .options[\"createOrder\"][\"accountId\"] to the name of your sub-account",
"method" => "fetchDepositAddress"
},
%{
"error" => "cex fetchOHLCV requires a parameter \"dataType\" to be either \"bestBid\" or \"bestAsk\"",
"method" => "fetchOHLCV"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :cancel_all_orders,
param_mappings: %{},
params: [
:symbol
],
path: "/do_cancel_all_orders",
response_transformer: {:extract_path, ["data", "clientOrderIds"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"cancelRequestId" => "c_1771930432312",
"timestamp" => "<generated>"
},
market_type: :spot,
method: :post,
name: :cancel_order,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol
],
path: "/do_cancel_my_order",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_accounts,
param_mappings: %{},
params: [],
path: "/get_my_account_status_v3",
response_transformer: {:extract_path, ["data", "balancesPerAccounts"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/get_my_wallet_balance",
response_transformer: {:extract_path, ["data", "balancesPerAccounts"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
default_params: %{
"archived" => true,
"serverCreateTimestampFrom" => "<generated>"
},
market_type: :spot,
method: :post,
name: :fetch_closed_order,
param_mappings: %{
"arg1" => "pair"
},
params: [],
path: "/get_my_orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
default_params: %{
"archived" => true,
"serverCreateTimestampFrom" => "<generated>"
},
market_type: :spot,
method: :post,
name: :fetch_closed_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/get_my_orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/get_currencies_info",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_deposits_withdrawals,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/get_my_funding_history",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:limit
],
path: "/get_order_book",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_ledger,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:since,
:limit
],
path: "/get_my_transaction_history",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/get_pairs_info",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_open_order,
param_mappings: %{
"arg1" => "pair"
},
params: [],
path: "/get_my_orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/get_my_orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:limit
],
path: "/get_order_book",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"pairs" => [
"BTCUSDT"
]
},
market_type: :spot,
method: :post,
name: :fetch_ticker,
param_mappings: %{},
params: [
:symbol
],
path: "/get_ticker",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"pairs" => [
"BTCUSDT"
]
},
market_type: :spot,
method: :post,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/get_ticker",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_time,
param_mappings: %{},
params: [],
path: "/get_server_time",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"fromDateISO" => "2024-01-01T00:00:00.000Z"
},
market_type: :spot,
method: :post,
name: :fetch_trades,
param_mappings: %{
"limit" => "pageSize",
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/get_trade_history",
response_transformer: {:extract_path, ["data", "trades"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/get_my_current_fee",
response_transformer: {:extract_path, ["data", "tradingFee"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :transfer,
param_mappings: %{
"code" => "currency",
"fromAccount" => "fromAccountId",
"toAccount" => "toAccountId"
},
params: [
:code,
:amount,
:fromAccount,
:toAccount
],
path: "/do_my_internal_transfer",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
}
],
error_code_details: %{
"API orders from Main account are not allowed" => %{
description: nil,
type: :invalid_parameters
},
"Get deposit address for main account is not allowed" => %{
description: nil,
type: :access_restricted
},
"Insufficient funds" => %{
description: nil,
type: :insufficient_balance
},
"Mandatory parameter side should be one of BUY,SELL" => %{
description: nil,
type: :invalid_parameters
},
"Market Trigger orders are not allowed" => %{
description: "for some reason, triggerPrice does not work for market orders",
type: :invalid_parameters
},
"You have negative balance on following accounts" => %{
description: nil,
type: :insufficient_balance
},
"check failed" => %{
description: nil,
type: :invalid_parameters
},
"key not passed or incorrect" => %{
description: nil,
type: :invalid_credentials
}
},
error_codes: %{
"API orders from Main account are not allowed" => :invalid_parameters,
"Get deposit address for main account is not allowed" => :access_restricted,
"Insufficient funds" => :insufficient_balance,
"Mandatory parameter side should be one of BUY,SELL" => :invalid_parameters,
"Market Trigger orders are not allowed" => :invalid_parameters,
"You have negative balance on following accounts" => :insufficient_balance,
"check failed" => :invalid_parameters,
"key not passed or incorrect" => :invalid_credentials
},
exceptions: %{
broad: %{
"API orders from Main account are not allowed" => :bad_request,
"Get deposit address for main account is not allowed" => :permission_denied,
"Insufficient funds" => :insufficient_funds,
"Mandatory parameter side should be one of BUY,SELL" => :bad_request,
"Market Trigger orders are not allowed" => :bad_request,
"You have negative balance on following accounts" => :insufficient_funds,
"check failed" => :bad_request,
"key not passed or incorrect" => :authentication_error
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networks" => %{
"ADA" => "cardano",
"ALGO" => "algorand",
"ARB" => "arbitrum",
"ATOM" => "cosmos",
"AVALANCHEC" => "avalanche",
"BSC20" => "binancesmartchain",
"BTC" => "bitcoin",
"CRONOS" => "cronos",
"DASH" => "dash",
"DOGE" => "dogecoin",
"DOT" => "polkadot",
"DYDX" => "dydx",
"EOS" => "eos",
"ERC20" => "ERC20",
"ETHPOW" => "ethereumpow",
"FTM" => "fantom",
"ICP" => "icp",
"INJ" => "injective",
"KAVA" => "kava",
"KSM" => "kusama",
"LTC" => "litecoin",
"MATIC" => "polygon",
"MINA" => "mina",
"NEAR" => "near",
"NEO" => "neo",
"NEO3" => "neo3",
"ONT" => "ontology",
"OPT" => "optimism",
"SEI" => "sei",
"SGB" => "songbird",
"SOLANA" => "solana",
"THETA" => "theta",
"TIA" => "celestia",
"TON" => "ton",
"TRC20" => "tron",
"XDC" => "xdc",
"XLM" => "stellar",
"XRP" => "ripple",
"XTZ" => "tezos",
"ZIL" => "zilliqa"
},
"networksById" => %{
"ERC20" => "ERC20",
"algorand" => "ALGO",
"arbitrum" => "ARB",
"avalanche" => "AVALANCHEC",
"binancesmartchain" => "BSC20",
"bitcoin" => "BTC",
"cardano" => "ADA",
"celestia" => "TIA",
"cosmos" => "ATOM",
"cronos" => "CRONOS",
"dash" => "DASH",
"dogecoin" => "DOGE",
"dydx" => "DYDX",
"eos" => "EOS",
"ethereumpow" => "ETHPOW",
"fantom" => "FTM",
"icp" => "ICP",
"injective" => "INJ",
"kava" => "KAVA",
"kusama" => "KSM",
"litecoin" => "LTC",
"mina" => "MINA",
"near" => "NEAR",
"neo" => "NEO",
"neo3" => "NEO3",
"ontology" => "ONT",
"optimism" => "OPT",
"polkadot" => "DOT",
"polygon" => "MATIC",
"ripple" => "XRP",
"sei" => "SEI",
"solana" => "SOLANA",
"songbird" => "SGB",
"stellar" => "XLM",
"tezos" => "XTZ",
"theta" => "THETA",
"ton" => "TON",
"tron" => "TRC20",
"xdc" => "XDC",
"zilliqa" => "ZIL"
}
},
extended_metadata: %{
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg",
referral_url: "https://cex.io/r/0/up105393824/0/"
},
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: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: true,
gtd: true,
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: false,
trailing: false,
trigger: false,
until_days: 100000
},
fetch_ohlcv: %{
limit: 1000
},
fetch_open_orders: %{
limit: 1000,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: nil,
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n // in some cases, like from createOrder, exchange returns nested escaped JSON string:\n // {\"ok\":\"ok\",\"data\":{\"messageType\":\"executionReport\", \"orderRejectReason\":\"{\\\"code\\\":405}\"} }\n // and because of `.parseJson` bug, we need extra fix\n if (response === undefined) {\n if (body === undefined) {\n throw new errors.NullResponse(this.id + ' returned empty response');\n }\n else if (body[0] === '{') {\n const fixed = this.fixStringifiedJsonMembers(body);\n response = this.parseJson(fixed);\n }\n else {\n throw new errors.NullResponse(this.id + ' returned unparsed response: ' + body);\n }\n }\n const error = this.safeString(response, 'error');\n if (error !== undefined) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], error, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], error, feedback);\n throw new errors.ExchangeError(feedback);\n }\n // check errors in order-engine (the responses are not standard, so we parse here)\n if (url.indexOf('do_my_new_order') >= 0) {\n const data = this.safeDict(response, 'data', {});\n const rejectReason = this.safeString(data, 'rejectReason');\n if (rejectReason !== undefined) {\n this.throwBroadlyMatchedException(this.exceptions['broad'], rejectReason, rejectReason);\n throw new errors.ExchangeError(this.id + ' createOrder() ' + rejectReason);\n }\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: false,
cancel_all_orders: true,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: false,
cancel_orders_with_client_order_id: false,
cancel_orders_ws: false,
close_all_positions: false,
close_position: false,
create_deposit_address: false,
create_limit_buy_order: false,
create_limit_buy_order_ws: false,
create_limit_order: true,
create_limit_order_ws: false,
create_limit_sell_order: false,
create_limit_sell_order_ws: false,
create_market_buy_order: false,
create_market_buy_order_with_cost: false,
create_market_buy_order_with_cost_ws: false,
create_market_buy_order_ws: false,
create_market_order: 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: true,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: true,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: true,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: true,
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: false,
fetch_deposits_withdrawals: true,
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: true,
fetch_ledger_entry: false,
fetch_leverage: false,
fetch_leverage_tiers: false,
fetch_leverages: false,
fetch_liquidations: false,
fetch_long_short_ratio: false,
fetch_long_short_ratio_history: false,
fetch_margin_adjustment_history: false,
fetch_margin_mode: false,
fetch_margin_modes: false,
fetch_mark_ohlcv: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: 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: true,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: false,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: 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: true,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
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: false,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
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: true,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: true,
watch_bids_asks: 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: false,
withdraw: false,
ws: false
},
http_config: nil,
id: "cex",
markets: nil,
name: "CEX.IO",
ohlcv_timestamp_resolution: :unknown,
options: %{
networks: %{
"ADA" => "cardano",
"ALGO" => "algorand",
"ARB" => "arbitrum",
"ATOM" => "cosmos",
"AVALANCHEC" => "avalanche",
"BSC20" => "binancesmartchain",
"BTC" => "bitcoin",
"CRONOS" => "cronos",
"DASH" => "dash",
"DOGE" => "dogecoin",
"DOT" => "polkadot",
"DYDX" => "dydx",
"EOS" => "eos",
"ERC20" => "ERC20",
"ETHPOW" => "ethereumpow",
"FTM" => "fantom",
"ICP" => "icp",
"INJ" => "injective",
"KAVA" => "kava",
"KSM" => "kusama",
"LTC" => "litecoin",
"MATIC" => "polygon",
"MINA" => "mina",
"NEAR" => "near",
"NEO" => "neo",
"NEO3" => "neo3",
"ONT" => "ontology",
"OPT" => "optimism",
"SEI" => "sei",
"SGB" => "songbird",
"SOLANA" => "solana",
"THETA" => "theta",
"TIA" => "celestia",
"TON" => "ton",
"TRC20" => "tron",
"XDC" => "xdc",
"XLM" => "stellar",
"XRP" => "ripple",
"XTZ" => "tezos",
"ZIL" => "zilliqa"
}
},
order_mappings: nil,
param_mappings: %{
"arg1" => "pair",
"code" => "currency",
"fromAccount" => "fromAccountId",
"id" => "orderId",
"limit" => "pageSize",
"symbol" => "pair",
"toAccount" => "toAccountId"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 928,
"line_start" => 921,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "code",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "account"
}
],
"name" => "parseAccount",
"signature" => "parseAccount (account: Dict): Account",
"source" => "parseAccount (account: Dict): Account {\n return {\n 'id': undefined,\n 'type': undefined,\n 'code': undefined,\n 'info': account,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 999,
"line_start" => 983,
"mappings" => [
%{
"comment" => nil,
"key" => "used",
"value" => "this.safeString (balance, 'balanceOnHold')"
},
%{
"comment" => nil,
"key" => "total",
"value" => "this.safeString (balance, 'balance')"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const result: Dict = {\n 'info': response,\n };\n const keys = Object.keys (response);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const balance = this.safeDict (response, key, {});\n const code = this.safeCurrencyCode (key);\n const account: Dict = {\n 'used': this.safeString (balance, 'balanceOnHold'),\n 'total': this.safeString (balance, 'balance'),\n };\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 425,
"line_start" => 366,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "code",
"value" => "code"
},
%{
"comment" => nil,
"key" => "name",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "active",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "deposit",
"value" => "this.safeBool (rawCurrency, 'walletDeposit')"
},
%{
"comment" => nil,
"key" => "withdraw",
"value" => "this.safeBool (rawCurrency, 'walletWithdrawal')"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "precision",
"value" => "currencyPrecision"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'withdraw': {\n 'min': undefined,\n 'max': undefined,\n },\n }"
},
%{
"comment" => nil,
"key" => "networks",
"value" => "networks"
},
%{
"comment" => nil,
"key" => "info",
"value" => "rawCurrency"
},
%{
"comment" => nil,
"key" => "id",
"value" => "networkId"
},
%{
"comment" => nil,
"key" => "network",
"value" => "networkCode"
},
%{
"comment" => nil,
"key" => "margin",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "deposit",
"value" => "deposit"
},
%{
"comment" => nil,
"key" => "withdraw",
"value" => "withdraw"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "this.safeNumber (rawNetwork, 'withdrawalFee')"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'deposit': {\n 'min': this.safeNumber (rawNetwork, 'minDeposit'),\n 'max': undefined,\n },\n 'withdraw': {\n 'min': this.safeNumber (rawNetwork, 'minWithdrawal'),\n 'max': undefined,\n },\n }"
},
%{
"comment" => nil,
"key" => "info",
"value" => "rawNetwork"
},
%{
"comment" => nil,
"key" => "deposit",
"value" => "{\n 'min': this.safeNumber (rawNetwork, 'minDeposit'),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "withdraw",
"value" => "{\n 'min': this.safeNumber (rawNetwork, 'minWithdrawal'),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "min",
"value" => "this.safeNumber (rawNetwork, 'minWithdrawal')"
},
%{
"comment" => nil,
"key" => "max",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "withdraw",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
}
],
"name" => "parseCurrency",
"signature" => "parseCurrency (rawCurrency: Dict): Currency",
"source" => "parseCurrency (rawCurrency: Dict): Currency {\n const id = this.safeString (rawCurrency, 'currency');\n const code = this.safeCurrencyCode (id);\n const type = this.safeBool (rawCurrency, 'fiat') ? 'fiat' : 'crypto';\n const currencyPrecision = this.parseNumber (this.parsePrecision (this.safeString (rawCurrency, 'precision')));\n const networks: Dict = {};\n const rawNetworks = this.safeDict (rawCurrency, 'blockchains', {});\n const keys = Object.keys (rawNetworks);\n for (let j = 0; j < keys.length; j++) {\n const networkId = keys[j];\n const rawNetwork = rawNetworks[networkId];\n const networkCode = this.networkIdToCode (networkId);\n const deposit = this.safeString (rawNetwork, 'deposit') === 'enabled';\n const withdraw = this.safeString (rawNetwork, 'withdrawal') === 'enabled';\n networks[networkCode] = {\n 'id': networkId,\n 'network': networkCode,\n 'margin': undefined,\n 'deposit': deposit,\n 'withdraw': withdraw,\n 'active': undefined,\n 'fee': this.safeNumber (rawNetwork, 'withdrawalFee'),\n 'precision': currencyPrecision,\n 'limits': {\n 'deposit': {\n 'min': this.safeNumber (rawNetwork, 'minDeposit'),\n 'max': undefined,\n },\n 'withdraw': {\n 'min': this.safeNumber (rawNetwork, 'minWithdrawal'),\n 'max': undefined,\n },\n },\n 'info': rawNetwork,\n };\n }\n return this.safeCurrencyStructure ({\n 'id': id,\n 'code': code,\n 'name': undefined,\n 'type': type,\n 'active': undefined,\n 'deposit': this.safeBool (rawCurrency, 'walletDeposit'),\n 'withdraw': this.safeBool (rawCurrency, 'walletWithdrawal'),\n 'fee': undefined,\n 'precision': currencyPrecision,\n 'limits': {\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'withdraw': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'networks': networks,\n 'info': rawCurrency,\n });\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1767,
"line_start" => 1755,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "depositAddress"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "currency['code']"
},
%{
"comment" => nil,
"key" => "network",
"value" => "this.networkIdToCode (this.safeString (depositAddress, 'blockchain'))"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
}
],
"name" => "parseDepositAddress",
"signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress",
"source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n const address = this.safeString (depositAddress, 'address');\n const currencyId = this.safeString (depositAddress, 'currency');\n currency = this.safeCurrency (currencyId, currency);\n this.checkAddress (address);\n return {\n 'info': depositAddress,\n 'currency': currency['code'],\n 'network': this.networkIdToCode (this.safeString (depositAddress, 'blockchain')),\n 'address': address,\n 'tag': undefined,\n } as DepositAddress;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1486,
"line_start" => 1454,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "item"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (item, 'transactionId')"
},
%{
"comment" => nil,
"key" => "direction",
"value" => "direction"
},
%{
"comment" => nil,
"key" => "account",
"value" => "this.safeString (item, 'accountId', '')"
},
%{
"comment" => nil,
"key" => "referenceAccount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "referenceId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.parseLedgerEntryType (type)"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.parseNumber (amount)"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "before",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "after",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseLedgerEntry",
"signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
"source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n let amount = this.safeString (item, 'amount');\n let direction = undefined;\n if (Precise.stringLe (amount, '0')) {\n direction = 'out';\n amount = Precise.stringMul ('-1', amount);\n } else {\n direction = 'in';\n }\n const currencyId = this.safeString (item, 'currency');\n currency = this.safeCurrency (currencyId, currency);\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestampString = this.safeString (item, 'timestamp');\n const timestamp = this.parse8601 (timestampString);\n const type = this.safeString (item, 'type');\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': this.safeString (item, 'transactionId'),\n 'direction': direction,\n 'account': this.safeString (item, 'accountId', ''),\n 'referenceAccount': undefined,\n 'referenceId': undefined,\n 'type': this.parseLedgerEntryType (type),\n 'currency': code,\n 'amount': this.parseNumber (amount),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'before': undefined,\n 'after': undefined,\n 'status': undefined,\n 'fee': undefined,\n }, currency) as LedgerEntry;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1495,
"line_start" => 1488,
"mappings" => [],
"name" => "parseLedgerEntryType",
"signature" => "parseLedgerEntryType (type)",
"source" => "parseLedgerEntryType (type) {\n const ledgerType: Dict = {\n 'deposit': 'deposit',\n 'withdraw': 'withdrawal',\n 'commission': 'fee',\n };\n return this.safeString (ledgerType, type, type);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 521,
"line_start" => 462,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "base",
"value" => "base"
},
%{
"comment" => nil,
"key" => "baseId",
"value" => "baseId"
},
%{
"comment" => nil,
"key" => "quote",
"value" => "quote"
},
%{
"comment" => nil,
"key" => "quoteId",
"value" => "quoteId"
},
%{
"comment" => nil,
"key" => "settle",
"value" => "undefined"
},
%{
"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" => "contract",
"value" => "false"
},
%{
"comment" => nil,
"key" => "linear",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "inverse",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiry",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiryDatetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "strike",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "optionType",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'amount': {\n 'min': this.safeNumber (market, 'baseMin'),\n 'max': this.safeNumber (market, 'baseMax'),\n },\n 'price': {\n 'min': this.safeNumber (market, 'minPrice'),\n 'max': this.safeNumber (market, 'maxPrice'),\n },\n 'cost': {\n 'min': this.safeNumber (market, 'quoteMin'),\n 'max': this.safeNumber (market, 'quoteMax'),\n },\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n }"
},
%{
"comment" => "'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteLotSize'))), // buggy, doesn't reflect their documentation\n 'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n 'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n }",
"key" => "precision",
"value" => "{\n 'amount': this.safeString (market, 'baseLotSize'),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision')))"
},
%{
"comment" => nil,
"key" => "active",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "created",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "market"
},
%{
"comment" => nil,
"key" => "min",
"value" => "this.safeNumber (market, 'minPrice')"
},
%{
"comment" => nil,
"key" => "max",
"value" => "this.safeNumber (market, 'maxPrice')"
},
%{
"comment" => nil,
"key" => "min",
"value" => "this.safeNumber (market, 'quoteMin')"
},
%{
"comment" => nil,
"key" => "max",
"value" => "this.safeNumber (market, 'quoteMax')"
},
%{
"comment" => nil,
"key" => "min",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "max",
"value" => "undefined"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (market: Dict): Market",
"source" => "parseMarket (market: Dict): Market {\n const baseId = this.safeString (market, 'base');\n const base = this.safeCurrencyCode (baseId);\n const quoteId = this.safeString (market, 'quote');\n const quote = this.safeCurrencyCode (quoteId);\n const id = base + '-' + quote; // not actual id, but for this exchange we can use this abbreviation, because e.g. tickers have hyphen in between\n const symbol = base + '/' + quote;\n return this.safeMarketStructure ({\n 'id': id,\n 'symbol': symbol,\n 'base': base,\n 'baseId': baseId,\n 'quote': quote,\n 'quoteId': quoteId,\n 'settle': undefined,\n 'settleId': undefined,\n 'type': 'spot',\n 'spot': true,\n 'margin': false,\n 'swap': false,\n 'future': false,\n 'option': false,\n 'contract': false,\n 'linear': undefined,\n 'inverse': undefined,\n 'contractSize': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'limits': {\n 'amount': {\n 'min': this.safeNumber (market, 'baseMin'),\n 'max': this.safeNumber (market, 'baseMax'),\n },\n 'price': {\n 'min': this.safeNumber (market, 'minPrice'),\n 'max': this.safeNumber (market, 'maxPrice'),\n },\n 'cost': {\n 'min': this.safeNumber (market, 'quoteMin'),\n 'max': this.safeNumber (market, 'quoteMax'),\n },\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'precision': {\n 'amount': this.safeString (market, 'baseLotSize'),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'pricePrecision'))),\n // 'cost': this.parseNumber (this.parsePrecision (this.safeString (market, 'quoteLotSize'))), // buggy, doesn't reflect their documentation\n 'base': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n 'quote': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n },\n 'active': undefined,\n 'created': undefined,\n 'info': market,\n });\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 831,
"line_start" => 822,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n return [\n this.safeInteger (ohlcv, 'timestamp'),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'volume'),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1246,
"line_start" => 1167,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (order, 'orderId')"
},
%{
"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" => "lastUpdateTimestamp",
"value" => "this.safeInteger (order, 'lastUpdateTimestamp')"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.safeStringLower (order, 'orderType')"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "this.safeString (order, 'timeInForce')"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "this.safeStringLower (order, 'side')"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.safeNumber (order, 'price')"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "this.safeNumber (order, 'stopPrice')"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "requestedBase"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "executedQuote"
},
%{
"comment" => nil,
"key" => "average",
"value" => "this.safeNumber (order, 'averagePrice')"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "executedBase"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "feeCode"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "feeAmount"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // \"orderId\": \"1313003\",\n // \"clientOrderId\": \"037F0AFEB93A\",\n // \"clientId\": \"up421412345\",\n // \"accountId\": null,\n // \"status\": \"FILLED\",\n // \"statusIsFinal\": true,\n // \"currency1\": \"AI\",\n // \"currency2\": \"USDT\",\n // \"side\": \"BUY\",\n // \"orderType\": \"Market\",\n // \"timeInForce\": \"IOC\",\n // \"comment\": null,\n // \"rejectCode\": null,\n // \"rejectReason\": null,\n // \"initialOnHoldAmountCcy1\": null,\n // \"initialOnHoldAmountCcy2\": \"10.23456700\",\n // \"executedAmountCcy1\": \"25.606429\",\n // \"executedAmountCcy2\": \"10.20904439\",\n // \"requestedAmountCcy1\": null,\n // \"requestedAmountCcy2\": \"10.20904439\",\n // \"originalAmountCcy2\": \"10.23456700\",\n // \"feeAmount\": \"0.02552261\",\n // \"feeCurrency\": \"USDT\",\n // \"price\": null,\n // \"averagePrice\": \"0.3986\",\n // \"clientCreateTimestamp\": \"1728474625320\",\n // \"serverCreateTimestamp\": \"1728474624956\",\n // \"lastUpdateTimestamp\": \"1728474628015\",\n // \"expireTime\": null,\n // \"effectiveTime\": null\n //\n const currency1 = this.safeString (order, 'currency1');\n const currency2 = this.safeString (order, 'currency2');\n let marketId = undefined;\n if (currency1 !== undefined && currency2 !== undefined) {\n marketId = currency1 + '-' + currency2;\n }\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const status = this.parseOrderStatus (this.safeString (order, 'status'));\n const fee = {};\n const feeAmount = this.safeNumber (order, 'feeAmount');\n if (feeAmount !== undefined) {\n const currencyId = this.safeString (order, 'feeCurrency');\n const feeCode = this.safeCurrencyCode (currencyId);\n fee['currency'] = feeCode;\n fee['cost'] = feeAmount;\n }\n const timestamp = this.safeInteger (order, 'serverCreateTimestamp');\n const requestedBase = this.safeNumber (order, 'requestedAmountCcy1');\n const executedBase = this.safeNumber (order, 'executedAmountCcy1');\n // const requestedQuote = this.safeNumber (order, 'requestedAmountCcy2');\n const executedQuote = this.safeNumber (order, 'executedAmountCcy2');\n return this.safeOrder ({\n 'id': this.safeString (order, 'orderId'),\n 'clientOrderId': this.safeString (order, 'clientOrderId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastUpdateTimestamp': this.safeInteger (order, 'lastUpdateTimestamp'),\n 'lastTradeTimestamp': undefined,\n 'symbol': symbol,\n 'type': this.safeStringLower (order, 'orderType'),\n 'timeInForce': this.safeString (order, 'timeInForce'),\n 'postOnly': undefined,\n 'side': this.safeStringLower (order, 'side'),\n 'price': this.safeNumber (order, 'price'),\n 'triggerPrice': this.safeNumber (order, 'stopPrice'),\n 'amount': requestedBase,\n 'cost': executedQuote,\n 'average': this.safeNumber (order, 'averagePrice'),\n 'filled': executedBase,\n 'remaining': undefined,\n 'status': status,\n 'fee': fee,\n 'trades': undefined,\n 'info': order,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1165,
"line_start" => 1153,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'PENDING_NEW': 'open',\n 'NEW': 'open',\n 'PARTIALLY_FILLED': 'open',\n 'FILLED': 'closed',\n 'EXPIRED': 'expired',\n 'REJECTED': 'rejected',\n 'PENDING_CANCEL': 'canceling',\n 'CANCELLED': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 631,
"line_start" => 607,
"mappings" => [
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "high",
"value" => "this.safeNumber (ticker, 'high')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeNumber (ticker, 'low')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "this.safeNumber (ticker, 'bestBid')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeNumber (ticker, 'bestAsk')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "this.safeString (ticker, 'last')"
},
%{
"comment" => nil,
"key" => "change",
"value" => "this.safeNumber (ticker, 'priceChange')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "this.safeNumber (ticker, 'priceChangePercentage')"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'volume')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "this.safeString (ticker, '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 const marketId = this.safeString (ticker, 'id');\n const symbol = this.safeSymbol (marketId, market);\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'high': this.safeNumber (ticker, 'high'),\n 'low': this.safeNumber (ticker, 'low'),\n 'bid': this.safeNumber (ticker, 'bestBid'),\n 'bidVolume': undefined,\n 'ask': this.safeNumber (ticker, 'bestAsk'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': this.safeString (ticker, 'last'), // last indicative price per api docs (difference also seen here: https://github.com/ccxt/ccxt/actions/runs/14593899575/job/40935513901?pr=25767#step:11:456 )\n 'previousClose': undefined,\n 'change': this.safeNumber (ticker, 'priceChange'),\n 'percentage': this.safeNumber (ticker, 'priceChangePercentage'),\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'volume'),\n 'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"tradeId\": \"1728630559823-0\",\n \"dateISO\": \"2024-10-11T07:09:19.823Z\",\n \"side\": \"SELL\",\n \"price\": \"60879.5\",\n \"amount\": \"0.00165962\"\n },"
],
"line_end" => 713,
"line_start" => 683,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (trade, 'tradeId')"
},
%{
"comment" => nil,
"key" => "order",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "this.safeStringLower (trade, 'side')"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.safeString (trade, 'price')"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeString (trade, 'amount')"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // public fetchTrades\n //\n // {\n // \"tradeId\": \"1728630559823-0\",\n // \"dateISO\": \"2024-10-11T07:09:19.823Z\",\n // \"side\": \"SELL\",\n // \"price\": \"60879.5\",\n // \"amount\": \"0.00165962\"\n // },\n //\n const dateStr = this.safeString (trade, 'dateISO');\n const timestamp = this.parse8601 (dateStr);\n market = this.safeMarket (undefined, market);\n return this.safeTrade ({\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'id': this.safeString (trade, 'tradeId'),\n 'order': undefined,\n 'type': undefined,\n 'takerOrMaker': undefined,\n 'side': this.safeStringLower (trade, 'side'),\n 'price': this.safeString (trade, 'price'),\n 'amount': this.safeString (trade, 'amount'),\n 'cost': undefined,\n 'fee': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 890,
"line_start" => 881,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "this.safeString (market, 'symbol')"
},
%{
"comment" => nil,
"key" => "maker",
"value" => "this.safeNumber (fee, 'percent')"
},
%{
"comment" => nil,
"key" => "taker",
"value" => "this.safeNumber (fee, 'percent')"
},
%{
"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 return {\n 'info': fee,\n 'symbol': this.safeString (market, 'symbol'),\n 'maker': this.safeNumber (fee, 'percent'),\n 'taker': this.safeNumber (fee, 'percent'),\n 'percentage': undefined,\n 'tierBased': undefined,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 879,
"line_start" => 859,
"mappings" => [],
"name" => "parseTradingFees",
"signature" => "parseTradingFees (response, useKeyAsId = false): TradingFees",
"source" => "parseTradingFees (response, useKeyAsId = false): TradingFees {\n const result: Dict = {};\n const keys = Object.keys (response);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n let market = undefined;\n if (useKeyAsId) {\n market = this.safeMarket (key);\n }\n const parsed = this.parseTradingFee (response[key], market);\n result[parsed['symbol']] = parsed;\n }\n for (let i = 0; i < this.symbols.length; i++) {\n const symbol = this.symbols[i];\n if (!(symbol in result)) {\n const market = this.market (symbol);\n result[symbol] = this.parseTradingFee (response, market);\n }\n }\n return result;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1581,
"line_start" => 1549,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'txId')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'amount')"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (this.safeString (transaction, 'status'))"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "address",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "{\n 'currency': code,\n 'cost': this.safeNumber (transaction, 'commissionAmount'),\n }"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeNumber (transaction, 'commissionAmount')"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n const currencyId = this.safeString (transaction, 'currency');\n const direction = this.safeString (transaction, 'direction');\n const type = (direction === 'withdraw') ? 'withdrawal' : 'deposit';\n const code = this.safeCurrencyCode (currencyId, currency);\n const updatedAt = this.safeString (transaction, 'updatedAt');\n const timestamp = this.parse8601 (updatedAt);\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'txId'),\n 'txid': undefined,\n 'type': type,\n 'currency': code,\n 'network': undefined,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'status': this.parseTransactionStatus (this.safeString (transaction, 'status')),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': undefined,\n 'addressFrom': undefined,\n 'addressTo': undefined,\n 'tag': undefined,\n 'tagFrom': undefined,\n 'tagTo': undefined,\n 'updated': undefined,\n 'comment': undefined,\n 'fee': {\n 'currency': code,\n 'cost': this.safeNumber (transaction, 'commissionAmount'),\n },\n 'internal': undefined,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1590,
"line_start" => 1583,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'rejected': 'rejected',\n 'pending': 'pending',\n 'approved': 'ok',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"ok\": \"ok\",\n \"data\": {\n \"transactionId\": \"30225415\"\n }\n }",
"{\n \"ok\": \"ok\",\n \"data\": {\n \"accountId\": \"sub1\",\n \"clientTxId\": \"27ba8284-67cf-4386-9ec7-80b3871abd45\",\n \"currency\": \"USDT\",\n \"status\": \"approved\"\n }\n }"
],
"line_end" => 1712,
"line_start" => 1676,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transfer"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString2 (transfer, 'transactionId', 'clientTxId')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "currencyCode"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fromAccount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "toAccount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (this.safeString (transfer, 'status'))"
}
],
"name" => "parseTransfer",
"signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
"source" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n //\n // transferBetweenSubAccounts\n //\n // {\n // \"ok\": \"ok\",\n // \"data\": {\n // \"transactionId\": \"30225415\"\n // }\n // }\n //\n // transfer between main/sub\n //\n // {\n // \"ok\": \"ok\",\n // \"data\": {\n // \"accountId\": \"sub1\",\n // \"clientTxId\": \"27ba8284-67cf-4386-9ec7-80b3871abd45\",\n // \"currency\": \"USDT\",\n // \"status\": \"approved\"\n // }\n // }\n //\n const currencyId = this.safeString (transfer, 'currency');\n const currencyCode = this.safeCurrencyCode (currencyId, currency);\n return {\n 'info': transfer,\n 'id': this.safeString2 (transfer, 'transactionId', 'clientTxId'),\n 'timestamp': undefined,\n 'datetime': undefined,\n 'currency': currencyCode,\n 'amount': undefined,\n 'fromAccount': undefined,\n 'toAccount': undefined,\n 'status': this.parseTransactionStatus (this.safeString (transfer, 'status')),\n };\n }"
}
],
path_prefix: "",
pro: true,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 300,
period: 1000,
requests: 3,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 5,
method: :post,
path: "/do_cancel_all_orders"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/do_cancel_my_order"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/do_create_account"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/do_deposit_funds_from_wallet"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/do_my_internal_transfer"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/do_my_new_order"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/do_withdrawal_funds_to_wallet"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_candles"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_deposit_address"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_fee_strategy"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_my_account_status_v3"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_my_current_fee"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_my_funding_history"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_my_orders"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_my_transaction_history"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_my_volume"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_my_wallet_balance"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_order_book"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/get_processing_info"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_trade_history"
}
],
public: [
%{
auth: false,
cost: 1,
method: :post,
path: "/get_candles"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_currencies_info"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_order_book"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_pairs_info"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/get_processing_info"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_server_time"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_ticker"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/get_trade_history"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
api_key_header: "X-AGGR-KEY",
confidence: :medium,
pattern: :hmac_sha256_headers,
signature_encoding: :base64,
signature_header: "X-AGGR-SIGNATURE"
},
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" => 12710000,
"min" => 144
},
"cost" => %{
"max" => 1000000,
"min" => 10
},
"price" => %{
"max" => 7.5,
"min" => 0.0114
}
},
sample_precision: %{
"amount" => "0.000001",
"base" => 1.0e-6,
"price" => 0.0001,
"quote" => 1.0e-8
},
spot: %{
base: "A",
base_id: "A",
case: :upper,
contract: false,
id: "A-USD",
limits: %{
"amount" => %{
"max" => 12710000,
"min" => 144
},
"cost" => %{
"max" => 1000000,
"min" => 10
},
"leverage" => %{},
"price" => %{
"max" => 7.5,
"min" => 0.0114
}
},
precision: %{
"amount" => "0.000001",
"base" => 1.0e-6,
"price" => 0.0001,
"quote" => 1.0e-8
},
quote: "USD",
quote_id: "USD",
separator: "-",
symbol: "A/USD"
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :dash_upper,
separator: "-",
suffix: nil
}
},
timeframes: %{
"15m" => "15m",
"1d" => "1d",
"1h" => "1h",
"1m" => "1m",
"2h" => "2h",
"30m" => "30m",
"4h" => "4h",
"5m" => "5m"
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://trade.cex.io/api/spot/rest-public",
api_sections: %{
"private" => "https://trade.cex.io/api/spot/rest",
"public" => "https://trade.cex.io/api/spot/rest-public"
},
doc: "https://trade.cex.io/docs/",
other: nil,
sandbox: nil,
www: "https://cex.io"
},
version: nil,
ws: %{
auth: %{
algorithm: :sha256,
encoding: :hex,
market_specific: false,
message_format: :op_args,
op_field: "op",
op_value: "auth",
pattern: :generic_hmac,
payload_format: "custom",
requires_passphrase: false,
timestamp_unit: :seconds
},
channel_templates: %{
watch_balance: %{
auth_required: true,
market_id_format: :native,
params: [],
pattern: :event_based
},
watch_my_trades: %{
auth_required: true,
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :event_based
},
watch_ohlcv: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :event_based
},
watch_order_book: %{
auth_required: true,
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :event_based
},
watch_orders: %{
auth_required: true,
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :event_based
},
watch_ticker: %{
auth_required: true,
market_id_format: :native,
params: [],
pattern: :event_based
},
watch_tickers: %{
market_id_format: :native,
params: [],
pattern: :event_based
},
watch_trades: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :event_based
}
},
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: false
},
message_patterns: [
%{
format: :custom,
keys: [
"auth",
"e"
],
sources: [
:send,
:watch
]
},
%{
format: :custom,
keys: [
"e",
"i",
"rooms"
],
sources: [
:send,
:watch
]
},
%{
format: :custom,
keys: [
"e",
"rooms"
],
sources: [
:send,
:watch
]
},
%{
args_field: "data",
format: :custom,
keys: [
"data",
"e",
"oid"
],
sources: [
:send,
:watch
]
}
],
subscription_config: %{
args_field: "channel",
args_format: :string,
market_id_format: :native,
op_field: "event"
},
subscription_pattern: :event_subscribe,
urls: "wss://ws.cex.io/ws",
watch_methods: [
"watchBalance",
"watchMyTrades",
"watchOHLCV",
"watchOrderBook",
"watchOrders",
"watchTicker",
"watchTickers",
"watchTrades"
]
}
}