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

priv/specs/extracted/coincheck.exs

# coincheck Exchange Specification
#
# Auto-generated by: mix ccxt.extract coincheck
# CCXT version: 4.5.34
# Spec format version: 1
#
# Review before use:
# - signing: Detected from sign() method, verify with testnet
# - endpoints: Raw paths extracted, map to unified API as needed
# - exceptions: Extracted (exact, broad, HTTP status codes)
# - features/options: Extracted from describe()
# - classification: Set to :supported initially, promote after validation
#
%{
api_param_requirements: nil,
certified: false,
classification: :supported,
comment: nil,
countries: [
"JP",
"ID"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 13,
"coveragePercent" => 100,
"enabledMethods" => 17,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
},
%{
"method" => "fetchCurrencies",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 2,
"extractableMethods" => 15,
"failures" => [
%{
"error" => "Cannot convert undefined or null to object",
"method" => "fetchMarkets"
},
%{
"error" => "coincheck fetchTicker() supports BTC/JPY only",
"method" => "fetchTicker"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{},
params: [
:id,
:symbol
],
path: "/exchange/orders/{id}",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"price" => "rate",
"side" => "order_type",
"symbol" => "pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/exchange/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"order_type" => "market_buy"
},
market_type: :spot,
method: :post,
name: :create_market_order,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/exchange/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"price" => "rate",
"side" => "order_type",
"symbol" => "pair"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/exchange/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/accounts/balance",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:since,
:limit
],
path: "/deposit_money",
response_transformer: {:extract_path, ["deposits"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:limit
],
path: "/order_books",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/exchange/orders/transactions_pagination",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/exchange/orders/opens",
response_transformer: {:extract_path, ["orders"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:limit
],
path: "/order_books",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/trades",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/accounts",
response_transformer: {:extract_path, ["exchange_fees"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/withdraws",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
}
],
error_code_details: %{
"disabled API Key" => %{
description: "{\"success\":false,\"error\":\"disabled API Key\"}'",
type: :invalid_credentials
},
"invalid authentication" => %{
description: "{\"success\":false,\"error\":\"invalid authentication\"}",
type: :invalid_credentials
}
},
error_codes: %{
"disabled API Key" => :invalid_credentials,
"invalid authentication" => :invalid_credentials
},
exceptions: %{
exact: %{
"disabled API Key" => :authentication_error,
"invalid authentication" => :authentication_error
}
},
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://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: false,
gtd: false,
ioc: false,
po: true
},
trailing: false,
trigger_direction: false,
trigger_price: false
},
fetch_my_trades: %{
margin_mode: false,
symbol_required: true
},
fetch_open_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
maker: 0,
percentage: true,
taker: 0,
tier_based: false
}
},
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined;\n }\n //\n // {\"success\":false,\"error\":\"disabled API Key\"}'\n // {\"success\":false,\"error\":\"invalid authentication\"}\n //\n const success = this.safeBool(response, 'success', true);\n if (!success) {\n const error = this.safeString(response, 'error');\n const feedback = this.id + ' ' + this.json(response);\n this.throwExactlyMatchedException(this.exceptions['exact'], error, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n throw new errors.ExchangeError(this.id + ' ' + this.json(response));\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: 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_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: true,
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: true,
fetch_deposits_withdrawals: false,
fetch_deposits_ws: false,
fetch_funding_history: false,
fetch_funding_interval: false,
fetch_funding_intervals: false,
fetch_funding_rate: false,
fetch_funding_rate_history: false,
fetch_funding_rates: false,
fetch_greeks: false,
fetch_index_ohlcv: false,
fetch_isolated_borrow_rate: false,
fetch_isolated_borrow_rates: false,
fetch_isolated_positions: false,
fetch_l2_order_book: true,
fetch_l3_order_book: false,
fetch_last_prices: false,
fetch_ledger: false,
fetch_ledger_entry: false,
fetch_leverage: false,
fetch_leverage_tiers: false,
fetch_leverages: false,
fetch_liquidations: false,
fetch_long_short_ratio: false,
fetch_long_short_ratio_history: false,
fetch_margin_adjustment_history: false,
fetch_margin_mode: false,
fetch_margin_modes: false,
fetch_mark_ohlcv: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: true,
fetch_my_trades_ws: false,
fetch_ohlcv: false,
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: false,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: false,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: false,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: false,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: true,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: true,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
repay_margin: false,
sandbox: false,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: true,
swap: false,
transfer: false,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: false,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: false,
watch_ohlcv: false,
watch_ohlcv_for_symbols: false,
watch_order_book: 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: false,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: false,
withdraw: false,
ws: true
},
http_config: nil,
id: "coincheck",
markets: %{
"BTC/JPY" => %{
"base" => "BTC",
"baseId" => "btc",
"contract" => false,
"future" => false,
"id" => "btc_jpy",
"index" => false,
"limits" => %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
"marginModes" => %{},
"option" => false,
"precision" => %{},
"quote" => "JPY",
"quoteId" => "jpy",
"spot" => true,
"swap" => false,
"symbol" => "BTC/JPY",
"type" => "spot"
},
"ETC/BTC" => %{
"base" => "ETC",
"baseId" => "etc",
"contract" => false,
"future" => false,
"id" => "etc_btc",
"index" => false,
"limits" => %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
"marginModes" => %{},
"option" => false,
"precision" => %{},
"quote" => "BTC",
"quoteId" => "btc",
"spot" => true,
"swap" => false,
"symbol" => "ETC/BTC",
"type" => "spot"
},
"ETC/JPY" => %{
"base" => "ETC",
"baseId" => "etc",
"contract" => false,
"future" => false,
"id" => "etc_jpy",
"index" => false,
"limits" => %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
"marginModes" => %{},
"option" => false,
"precision" => %{},
"quote" => "JPY",
"quoteId" => "jpy",
"spot" => true,
"swap" => false,
"symbol" => "ETC/JPY",
"type" => "spot"
},
"FCT/JPY" => %{
"base" => "FCT",
"baseId" => "fct",
"contract" => false,
"future" => false,
"id" => "fct_jpy",
"index" => false,
"limits" => %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
"marginModes" => %{},
"option" => false,
"precision" => %{},
"quote" => "JPY",
"quoteId" => "jpy",
"spot" => true,
"swap" => false,
"symbol" => "FCT/JPY",
"type" => "spot"
},
"MONA/JPY" => %{
"base" => "MONA",
"baseId" => "mona",
"contract" => false,
"future" => false,
"id" => "mona_jpy",
"index" => false,
"limits" => %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
"marginModes" => %{},
"option" => false,
"precision" => %{},
"quote" => "JPY",
"quoteId" => "jpy",
"spot" => true,
"swap" => false,
"symbol" => "MONA/JPY",
"type" => "spot"
}
},
name: "coincheck",
ohlcv_timestamp_resolution: :unknown,
options: %{},
order_mappings: nil,
param_mappings: %{
"code" => "currency",
"price" => "rate",
"side" => "order_type",
"symbol" => "pair"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 281,
"line_start" => 265,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const result: Dict = { 'info': response };\n const codes = Object.keys (this.currencies);\n for (let i = 0; i < codes.length; i++) {\n const code = codes[i];\n const currency = this.currency (code);\n const currencyId = currency['id'];\n if (currencyId in response) {\n const account = this.account ();\n const reserved = currencyId + '_reserved';\n account['free'] = this.safeString (response, currencyId);\n account['used'] = this.safeString (response, reserved);\n result[code] = account;\n }\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{ id: 202835,\n \"order_type\": \"buy\",\n \"rate\": 26890,\n \"pair\": \"btc_jpy\",\n \"pending_amount\": \"0.5527\",\n \"pending_market_buy_amount\": null,\n \"stop_loss_rate\": null,\n \"created_at\": \"2015-01-10T05:55:38.000Z\" }"
],
"line_end" => 372,
"line_start" => 325,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "remaining"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "average",
"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 // fetchOpenOrders\n //\n // { id: 202835,\n // \"order_type\": \"buy\",\n // \"rate\": 26890,\n // \"pair\": \"btc_jpy\",\n // \"pending_amount\": \"0.5527\",\n // \"pending_market_buy_amount\": null,\n // \"stop_loss_rate\": null,\n // \"created_at\": \"2015-01-10T05:55:38.000Z\" }\n //\n // todo: add formats for fetchOrder, fetchClosedOrders here\n //\n const id = this.safeString (order, 'id');\n const side = this.safeString (order, 'order_type');\n const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n const amount = this.safeString (order, 'pending_amount');\n const remaining = this.safeString (order, 'pending_amount');\n const price = this.safeString (order, 'rate');\n const status = undefined;\n const marketId = this.safeString (order, 'pair');\n const symbol = this.safeSymbol (marketId, market, '_');\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'amount': amount,\n 'remaining': remaining,\n 'filled': undefined,\n 'side': side,\n 'type': undefined,\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'status': status,\n 'symbol': symbol,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': undefined,\n 'fee': undefined,\n 'info': order,\n 'average': undefined,\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"last\":4192632.0,\n \"bid\":4192496.0,\n \"ask\":4193749.0,\n \"high\":4332000.0,\n \"low\":4101047.0,\n \"volume\":2313.43191762,\n \"timestamp\":1643374115\n }"
],
"line_end" => 431,
"line_start" => 394,
"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" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"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 // \"last\":4192632.0,\n // \"bid\":4192496.0,\n // \"ask\":4193749.0,\n // \"high\":4332000.0,\n // \"low\":4101047.0,\n // \"volume\":2313.43191762,\n // \"timestamp\":1643374115\n // }\n //\n const symbol = this.safeSymbol (undefined, market);\n const timestamp = this.safeTimestamp (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': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'volume'),\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"206849494\",\n \"amount\": \"0.01\",\n \"rate\": \"5598346.0\",\n \"pair\": \"btc_jpy\",\n \"order_type\": \"sell\",\n \"created_at\": \"2021-12-08T14:10:33.000Z\"\n }",
"{\n \"id\": 38,\n \"order_id\": 49,\n \"created_at\": \"2015-11-18T07:02:21.000Z\",\n \"funds\": {\n \"btc\": \"0.1\",\n \"jpy\": \"-4096.135\"\n },\n \"pair\": \"btc_jpy\",\n \"rate\": \"40900.0\",\n \"fee_currency\": \"JPY\",\n \"fee\": \"6.135\",\n \"liquidity\": \"T\",\n \"side\": \"buy\"\n }"
],
"line_end" => 545,
"line_start" => 466,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"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" => "currency",
"value" => "this.safeString (trade, 'fee_currency')"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeString (trade, 'fee')"
}
],
"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 // \"id\": \"206849494\",\n // \"amount\": \"0.01\",\n // \"rate\": \"5598346.0\",\n // \"pair\": \"btc_jpy\",\n // \"order_type\": \"sell\",\n // \"created_at\": \"2021-12-08T14:10:33.000Z\"\n // }\n //\n // fetchMyTrades (private) - example from docs\n //\n // {\n // \"id\": 38,\n // \"order_id\": 49,\n // \"created_at\": \"2015-11-18T07:02:21.000Z\",\n // \"funds\": {\n // \"btc\": \"0.1\",\n // \"jpy\": \"-4096.135\"\n // },\n // \"pair\": \"btc_jpy\",\n // \"rate\": \"40900.0\",\n // \"fee_currency\": \"JPY\",\n // \"fee\": \"6.135\",\n // \"liquidity\": \"T\",\n // \"side\": \"buy\"\n // }\n //\n const timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n const id = this.safeString (trade, 'id');\n const priceString = this.safeString (trade, 'rate');\n const marketId = this.safeString (trade, 'pair');\n market = this.safeMarket (marketId, market, '_');\n const baseId = market['baseId'];\n const quoteId = market['quoteId'];\n const symbol = market['symbol'];\n let takerOrMaker = undefined;\n let amountString = undefined;\n let costString = undefined;\n let side = undefined;\n let fee = undefined;\n let orderId = undefined;\n if ('liquidity' in trade) {\n if (this.safeString (trade, 'liquidity') === 'T') {\n takerOrMaker = 'taker';\n } else if (this.safeString (trade, 'liquidity') === 'M') {\n takerOrMaker = 'maker';\n }\n const funds = this.safeValue (trade, 'funds', {});\n amountString = this.safeString (funds, baseId);\n costString = this.safeString (funds, quoteId);\n fee = {\n 'currency': this.safeString (trade, 'fee_currency'),\n 'cost': this.safeString (trade, 'fee'),\n };\n side = this.safeString (trade, 'side');\n orderId = this.safeString (trade, 'order_id');\n } else {\n amountString = this.safeString (trade, 'amount');\n side = this.safeString (trade, 'order_type');\n }\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'datetime': this.iso8601 (timestamp),\n 'timestamp': timestamp,\n 'symbol': symbol,\n 'type': undefined,\n 'side': side,\n 'order': orderId,\n 'takerOrMaker': takerOrMaker,\n 'price': priceString,\n 'amount': amountString,\n 'cost': costString,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": 2,\n \"amount\": \"0.05\",\n \"currency\": \"BTC\",\n \"address\": \"13PhzoK8me3u5nHzzFD85qT9RqEWR9M4Ty\",\n \"status\": \"confirmed\",\n \"confirmed_at\": \"2015-06-13T08:29:18.000Z\",\n \"created_at\": \"2015-06-13T08:22:18.000Z\"\n }",
"{\n \"id\": 398,\n \"status\": \"finished\",\n \"amount\": \"242742.0\",\n \"currency\": \"JPY\",\n \"created_at\": \"2014-12-04T15:00:00.000Z\",\n \"bank_account_id\": 243,\n \"fee\": \"400.0\",\n \"is_fast\": true\n }"
],
"line_end" => 919,
"line_start" => 854,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "updated"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n //\n // {\n // \"id\": 2,\n // \"amount\": \"0.05\",\n // \"currency\": \"BTC\",\n // \"address\": \"13PhzoK8me3u5nHzzFD85qT9RqEWR9M4Ty\",\n // \"status\": \"confirmed\",\n // \"confirmed_at\": \"2015-06-13T08:29:18.000Z\",\n // \"created_at\": \"2015-06-13T08:22:18.000Z\"\n // }\n //\n // fetchWithdrawals\n //\n // {\n // \"id\": 398,\n // \"status\": \"finished\",\n // \"amount\": \"242742.0\",\n // \"currency\": \"JPY\",\n // \"created_at\": \"2014-12-04T15:00:00.000Z\",\n // \"bank_account_id\": 243,\n // \"fee\": \"400.0\",\n // \"is_fast\": true\n // }\n //\n const id = this.safeString (transaction, 'id');\n const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n const address = this.safeString (transaction, 'address');\n const amount = this.safeNumber (transaction, 'amount');\n const currencyId = this.safeString (transaction, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n const updated = this.parse8601 (this.safeString (transaction, 'confirmed_at'));\n let fee = undefined;\n const feeCost = this.safeNumber (transaction, 'fee');\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': code,\n };\n }\n return {\n 'info': transaction,\n 'id': id,\n 'txid': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': undefined,\n 'address': address,\n 'addressTo': address,\n 'addressFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': undefined,\n 'amount': amount,\n 'currency': code,\n 'status': status,\n 'updated': updated,\n 'comment': undefined,\n 'internal': undefined,\n 'fee': fee,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 852,
"line_start" => 840,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n // withdrawals\n 'pending': 'pending',\n 'processing': 'pending',\n 'finished': 'ok',\n 'canceled': 'canceled',\n // deposits\n 'confirmed': 'pending',\n 'received': 'ok',\n };\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 1500,
period: 1000,
requests: 1,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [],
public: []
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: %{
code_field: "error",
field: "success",
message_field: "message",
success_values: nil,
type: :success_bool
},
signing: %{
api_key_header: "ACCESS-KEY",
confidence: :medium,
passphrase_header: "ACCESS-PASSPHRASE",
pattern: :hmac_sha256_passphrase_signed,
signature_header: "ACCESS-SIGN",
timestamp_header: "ACCESS-TIMESTAMP"
},
spec_format_version: 1,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: %{
precision_mode: 4,
sample_limits: %{
"amount" => %{},
"cost" => %{},
"price" => %{}
},
sample_precision: %{},
spot: %{
base: "BTC",
base_id: "btc",
case: :lower,
contract: false,
id: "btc_jpy",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
precision: %{},
quote: "JPY",
quote_id: "jpy",
separator: "_",
symbol: "BTC/JPY"
}
},
symbol_patterns: %{
spot: %{
case: :lower,
component_order: nil,
date_format: nil,
pattern: :underscore_lower,
separator: "_",
suffix: nil
}
},
timeframes: %{},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://coincheck.com/api",
api_sections: %{
"rest" => "https://coincheck.com/api"
},
doc: "https://coincheck.com/documents/exchange/api",
other: nil,
sandbox: nil,
www: "https://coincheck.com"
},
version: nil,
ws: %{
channel_templates: %{
watch_order_book: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_topic,
separator: ":"
},
watch_trades: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_topic,
separator: ":"
}
},
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: false,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: nil,
watch_orders: false,
watch_orders_for_symbols: nil,
watch_position: nil,
watch_positions: nil,
watch_status: nil,
watch_ticker: false,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: false
},
message_patterns: [
%{
args_field: "channel",
format: :type,
keys: [
"channel",
"type"
],
kind_field: "type",
kind_value: "subscribe",
sources: [
:send,
:watch
]
}
],
options: %{
"watchOrderBook" => %{
"snapshotDelay" => 6,
"snapshotMaxRetries" => 3
},
"wsSessionToken" => ""
},
subscription_config: %{
args_field: "topic",
args_format: :string,
market_id_format: :native,
op_field: "type",
separator: ":"
},
subscription_pattern: :type_subscribe,
urls: "wss://ws-api.coincheck.com/",
watch_methods: [
"watchOrderBook",
"watchTrades"
]
}
}