Current section
Files
Jump to
Current section
Files
priv/specs/extracted/btcturk.exs
# BTCTurk Exchange Specification
#
# Auto-generated by: mix ccxt.extract btcturk
# CCXT version: 4.5.42
# Spec format version: 2
#
# Review before use:
# - signing: Detected from sign() method, verify with testnet
# - endpoints: Raw paths extracted, map to unified API as needed
# - exceptions: Extracted (exact, broad, HTTP status codes)
# - features/options: Extracted from describe()
# - classification: Set to :supported initially, promote after validation
#
%{
api_param_requirements: nil,
certified: false,
classification: :supported,
comment: nil,
countries: [
"TR"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 15,
"coveragePercent" => 100,
"enabledMethods" => 16,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 15,
"failures" => []
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1,
expects: :single,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{},
params: [
:id,
:symbol
],
path: "/order",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newClientOrderId" => "<generated>",
"orderMethod" => "limit"
},
expects: :single,
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"amount" => "quantity",
"side" => "orderType",
"symbol" => "pairSymbol"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/order",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newClientOrderId" => "<generated>",
"orderMethod" => "market"
},
expects: :single,
market_type: :spot,
method: :post,
name: :create_market_order,
param_mappings: %{
"amount" => "quantity",
"side" => "orderType",
"symbol" => "pairSymbol"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/order",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"newClientOrderId" => "<generated>"
},
expects: :single,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "quantity",
"side" => "orderType",
"symbol" => "pairSymbol",
"type" => "orderMethod"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/order",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/users/balances",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "pairSymbol"
},
params: [
:symbol,
:limit
],
path: "/orderbook",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/server/exchangeinfo",
response_transformer: {:extract_path, ["data", "symbols"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/users/transactions/trade",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "graph",
auth: false,
base_url: "https://graph-api.btcturk.com/v1",
cost: 1,
default_params: %{
"resolution" => 60,
"to" => "<generated>"
},
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"since" => "from",
"timeframe" => "resolution"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/klines/history",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "pairSymbol"
},
params: [
:symbol,
:since,
:limit
],
path: "/openOrders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "pairSymbol"
},
params: [
:symbol,
:limit
],
path: "/orderbook",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_orders,
param_mappings: %{
"symbol" => "pairSymbol"
},
params: [
:symbol,
:since,
:limit
],
path: "/allOrders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 0.1,
expects: :single,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{},
params: [
:symbol
],
path: "/ticker",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 0.1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/ticker",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
expects: :list,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"limit" => "last",
"symbol" => "pairSymbol"
},
params: [
:symbol,
:since,
:limit
],
path: "/trades",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
}
],
error_code_details: %{
"FAILED_LIMIT_ORDER" => %{
description: nil,
type: :invalid_order
},
"FAILED_MARKET_ORDER" => %{
description: nil,
type: :invalid_order
},
"FAILED_ORDER_WITH_OPEN_ORDERS" => %{
description: nil,
type: :insufficient_balance
}
},
error_codes: %{
"FAILED_LIMIT_ORDER" => :invalid_order,
"FAILED_MARKET_ORDER" => :invalid_order,
"FAILED_ORDER_WITH_OPEN_ORDERS" => :insufficient_balance
},
exceptions: %{
exact: %{
"FAILED_LIMIT_ORDER" => :invalid_order,
"FAILED_MARKET_ORDER" => :invalid_order,
"FAILED_ORDER_WITH_OPEN_ORDERS" => :insufficient_funds
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networksById" => %{}
},
extended_metadata: %{
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/10e0a238-9f60-4b06-9dda-edfc7602f1d6"
},
extracted_metadata: %{
ccxt_version: "4.5.42"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: false,
gtd: false,
ioc: false,
po: false
},
trailing: false,
trigger_direction: false,
trigger_price: true
},
fetch_my_trades: %{
days_back: 100000,
limit: 100,
margin_mode: false,
symbol_required: true,
until_days: 30
},
fetch_ohlcv: %{},
fetch_open_orders: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
fetch_orders: %{
days_back: 100000,
limit: 1000,
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false,
until_days: 30
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
maker: 0.0005,
taker: 0.0009
}
},
forward_aliases: nil,
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n const errorCode = this.safeString(response, 'code', '0');\n const message = this.safeString(response, 'message');\n const output = (message === undefined) ? body : message;\n this.throwExactlyMatchedException(this.exceptions['exact'], message, this.id + ' ' + output);\n if ((errorCode !== '0') && (errorCode !== 'SUCCESS')) {\n throw new errors.ExchangeError(this.id + ' ' + output);\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: true,
cancel_all_orders: false,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: false,
cancel_orders_with_client_order_id: false,
cancel_orders_ws: false,
close_all_positions: false,
close_position: false,
create_deposit_address: 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: false,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_a_d_l_rank: false,
fetch_accounts: false,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: 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: false,
fetch_currencies_ws: true,
fetch_deposit: false,
fetch_deposit_address: false,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: false,
fetch_deposit_withdraw_fees: false,
fetch_deposits: false,
fetch_deposits_withdrawals: false,
fetch_deposits_ws: false,
fetch_funding_history: false,
fetch_funding_interval: false,
fetch_funding_intervals: false,
fetch_funding_rate: false,
fetch_funding_rate_history: false,
fetch_funding_rates: false,
fetch_greeks: false,
fetch_index_ohlcv: false,
fetch_isolated_borrow_rate: false,
fetch_isolated_borrow_rates: false,
fetch_isolated_positions: false,
fetch_l2_order_book: true,
fetch_l3_order_book: false,
fetch_last_prices: false,
fetch_ledger: false,
fetch_ledger_entry: false,
fetch_leverage: false,
fetch_leverage_tiers: false,
fetch_leverages: false,
fetch_liquidations: false,
fetch_long_short_ratio: false,
fetch_long_short_ratio_history: false,
fetch_margin_adjustment_history: false,
fetch_margin_mode: false,
fetch_margin_modes: false,
fetch_mark_ohlcv: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: true,
fetch_my_trades_ws: false,
fetch_ohlcv: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: false,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: false,
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_a_d_l_rank: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: false,
fetch_positions_a_d_l_rank: false,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: false,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: true,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: false,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
repay_margin: false,
sandbox: false,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: true,
swap: false,
transfer: false,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: false,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: false,
watch_ohlcv: false,
watch_ohlcv_for_symbols: false,
watch_order_book: false,
watch_order_book_for_symbols: false,
watch_orders: false,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: false,
watch_tickers: false,
watch_trades: false,
watch_trades_for_symbols: false,
withdraw: false,
ws: false
},
http_config: nil,
id: "btcturk",
markets: nil,
name: "BTCTurk",
ohlcv_timestamp_resolution: :seconds,
options: %{},
order_mappings: nil,
param_mappings: %{
"amount" => "quantity",
"limit" => "last",
"side" => "orderType",
"since" => "from",
"symbol" => "pairSymbol",
"timeframe" => "resolution",
"type" => "orderMethod"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 403,
"line_start" => 385,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "response"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const data = this.safeList (response, 'data', []);\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n for (let i = 0; i < data.length; i++) {\n const entry = data[i];\n const currencyId = this.safeString (entry, 'asset');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['total'] = this.safeString (entry, 'balance');\n account['free'] = this.safeString (entry, 'free');\n account['used'] = this.safeString (entry, 'locked');\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 383,
"line_start" => 310,
"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" => "(status === 'TRADING')"
},
%{
"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.parseNumber (this.parsePrecision (this.safeString (entry, 'numeratorScale'))),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (entry, 'denominatorScale'))),\n }"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': minAmount,\n 'max': maxAmount,\n },\n 'price': {\n 'min': minPrice,\n 'max': maxPrice,\n },\n 'cost': {\n 'min': minCost,\n 'max': undefined,\n },\n }"
},
%{
"comment" => nil,
"key" => "created",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "entry"
},
%{
"comment" => nil,
"key" => "leverage",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "{\n 'min': minAmount,\n 'max': maxAmount,\n }"
},
%{
"comment" => nil,
"key" => "price",
"value" => "{\n 'min': minPrice,\n 'max': maxPrice,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "{\n 'min': minCost,\n 'max': undefined,\n }"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (entry): Market",
"source" => "parseMarket (entry): Market {\n const id = this.safeString (entry, 'name');\n const baseId = this.safeString (entry, 'numerator');\n const quoteId = this.safeString (entry, 'denominator');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const filters = this.safeList (entry, 'filters', []);\n let minPrice = undefined;\n let maxPrice = undefined;\n let minAmount = undefined;\n let maxAmount = undefined;\n let minCost = undefined;\n for (let j = 0; j < filters.length; j++) {\n const filter = filters[j];\n const filterType = this.safeString (filter, 'filterType');\n if (filterType === 'PRICE_FILTER') {\n minPrice = this.safeNumber (filter, 'minPrice');\n maxPrice = this.safeNumber (filter, 'maxPrice');\n minAmount = this.safeNumber (filter, 'minAmount');\n maxAmount = this.safeNumber (filter, 'maxAmount');\n minCost = this.safeNumber (filter, 'minExchangeValue');\n }\n }\n const status = this.safeString (entry, 'status');\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': (status === 'TRADING'),\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.parseNumber (this.parsePrecision (this.safeString (entry, 'numeratorScale'))),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (entry, 'denominatorScale'))),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': minAmount,\n 'max': maxAmount,\n },\n 'price': {\n 'min': minPrice,\n 'max': maxPrice,\n },\n 'cost': {\n 'min': minCost,\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': entry,\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"timestamp\": 1661990400,\n \"high\": 368388.0,\n \"open\": 368388.0,\n \"low\": 368388.0,\n \"close\": 368388.0,\n \"volume\": 0.00035208,\n }"
],
"line_end" => 674,
"line_start" => 655,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"timestamp\": 1661990400,\n // \"high\": 368388.0,\n // \"open\": 368388.0,\n // \"low\": 368388.0,\n // \"close\": 368388.0,\n // \"volume\": 0.00035208,\n // }\n //\n return [\n this.safeTimestamp (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" => 777,
"line_start" => 756,
"mappings" => [],
"name" => "parseOHLCVs",
"signature" => "parseOHLCVs (ohlcvs, market = undefined, timeframe = '1m', since: Int = undefined, limit: Int = undefined, tail: Bool = false)",
"source" => "parseOHLCVs (ohlcvs, market = undefined, timeframe = '1m', since: Int = undefined, limit: Int = undefined, tail: Bool = false) {\n const results = [];\n const timestamp = this.safeList (ohlcvs, 't', []);\n const high = this.safeList (ohlcvs, 'h', []);\n const open = this.safeList (ohlcvs, 'o', []);\n const low = this.safeList (ohlcvs, 'l', []);\n const close = this.safeList (ohlcvs, 'c', []);\n const volume = this.safeList (ohlcvs, 'v', []);\n for (let i = 0; i < timestamp.length; i++) {\n const ohlcv: Dict = {\n 'timestamp': this.safeInteger (timestamp, i),\n 'high': this.safeNumber (high, i),\n 'open': this.safeNumber (open, i),\n 'low': this.safeNumber (low, i),\n 'close': this.safeNumber (close, i),\n 'volume': this.safeNumber (volume, i),\n };\n results.push (this.parseOHLCV (ohlcv, market));\n }\n const sorted = this.sortBy (results, 0);\n return this.filterBySinceLimit (sorted, since, limit, 0, tail) as OHLCV[];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": 2605984008,\n \"price\": \"55000\",\n \"amount\": \"0.00050000\",\n \"quantity\": \"0.00050000\",\n \"stopPrice\": \"0\",\n \"pairSymbol\": \"BTCUSDT\",\n \"pairSymbolNormalized\": \"BTC_USDT\",\n \"type\": \"buy\",\n \"method\": \"limit\",\n \"orderClientId\": \"f479bdb6-0965-4f03-95b5-daeb7aa5a3a5\",\n \"time\": 0,\n \"updateTime\": 1618913083543,\n \"status\": \"Untouched\",\n \"leftAmount\": \"0.00050000\"\n }",
"{\n \"id\": \"2606935102\",\n \"quantity\": \"0.0002\",\n \"price\": \"56000\",\n \"stopPrice\": null,\n \"newOrderClientId\": \"98e5c491-7ed9-462b-9666-93553180fb28\",\n \"type\": \"buy\",\n \"method\": \"limit\",\n \"pairSymbol\": \"BTCUSDT\",\n \"pairSymbolNormalized\": \"BTC_USDT\",\n \"datetime\": \"1618916479523\"\n }"
],
"line_end" => 991,
"line_start" => 926,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "remaining"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "clientOrderId"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // fetchOrders / fetchOpenOrders\n // {\n // \"id\": 2605984008,\n // \"price\": \"55000\",\n // \"amount\": \"0.00050000\",\n // \"quantity\": \"0.00050000\",\n // \"stopPrice\": \"0\",\n // \"pairSymbol\": \"BTCUSDT\",\n // \"pairSymbolNormalized\": \"BTC_USDT\",\n // \"type\": \"buy\",\n // \"method\": \"limit\",\n // \"orderClientId\": \"f479bdb6-0965-4f03-95b5-daeb7aa5a3a5\",\n // \"time\": 0,\n // \"updateTime\": 1618913083543,\n // \"status\": \"Untouched\",\n // \"leftAmount\": \"0.00050000\"\n // }\n //\n // createOrder\n // {\n // \"id\": \"2606935102\",\n // \"quantity\": \"0.0002\",\n // \"price\": \"56000\",\n // \"stopPrice\": null,\n // \"newOrderClientId\": \"98e5c491-7ed9-462b-9666-93553180fb28\",\n // \"type\": \"buy\",\n // \"method\": \"limit\",\n // \"pairSymbol\": \"BTCUSDT\",\n // \"pairSymbolNormalized\": \"BTC_USDT\",\n // \"datetime\": \"1618916479523\"\n // }\n //\n const id = this.safeString (order, 'id');\n const price = this.safeString (order, 'price');\n const amountString = this.safeString2 (order, 'amount', 'quantity');\n const amount = Precise.stringAbs (amountString);\n const remaining = this.safeString (order, 'leftAmount');\n const marketId = this.safeString (order, 'pairSymbol');\n const symbol = this.safeSymbol (marketId, market);\n const side = this.safeString (order, 'type');\n const type = this.safeString (order, 'method');\n const clientOrderId = this.safeString (order, 'orderClientId');\n const timestamp = this.safeInteger2 (order, 'updateTime', 'datetime');\n const rawStatus = this.safeString (order, 'status');\n const status = this.parseOrderStatus (rawStatus);\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'price': price,\n 'amount': amount,\n 'remaining': remaining,\n 'filled': undefined,\n 'cost': undefined,\n 'average': undefined,\n 'status': status,\n 'side': side,\n 'type': type,\n 'clientOrderId': clientOrderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'fee': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 924,
"line_start" => 916,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'Untouched': 'open',\n 'Partial': 'open',\n 'Canceled': 'canceled',\n 'Closed': 'closed',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"pair\": \"BTCTRY\",\n \"pairNormalized\": \"BTC_TRY\",\n \"timestamp\": 1618826361234,\n \"last\": 462485,\n \"high\": 473976,\n \"low\": 444201,\n \"bid\": 461928,\n \"ask\": 462485,\n \"open\": 456915,\n \"volume\": 917.41368645,\n \"average\": 462868.29574589,\n \"daily\": 5570,\n \"dailyPercent\": 1.22,\n \"denominatorSymbol\": \"TRY\",\n \"numeratorSymbol\": \"BTC\",\n \"order\": 1000\n }"
],
"line_end" => 516,
"line_start" => 468,
"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, 'high')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeString (ticker, 'low')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "this.safeString (ticker, 'bid')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeString (ticker, 'ask')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "this.safeString (ticker, 'open')"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "this.safeString (ticker, 'daily')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "this.safeString (ticker, 'dailyPercent')"
},
%{
"comment" => nil,
"key" => "average",
"value" => "this.safeString (ticker, 'average')"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'volume')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "undefined"
},
%{
"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 // {\n // \"pair\": \"BTCTRY\",\n // \"pairNormalized\": \"BTC_TRY\",\n // \"timestamp\": 1618826361234,\n // \"last\": 462485,\n // \"high\": 473976,\n // \"low\": 444201,\n // \"bid\": 461928,\n // \"ask\": 462485,\n // \"open\": 456915,\n // \"volume\": 917.41368645,\n // \"average\": 462868.29574589,\n // \"daily\": 5570,\n // \"dailyPercent\": 1.22,\n // \"denominatorSymbol\": \"TRY\",\n // \"numeratorSymbol\": \"BTC\",\n // \"order\": 1000\n // }\n //\n const marketId = this.safeString (ticker, 'pair');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const timestamp = this.safeInteger (ticker, 'timestamp');\n const last = this.safeString (ticker, 'last');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high'),\n 'low': this.safeString (ticker, 'low'),\n 'bid': this.safeString (ticker, 'bid'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'ask'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': this.safeString (ticker, 'open'),\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': this.safeString (ticker, 'daily'),\n 'percentage': this.safeString (ticker, 'dailyPercent'),\n 'average': this.safeString (ticker, 'average'),\n 'baseVolume': this.safeString (ticker, 'volume'),\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"pair\": \"BTCUSDT\",\n \"pairNormalized\": \"BTC_USDT\",\n \"numerator\": \"BTC\",\n \"denominator\": \"USDT\",\n \"date\": \"1618916879083\",\n \"tid\": \"637545136790672520\",\n \"price\": \"55774\",\n \"amount\": \"0.27917100\",\n \"side\": \"buy\"\n }",
"{\n \"price\": \"56000\",\n \"numeratorSymbol\": \"BTC\",\n \"denominatorSymbol\": \"USDT\",\n \"orderType\": \"buy\",\n \"orderId\": \"2606935102\",\n \"id\": \"320874372\",\n \"timestamp\": \"1618916479593\",\n \"amount\": \"0.00020000\",\n \"fee\": \"0\",\n \"tax\": \"0\"\n }"
],
"line_end" => 610,
"line_start" => 549,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "order",
"value" => "order"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "price",
"value" => "priceString"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amountString"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "Precise.stringAbs (feeAmountString)"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "this.safeCurrencyCode (feeCurrency)"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades\n // {\n // \"pair\": \"BTCUSDT\",\n // \"pairNormalized\": \"BTC_USDT\",\n // \"numerator\": \"BTC\",\n // \"denominator\": \"USDT\",\n // \"date\": \"1618916879083\",\n // \"tid\": \"637545136790672520\",\n // \"price\": \"55774\",\n // \"amount\": \"0.27917100\",\n // \"side\": \"buy\"\n // }\n //\n // fetchMyTrades\n // {\n // \"price\": \"56000\",\n // \"numeratorSymbol\": \"BTC\",\n // \"denominatorSymbol\": \"USDT\",\n // \"orderType\": \"buy\",\n // \"orderId\": \"2606935102\",\n // \"id\": \"320874372\",\n // \"timestamp\": \"1618916479593\",\n // \"amount\": \"0.00020000\",\n // \"fee\": \"0\",\n // \"tax\": \"0\"\n // }\n //\n const timestamp = this.safeInteger2 (trade, 'date', 'timestamp');\n const id = this.safeString2 (trade, 'tid', 'id');\n const order = this.safeString (trade, 'orderId');\n const priceString = this.safeString (trade, 'price');\n const amountString = Precise.stringAbs (this.safeString (trade, 'amount'));\n const marketId = this.safeString (trade, 'pair');\n const symbol = this.safeSymbol (marketId, market);\n const side = this.safeString2 (trade, 'side', 'orderType');\n let fee = undefined;\n const feeAmountString = this.safeString (trade, 'fee');\n if (feeAmountString !== undefined) {\n const feeCurrency = this.safeString (trade, 'denominatorSymbol');\n fee = {\n 'cost': Precise.stringAbs (feeAmountString),\n 'currency': this.safeCurrencyCode (feeCurrency),\n };\n }\n return this.safeTrade ({\n 'info': trade,\n 'id': id,\n 'order': order,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'type': undefined,\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': priceString,\n 'amount': amountString,\n 'cost': undefined,\n 'fee': fee,\n }, market);\n }"
}
],
path_prefix: "",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 100,
period: 1000,
requests: 10,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 1,
method: :get,
path: "/allOrders"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/openOrders"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/users/balances"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/users/transactions/trade"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/cancelOrder"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/order"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/users/transactions/crypto"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/users/transactions/fiat"
},
%{
auth: false,
cost: 1,
method: :delete,
path: "/order"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/ohlc"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orderbook"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/server/exchangeinfo"
},
%{
auth: false,
cost: 0.1,
method: :get,
path: "/ticker"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/trades"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
confidence: :medium,
pattern: :hmac_sha256_headers,
signature_encoding: :base64
},
spec_format_version: 2,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: %{
precision_mode: 4,
sample_limits: %{
"amount" => %{},
"cost" => %{
"min" => 99.91
},
"price" => %{
"max" => 10000000,
"min" => 1.0e-13
}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 1
},
spot: %{
base: "BTC",
base_id: "BTC",
case: :upper,
contract: false,
id: "BTCTRY",
limits: %{
"amount" => %{},
"cost" => %{
"min" => 99.91
},
"leverage" => %{},
"price" => %{
"max" => 10000000,
"min" => 1.0e-13
}
},
maker: 0.0005,
precision: %{
"amount" => 1.0e-8,
"price" => 1
},
quote: "TRY",
quote_id: "TRY",
separator: "",
symbol: "BTC/TRY",
taker: 0.0009
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :no_separator_upper,
prefix: nil,
separator: "",
suffix: nil
}
},
timeframes: %{
"15m" => 15,
"1d" => "1 d",
"1h" => 60,
"1m" => 1,
"1w" => "1 w",
"1y" => "1 y",
"30m" => 30,
"4h" => 240
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://api.btcturk.com/api/v2",
api_sections: %{
"graph" => "https://graph-api.btcturk.com/v1",
"private" => "https://api.btcturk.com/api/v1",
"public" => "https://api.btcturk.com/api/v2"
},
doc: "https://github.com/BTCTrader/broker-api-docs",
other: nil,
sandbox: nil,
www: "https://www.btcturk.com"
},
version: nil,
ws: nil
}