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 ndax.exs
Raw

priv/specs/extracted/ndax.exs

# NDAX Exchange Specification
#
# Auto-generated by: mix ccxt.extract ndax
# 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: [
"CA"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 7,
"coveragePercent" => 100,
"enabledMethods" => 29,
"excluded" => [],
"excludedMethods" => 0,
"extractableMethods" => 29,
"failures" => [
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "cancelAllOrders"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "cancelOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createDepositAddress"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createLimitOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createMarketOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createStopLimitOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createStopMarketOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "createStopOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "editOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchAccounts"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchBalance"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchDepositAddress"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchDeposits"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchLedger"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchMyTrades"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchOpenOrders"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchOrder"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchOrders"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchOrderTrades"
},
%{
"error" => "ndax fetchAccounts() requires exchange.login email credential",
"method" => "fetchWithdrawals"
},
%{
"error" => "ndax call signIn() method to obtain a session token",
"method" => "withdraw"
}
]
},
endpoints: [
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/GetProducts",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"Depth" => 100,
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "InstrumentId"
},
params: [
:symbol,
:limit
],
path: "/GetL2Snapshot",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/GetInstruments",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"FromDate" => "2024-01-01 00:00:00",
"Interval" => "3600",
"ToDate" => "2024-01-05 04:00:00",
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"symbol" => "InstrumentId"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/GetTickerHistory",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"limit" => "Depth",
"symbol" => "InstrumentId"
},
params: [
:symbol,
:limit
],
path: "/GetL2Snapshot",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "InstrumentId"
},
params: [
:symbol
],
path: "/GetLevel1",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"omsId" => 1
},
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"limit" => "Count",
"symbol" => "InstrumentId"
},
params: [
:symbol,
:since,
:limit
],
path: "/GetLastTrades",
source: :intercepted
}
],
error_code_details: %{
"Invalid InstrumentId" => %{
description: "{\"result\":false,\"errormsg\":\"Invalid InstrumentId: 10000\",\"errorcode\":100,\"detail\":null}",
type: :invalid_order
},
"Not_Enough_Funds" => %{
description: "{\"status\":\"Rejected\",\"errormsg\":\"Not_Enough_Funds\",\"errorcode\":101}",
type: :insufficient_balance
},
"Resource Not Found" => %{
description: "{\"result\":false,\"errormsg\":\"Resource Not Found\",\"errorcode\":104,\"detail\":null}",
type: :order_not_found
},
"Server Error" => %{
description: "{\"result\":false,\"errormsg\":\"Server Error\",\"errorcode\":102,\"detail\":null}",
type: :exchange_error
},
"This endpoint requires 2FACode along with the payload" => %{
description: nil,
type: :invalid_credentials
}
},
error_codes: %{
"Invalid InstrumentId" => :invalid_order,
"Not_Enough_Funds" => :insufficient_balance,
"Resource Not Found" => :order_not_found,
"Server Error" => :exchange_error,
"This endpoint requires 2FACode along with the payload" => :invalid_credentials
},
exceptions: %{
broad: %{
"Invalid InstrumentId" => :bad_symbol,
"This endpoint requires 2FACode along with the payload" => :authentication_error
},
exact: %{
"Not_Enough_Funds" => :insufficient_funds,
"Resource Not Found" => :order_not_found,
"Server Error" => :exchange_error
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networksById" => %{},
"omsId" => 1,
"orderTypes" => %{
"1" => 1,
"2" => 2,
"3" => 3,
"4" => 4,
"5" => 5,
"6" => 6,
"7" => 7,
"BlockTrade" => 7,
"Limit" => 2,
"Market" => 1,
"StopLimit" => 4,
"StopMarket" => 3,
"TrailingStopLimit" => 6,
"TrailingStopMarket" => 5
}
},
extended_metadata: %{
fees_url: "https://ndax.io/fees",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/108623144-67a3ef00-744e-11eb-8140-75c6b851e945.jpg",
referral_url: "https://one.ndax.io/bfQiSL"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: true,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: true,
gtd: false,
ioc: true,
po: true
},
trailing: false,
trigger_direction: false,
trigger_price: true,
trigger_price_type: %{
index: false,
last: true,
mark: false
}
},
fetch_my_trades: %{
days_back: 100000,
limit: 100,
margin_mode: false,
symbol_required: false,
until_days: 100000
},
fetch_ohlcv: %{},
fetch_open_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: true
},
swap: %{}
},
fees: %{
trading: %{
maker: 0.002,
percentage: true,
taker: 0.0025,
tier_based: false
}
},
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (code === 404) {\n throw new errors.AuthenticationError(this.id + ' ' + body);\n }\n if (response === undefined) {\n return undefined;\n }\n //\n // {\"status\":\"Rejected\",\"errormsg\":\"Not_Enough_Funds\",\"errorcode\":101}\n // {\"result\":false,\"errormsg\":\"Server Error\",\"errorcode\":102,\"detail\":null}\n //\n const message = this.safeString(response, 'errormsg');\n if ((message !== undefined) && (message !== '')) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n throw new errors.ExchangeError(feedback);\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: false,
cancel_all_orders: true,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: false,
cancel_orders_with_client_order_id: false,
cancel_orders_ws: false,
close_all_positions: false,
close_position: false,
create_deposit_address: 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: 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: true,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: true,
create_stop_market_order_ws: false,
create_stop_order: true,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: true,
fetch_all_greeks: false,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: false,
fetch_closed_orders_ws: false,
fetch_convert_currencies: false,
fetch_convert_quote: false,
fetch_convert_trade: false,
fetch_convert_trade_history: false,
fetch_cross_borrow_rate: false,
fetch_cross_borrow_rates: false,
fetch_currencies: true,
fetch_currencies_ws: true,
fetch_deposit: false,
fetch_deposit_address: true,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: false,
fetch_deposit_withdraw_fees: false,
fetch_deposits: true,
fetch_deposits_withdrawals: false,
fetch_deposits_ws: false,
fetch_funding_history: false,
fetch_funding_interval: false,
fetch_funding_intervals: false,
fetch_funding_rate: false,
fetch_funding_rate_history: false,
fetch_funding_rates: false,
fetch_greeks: false,
fetch_index_ohlcv: false,
fetch_isolated_borrow_rate: false,
fetch_isolated_borrow_rates: false,
fetch_isolated_positions: false,
fetch_l2_order_book: true,
fetch_l3_order_book: false,
fetch_last_prices: false,
fetch_ledger: 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_price: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: true,
fetch_my_trades_ws: false,
fetch_ohlcv: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: true,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: true,
fetch_order_with_client_order_id: false,
fetch_order_ws: false,
fetch_orders: true,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: false,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: false,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: false,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: true,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
sandbox: true,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: true,
spot: true,
swap: false,
transfer: false,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: false,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: false,
watch_ohlcv: true,
watch_ohlcv_for_symbols: false,
watch_order_book: true,
watch_order_book_for_symbols: false,
watch_orders: false,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: true,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: false,
withdraw: true,
ws: false
},
http_config: nil,
id: "ndax",
markets: nil,
name: "NDAX",
ohlcv_timestamp_resolution: :unknown,
options: %{
oms_id: 1,
order_types: %{
"1" => 1,
"2" => 2,
"3" => 3,
"4" => 4,
"5" => 5,
"6" => 6,
"7" => 7,
"BlockTrade" => 7,
"Limit" => 2,
"Market" => 1,
"StopLimit" => 4,
"StopMarket" => 3,
"TrailingStopLimit" => 6,
"TrailingStopMarket" => 5
}
},
order_mappings: nil,
param_mappings: %{
"limit" => "Count",
"symbol" => "InstrumentId"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 1174,
"line_start" => 1156,
"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, 'ProductId');\n if (currencyId in this.currencies_by_id) {\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['total'] = this.safeString (balance, 'Amount');\n account['used'] = this.safeString (balance, 'Hold');\n result[code] = account;\n }\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"result\":true,\n \"errormsg\":null,\n \"statuscode\":0,\n \"AssetManagerId\":1,\n \"AccountId\":449,\n \"AssetId\":1,\n \"ProviderId\":1,\n \"DepositInfo\":\"[\\\"r3e95RwVsLH7yCbnMfyh7SA8FdwUJCB4S2?memo=241452010\\\"]\"\n }"
],
"line_end" => 2168,
"line_start" => 2134,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "depositAddress"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"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 // fetchDepositAddress, createDepositAddress\n //\n // {\n // \"result\":true,\n // \"errormsg\":null,\n // \"statuscode\":0,\n // \"AssetManagerId\":1,\n // \"AccountId\":449,\n // \"AssetId\":1,\n // \"ProviderId\":1,\n // \"DepositInfo\":\"[\\\"r3e95RwVsLH7yCbnMfyh7SA8FdwUJCB4S2?memo=241452010\\\"]\"\n // }\n //\n const depositInfoString = this.safeString (depositAddress, 'DepositInfo');\n const depositInfo = JSON.parse (depositInfoString);\n const depositInfoLength = depositInfo.length;\n const lastString = this.safeString (depositInfo, depositInfoLength - 1);\n const parts = lastString.split ('?memo=');\n const address = this.safeString (parts, 0);\n const tag = this.safeString (parts, 1);\n let code = undefined;\n if (currency !== undefined) {\n code = currency['code'];\n }\n this.checkAddress (address);\n return {\n 'info': depositAddress,\n 'currency': code,\n 'network': undefined,\n 'address': address,\n 'tag': tag,\n } as DepositAddress;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"TransactionId\": 2663709493,\n \"ReferenceId\": 68,\n \"OMSId\": 1,\n \"AccountId\": 449,\n \"CR\": 10.000000000000000000000000000,\n \"DR\": 0.0000000000000000000000000000,\n \"Counterparty\": 3,\n \"TransactionType\": \"Other\",\n \"ReferenceType\": \"Deposit\",\n \"ProductId\": 1,\n \"Balance\": 10.000000000000000000000000000,\n \"TimeStamp\": 1607532331591\n }"
],
"line_end" => 1307,
"line_start" => 1252,
"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" => "referenceId",
"value" => "this.safeString (item, 'ReferenceId')"
},
%{
"comment" => nil,
"key" => "referenceAccount",
"value" => "this.safeString (item, 'Counterparty')"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.parseLedgerEntryType (this.safeString (item, 'ReferenceType'))"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "this.safeCurrencyCode (currencyId, currency)"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.parseNumber (amount)"
},
%{
"comment" => nil,
"key" => "before",
"value" => "this.parseNumber (before)"
},
%{
"comment" => nil,
"key" => "after",
"value" => "this.parseNumber (after)"
},
%{
"comment" => nil,
"key" => "status",
"value" => "'ok'"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"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 //\n // {\n // \"TransactionId\": 2663709493,\n // \"ReferenceId\": 68,\n // \"OMSId\": 1,\n // \"AccountId\": 449,\n // \"CR\": 10.000000000000000000000000000,\n // \"DR\": 0.0000000000000000000000000000,\n // \"Counterparty\": 3,\n // \"TransactionType\": \"Other\",\n // \"ReferenceType\": \"Deposit\",\n // \"ProductId\": 1,\n // \"Balance\": 10.000000000000000000000000000,\n // \"TimeStamp\": 1607532331591\n // }\n //\n const currencyId = this.safeString (item, 'ProductId');\n currency = this.safeCurrency (currencyId, currency);\n const credit = this.safeString (item, 'CR');\n const debit = this.safeString (item, 'DR');\n let amount = undefined;\n let direction = undefined;\n if (Precise.stringLt (credit, '0')) {\n amount = credit;\n direction = 'in';\n } else if (Precise.stringLt (debit, '0')) {\n amount = debit;\n direction = 'out';\n }\n let before = undefined;\n const after = this.safeString (item, 'Balance');\n if (direction === 'out') {\n before = Precise.stringAdd (after, amount);\n } else if (direction === 'in') {\n before = Precise.stringMax ('0', Precise.stringSub (after, amount));\n }\n const timestamp = this.safeInteger (item, 'TimeStamp');\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': this.safeString (item, 'TransactionId'),\n 'direction': direction,\n 'account': this.safeString (item, 'AccountId'),\n 'referenceId': this.safeString (item, 'ReferenceId'),\n 'referenceAccount': this.safeString (item, 'Counterparty'),\n 'type': this.parseLedgerEntryType (this.safeString (item, 'ReferenceType')),\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'amount': this.parseNumber (amount),\n 'before': this.parseNumber (before),\n 'after': this.parseNumber (after),\n 'status': 'ok',\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'fee': undefined,\n }, currency) as LedgerEntry;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1250,
"line_start" => 1233,
"mappings" => [],
"name" => "parseLedgerEntryType",
"signature" => "parseLedgerEntryType (type)",
"source" => "parseLedgerEntryType (type) {\n const types: Dict = {\n 'Trade': 'trade',\n 'Deposit': 'transaction',\n 'Withdraw': 'transaction',\n 'Transfer': 'transfer',\n 'OrderHold': 'trade',\n 'WithdrawHold': 'transaction',\n 'DepositHold': 'transaction',\n 'MarginHold': 'trade',\n 'ManualHold': 'trade',\n 'ManualEntry': 'trade',\n 'MarginAcquisition': 'trade',\n 'MarginRelinquish': 'trade',\n 'MarginQuoteHold': 'trade',\n };\n return this.safeString (types, type, type);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 645,
"line_start" => 586,
"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" => "(sessionRunning && !isDisable)"
},
%{
"comment" => nil,
"key" => "contract",
"value" => "false"
},
%{
"comment" => nil,
"key" => "linear",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "inverse",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiry",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiryDatetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "strike",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "optionType",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "precision",
"value" => "{\n 'amount': this.safeNumber (market, 'QuantityIncrement'),\n 'price': this.safeNumber (market, 'PriceIncrement'),\n }"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'MinimumQuantity'),\n 'max': undefined,\n },\n 'price': {\n 'min': this.safeNumber (market, 'MinimumPrice'),\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" => "leverage",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "{\n 'min': this.safeNumber (market, 'MinimumQuantity'),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "price",
"value" => "{\n 'min': this.safeNumber (market, 'MinimumPrice'),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "min",
"value" => "this.safeNumber (market, 'MinimumPrice')"
},
%{
"comment" => nil,
"key" => "max",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "min",
"value" => "undefined"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (market: Dict): Market",
"source" => "parseMarket (market: Dict): Market {\n const id = this.safeString (market, 'InstrumentId');\n // const lowercaseId = this.safeStringLower (market, 'symbol');\n const baseId = this.safeString (market, 'Product1');\n const quoteId = this.safeString (market, 'Product2');\n const base = this.safeCurrencyCode (this.safeString (market, 'Product1Symbol'));\n const quote = this.safeCurrencyCode (this.safeString (market, 'Product2Symbol'));\n const sessionStatus = this.safeString (market, 'SessionStatus');\n const isDisable = this.safeValue (market, 'IsDisable');\n const sessionRunning = (sessionStatus === 'Running');\n return {\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': (sessionRunning && !isDisable),\n 'contract': false,\n 'linear': undefined,\n 'inverse': undefined,\n 'contractSize': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.safeNumber (market, 'QuantityIncrement'),\n 'price': this.safeNumber (market, 'PriceIncrement'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'MinimumQuantity'),\n 'max': undefined,\n },\n 'price': {\n 'min': this.safeNumber (market, 'MinimumPrice'),\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 1501603632000, // 0 DateTime\n 2700.33, // 1 High\n 2687.01, // 2 Low\n 2687.01, // 3 Open\n 2687.01, // 4 Close\n 24.86100992, // 5 Volume\n 0, // 6 Inside Bid Price\n 2870.95, // 7 Inside Ask Price\n 1 // 8 InstrumentId\n ]"
],
"line_end" => 871,
"line_start" => 849,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // [\n // 1501603632000, // 0 DateTime\n // 2700.33, // 1 High\n // 2687.01, // 2 Low\n // 2687.01, // 3 Open\n // 2687.01, // 4 Close\n // 24.86100992, // 5 Volume\n // 0, // 6 Inside Bid Price\n // 2870.95, // 7 Inside Ask Price\n // 1 // 8 InstrumentId\n // ]\n //\n return [\n this.safeInteger (ohlcv, 0),\n this.safeNumber (ohlcv, 3),\n this.safeNumber (ohlcv, 1),\n this.safeNumber (ohlcv, 2),\n this.safeNumber (ohlcv, 4),\n this.safeNumber (ohlcv, 5),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"status\":\"Accepted\",\n \"errormsg\":\"\",\n \"OrderId\": 2543565231\n }",
"{\n \"ReplacementOrderId\": 1234,\n \"ReplacementClOrdId\": 1561,\n \"OrigOrderId\": 5678,\n \"OrigClOrdId\": 91011,\n }",
"{\n \"Side\":\"Buy\",\n \"OrderId\":2543565233,\n \"Price\":19010,\n \"Quantity\":0.345,\n \"DisplayQuantity\":0.345,\n \"Instrument\":8,\n \"Account\":449,\n \"AccountName\":\"igor@ccxt.trade\",\n \"OrderType\":\"Limit\",\n \"ClientOrderId\":0,\n \"OrderState\":\"Working\",\n \"ReceiveTime\":1607579326003,\n \"ReceiveTimeTicks\":637431761260028981,\n \"LastUpdatedTime\":1607579326005,\n \"LastUpdatedTimeTicks\":637431761260054714,\n \"OrigQuantity\":0.345,\n \"QuantityExecuted\":0,\n \"GrossValueExecuted\":0,\n \"ExecutableValue\":0,\n \"AvgPrice\":0,\n \"CounterPartyId\":0,\n \"ChangeReason\":\"NewInputAccepted\",\n \"OrigOrderId\":2543565233,\n \"OrigClOrdId\":0,\n \"EnteredBy\":446,\n \"UserName\":\"igor@ccxt.trade\",\n \"IsQuote\":false,\n \"InsideAsk\":19069.32,\n \"InsideAskSize\":0.099736,\n \"InsideBid\":19068.25,\n \"InsideBidSize\":1.330001,\n \"LastTradePrice\":19068.25,\n \"RejectReason\":\"\",\n \"IsLockedIn\":false,\n \"CancelReason\":\"\",\n \"OrderFlag\":\"AddedToBook\",\n \"UseMargin\":false,\n \"StopPrice\":0,\n \"PegPriceType\":\"Unknown\",\n \"PegOffset\":0,\n \"PegLimitOffset\":0,\n \"IpAddress\":null,\n \"ClientOrderIdUuid\":null,\n \"OMSId\":1\n }"
],
"line_end" => 1465,
"line_start" => 1372,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString2 (order, 'ReplacementOrderId', 'OrderId')"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "this.safeString2 (order, 'ReplacementClOrdId', 'ClientOrderId')"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "this.safeInteger (order, 'LastUpdatedTime')"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseOrderStatus (this.safeString (order, 'OrderState'))"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "this.safeSymbol (marketId, market)"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.safeStringLower (order, 'OrderType')"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "this.safeStringLower (order, 'Side')"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.safeString (order, 'Price')"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "this.parseNumber (this.omitZero (this.safeString (order, 'StopPrice')))"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeString (order, 'GrossValueExecuted')"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeString (order, 'OrigQuantity')"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "this.safeString (order, 'QuantityExecuted')"
},
%{
"comment" => nil,
"key" => "average",
"value" => "this.safeString (order, 'AvgPrice')"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n //\n // {\n // \"status\":\"Accepted\",\n // \"errormsg\":\"\",\n // \"OrderId\": 2543565231\n // }\n //\n // editOrder\n //\n // {\n // \"ReplacementOrderId\": 1234,\n // \"ReplacementClOrdId\": 1561,\n // \"OrigOrderId\": 5678,\n // \"OrigClOrdId\": 91011,\n // }\n //\n // fetchOpenOrders, fetchClosedOrders\n //\n // {\n // \"Side\":\"Buy\",\n // \"OrderId\":2543565233,\n // \"Price\":19010,\n // \"Quantity\":0.345,\n // \"DisplayQuantity\":0.345,\n // \"Instrument\":8,\n // \"Account\":449,\n // \"AccountName\":\"igor@ccxt.trade\",\n // \"OrderType\":\"Limit\",\n // \"ClientOrderId\":0,\n // \"OrderState\":\"Working\",\n // \"ReceiveTime\":1607579326003,\n // \"ReceiveTimeTicks\":637431761260028981,\n // \"LastUpdatedTime\":1607579326005,\n // \"LastUpdatedTimeTicks\":637431761260054714,\n // \"OrigQuantity\":0.345,\n // \"QuantityExecuted\":0,\n // \"GrossValueExecuted\":0,\n // \"ExecutableValue\":0,\n // \"AvgPrice\":0,\n // \"CounterPartyId\":0,\n // \"ChangeReason\":\"NewInputAccepted\",\n // \"OrigOrderId\":2543565233,\n // \"OrigClOrdId\":0,\n // \"EnteredBy\":446,\n // \"UserName\":\"igor@ccxt.trade\",\n // \"IsQuote\":false,\n // \"InsideAsk\":19069.32,\n // \"InsideAskSize\":0.099736,\n // \"InsideBid\":19068.25,\n // \"InsideBidSize\":1.330001,\n // \"LastTradePrice\":19068.25,\n // \"RejectReason\":\"\",\n // \"IsLockedIn\":false,\n // \"CancelReason\":\"\",\n // \"OrderFlag\":\"AddedToBook\",\n // \"UseMargin\":false,\n // \"StopPrice\":0,\n // \"PegPriceType\":\"Unknown\",\n // \"PegOffset\":0,\n // \"PegLimitOffset\":0,\n // \"IpAddress\":null,\n // \"ClientOrderIdUuid\":null,\n // \"OMSId\":1\n // }\n //\n const timestamp = this.safeInteger (order, 'ReceiveTime');\n const marketId = this.safeString (order, 'Instrument');\n return this.safeOrder ({\n 'id': this.safeString2 (order, 'ReplacementOrderId', 'OrderId'),\n 'clientOrderId': this.safeString2 (order, 'ReplacementClOrdId', 'ClientOrderId'),\n 'info': order,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': this.safeInteger (order, 'LastUpdatedTime'),\n 'status': this.parseOrderStatus (this.safeString (order, 'OrderState')),\n 'symbol': this.safeSymbol (marketId, market),\n 'type': this.safeStringLower (order, 'OrderType'),\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': this.safeStringLower (order, 'Side'),\n 'price': this.safeString (order, 'Price'),\n 'triggerPrice': this.parseNumber (this.omitZero (this.safeString (order, 'StopPrice'))),\n 'cost': this.safeString (order, 'GrossValueExecuted'),\n 'amount': this.safeString (order, 'OrigQuantity'),\n 'filled': this.safeString (order, 'QuantityExecuted'),\n 'average': this.safeString (order, 'AvgPrice'),\n 'remaining': undefined,\n 'fee': undefined,\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 683,
"line_start" => 647,
"mappings" => [],
"name" => "parseOrderBook",
"signature" => "parseOrderBook (orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey:IndexType = 6, amountKey:IndexType = 8, countOrIdKey: IndexType = 2)",
"source" => "parseOrderBook (orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey:IndexType = 6, amountKey:IndexType = 8, countOrIdKey: IndexType = 2) {\n let nonce = undefined;\n const result: Dict = {\n 'symbol': symbol,\n 'bids': [],\n 'asks': [],\n 'timestamp': undefined,\n 'datetime': undefined,\n 'nonce': undefined,\n };\n for (let i = 0; i < orderbook.length; i++) {\n const level = orderbook[i];\n if (timestamp === undefined) {\n timestamp = this.safeInteger (level, 2);\n } else {\n const newTimestamp = this.safeInteger (level, 2);\n timestamp = Math.max (timestamp, newTimestamp);\n }\n if (nonce === undefined) {\n nonce = this.safeInteger (level, 0);\n } else {\n const newNonce = this.safeInteger (level, 0);\n nonce = Math.max (nonce, newNonce);\n }\n const bidask = this.parseBidAsk (level, priceKey, amountKey);\n const levelSide = this.safeInteger (level, 9);\n const side = levelSide ? asksKey : bidsKey;\n const resultSide = result[side];\n resultSide.push (bidask);\n }\n result['bids'] = this.sortBy (result['bids'], 0, true);\n result['asks'] = this.sortBy (result['asks'], 0);\n result['timestamp'] = timestamp;\n result['datetime'] = this.iso8601 (timestamp);\n result['nonce'] = nonce;\n return result as OrderBook;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1370,
"line_start" => 1360,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'Accepted': 'open',\n 'Rejected': 'rejected',\n 'Working': 'open',\n 'Canceled': 'canceled',\n 'Expired': 'expired',\n 'FullyExecuted': 'closed',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"OMSId\":1,\n \"InstrumentId\":8,\n \"BestBid\":19069.31,\n \"BestOffer\":19069.32,\n \"LastTradedPx\":19069.32,\n \"LastTradedQty\":0.0001,\n \"LastTradeTime\":1607040406424,\n \"SessionOpen\":19069.32,\n \"SessionHigh\":19069.32,\n \"SessionLow\":19069.32,\n \"SessionClose\":19069.32,\n \"Volume\":0.0001,\n \"CurrentDayVolume\":0.0001,\n \"CurrentDayNotional\":1.906932,\n \"CurrentDayNumTrades\":1,\n \"CurrentDayPxChange\":0.00,\n \"Rolling24HrVolume\":0.000000000000000000000000000,\n \"Rolling24HrNotional\":0.00000000000000000000000,\n \"Rolling24NumTrades\":0,\n \"Rolling24HrPxChange\":0,\n \"TimeStamp\":\"1607040406425\",\n \"BidQty\":0,\n \"AskQty\":0,\n \"BidOrderCt\":0,\n \"AskOrderCt\":0,\n \"Rolling24HrPxChangePercent\":0,\n }"
],
"line_end" => 796,
"line_start" => 731,
"mappings" => [
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "high",
"value" => "this.safeString (ticker, 'SessionHigh')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeString (ticker, 'SessionLow')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "this.safeString (ticker, 'BestBid')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "open"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "change"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "percentage"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "baseVolume"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "quoteVolume"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // fetchTicker\n //\n // {\n // \"OMSId\":1,\n // \"InstrumentId\":8,\n // \"BestBid\":19069.31,\n // \"BestOffer\":19069.32,\n // \"LastTradedPx\":19069.32,\n // \"LastTradedQty\":0.0001,\n // \"LastTradeTime\":1607040406424,\n // \"SessionOpen\":19069.32,\n // \"SessionHigh\":19069.32,\n // \"SessionLow\":19069.32,\n // \"SessionClose\":19069.32,\n // \"Volume\":0.0001,\n // \"CurrentDayVolume\":0.0001,\n // \"CurrentDayNotional\":1.906932,\n // \"CurrentDayNumTrades\":1,\n // \"CurrentDayPxChange\":0.00,\n // \"Rolling24HrVolume\":0.000000000000000000000000000,\n // \"Rolling24HrNotional\":0.00000000000000000000000,\n // \"Rolling24NumTrades\":0,\n // \"Rolling24HrPxChange\":0,\n // \"TimeStamp\":\"1607040406425\",\n // \"BidQty\":0,\n // \"AskQty\":0,\n // \"BidOrderCt\":0,\n // \"AskOrderCt\":0,\n // \"Rolling24HrPxChangePercent\":0,\n // }\n //\n const timestamp = this.safeInteger (ticker, 'TimeStamp');\n const marketId = this.safeString (ticker, 'InstrumentId');\n market = this.safeMarket (marketId, market);\n const symbol = this.safeSymbol (marketId, market);\n const last = this.safeString (ticker, 'LastTradedPx');\n const percentage = this.safeString (ticker, 'Rolling24HrPxChangePercent');\n const change = this.safeString (ticker, 'Rolling24HrPxChange');\n const open = this.safeString (ticker, 'SessionOpen');\n const baseVolume = this.safeString (ticker, 'Rolling24HrVolume');\n const quoteVolume = this.safeString (ticker, 'Rolling24HrNotional');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'SessionHigh'),\n 'low': this.safeString (ticker, 'SessionLow'),\n 'bid': this.safeString (ticker, 'BestBid'),\n 'bidVolume': undefined, // this.safeNumber (ticker, 'BidQty'), always shows 0\n 'ask': this.safeString (ticker, 'BestOffer'),\n 'askVolume': undefined, // this.safeNumber (ticker, 'AskQty'), always shows 0\n 'vwap': undefined,\n 'open': open,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': change,\n 'percentage': percentage,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"[\n 6913253, // 0 TradeId\n 8, // 1 ProductPairCode\n 0.03340802, // 2 Quantity\n 19116.08, // 3 Price\n 2543425077, // 4 Order1\n 2543425482, // 5 Order2\n 1606935922416, // 6 Tradetime\n 0, // 7 Direction\n 1, // 8 TakerSide\n 0, // 9 BlockTrade\n 0, // 10 Either Order1ClientId or Order2ClientId\n ]",
"{\n \"OMSId\":1,\n \"ExecutionId\":16916567,\n \"TradeId\":14476351,\n \"OrderId\":2543565231,\n \"AccountId\":449,\n \"AccountName\":\"igor@ccxt.trade\",\n \"SubAccountId\":0,\n \"ClientOrderId\":0,\n \"InstrumentId\":8,\n \"Side\":\"Sell\",\n \"OrderType\":\"Market\",\n \"Quantity\":0.1230000000000000000000000000,\n \"RemainingQuantity\":0.0000000000000000000000000000,\n \"Price\":19069.310000000000000000000000,\n \"Value\":2345.5251300000000000000000000,\n \"CounterParty\":\"7\",\n \"OrderTradeRevision\":1,\n \"Direction\":\"NoChange\",\n \"IsBlockTrade\":false,\n \"Fee\":1.1727625650000000000000000000,\n \"FeeProductId\":8,\n \"OrderOriginator\":446,\n \"UserName\":\"igor@ccxt.trade\",\n \"TradeTimeMS\":1607565031569,\n \"MakerTaker\":\"Taker\",\n \"AdapterTradeId\":0,\n \"InsideBid\":19069.310000000000000000000000,\n \"InsideBidSize\":0.2400950000000000000000000000,\n \"InsideAsk\":19069.320000000000000000000000,\n \"InsideAskSize\":0.0997360000000000000000000000,\n \"IsQuote\":false,\n \"CounterPartyClientUserId\":1,\n \"NotionalProductId\":2,\n \"NotionalRate\":1.0000000000000000000000000000,\n \"NotionalValue\":2345.5251300000000000000000000,\n \"NotionalHoldAmount\":0,\n \"TradeTime\":637431618315686826\n }",
"{\n \"Side\":\"Sell\",\n \"OrderId\":2543565235,\n \"Price\":18600.000000000000000000000000,\n \"Quantity\":0.0000000000000000000000000000,\n \"DisplayQuantity\":0.0000000000000000000000000000,\n \"Instrument\":8,\n \"Account\":449,\n \"AccountName\":\"igor@ccxt.trade\",\n \"OrderType\":\"Limit\",\n \"ClientOrderId\":0,\n \"OrderState\":\"FullyExecuted\",\n \"ReceiveTime\":1607585844956,\n \"ReceiveTimeTicks\":637431826449564182,\n \"LastUpdatedTime\":1607585844959,\n \"LastUpdatedTimeTicks\":637431826449593893,\n \"OrigQuantity\":0.1230000000000000000000000000,\n \"QuantityExecuted\":0.1230000000000000000000000000,\n \"GrossValueExecuted\":2345.3947500000000000000000000,\n \"ExecutableValue\":0.0000000000000000000000000000,\n \"AvgPrice\":19068.250000000000000000000000,\n \"CounterPartyId\":0,\n \"ChangeReason\":\"Trade\",\n \"OrigOrderId\":2543565235,\n \"OrigClOrdId\":0,\n \"EnteredBy\":446,\n \"UserName\":\"igor@ccxt.trade\",\n \"IsQuote\":false,\n \"InsideAsk\":19069.320000000000000000000000,\n \"InsideAskSize\":0.0997360000000000000000000000,\n \"InsideBid\":19068.250000000000000000000000,\n \"InsideBidSize\":1.3300010000000000000000000000,\n \"LastTradePrice\":19068.250000000000000000000000,\n \"RejectReason\":\"\",\n \"IsLockedIn\":false,\n \"CancelReason\":\"\",\n \"OrderFlag\":\"0\",\n \"UseMargin\":false,\n \"StopPrice\":0.0000000000000000000000000000,\n \"PegPriceType\":\"Unknown\",\n \"PegOffset\":0.0000000000000000000000000000,\n \"PegLimitOffset\":0.0000000000000000000000000000,\n \"IpAddress\":\"x.x.x.x\",\n \"ClientOrderIdUuid\":null,\n \"OMSId\":1\n }"
],
"line_end" => 1086,
"line_start" => 920,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "takerOrMaker"
},
%{
"comment" => nil,
"key" => "price",
"value" => "priceString"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amountString"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "costString"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "feeCostString"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "feeCurrencyCode"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades (public)\n //\n // [\n // 6913253, // 0 TradeId\n // 8, // 1 ProductPairCode\n // 0.03340802, // 2 Quantity\n // 19116.08, // 3 Price\n // 2543425077, // 4 Order1\n // 2543425482, // 5 Order2\n // 1606935922416, // 6 Tradetime\n // 0, // 7 Direction\n // 1, // 8 TakerSide\n // 0, // 9 BlockTrade\n // 0, // 10 Either Order1ClientId or Order2ClientId\n // ]\n //\n // fetchMyTrades (private)\n //\n // {\n // \"OMSId\":1,\n // \"ExecutionId\":16916567,\n // \"TradeId\":14476351,\n // \"OrderId\":2543565231,\n // \"AccountId\":449,\n // \"AccountName\":\"igor@ccxt.trade\",\n // \"SubAccountId\":0,\n // \"ClientOrderId\":0,\n // \"InstrumentId\":8,\n // \"Side\":\"Sell\",\n // \"OrderType\":\"Market\",\n // \"Quantity\":0.1230000000000000000000000000,\n // \"RemainingQuantity\":0.0000000000000000000000000000,\n // \"Price\":19069.310000000000000000000000,\n // \"Value\":2345.5251300000000000000000000,\n // \"CounterParty\":\"7\",\n // \"OrderTradeRevision\":1,\n // \"Direction\":\"NoChange\",\n // \"IsBlockTrade\":false,\n // \"Fee\":1.1727625650000000000000000000,\n // \"FeeProductId\":8,\n // \"OrderOriginator\":446,\n // \"UserName\":\"igor@ccxt.trade\",\n // \"TradeTimeMS\":1607565031569,\n // \"MakerTaker\":\"Taker\",\n // \"AdapterTradeId\":0,\n // \"InsideBid\":19069.310000000000000000000000,\n // \"InsideBidSize\":0.2400950000000000000000000000,\n // \"InsideAsk\":19069.320000000000000000000000,\n // \"InsideAskSize\":0.0997360000000000000000000000,\n // \"IsQuote\":false,\n // \"CounterPartyClientUserId\":1,\n // \"NotionalProductId\":2,\n // \"NotionalRate\":1.0000000000000000000000000000,\n // \"NotionalValue\":2345.5251300000000000000000000,\n // \"NotionalHoldAmount\":0,\n // \"TradeTime\":637431618315686826\n // }\n //\n // fetchOrderTrades\n //\n // {\n // \"Side\":\"Sell\",\n // \"OrderId\":2543565235,\n // \"Price\":18600.000000000000000000000000,\n // \"Quantity\":0.0000000000000000000000000000,\n // \"DisplayQuantity\":0.0000000000000000000000000000,\n // \"Instrument\":8,\n // \"Account\":449,\n // \"AccountName\":\"igor@ccxt.trade\",\n // \"OrderType\":\"Limit\",\n // \"ClientOrderId\":0,\n // \"OrderState\":\"FullyExecuted\",\n // \"ReceiveTime\":1607585844956,\n // \"ReceiveTimeTicks\":637431826449564182,\n // \"LastUpdatedTime\":1607585844959,\n // \"LastUpdatedTimeTicks\":637431826449593893,\n // \"OrigQuantity\":0.1230000000000000000000000000,\n // \"QuantityExecuted\":0.1230000000000000000000000000,\n // \"GrossValueExecuted\":2345.3947500000000000000000000,\n // \"ExecutableValue\":0.0000000000000000000000000000,\n // \"AvgPrice\":19068.250000000000000000000000,\n // \"CounterPartyId\":0,\n // \"ChangeReason\":\"Trade\",\n // \"OrigOrderId\":2543565235,\n // \"OrigClOrdId\":0,\n // \"EnteredBy\":446,\n // \"UserName\":\"igor@ccxt.trade\",\n // \"IsQuote\":false,\n // \"InsideAsk\":19069.320000000000000000000000,\n // \"InsideAskSize\":0.0997360000000000000000000000,\n // \"InsideBid\":19068.250000000000000000000000,\n // \"InsideBidSize\":1.3300010000000000000000000000,\n // \"LastTradePrice\":19068.250000000000000000000000,\n // \"RejectReason\":\"\",\n // \"IsLockedIn\":false,\n // \"CancelReason\":\"\",\n // \"OrderFlag\":\"0\",\n // \"UseMargin\":false,\n // \"StopPrice\":0.0000000000000000000000000000,\n // \"PegPriceType\":\"Unknown\",\n // \"PegOffset\":0.0000000000000000000000000000,\n // \"PegLimitOffset\":0.0000000000000000000000000000,\n // \"IpAddress\":\"x.x.x.x\",\n // \"ClientOrderIdUuid\":null,\n // \"OMSId\":1\n // }\n //\n let priceString = undefined;\n let amountString = undefined;\n let costString = undefined;\n let timestamp = undefined;\n let id = undefined;\n let marketId = undefined;\n let side = undefined;\n let orderId = undefined;\n let takerOrMaker = undefined;\n let fee = undefined;\n let type = undefined;\n if (Array.isArray (trade)) {\n priceString = this.safeString (trade, 3);\n amountString = this.safeString (trade, 2);\n timestamp = this.safeInteger (trade, 6);\n id = this.safeString (trade, 0);\n marketId = this.safeString (trade, 1);\n const takerSide = this.safeValue (trade, 8);\n side = takerSide ? 'sell' : 'buy';\n orderId = this.safeString (trade, 4);\n } else {\n timestamp = this.safeInteger2 (trade, 'TradeTimeMS', 'ReceiveTime');\n id = this.safeString (trade, 'TradeId');\n orderId = this.safeString2 (trade, 'OrderId', 'OrigOrderId');\n marketId = this.safeString2 (trade, 'InstrumentId', 'Instrument');\n priceString = this.safeString (trade, 'Price');\n amountString = this.safeString (trade, 'Quantity');\n costString = this.safeString2 (trade, 'Value', 'GrossValueExecuted');\n takerOrMaker = this.safeStringLower (trade, 'MakerTaker');\n side = this.safeStringLower (trade, 'Side');\n type = this.safeStringLower (trade, 'OrderType');\n const feeCostString = this.safeString (trade, 'Fee');\n if (feeCostString !== undefined) {\n const feeCurrencyId = this.safeString (trade, 'FeeProductId');\n const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n fee = {\n 'cost': feeCostString,\n 'currency': feeCurrencyCode,\n };\n }\n }\n const symbol = this.safeSymbol (marketId, market);\n return this.safeTrade ({\n 'info': trade,\n 'id': id,\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'order': orderId,\n 'type': type,\n 'side': side,\n 'takerOrMaker': takerOrMaker,\n 'price': priceString,\n 'amount': amountString,\n 'cost': costString,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"OMSId\": 1,\n \"DepositId\": 44,\n \"AccountId\": 449,\n \"SubAccountId\": 0,\n \"ProductId\": 4,\n \"Amount\": 200.00000000000000000000000000,\n \"LastUpdateTimeStamp\": 637431291261187806,\n \"ProductType\": \"CryptoCurrency\",\n \"TicketStatus\": \"FullyProcessed\",\n \"DepositInfo\": \"{\n \"AccountProviderId\":42,\n \"AccountProviderName\":\"USDT_BSC\",\n \"TXId\":\"0x3879b02632c69482646409e991149290bc9a58e4603be63c7c2c90a843f45d2b\",\n \"FromAddress\":\"0x8894E0a0c962CB723c1976a4421c95949bE2D4E3\",\n \"ToAddress\":\"0x5428EcEB1F7Ee058f64158589e27D087149230CB\"\n }\",\n \"DepositCode\": \"ab0e23d5-a9ce-4d94-865f-9ab464fb1de3\",\n \"TicketNumber\": 71,\n \"NotionalProductId\": 13,\n \"NotionalValue\": 200.00000000000000000000000000,\n \"FeeAmount\": 0.0000000000000000000000000000,\n }",
"{\n \"Amount\": 0.0,\n \"FeeAmount\": 0.0,\n \"NotionalValue\": 0.0,\n \"WithdrawId\": 0,\n \"AssetManagerId\": 0,\n \"AccountId\": 0,\n \"AssetId\": 0,\n \"TemplateForm\": \"{\\\"TemplateType\\\": \\\"TetherRPCWithdraw\\\",\\\"Comment\\\": \\\"TestWithdraw\\\",\\\"ExternalAddress\\\": \\\"ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3\\\"}\",\n \"TemplateFormType\": \"TetherRPCWithdraw\",\n \"omsId\": 0,\n \"TicketStatus\": 0,\n \"TicketNumber\": 0,\n \"WithdrawTransactionDetails\": \"\",\n \"WithdrawType\": \"\",\n \"WithdrawCode\": \"490b4fa3-53fc-44f4-bd29-7e16be86fba3\",\n \"AssetType\": 0,\n \"Reaccepted\": true,\n \"NotionalProductId\": 0\n }"
],
"line_end" => 2446,
"line_start" => 2349,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString2 (templateForm, 'TxId', 'TXId')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "this.safeString (templateForm, 'FromAddress')"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'Amount')"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatusByType (transactionStatus, type)"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "updated"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n //\n // {\n // \"OMSId\": 1,\n // \"DepositId\": 44,\n // \"AccountId\": 449,\n // \"SubAccountId\": 0,\n // \"ProductId\": 4,\n // \"Amount\": 200.00000000000000000000000000,\n // \"LastUpdateTimeStamp\": 637431291261187806,\n // \"ProductType\": \"CryptoCurrency\",\n // \"TicketStatus\": \"FullyProcessed\",\n // \"DepositInfo\": \"{\n // \"AccountProviderId\":42,\n // \"AccountProviderName\":\"USDT_BSC\",\n // \"TXId\":\"0x3879b02632c69482646409e991149290bc9a58e4603be63c7c2c90a843f45d2b\",\n // \"FromAddress\":\"0x8894E0a0c962CB723c1976a4421c95949bE2D4E3\",\n // \"ToAddress\":\"0x5428EcEB1F7Ee058f64158589e27D087149230CB\"\n // }\",\n // \"DepositCode\": \"ab0e23d5-a9ce-4d94-865f-9ab464fb1de3\",\n // \"TicketNumber\": 71,\n // \"NotionalProductId\": 13,\n // \"NotionalValue\": 200.00000000000000000000000000,\n // \"FeeAmount\": 0.0000000000000000000000000000,\n // }\n //\n // fetchWithdrawals\n //\n // {\n // \"Amount\": 0.0,\n // \"FeeAmount\": 0.0,\n // \"NotionalValue\": 0.0,\n // \"WithdrawId\": 0,\n // \"AssetManagerId\": 0,\n // \"AccountId\": 0,\n // \"AssetId\": 0,\n // \"TemplateForm\": \"{\\\"TemplateType\\\": \\\"TetherRPCWithdraw\\\",\\\"Comment\\\": \\\"TestWithdraw\\\",\\\"ExternalAddress\\\": \\\"ms6C3pKAAr8gRCcnVebs8VRkVrjcvqNYv3\\\"}\",\n // \"TemplateFormType\": \"TetherRPCWithdraw\",\n // \"omsId\": 0,\n // \"TicketStatus\": 0,\n // \"TicketNumber\": 0,\n // \"WithdrawTransactionDetails\": \"\",\n // \"WithdrawType\": \"\",\n // \"WithdrawCode\": \"490b4fa3-53fc-44f4-bd29-7e16be86fba3\",\n // \"AssetType\": 0,\n // \"Reaccepted\": true,\n // \"NotionalProductId\": 0\n // }\n //\n let id = undefined;\n const currencyId = this.safeString (transaction, 'ProductId');\n const code = this.safeCurrencyCode (currencyId, currency);\n let type = undefined;\n if ('DepositId' in transaction) {\n id = this.safeString (transaction, 'DepositId');\n type = 'deposit';\n } else if ('WithdrawId' in transaction) {\n id = this.safeString (transaction, 'WithdrawId');\n type = 'withdrawal';\n }\n const templateForm = this.parseJson (this.safeValue2 (transaction, 'TemplateForm', 'DepositInfo'));\n let updated = this.safeInteger (transaction, 'LastUpdateTimeStamp');\n if (templateForm !== undefined) {\n updated = this.safeInteger (templateForm, 'LastUpdated', updated);\n }\n const address = this.safeString2 (templateForm, 'ExternalAddress', 'ToAddress');\n const timestamp = this.safeInteger (templateForm, 'TimeSubmitted');\n const feeCost = this.safeNumber (transaction, 'FeeAmount');\n const transactionStatus = this.safeString (transaction, 'TicketStatus');\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = { 'currency': code, 'cost': feeCost };\n }\n return {\n 'info': transaction,\n 'id': id,\n 'txid': this.safeString2 (templateForm, 'TxId', 'TXId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': address,\n 'addressTo': address,\n 'addressFrom': this.safeString (templateForm, 'FromAddress'),\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': this.safeNumber (transaction, 'Amount'),\n 'currency': code,\n 'status': this.parseTransactionStatusByType (transactionStatus, type),\n 'updated': updated,\n 'fee': fee,\n 'internal': undefined,\n 'comment': undefined,\n 'network': undefined,\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 2347,
"line_start" => 2300,
"mappings" => [],
"name" => "parseTransactionStatusByType",
"signature" => "parseTransactionStatusByType (status, type = undefined)",
"source" => "parseTransactionStatusByType (status, type = undefined) {\n const statusesByType: Dict = {\n 'deposit': {\n 'New': 'pending', // new ticket awaiting operator review\n 'AdminProcessing': 'pending', // an admin is looking at the ticket\n 'Accepted': 'pending', // an admin accepts the ticket\n 'Rejected': 'rejected', // admin rejects the ticket\n 'SystemProcessing': 'pending', // automatic processing; an unlikely status for a deposit\n 'FullyProcessed': 'ok', // the deposit has concluded\n 'Failed': 'failed', // the deposit has failed for some reason\n 'Pending': 'pending', // Account Provider has set status to pending\n 'Confirmed': 'pending', // Account Provider confirms the deposit\n 'AmlProcessing': 'pending', // anti-money-laundering process underway\n 'AmlAccepted': 'pending', // anti-money-laundering process successful\n 'AmlRejected': 'rejected', // deposit did not stand up to anti-money-laundering process\n 'AmlFailed': 'failed', // anti-money-laundering process failed/did not complete\n 'LimitsAccepted': 'pending', // deposit meets limits for fiat or crypto asset\n 'LimitsRejected': 'rejected', // deposit does not meet limits for fiat or crypto asset\n },\n 'withdrawal': {\n 'New': 'pending', // awaiting operator review\n 'AdminProcessing': 'pending', // An admin is looking at the ticket\n 'Accepted': 'pending', // withdrawal will proceed\n 'Rejected': 'rejected', // admin or automatic rejection\n 'SystemProcessing': 'pending', // automatic processing underway\n 'FullyProcessed': 'ok', // the withdrawal has concluded\n 'Failed': 'failed', // the withdrawal failed for some reason\n 'Pending': 'pending', // the admin has placed the withdrawal in pending status\n 'Pending2Fa': 'pending', // user must click 2-factor authentication confirmation link\n 'AutoAccepted': 'pending', // withdrawal will be automatically processed\n 'Delayed': 'pending', // waiting for funds to be allocated for the withdrawal\n 'UserCanceled': 'canceled', // withdraw canceled by user or Superuser\n 'AdminCanceled': 'canceled', // withdraw canceled by Superuser\n 'AmlProcessing': 'pending', // anti-money-laundering process underway\n 'AmlAccepted': 'pending', // anti-money-laundering process complete\n 'AmlRejected': 'rejected', // withdrawal did not stand up to anti-money-laundering process\n 'AmlFailed': 'failed', // withdrawal did not complete anti-money-laundering process\n 'LimitsAccepted': 'pending', // withdrawal meets limits for fiat or crypto asset\n 'LimitsRejected': 'rejected', // withdrawal does not meet limits for fiat or crypto asset\n 'Submitted': 'pending', // withdrawal sent to Account Provider; awaiting blockchain confirmation\n 'Confirmed': 'pending', // Account Provider confirms that withdrawal is on the blockchain\n 'ManuallyConfirmed': 'pending', // admin has sent withdrawal via wallet or admin function directly; marks ticket as FullyProcessed; debits account\n 'Confirmed2Fa': 'pending', // user has confirmed withdraw via 2-factor authentication.\n },\n };\n const statuses = this.safeValue (statusesByType, type, {});\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "",
pro: true,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 1000,
period: 1000,
requests: 1,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 1,
method: :get,
path: "/GetWithdrawTemplate"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserAccounts"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserAccountInfos"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetTradesHistory"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUnredactedUserConfigByKey"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAccountDepositTransactions"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetWithdrawFee"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAllAccountConfigs"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAllOpenTradeReports"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetDepositInfo"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAllDepositRequestInfoTemplates"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOMSWithdrawFees"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetWithdrawTemplateTypes"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetWithdrawTicket"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserReportWriterResultRecords"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOrderFee"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOpenQuotes"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserAffiliateCount"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetWithdraws"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetDepositTickets"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserConfig"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOpenOrders"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAccountInfo"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOmsFeeTiers"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAllUnredactedUserConfigsForUser"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAccountWithdrawTransactions"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOpenTradeReports"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetWithdrawTickets"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetDepositTicket"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetDepositRequestInfoTemplate"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetTreasuryProductsForAccount"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetDeposits"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserDevices"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAccountTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAccountPositions"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOrderHistory"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOrderStatus"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetOrdersHistory"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserAffiliateTag"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetAccountTransactions"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetUserReportTickets"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/AddUserAffiliateTag"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CancelAllOrders"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CancelOrder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CancelQuote"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CancelReplaceOrder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CancelUserReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CancelWithdraw"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CreateDepositTicket"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CreateQuote"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/CreateWithdrawTicket"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/GenerateTradeActivityReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/GenerateTransactionActivityReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/GenerateTreasuryActivityReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/GetOrderHistoryByOrderId"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/ModifyOrder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/RegisterNewDevice"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/ScheduleTradeActivityReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/ScheduleTransactionActivityReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/ScheduleTreasuryActivityReport"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/SendOrder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/SubmitBlockTrade"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/SubmitDepositTicketComment"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/SubmitWithdrawTicketComment"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/SubscribeAccountEvents"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/UpdateQuote"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/UpdateUserAffiliateTag"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/Activate2FA"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/Authenticate"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/Authenticate2FA"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/AuthenticateUser"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetInstrument"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetInstruments"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetL2Snapshot"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetLastTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetLevel1"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetProduct"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetProducts"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetTickerHistory"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/GetValidate2FARequiredEndpoints"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/LogOut"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/Ping"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/SubscribeBlockTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/SubscribeLevel1"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/SubscribeLevel2"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/SubscribeTicker"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/SubscribeTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/UnsubscribeBlockTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/UnsubscribeLevel1"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/UnsubscribeLevel2"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/UnsubscribeTicker"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/UnsubscribeTrades"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/trades"
}
]
},
required_credentials: %{
api_key: true,
password: true,
secret: true,
uid: true
},
requires_eddsa: false,
response_error: nil,
signing: %{
api_key_header: "APIKey",
confidence: :medium,
has_passphrase: true,
nonce_header: "Nonce",
pattern: :hmac_sha256_passphrase_signed,
signature_header: "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" => %{
"min" => 1.0e-5
},
"cost" => %{},
"price" => %{
"min" => 25000
}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 0.01
},
spot: %{
base: "BTC",
base_id: "1",
case: :upper,
contract: false,
id: "1",
limits: %{
"amount" => %{
"min" => 1.0e-5
},
"cost" => %{},
"leverage" => %{},
"price" => %{
"min" => 25000
}
},
maker: 0.002,
precision: %{
"amount" => 1.0e-8,
"price" => 0.01
},
quote: "CAD",
quote_id: "7",
separator: "",
symbol: "BTC/CAD",
taker: 0.0025
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :no_separator_upper,
separator: "",
suffix: nil
}
},
timeframes: %{
"12h" => "43200",
"15m" => "900",
"1M" => "2419200",
"1d" => "86400",
"1h" => "3600",
"1m" => "60",
"1w" => "604800",
"2h" => "7200",
"30m" => "1800",
"4M" => "9676800",
"4h" => "14400",
"5m" => "300",
"6h" => "21600"
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://api.ndax.io:8443/AP",
api_sections: %{
"private" => "https://api.ndax.io:8443/AP",
"public" => "https://api.ndax.io:8443/AP"
},
doc: [
"https://apidoc.ndax.io/"
],
other: nil,
sandbox: %{
"private" => "https://ndaxmarginstaging.cdnhop.net:8443/AP",
"public" => "https://ndaxmarginstaging.cdnhop.net:8443/AP"
},
www: "https://ndax.io"
},
version: nil,
ws: %{
channel_templates: %{
watch_ohlcv: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_order_book: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_ticker: %{
market_id_format: :native,
params: [],
pattern: :custom
},
watch_trades: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
}
},
has: %{
watch_balance: nil,
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: nil,
watch_ohlcv: true,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: nil,
watch_orders: nil,
watch_orders_for_symbols: nil,
watch_position: nil,
watch_positions: nil,
watch_status: nil,
watch_ticker: true,
watch_tickers: nil,
watch_trades: true,
watch_trades_for_symbols: false
},
message_patterns: [
%{
format: :custom,
keys: [
"i",
"m",
"n",
"o"
],
sources: [
:send,
:watch
]
}
],
subscription_config: %{
args_field: "o",
args_format: :json_string,
market_id_format: :native,
op_field: "m"
},
subscription_pattern: :custom,
test_urls: "wss://ndaxmarginstaging.cdnhop.net:10456/WSAdminGatewa/",
urls: "wss://api.ndax.io/WSGateway",
watch_methods: [
"watchOHLCV",
"watchOrderBook",
"watchTicker",
"watchTrades"
]
}
}