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

priv/specs/extracted/bitbns.exs

# Bitbns Exchange Specification
#
# Auto-generated by: mix ccxt.extract bitbns
# 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: [
"IN"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 19,
"coveragePercent" => 100,
"enabledMethods" => 22,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
},
%{
"method" => "fetchCurrencies",
"reason" => "emulated (returns cached data, no HTTP call)"
},
%{
"method" => "fetchTicker",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 3,
"extractableMethods" => 19,
"failures" => []
},
endpoints: [
%{
api_section: "v2",
auth: false,
base_url: "https://api.{hostname}/api/trade/v2",
cost: 1,
default_params: %{
"side" => "usdtcancelOrder"
},
market_type: :spot,
method: :post,
name: :cancel_order,
param_mappings: %{
"id" => "entry_id"
},
params: [
:id,
:symbol
],
path: "/cancel",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v2",
auth: false,
base_url: "https://api.{hostname}/api/trade/v2",
cost: 1,
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"amount" => "quantity",
"price" => "rate"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
market_type: :spot,
method: :post,
name: :create_market_order,
param_mappings: %{
"amount" => "quantity",
"symbol" => "market"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/placeMarketOrderQnty/{symbol}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v2",
auth: false,
base_url: "https://api.{hostname}/api/trade/v2",
cost: 1,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "quantity",
"price" => "rate"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v2",
auth: false,
base_url: "https://api.{hostname}/api/trade/v2",
cost: 1,
default_params: %{
"triggerDirection" => "below"
},
market_type: :swap,
method: :post,
name: :create_stop_order,
param_mappings: %{
"amount" => "quantity",
"price" => "rate",
"triggerPrice" => "t_rate"
},
params: [
:symbol,
:type,
:side,
:amount,
:price,
:triggerPrice
],
path: "/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v2",
auth: false,
base_url: "https://api.{hostname}/api/trade/v2",
cost: 1,
default_params: %{
"triggerDirection" => "below"
},
market_type: :swap,
method: :post,
name: :create_trigger_order,
param_mappings: %{
"amount" => "quantity",
"price" => "rate",
"triggerPrice" => "t_rate"
},
params: [
:symbol,
:type,
:side,
:amount,
:price,
:triggerPrice
],
path: "/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/currentCoinBalance/EVERYTHING",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_deposit_address,
param_mappings: %{
"code" => "symbol"
},
params: [
:code
],
path: "/getCoinAddress/{symbol}",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
default_params: %{
"page" => 0
},
market_type: :spot,
method: :post,
name: :fetch_deposits,
param_mappings: %{
"code" => "symbol"
},
params: [
:code,
:since,
:limit
],
path: "/depositHistory/{symbol}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "www",
auth: false,
base_url: "https://{hostname}",
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/order/fetchOrderbook",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "www",
auth: false,
base_url: "https://{hostname}",
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/order/fetchMarkets",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
default_params: %{
"page" => 0
},
market_type: :spot,
method: :post,
name: :fetch_my_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/listExecutedOrders/{symbol}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v2",
auth: false,
base_url: "https://api.{hostname}/api/trade/v2",
cost: 1,
default_params: %{
"page" => 0,
"side" => "usdtListOpenOrders"
},
market_type: :spot,
method: :post,
name: :fetch_open_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/getordersnew",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_order,
param_mappings: %{
"id" => "entry_id"
},
params: [
:id,
:symbol
],
path: "/orderStatus/{symbol}",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "www",
auth: false,
base_url: "https://{hostname}",
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/order/fetchOrderbook",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_status,
param_mappings: %{},
params: [],
path: "/platform/status",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "www",
auth: false,
base_url: "https://{hostname}",
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/order/fetchTickers",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "www",
auth: false,
base_url: "https://{hostname}",
cost: 1,
default_params: %{
"coin" => "BTC"
},
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/exchangeData/tradedetails",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "v1",
auth: false,
base_url: "https://api.{hostname}/api/trade/v1",
cost: 1,
default_params: %{
"page" => 0
},
market_type: :spot,
method: :post,
name: :fetch_withdrawals,
param_mappings: %{
"code" => "symbol"
},
params: [
:code,
:since,
:limit
],
path: "/withdrawHistory/{symbol}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
}
],
error_code_details: %{
400 => %{
description: "Invalid Request",
type: :invalid_parameters
},
409 => %{
description: "{\"data\":\"\",\"status\":0,\"error\":\"coin name not supplied or not yet supported\",\"code\":409}",
type: :invalid_order
},
416 => %{
description: "{\"data\":\"Oops ! Not sufficient currency to sell\",\"status\":0,\"error\":null,\"code\":416}",
type: :insufficient_balance
},
417 => %{
description: "{\"data\":[],\"status\":0,\"error\":\"Nothing to show\",\"code\":417}",
type: :order_not_found
}
},
error_codes: %{
400 => :invalid_parameters,
409 => :invalid_order,
416 => :insufficient_balance,
417 => :order_not_found
},
exceptions: %{
exact: %{
"400" => :bad_request,
"409" => :bad_symbol,
"416" => :insufficient_funds,
"417" => :order_not_found
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networksById" => %{}
},
extended_metadata: %{
fees_url: "https://bitbns.com/fees",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9",
referral_url: "https://ref.bitbns.com/1090961"
},
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: false
},
trailing: false,
trigger_direction: false,
trigger_price: true
},
fetch_my_trades: %{
margin_mode: false,
symbol_required: true
},
fetch_ohlcv: %{
limit: 100
},
fetch_open_orders: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: true
},
fetch_order: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
fee_side: "quote",
maker: 0.0025,
percentage: true,
taker: 0.0025,
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; // fallback to default error handler\n }\n //\n // {\"msg\":\"Invalid Request\",\"status\":-1,\"code\":400}\n // {\"data\":[],\"status\":0,\"error\":\"Nothing to show\",\"code\":417}\n //\n const code = this.safeString(response, 'code');\n const message = this.safeString(response, 'msg');\n const error = (code !== undefined) && (code !== '200') && (code !== '204');\n if (error || (message !== undefined)) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\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: true,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: true,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fech_currencies: 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: true,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: false,
fetch_deposit_withdraw_fees: false,
fetch_deposits: true,
fetch_deposits_withdrawals: false,
fetch_deposits_ws: false,
fetch_funding_history: false,
fetch_funding_interval: false,
fetch_funding_intervals: false,
fetch_funding_rate: false,
fetch_funding_rate_history: false,
fetch_funding_rates: false,
fetch_greeks: false,
fetch_index_ohlcv: false,
fetch_isolated_borrow_rate: false,
fetch_isolated_borrow_rates: false,
fetch_isolated_positions: false,
fetch_l2_order_book: true,
fetch_l3_order_book: false,
fetch_last_prices: false,
fetch_ledger: 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: 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: true,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: true,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: 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: false,
ws: false
},
http_config: nil,
id: "bitbns",
markets: nil,
name: "Bitbns",
ohlcv_timestamp_resolution: :unknown,
options: %{},
order_mappings: %{
side_format: :uppercase,
side_key: "side",
type_format: nil,
type_key: nil
},
param_mappings: %{
"amount" => "quantity",
"code" => "symbol",
"id" => "entry_id",
"price" => "rate",
"symbol" => "market",
"triggerPrice" => "t_rate"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 530,
"line_start" => 503,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const timestamp = undefined;\n const result: Dict = {\n 'info': response,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n };\n const data = this.safeDict (response, 'data', {});\n const keys = Object.keys (data);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const parts = key.split ('availableorder');\n const numParts = parts.length;\n if (numParts > 1) {\n let currencyId = this.safeString (parts, 1);\n // note that \"Money\" stands for INR - the only fiat in bitbns\n const account = this.account ();\n account['free'] = this.safeString (data, key);\n account['used'] = this.safeString (data, 'inorder' + currencyId);\n if (currencyId === 'Money') {\n currencyId = 'INR';\n }\n const code = this.safeCurrencyCode (currencyId);\n result[code] = account;\n }\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"data\": \"Successfully placed bid to purchase currency\",\n \"status\": 1,\n \"error\": null,\n \"id\": 5424475,\n \"code\": 200\n }",
"{\n \"entry_id\": 5424475,\n \"btc\": 0.01,\n \"rate\": 2000,\n \"time\": \"2021-04-25T17:05:42.000Z\",\n \"type\": 0,\n \"status\": 0\n \"t_rate\": 0.45, // only stop orders\n \"trail\": 0 // only stop orders\n }",
"{\n \"data\": \"Successfully cancelled the order\",\n \"status\": 1,\n \"error\": null,\n \"code\": 200\n }"
],
"line_end" => 654,
"line_start" => 578,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "this.parse8601 (datetime)"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "datetime"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "this.safeString (market, 'symbol')"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.safeString (order, 'rate')"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "triggerPrice"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeString (order, 'btc')"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "{\n 'cost': undefined,\n 'currency': undefined,\n 'rate': undefined,\n }"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "rate",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n //\n // {\n // \"data\": \"Successfully placed bid to purchase currency\",\n // \"status\": 1,\n // \"error\": null,\n // \"id\": 5424475,\n // \"code\": 200\n // }\n //\n // fetchOpenOrders, fetchOrder\n //\n // {\n // \"entry_id\": 5424475,\n // \"btc\": 0.01,\n // \"rate\": 2000,\n // \"time\": \"2021-04-25T17:05:42.000Z\",\n // \"type\": 0,\n // \"status\": 0\n // \"t_rate\": 0.45, // only stop orders\n // \"trail\": 0 // only stop orders\n // }\n //\n // cancelOrder\n //\n // {\n // \"data\": \"Successfully cancelled the order\",\n // \"status\": 1,\n // \"error\": null,\n // \"code\": 200\n // }\n //\n const id = this.safeString2 (order, 'id', 'entry_id');\n const datetime = this.safeString (order, 'time');\n const triggerPrice = this.safeString (order, 't_rate');\n let side = this.safeString (order, 'type');\n if (side === '0') {\n side = 'buy';\n } else if (side === '1') {\n side = 'sell';\n }\n const data = this.safeString (order, 'data');\n let status = this.safeString (order, 'status');\n if (data === 'Successfully cancelled the order') {\n status = 'cancelled';\n } else {\n status = this.parseStatus (status);\n }\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': undefined,\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'lastTradeTimestamp': undefined,\n 'symbol': this.safeString (market, 'symbol'),\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': this.safeString (order, 'rate'),\n 'triggerPrice': triggerPrice,\n 'amount': this.safeString (order, 'btc'),\n 'cost': undefined,\n 'average': undefined,\n 'filled': undefined,\n 'remaining': undefined,\n 'status': status,\n 'fee': {\n 'cost': undefined,\n 'currency': undefined,\n 'rate': undefined,\n },\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 576,
"line_start" => 562,
"mappings" => [],
"name" => "parseStatus",
"signature" => "parseStatus (status)",
"source" => "parseStatus (status) {\n const statuses: Dict = {\n '-1': 'cancelled',\n '0': 'open',\n '1': 'open',\n '2': 'done',\n // 'PARTIALLY_FILLED': 'open',\n // 'FILLED': 'closed',\n // 'CANCELED': 'canceled',\n // 'PENDING_CANCEL': 'canceling', // currently unused\n // 'REJECTED': 'rejected',\n // 'EXPIRED': 'expired',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"symbol\":\"BTC/INR\",\n \"info\":{\n \"highest_buy_bid\":4368494.31,\n \"lowest_sell_bid\":4374835.09,\n \"last_traded_price\":4374835.09,\n \"yes_price\":4531016.27,\n \"volume\":{\"max\":\"4569119.23\",\"min\":\"4254552.13\",\"volume\":62.17722344}\n },\n \"timestamp\":1619100020845,\n \"datetime\":1619100020845,\n \"high\":\"4569119.23\",\n \"low\":\"4254552.13\",\n \"bid\":4368494.31,\n \"bidVolume\":\"\",\n \"ask\":4374835.09,\n \"askVolume\":\"\",\n \"vwap\":\"\",\n \"open\":4531016.27,\n \"close\":4374835.09,\n \"last\":4374835.09,\n \"baseVolume\":62.17722344,\n \"quoteVolume\":\"\",\n \"previousClose\":\"\",\n \"change\":-156181.1799999997,\n \"percentage\":-3.446934874943623,\n \"average\":4452925.68\n }"
],
"line_end" => 455,
"line_start" => 398,
"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" => "this.safeString (ticker, 'bidVolume')"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeString (ticker, 'ask')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "this.safeString (ticker, 'askVolume')"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "this.safeString (ticker, 'vwap')"
},
%{
"comment" => nil,
"key" => "open",
"value" => "this.safeString (ticker, 'open')"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "this.safeString (ticker, 'previousClose')"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "this.safeString (ticker, 'percentage')"
},
%{
"comment" => nil,
"key" => "average",
"value" => "this.safeString (ticker, 'average')"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'baseVolume')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "this.safeString (ticker, '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 // \"symbol\":\"BTC/INR\",\n // \"info\":{\n // \"highest_buy_bid\":4368494.31,\n // \"lowest_sell_bid\":4374835.09,\n // \"last_traded_price\":4374835.09,\n // \"yes_price\":4531016.27,\n // \"volume\":{\"max\":\"4569119.23\",\"min\":\"4254552.13\",\"volume\":62.17722344}\n // },\n // \"timestamp\":1619100020845,\n // \"datetime\":1619100020845,\n // \"high\":\"4569119.23\",\n // \"low\":\"4254552.13\",\n // \"bid\":4368494.31,\n // \"bidVolume\":\"\",\n // \"ask\":4374835.09,\n // \"askVolume\":\"\",\n // \"vwap\":\"\",\n // \"open\":4531016.27,\n // \"close\":4374835.09,\n // \"last\":4374835.09,\n // \"baseVolume\":62.17722344,\n // \"quoteVolume\":\"\",\n // \"previousClose\":\"\",\n // \"change\":-156181.1799999997,\n // \"percentage\":-3.446934874943623,\n // \"average\":4452925.68\n // }\n //\n const timestamp = this.safeInteger (ticker, 'timestamp');\n const marketId = this.safeString (ticker, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\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': this.safeString (ticker, 'bidVolume'),\n 'ask': this.safeString (ticker, 'ask'),\n 'askVolume': this.safeString (ticker, 'askVolume'),\n 'vwap': this.safeString (ticker, 'vwap'),\n 'open': this.safeString (ticker, 'open'),\n 'close': last,\n 'last': last,\n 'previousClose': this.safeString (ticker, 'previousClose'), // previous day close\n 'change': this.safeString (ticker, 'change'),\n 'percentage': this.safeString (ticker, 'percentage'),\n 'average': this.safeString (ticker, 'average'),\n 'baseVolume': this.safeString (ticker, 'baseVolume'),\n 'quoteVolume': this.safeString (ticker, 'quoteVolume'),\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"type\": \"BTC Sell order executed\",\n \"typeI\": 6,\n \"crypto\": 5000,\n \"amount\": 35.4,\n \"rate\": 709800,\n \"date\": \"2020-05-22T15:05:34.000Z\",\n \"unit\": \"INR\",\n \"factor\": 100000000,\n \"fee\": 0.09,\n \"delh_btc\": -5000,\n \"delh_inr\": 0,\n \"del_btc\": 0,\n \"del_inr\": 35.4,\n \"id\": \"2938823\"\n }",
"{\n \"tradeId\":\"1909151\",\n \"price\":\"61904.6300\",\n \"quote_volume\":1618.05,\n \"base_volume\":0.02607254,\n \"timestamp\":1634548602000,\n \"type\":\"buy\"\n }"
],
"line_end" => 938,
"line_start" => 859,
"mappings" => [
%{
"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" => "id",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"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" => "costString"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchMyTrades\n //\n // {\n // \"type\": \"BTC Sell order executed\",\n // \"typeI\": 6,\n // \"crypto\": 5000,\n // \"amount\": 35.4,\n // \"rate\": 709800,\n // \"date\": \"2020-05-22T15:05:34.000Z\",\n // \"unit\": \"INR\",\n // \"factor\": 100000000,\n // \"fee\": 0.09,\n // \"delh_btc\": -5000,\n // \"delh_inr\": 0,\n // \"del_btc\": 0,\n // \"del_inr\": 35.4,\n // \"id\": \"2938823\"\n // }\n //\n // fetchTrades\n //\n // {\n // \"tradeId\":\"1909151\",\n // \"price\":\"61904.6300\",\n // \"quote_volume\":1618.05,\n // \"base_volume\":0.02607254,\n // \"timestamp\":1634548602000,\n // \"type\":\"buy\"\n // }\n //\n market = this.safeMarket (undefined, market);\n const orderId = this.safeString2 (trade, 'id', 'tradeId');\n let timestamp = this.parse8601 (this.safeString (trade, 'date'));\n timestamp = this.safeInteger (trade, 'timestamp', timestamp);\n const priceString = this.safeString2 (trade, 'rate', 'price');\n let amountString = this.safeString (trade, 'amount');\n let side = this.safeStringLower (trade, 'type');\n if (side !== undefined) {\n if (side.indexOf ('buy') >= 0) {\n side = 'buy';\n } else if (side.indexOf ('sell') >= 0) {\n side = 'sell';\n }\n }\n const factor = this.safeString (trade, 'factor');\n let costString = undefined;\n if (factor !== undefined) {\n amountString = Precise.stringDiv (amountString, factor);\n } else {\n amountString = this.safeString (trade, 'base_volume');\n costString = this.safeString (trade, 'quote_volume');\n }\n const symbol = market['symbol'];\n let fee = undefined;\n const feeCostString = this.safeString (trade, 'fee');\n if (feeCostString !== undefined) {\n const feeCurrencyCode = market['quote'];\n fee = {\n 'cost': feeCostString,\n 'currency': feeCurrencyCode,\n };\n }\n return this.safeTrade ({\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'id': orderId,\n 'order': orderId,\n 'type': undefined,\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': priceString,\n 'amount': amountString,\n 'cost': costString,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"type\":\"USDT deposited\",\n \"typeI\":1,\n \"amount\":100,\n \"date\":\"2021-04-24T14:56:04.000Z\",\n \"unit\":\"USDT\",\n \"factor\":100,\n \"fee\":0,\n \"delh_btc\":0,\n \"delh_inr\":0,\n \"rate\":0,\n \"del_btc\":10000,\n \"del_inr\":0\n }"
],
"line_end" => 1202,
"line_start" => 1136,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "undefined"
},
%{
"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" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"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"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n //\n // {\n // \"type\":\"USDT deposited\",\n // \"typeI\":1,\n // \"amount\":100,\n // \"date\":\"2021-04-24T14:56:04.000Z\",\n // \"unit\":\"USDT\",\n // \"factor\":100,\n // \"fee\":0,\n // \"delh_btc\":0,\n // \"delh_inr\":0,\n // \"rate\":0,\n // \"del_btc\":10000,\n // \"del_inr\":0\n // }\n //\n // fetchWithdrawals\n //\n // ...\n //\n const currencyId = this.safeString (transaction, 'unit');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.parse8601 (this.safeString2 (transaction, 'date', 'timestamp'));\n let type = this.safeString (transaction, 'type');\n const expTime = this.safeString (transaction, 'expTime', '');\n let status = undefined;\n if (type !== undefined) {\n if (type.indexOf ('deposit') >= 0) {\n type = 'deposit';\n status = 'ok';\n } else if (type.indexOf ('withdraw') >= 0 || expTime.indexOf ('withdraw') >= 0) {\n type = 'withdrawal';\n }\n }\n // const status = this.parseTransactionStatusByType (this.safeString (transaction, 'status'), type);\n const amount = this.safeNumber (transaction, 'amount');\n const feeCost = this.safeNumber (transaction, 'fee');\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = { 'currency': code, 'cost': feeCost };\n }\n return {\n 'info': transaction,\n 'id': undefined,\n 'txid': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': undefined,\n 'address': undefined,\n 'addressTo': undefined,\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 };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1134,
"line_start" => 1116,
"mappings" => [],
"name" => "parseTransactionStatusByType",
"signature" => "parseTransactionStatusByType (status, type = undefined)",
"source" => "parseTransactionStatusByType (status, type = undefined) {\n const statusesByType: Dict = {\n 'deposit': {\n '0': 'pending',\n '1': 'ok',\n },\n 'withdrawal': {\n '0': 'pending', // Email Sent\n '1': 'canceled', // Cancelled (different from 1 = ok in deposits)\n '2': 'pending', // Awaiting Approval\n '3': 'failed', // Rejected\n '4': 'pending', // Processing\n '5': 'failed', // Failure\n '6': 'ok', // Completed\n },\n };\n const statuses = this.safeDict (statusesByType, type, {});\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "",
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: "X-BITBNS-APIKEY",
confidence: :medium,
pattern: :hmac_sha512_nonce,
signature_header: "X-BITBNS-SIGNATURE"
},
spec_format_version: 1,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: %{
precision_mode: 4,
sample_limits: %{
"amount" => %{
"max" => 20,
"min" => 1.305e-5
},
"cost" => %{
"max" => 107244089.11999999,
"min" => 50
},
"price" => %{
"max" => 5362204.455999999,
"min" => 2298087.624
}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 0.01
},
spot: %{
base: "BTC",
base_id: "BTC",
case: :upper,
contract: false,
id: "BTC",
limits: %{
"amount" => %{
"max" => 20,
"min" => 1.305e-5
},
"cost" => %{
"max" => 107244089.11999999,
"min" => 50
},
"leverage" => %{},
"price" => %{
"max" => 5362204.455999999,
"min" => 2298087.624
}
},
maker: 0.0025,
precision: %{
"amount" => 1.0e-8,
"price" => 0.01
},
quote: "INR",
quote_id: "INR",
separator: "",
symbol: "BTC/INR",
taker: 0.0025
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :no_separator_upper,
separator: "",
suffix: nil
}
},
timeframes: %{},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://api.bitbns.com/api/trade/v1",
api_sections: %{
"v1" => "https://api.bitbns.com/api/trade/v1",
"v2" => "https://api.bitbns.com/api/trade/v2",
"www" => "https://bitbns.com"
},
doc: [
"https://bitbns.com/trade/#/api-trading/"
],
other: nil,
sandbox: nil,
www: "https://bitbns.com"
},
version: "v2",
ws: nil
}