# bitFlyer Exchange Specification # # Auto-generated by: mix ccxt.extract bitflyer # 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" => 17, "coveragePercent" => 100, "enabledMethods" => 22, "excluded" => [ %{ "method" => "editOrder", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchClosedOrders", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchOpenOrders", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchOrder", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 4, "extractableMethods" => 18, "failures" => [ %{ "error" => "bitflyer allows withdrawing JPY, USD, EUR only, BTC is not supported", "method" => "withdraw" } ] }, endpoints: [ %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :cancel_order, param_mappings: %{ "id" => "child_order_acceptance_id", "symbol" => "product_code" }, params: [ :id, :symbol ], path: "/cancelchildorder", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "child_order_type" => "LIMIT" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "amount" => "size", "symbol" => "product_code" }, params: [ :symbol, :side, :amount, :price ], path: "/sendchildorder", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "child_order_type" => "MARKET" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "amount" => "size", "symbol" => "product_code" }, params: [ :symbol, :side, :amount, :price ], path: "/sendchildorder", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "amount" => "size", "symbol" => "product_code", "type" => "child_order_type" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/sendchildorder", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/getbalance", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/getcoinins", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "product_code" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{}, params: [ :symbol ], path: "/getfundingrate", response_transformer: {:extract_path_unwrap, ["commission_rate"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "product_code" }, params: [ :symbol, :limit ], path: "/getboard", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/getmarkets", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{ "symbol" => "product_code" }, params: [ :symbol, :since, :limit ], path: "/getexecutions", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "symbol" => "product_code" }, params: [ :symbol, :limit ], path: "/getboard", response_transformer: {:extract_path_unwrap, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "count" => 100 }, market_type: :spot, method: :get, name: :fetch_orders, param_mappings: %{ "symbol" => "product_code" }, params: [ :symbol, :since, :limit ], path: "/getchildorders", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "product_code" => [ "BTCUSDT" ] }, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/getpositions", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "product_code" }, params: [ :symbol ], path: "/getticker", response_transformer: {:extract_path_unwrap, ["commission_rate"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "limit" => "count", "symbol" => "product_code" }, params: [ :symbol, :since, :limit ], path: "/getexecutions", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_trading_fee, param_mappings: %{ "symbol" => "product_code" }, params: [ :symbol ], path: "/gettradingcommission", response_transformer: {:extract_path_unwrap, ["commission_rate"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/getcoinouts", response_transformer: {:extract_path, ["commission_rate"]}, source: :intercepted } ], error_code_details: %{ -2 => %{ description: "{\"status\":-2,\"error_message\":\"Under maintenance\",\"data\":null}", type: :network_error } }, error_codes: %{ -2 => :network_error }, exceptions: %{ exact: %{ "-2" => :on_maintenance } }, 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/d0217747-e54d-4533-8416-0d553dca74bb" }, 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: true, gtd: true, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: false }, fetch_closed_orders: %{ limit: 100, margin_mode: false, symbol_required: true, trailing: false, trigger: false }, fetch_my_trades: %{ limit: 100, margin_mode: false, symbol_required: true }, fetch_open_orders: %{ limit: 100, margin_mode: false, symbol_required: true, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: true, trailing: false, trigger: false }, fetch_orders: %{ limit: 100, margin_mode: false, symbol_required: true, trailing: false, trigger: false }, sandbox: false }, swap: %{} }, fees: %{ trading: %{ maker: 0.002, taker: 0.002 } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined; // fallback to the default error handler\n }\n const feedback = this.id + ' ' + body;\n // i.e. {\"status\":-2,\"error_message\":\"Under maintenance\",\"data\":null}\n const errorMessage = this.safeString(response, 'error_message');\n const statusCode = this.safeInteger(response, 'status');\n if (errorMessage !== undefined) {\n this.throwExactlyMatchedException(this.exceptions['exact'], statusCode, feedback);\n throw new errors.ExchangeError(feedback);\n }\n return undefined;\n }", has: %{ add_margin: false, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: false, cancel_all_orders: 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_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: true, fetch_deposits_withdrawals: false, fetch_deposits_ws: false, fetch_funding_history: false, fetch_funding_interval: false, fetch_funding_intervals: false, fetch_funding_rate: true, 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: true, 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_history: false, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: true, 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: true, fetch_trading_fees: false, fetch_trading_fees_ws: false, fetch_trading_limits: false, fetch_transaction_fee: false, fetch_transaction_fees: false, fetch_transactions: false, fetch_transfer: false, fetch_transfers: false, fetch_underlying_assets: false, fetch_volatility_history: false, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: true, fetch_withdrawals_ws: false, future: false, margin: false, option: false, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: 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: "bitflyer", markets: nil, name: "bitFlyer", ohlcv_timestamp_resolution: :unknown, options: %{}, order_mappings: %{ side_format: :uppercase, side_key: "side", type_format: nil, type_key: nil }, param_mappings: %{ "amount" => "size", "id" => "child_order_acceptance_id", "limit" => "count", "symbol" => "product_code", "type" => "child_order_type" }, parse_methods: [ %{ "comment" => nil, "examples" => [], "line_end" => 424, "line_start" => 412, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "source" => "parseBalance (response): Balances {\n const result: Dict = { 'info': response };\n for (let i = 0; i < response.length; i++) {\n const balance = response[i];\n const currencyId = this.safeString (balance, 'currency_code');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['total'] = this.safeString (balance, 'amount');\n account['free'] = this.safeString (balance, 'available');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1062, "line_start" => 1056, "mappings" => [], "name" => "parseDepositStatus", "signature" => "parseDepositStatus (status)", "source" => "parseDepositStatus (status) {\n const statuses: Dict = {\n 'PENDING': 'pending',\n 'COMPLETED': 'ok',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 248, "line_start" => 228, "mappings" => [], "name" => "parseExpiryDate", "signature" => "parseExpiryDate (expiry)", "source" => "parseExpiryDate (expiry) {\n const day = expiry.slice (0, 2);\n const monthName = expiry.slice (2, 5);\n const year = expiry.slice (5, 9);\n const months: Dict = {\n 'JAN': '01',\n 'FEB': '02',\n 'MAR': '03',\n 'APR': '04',\n 'MAY': '05',\n 'JUN': '06',\n 'JUL': '07',\n 'AUG': '08',\n 'SEP': '09',\n 'OCT': '10',\n 'NOV': '11',\n 'DEC': '12',\n };\n const month = this.safeString (months, monthName);\n return this.parse8601 (year + '-' + month + '-' + day + 'T00:00:00Z');\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"current_funding_rate\": -0.003750000000\n \"next_funding_rate_settledate\": \"2024-04-15T13:00:00\"\n }" ], "line_end" => 1207, "line_start" => 1178, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeString (market, 'symbol')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "interestRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "this.safeNumber (contract, 'current_funding_rate')" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "nextFundingTimestamp" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "this.iso8601 (nextFundingTimestamp)" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "interval", "value" => "undefined" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (contract, market: Market = undefined): FundingRate", "source" => "parseFundingRate (contract, market: Market = undefined): FundingRate {\n //\n // {\n // \"current_funding_rate\": -0.003750000000\n // \"next_funding_rate_settledate\": \"2024-04-15T13:00:00\"\n // }\n //\n const nextFundingDatetime = this.safeString (contract, 'next_funding_rate_settledate');\n const nextFundingTimestamp = this.parse8601 (nextFundingDatetime);\n return {\n 'info': contract,\n 'symbol': this.safeString (market, 'symbol'),\n 'markPrice': undefined,\n 'indexPrice': undefined,\n 'interestRate': undefined,\n 'estimatedSettlePrice': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'fundingRate': undefined,\n 'fundingTimestamp': undefined,\n 'fundingDatetime': undefined,\n 'nextFundingRate': this.safeNumber (contract, 'current_funding_rate'),\n 'nextFundingTimestamp': nextFundingTimestamp,\n 'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'interval': undefined,\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 774, "line_start" => 730, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "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" => "filled" }, %{ "comment" => nil, "key" => "remaining", "value" => "remaining" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "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 const timestamp = this.parse8601 (this.safeString (order, 'child_order_date'));\n const price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'size');\n const filled = this.safeString (order, 'executed_size');\n const remaining = this.safeString (order, 'outstanding_size');\n const status = this.parseOrderStatus (this.safeString (order, 'child_order_state'));\n const type = this.safeStringLower (order, 'child_order_type');\n const side = this.safeStringLower (order, 'side');\n const marketId = this.safeString (order, 'product_code');\n const symbol = this.safeSymbol (marketId, market);\n let fee = undefined;\n const feeCost = this.safeNumber (order, 'total_commission');\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': undefined,\n 'rate': undefined,\n };\n }\n const id = this.safeString (order, 'child_order_acceptance_id');\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': undefined,\n 'info': order,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'status': status,\n 'symbol': symbol,\n 'type': type,\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': undefined,\n 'amount': amount,\n 'filled': filled,\n 'remaining': remaining,\n 'fee': fee,\n 'average': undefined,\n 'trades': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 728, "line_start" => 719, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'ACTIVE': 'open',\n 'COMPLETED': 'closed',\n 'CANCELED': 'canceled',\n 'EXPIRED': 'canceled',\n 'REJECTED': 'canceled',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 505, "line_start" => 479, "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" => "undefined" }, %{ "comment" => nil, "key" => "low", "value" => "undefined" }, %{ "comment" => nil, "key" => "bid", "value" => "this.safeString (ticker, 'best_bid')" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeString (ticker, 'best_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_by_product')" }, %{ "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 const symbol = this.safeSymbol (undefined, market);\n const timestamp = this.parse8601 (this.safeString (ticker, 'timestamp'));\n const last = this.safeString (ticker, 'ltp');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': undefined,\n 'low': undefined,\n 'bid': this.safeString (ticker, 'best_bid'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'best_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_by_product'),\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\":2278466664,\n \"side\":\"SELL\",\n \"price\":56810.7,\n \"size\":0.08798,\n \"exec_date\":\"2021-11-19T11:46:39.323\",\n \"buy_child_order_acceptance_id\":\"JRF20211119-114209-236525\",\n \"sell_child_order_acceptance_id\":\"JRF20211119-114639-236919\"\n }", "{\n \"id\": 37233,\n \"side\": \"BUY\",\n \"price\": 33470,\n \"size\": 0.01,\n \"exec_date\": \"2015-07-07T09:57:40.397\",\n \"child_order_id\": \"JOR20150707-060559-021935\",\n \"child_order_acceptance_id\": \"JRF20150707-060559-396699\"\n \"commission\": 0,\n }," ], "line_end" => 589, "line_start" => 526, "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" => "market['symbol']" }, %{ "comment" => nil, "key" => "order", "value" => "order" }, %{ "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" => "undefined" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades (public) v1\n //\n // {\n // \"id\":2278466664,\n // \"side\":\"SELL\",\n // \"price\":56810.7,\n // \"size\":0.08798,\n // \"exec_date\":\"2021-11-19T11:46:39.323\",\n // \"buy_child_order_acceptance_id\":\"JRF20211119-114209-236525\",\n // \"sell_child_order_acceptance_id\":\"JRF20211119-114639-236919\"\n // }\n //\n // fetchMyTrades\n //\n // {\n // \"id\": 37233,\n // \"side\": \"BUY\",\n // \"price\": 33470,\n // \"size\": 0.01,\n // \"exec_date\": \"2015-07-07T09:57:40.397\",\n // \"child_order_id\": \"JOR20150707-060559-021935\",\n // \"child_order_acceptance_id\": \"JRF20150707-060559-396699\"\n // \"commission\": 0,\n // },\n //\n let side = this.safeStringLower (trade, 'side');\n if (side !== undefined) {\n if (side.length < 1) {\n side = undefined;\n }\n }\n let order = undefined;\n if (side !== undefined) {\n const idInner = side + '_child_order_acceptance_id';\n if (idInner in trade) {\n order = trade[idInner];\n }\n }\n if (order === undefined) {\n order = this.safeString (trade, 'child_order_acceptance_id');\n }\n const timestamp = this.parse8601 (this.safeString (trade, 'exec_date'));\n const priceString = this.safeString (trade, 'price');\n const amountString = this.safeString (trade, 'size');\n const id = this.safeString (trade, 'id');\n market = this.safeMarket (undefined, market);\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'order': order,\n 'type': undefined,\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': priceString,\n 'amount': amountString,\n 'cost': undefined,\n 'fee': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": 100,\n \"order_id\": \"CDP20151227-024141-055555\",\n \"currency_code\": \"BTC\",\n \"amount\": 0.00002,\n \"address\": \"1WriteySQufKZ2pVuM1oMhPrTtTVFq35j\",\n \"tx_hash\": \"9f92ee65a176bb9545f7becb8706c50d07d4cee5ffca34d8be3ef11d411405ae\",\n \"status\": \"COMPLETED\",\n \"event_date\": \"2015-11-27T08:59:20.301\"\n }", "{\n \"id\": 500,\n \"order_id\": \"CWD20151224-014040-077777\",\n \"currency_code\": \"BTC\",\n \"amount\": 0.1234,\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"tx_hash\": \"724c07dfd4044abcb390b0412c3e707dd5c4f373f0a52b3bd295ce32b478c60a\",\n \"fee\": 0.0005,\n \"additional_fee\": 0.0001,\n \"status\": \"COMPLETED\",\n \"event_date\": \"2015-12-24T01:40:40.397\"\n }", "{\n \"message_id\": \"69476620-5056-4003-bcbe-42658a2b041b\"\n }" ], "line_end" => 1151, "line_start" => 1072, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "txid", "value" => "txId" }, %{ "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" => "type" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "updated", "value" => "undefined" }, %{ "comment" => nil, "key" => "comment", "value" => "undefined" }, %{ "comment" => nil, "key" => "internal", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "cost", "value" => "this.parseNumber (Precise.stringAdd (feeCost, additionalFee))" } ], "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\": 100,\n // \"order_id\": \"CDP20151227-024141-055555\",\n // \"currency_code\": \"BTC\",\n // \"amount\": 0.00002,\n // \"address\": \"1WriteySQufKZ2pVuM1oMhPrTtTVFq35j\",\n // \"tx_hash\": \"9f92ee65a176bb9545f7becb8706c50d07d4cee5ffca34d8be3ef11d411405ae\",\n // \"status\": \"COMPLETED\",\n // \"event_date\": \"2015-11-27T08:59:20.301\"\n // }\n //\n // fetchWithdrawals\n //\n // {\n // \"id\": 500,\n // \"order_id\": \"CWD20151224-014040-077777\",\n // \"currency_code\": \"BTC\",\n // \"amount\": 0.1234,\n // \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n // \"tx_hash\": \"724c07dfd4044abcb390b0412c3e707dd5c4f373f0a52b3bd295ce32b478c60a\",\n // \"fee\": 0.0005,\n // \"additional_fee\": 0.0001,\n // \"status\": \"COMPLETED\",\n // \"event_date\": \"2015-12-24T01:40:40.397\"\n // }\n //\n // withdraw\n //\n // {\n // \"message_id\": \"69476620-5056-4003-bcbe-42658a2b041b\"\n // }\n //\n const id = this.safeString2 (transaction, 'id', 'message_id');\n const address = this.safeString (transaction, 'address');\n const currencyId = this.safeString (transaction, 'currency_code');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.parse8601 (this.safeString (transaction, 'event_date'));\n const amount = this.safeNumber (transaction, 'amount');\n const txId = this.safeString (transaction, 'tx_hash');\n const rawStatus = this.safeString (transaction, 'status');\n let type = undefined;\n let status = undefined;\n let fee = undefined;\n if ('fee' in transaction) {\n type = 'withdrawal';\n status = this.parseWithdrawalStatus (rawStatus);\n const feeCost = this.safeString (transaction, 'fee');\n const additionalFee = this.safeString (transaction, 'additional_fee');\n fee = { 'currency': code, 'cost': this.parseNumber (Precise.stringAdd (feeCost, additionalFee)) };\n } else {\n type = 'deposit';\n status = this.parseDepositStatus (rawStatus);\n }\n return {\n 'info': transaction,\n 'id': id,\n 'txid': txId,\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': type,\n 'amount': amount,\n 'currency': code,\n 'status': status,\n 'updated': undefined,\n 'comment': undefined,\n 'internal': undefined,\n 'fee': fee,\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1070, "line_start" => 1064, "mappings" => [], "name" => "parseWithdrawalStatus", "signature" => "parseWithdrawalStatus (status)", "source" => "parseWithdrawalStatus (status) {\n const statuses: Dict = {\n 'PENDING': 'pending',\n 'COMPLETED': 'ok',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "/v1/", pro: false, quote_json_numbers: nil, rate_limits: %{ interval_ms: 1000, 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: nil, 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: :upper, contract: false, id: "BTC_JPY", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, maker: 0.002, precision: %{}, quote: "JPY", quote_id: "JPY", separator: "_", symbol: "BTC/JPY", taker: 0.002 }, swap: %{ base: "BTC", base_id: "BTC", case: :upper, contract: true, id: "FX_BTC_JPY", inverse: false, limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, linear: true, maker: 0, precision: %{}, quote: "JPY", quote_id: "JPY", separator: "_", settle: "JPY", symbol: "BTC/JPY:JPY", taker: 0 } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :underscore_upper, separator: "_", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :implicit, separator: "_", suffix: nil } }, timeframes: %{}, url_strategy: %{ detected_from: "sign_method", pattern: :version_slash, prefix: "/v1/" }, urls: %{ api: "https://api.bitflyer.com", api_sections: %{ "rest" => "https://api.bitflyer.com" }, doc: "https://lightning.bitflyer.com/docs?lang=en", other: nil, sandbox: nil, www: "https://bitflyer.com" }, version: "v1", ws: nil }