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

priv/specs/extracted/zaif.exs

# Zaif Exchange Specification
#
# Auto-generated by: mix ccxt.extract zaif
# 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"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 12,
"coveragePercent" => 100,
"enabledMethods" => 13,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 12,
"failures" => []
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :cancel_order,
param_mappings: %{
"id" => "order_id"
},
params: [
:id,
:symbol
],
path: "/cancel_order",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
default_params: %{
"action" => "bid"
},
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"symbol" => "currency_pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/trade",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
default_params: %{
"action" => "bid"
},
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"symbol" => "currency_pair"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/trade",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :post,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/get_info",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 50,
market_type: :spot,
method: :post,
name: :fetch_closed_orders,
param_mappings: %{
"symbol" => "currency_pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/trade_history",
response_transformer: {:extract_path, ["return"]},
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: "/depth/{pair}",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/currency_pairs/all",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "currency_pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/active_orders",
response_transformer: {:extract_path, ["return"]},
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: "/depth/{pair}",
response_transformer: {:extract_path_unwrap, ["return"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol
],
path: "/ticker/{pair}",
response_transformer: {:extract_path_unwrap, ["return"]},
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/{pair}",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :post,
name: :withdraw,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:amount,
:address,
:tag
],
path: "/withdraw",
response_transformer: {:extract_path, ["return"]},
source: :intercepted
}
],
error_code_details: %{
"unsupported currency_pair" => %{
description: "{\"error\": \"unsupported currency_pair\"}",
type: :invalid_parameters
}
},
error_codes: %{
"unsupported currency_pair" => :invalid_parameters
},
exceptions: %{
exact: %{
"unsupported currency_pair" => :bad_request
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networksById" => %{}
},
extended_metadata: %{
fees_url: "https://zaif.jp/fee?lang=en",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/27766927-39ca2ada-5eeb-11e7-972f-1b4199518ca6.jpg"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: true,
margin_mode: true,
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_closed_orders: %{
days_back: 100000,
days_back_canceled: 1,
limit: 1000,
margin_mode: true,
symbol_required: false,
trailing: false,
trigger: false,
until_days: 100000
},
fetch_open_orders: %{
margin_mode: true,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
maker: 0,
percentage: true,
taker: 0.001
}
},
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 // {\"error\": \"unsupported currency_pair\"}\n //\n const feedback = this.id + ' ' + body;\n const error = this.safeString(response, 'error');\n if (error !== undefined) {\n this.throwExactlyMatchedException(this.exceptions['exact'], error, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], error, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\n }\n const success = this.safeBool(response, 'success', true);\n if (!success) {\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: 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: false,
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_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: true,
fetch_closed_orders_ws: false,
fetch_convert_currencies: false,
fetch_convert_quote: false,
fetch_convert_trade: false,
fetch_convert_trade_history: false,
fetch_cross_borrow_rate: false,
fetch_cross_borrow_rates: false,
fetch_currencies: false,
fetch_currencies_ws: true,
fetch_deposit: 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_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: false,
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: 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,
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: true,
ws: false
},
http_config: nil,
id: "zaif",
markets: nil,
name: "Zaif",
ohlcv_timestamp_resolution: :unknown,
options: %{},
order_mappings: nil,
param_mappings: %{
"code" => "currency",
"id" => "order_id",
"symbol" => "pair"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 350,
"line_start" => 325,
"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 balances = this.safeValue (response, 'return', {});\n const deposit = this.safeValue (balances, 'deposit');\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n const funds = this.safeValue (balances, 'funds', {});\n const currencyIds = Object.keys (funds);\n for (let i = 0; i < currencyIds.length; i++) {\n const currencyId = currencyIds[i];\n const code = this.safeCurrencyCode (currencyId);\n const balance = this.safeString (funds, currencyId);\n const account = this.account ();\n account['free'] = balance;\n account['total'] = balance;\n if (deposit !== undefined) {\n if (currencyId in deposit) {\n account['total'] = this.safeString (deposit, currencyId);\n }\n }\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 323,
"line_start" => 267,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"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" => "undefined"
},
%{
"comment" => nil,
"key" => "swap",
"value" => "false"
},
%{
"comment" => nil,
"key" => "future",
"value" => "false"
},
%{
"comment" => nil,
"key" => "option",
"value" => "false"
},
%{
"comment" => nil,
"key" => "active",
"value" => "undefined"
},
%{
"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, 'item_unit_step'),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'aux_unit_point'))),\n }"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'item_unit_min'),\n 'max': undefined,\n },\n 'price': {\n 'min': this.safeNumber (market, 'aux_unit_min'),\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, 'item_unit_min'),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "price",
"value" => "{\n 'min': this.safeNumber (market, 'aux_unit_min'),\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "min",
"value" => "this.safeNumber (market, 'aux_unit_min')"
},
%{
"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, 'currency_pair');\n const name = this.safeString (market, 'name');\n const [ baseId, quoteId ] = name.split ('/');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const symbol = base + '/' + quote;\n return {\n 'id': id,\n 'symbol': symbol,\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': undefined,\n 'swap': false,\n 'future': false,\n 'option': false,\n 'active': undefined, // can trade or not\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, 'item_unit_step'),\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'aux_unit_point'))),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'item_unit_min'),\n 'max': undefined,\n },\n 'price': {\n 'min': this.safeNumber (market, 'aux_unit_min'),\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 \"currency_pair\": \"btc_jpy\",\n \"action\": \"ask\",\n \"amount\": 0.03,\n \"price\": 56000,\n \"timestamp\": 1402021125,\n \"comment\" : \"demo\"\n }",
"{\n \"order_id\": 184,\n \"funds\": {\n \"jpy\": 15320,\n \"btc\": 1.392,\n \"mona\": 2600,\n \"kaori\": 0.1\n }\n }"
],
"line_end" => 654,
"line_start" => 600,
"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" => "status",
"value" => "'open'"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'limit'"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // {\n // \"currency_pair\": \"btc_jpy\",\n // \"action\": \"ask\",\n // \"amount\": 0.03,\n // \"price\": 56000,\n // \"timestamp\": 1402021125,\n // \"comment\" : \"demo\"\n // }\n //\n // cancelOrder\n //\n // {\n // \"order_id\": 184,\n // \"funds\": {\n // \"jpy\": 15320,\n // \"btc\": 1.392,\n // \"mona\": 2600,\n // \"kaori\": 0.1\n // }\n // }\n //\n let side = this.safeString (order, 'action');\n side = (side === 'bid') ? 'buy' : 'sell';\n const timestamp = this.safeTimestamp (order, 'timestamp');\n const marketId = this.safeString (order, 'currency_pair');\n const symbol = this.safeSymbol (marketId, market, '_');\n const price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'amount');\n const id = this.safeString2 (order, 'id', 'order_id');\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'status': 'open',\n 'symbol': symbol,\n 'type': 'limit',\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': undefined,\n 'amount': amount,\n 'filled': undefined,\n 'remaining': undefined,\n 'trades': undefined,\n 'fee': undefined,\n 'info': order,\n 'average': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"last\": 9e-08,\n \"high\": 1e-07,\n \"low\": 9e-08,\n \"vwap\": 0.0,\n \"volume\": 135250.0,\n \"bid\": 9e-08,\n \"ask\": 1e-07\n }"
],
"line_end" => 425,
"line_start" => 386,
"mappings" => [
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "high",
"value" => "this.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" => "vwap"
},
%{
"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" => "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 // {\n // \"last\": 9e-08,\n // \"high\": 1e-07,\n // \"low\": 9e-08,\n // \"vwap\": 0.0,\n // \"volume\": 135250.0,\n // \"bid\": 9e-08,\n // \"ask\": 1e-07\n // }\n //\n const symbol = this.safeSymbol (undefined, market);\n const vwap = this.safeString (ticker, 'vwap');\n const baseVolume = this.safeString (ticker, 'volume');\n const quoteVolume = Precise.stringMul (baseVolume, vwap);\n const last = this.safeString (ticker, 'last');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': undefined,\n 'datetime': undefined,\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': vwap,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"date\": 1648559414,\n \"price\": 5880375.0,\n \"amount\": 0.017,\n \"tid\": 176126557,\n \"currency_pair\": \"btc_jpy\",\n \"trade_type\": \"ask\"\n }"
],
"line_end" => 493,
"line_start" => 457,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "order",
"value" => "undefined"
},
%{
"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" => "undefined"
}
],
"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 // \"date\": 1648559414,\n // \"price\": 5880375.0,\n // \"amount\": 0.017,\n // \"tid\": 176126557,\n // \"currency_pair\": \"btc_jpy\",\n // \"trade_type\": \"ask\"\n // }\n //\n let side = this.safeString (trade, 'trade_type');\n side = (side === 'bid') ? 'buy' : 'sell';\n const timestamp = this.safeTimestamp (trade, 'date');\n const id = this.safeString2 (trade, 'id', 'tid');\n const priceString = this.safeString (trade, 'price');\n const amountString = this.safeString (trade, 'amount');\n const marketId = this.safeString (trade, 'currency_pair');\n const symbol = this.safeSymbol (marketId, market, '_');\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'type': undefined,\n 'side': side,\n 'order': undefined,\n 'takerOrMaker': undefined,\n 'price': priceString,\n 'amount': amountString,\n 'cost': undefined,\n 'fee': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": 23634,\n \"fee\": 0.001,\n \"txid\":,\n \"funds\": {\n \"jpy\": 15320,\n \"btc\": 1.392,\n \"xem\": 100.2,\n \"mona\": 2600\n }\n }"
],
"line_end" => 810,
"line_start" => 765,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'id')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString (transaction, 'txid')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "address",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "currency['code']"
},
%{
"comment" => nil,
"key" => "status",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // {\n // \"id\": 23634,\n // \"fee\": 0.001,\n // \"txid\":,\n // \"funds\": {\n // \"jpy\": 15320,\n // \"btc\": 1.392,\n // \"xem\": 100.2,\n // \"mona\": 2600\n // }\n // }\n //\n currency = this.safeCurrency (undefined, currency);\n let fee = undefined;\n const feeCost = this.safeValue (transaction, 'fee');\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': currency['code'],\n };\n }\n return {\n 'id': this.safeString (transaction, 'id'),\n 'txid': this.safeString (transaction, 'txid'),\n 'timestamp': undefined,\n 'datetime': undefined,\n 'network': undefined,\n 'addressFrom': undefined,\n 'address': undefined,\n 'addressTo': undefined,\n 'amount': undefined,\n 'type': undefined,\n 'currency': currency['code'],\n 'status': undefined,\n 'updated': undefined,\n 'tagFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'comment': undefined,\n 'internal': undefined,\n 'fee': fee,\n 'info': transaction,\n } as Transaction;\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: 5,
method: :post,
path: "/active_orders"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/cancel_order"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/deposit_history"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_id_info"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/get_info"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_info2"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/get_personal_info"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/trade"
},
%{
auth: false,
cost: 50,
method: :post,
path: "/trade_history"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/withdraw"
},
%{
auth: false,
cost: 5,
method: :post,
path: "/withdraw_history"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/currencies/all"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/currencies/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/currency_pairs/all"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/currency_pairs/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/depth/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/last_price/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/ticker/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/trades/{pair}"
}
]
},
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: "Key",
confidence: :medium,
pattern: :hmac_sha512_nonce
},
spec_format_version: 1,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: %{
precision_mode: 4,
sample_limits: %{
"amount" => %{
"min" => 0.0001
},
"cost" => %{},
"price" => %{
"min" => 0.0001
}
},
sample_precision: %{
"amount" => 0.0001,
"price" => 0.0001
},
spot: %{
base: "KLAY",
base_id: "KLAY",
case: :lower,
contract: false,
id: "klay_jpy",
limits: %{
"amount" => %{
"min" => 0.0001
},
"cost" => %{},
"leverage" => %{},
"price" => %{
"min" => 0.0001
}
},
maker: 0,
precision: %{
"amount" => 0.0001,
"price" => 0.0001
},
quote: "JPY",
quote_id: "JPY",
separator: "_",
symbol: "KLAY/JPY",
taker: 0.001
}
},
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://api.zaif.jp",
api_sections: %{
"rest" => "https://api.zaif.jp"
},
doc: [
"https://techbureau-api-document.readthedocs.io/ja/latest/index.html",
"https://corp.zaif.jp/api-docs",
"https://corp.zaif.jp/api-docs/api_links",
"https://www.npmjs.com/package/zaif.jp",
"https://github.com/you21979/node-zaif"
],
other: nil,
sandbox: nil,
www: "https://zaif.jp"
},
version: "1",
ws: nil
}