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

priv/specs/extracted/bitopro.exs

# BitoPro Exchange Specification
#
# Auto-generated by: mix ccxt.extract bitopro
# 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: :pro,
comment: nil,
countries: [
"TW"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 26,
"coveragePercent" => 100,
"enabledMethods" => 28,
"excluded" => [
%{
"method" => "fetchDepositWithdrawFee",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 27,
"failures" => [
%{
"error" => "bitopro fetchWithdrawal() requires the code argument",
"method" => "fetchWithdrawal"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 5,
market_type: :spot,
method: :delete,
name: :cancel_all_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol
],
path: "/orders/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.6666666666666666,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{
"symbol" => "pair"
},
params: [
:id,
:symbol
],
path: "/orders/{pair}/{id}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 5,
default_params: %{
"undefined" => [
"test-order-id"
]
},
market_type: :spot,
method: :put,
name: :cancel_orders,
param_mappings: %{},
params: [
:ids,
:symbol
],
path: "/orders",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.5,
default_params: %{
"timestamp" => "<generated>",
"type" => "limit"
},
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"side" => "action",
"symbol" => "pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.5,
default_params: %{
"timestamp" => "<generated>",
"type" => "market"
},
market_type: :spot,
method: :post,
name: :create_market_order,
param_mappings: %{
"side" => "action",
"symbol" => "pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.5,
default_params: %{
"timestamp" => "<generated>"
},
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"side" => "action",
"symbol" => "pair"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/orders/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.5,
default_params: %{
"timestamp" => "<generated>",
"triggerDirection" => "below"
},
market_type: :swap,
method: :post,
name: :create_stop_order,
param_mappings: %{
"side" => "action",
"symbol" => "pair",
"triggerPrice" => "stopPrice"
},
params: [
:symbol,
:type,
:side,
:amount,
:price,
:triggerPrice
],
path: "/orders/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 0.5,
default_params: %{
"timestamp" => "<generated>",
"triggerDirection" => "below"
},
market_type: :swap,
method: :post,
name: :create_trigger_order,
param_mappings: %{
"side" => "action",
"symbol" => "pair"
},
params: [
:symbol,
:type,
:side,
:amount,
:price,
:triggerPrice
],
path: "/orders/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/accounts/balance",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"statusKind" => "DONE"
},
market_type: :spot,
method: :get,
name: :fetch_closed_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/all/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/provisioning/currencies",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposit_withdraw_fees,
param_mappings: %{},
params: [
:codes
],
path: "/provisioning/currencies",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:since,
:limit
],
path: "/wallet/depositHistory/{currency}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:limit
],
path: "/order-book/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/provisioning/trading-pairs",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/trades/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"to" => "<generated>"
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"since" => "from",
"symbol" => "pair",
"timeframe" => "resolution"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/trading-history/{pair}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders/open",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{
"id" => "orderId",
"symbol" => "pair"
},
params: [
:id,
:symbol
],
path: "/orders/{pair}/{orderId}",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol,
:limit
],
path: "/order-book/{pair}",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "pair"
},
params: [
:symbol
],
path: "/tickers/{pair}",
response_transformer: {:extract_path_unwrap, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/tickers",
response_transformer: {:extract_path, ["data"]},
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, ["data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/provisioning/limitations-and-fees",
response_transformer: {:extract_path, ["tradingFeeRate"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:since,
:limit
],
path: "/wallet/withdrawHistory/{currency}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 10,
market_type: :spot,
method: :post,
name: :withdraw,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:amount,
:address,
:tag
],
path: "/wallet/withdraw/{currency}",
response_transformer: {:extract_path, ["data"]},
source: :intercepted
}
],
error_code_details: %{
"Address not in whitelist." => %{
description: nil,
type: :invalid_parameters
},
"Balance for " => %{
description: "{\"error\":\"Balance for eth not enough, only has 0, but ordered 0.01.\"}",
type: :insufficient_balance
},
"Invalid " => %{
description: "{\"error\":\"Invalid price -1.\"}",
type: :invalid_parameters
},
"Invalid Signature" => %{
description: "{\"error\":\"Invalid Signature\"}",
type: :invalid_credentials
},
"Invalid amount" => %{
description: "{\"error\":\"Invalid amount 0.0000000001, decimal limit is 8.\"}",
type: :invalid_order
},
"Invalid body" => %{
description: "{\"error\":\"Invalid body\"}",
type: :invalid_parameters
},
"Unsupported currency." => %{
description: "{\"error\":\"Unsupported currency.\"}",
type: :invalid_parameters
},
"Unsupported order type" => %{
description: "{\"error\":\"Unsupported order type\"}",
type: :invalid_parameters
},
"Wrong parameter" => %{
description: "{\"error\":\"Wrong parameter: from\"}",
type: :invalid_parameters
}
},
error_codes: %{
"Address not in whitelist." => :invalid_parameters,
"Balance for " => :insufficient_balance,
"Invalid " => :invalid_parameters,
"Invalid Signature" => :invalid_credentials,
"Invalid amount" => :invalid_order,
"Invalid body" => :invalid_parameters,
"Unsupported currency." => :invalid_parameters,
"Unsupported order type" => :invalid_parameters,
"Wrong parameter" => :invalid_parameters
},
exceptions: %{
broad: %{
"Balance for " => :insufficient_funds,
"Invalid " => :bad_request,
"Invalid amount" => :invalid_order,
"Wrong parameter" => :bad_request
},
exact: %{
"Address not in whitelist." => :bad_request,
"Invalid Signature" => :authentication_error,
"Invalid body" => :bad_request,
"Unsupported currency." => :bad_request,
"Unsupported order type" => :bad_request
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"fiatCurrencies" => [
"TWD"
],
"networks" => %{
"BEP20" => "BSC",
"BSC" => "BSC",
"ERC20" => "ERC20",
"ETH" => "ERC20",
"TRC20" => "TRX",
"TRX" => "TRX"
},
"networksById" => %{
"BSC" => "BSC",
"ERC20" => "ETH",
"TRX" => "TRC20"
}
},
extended_metadata: %{
fees_url: "https://www.bitopro.com/fees",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: false,
gtd: false,
ioc: false,
po: true
},
trailing: false,
trigger_direction: true,
trigger_price: true
},
fetch_closed_orders: %{
days_back: 100000,
days_back_canceled: 1,
limit: 1000,
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false,
until_days: 10000
},
fetch_my_trades: %{
days_back: 100000,
limit: 1000,
margin_mode: false,
symbol_required: true,
until_days: 100000
},
fetch_ohlcv: %{
limit: 1000
},
fetch_open_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
fetch_orders: %{
days_back: 100000,
limit: 1000,
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false,
until_days: 100000
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
maker: 0.001,
percentage: true,
taker: 0.002,
tier_based: true,
tiers: %{
maker: [
%{
fee: 0.001,
volume: 0
},
%{
fee: 9.7e-4,
volume: 3000000
},
%{
fee: 0.0007,
volume: 5000000
},
%{
fee: 0.0006,
volume: 30000000
},
%{
fee: 0.0005,
volume: 300000000
},
%{
fee: 0.0004,
volume: 550000000
},
%{
fee: 0.0003,
volume: 1300000000
}
],
taker: [
%{
fee: 0.002,
volume: 0
},
%{
fee: 0.00194,
volume: 3000000
},
%{
fee: 0.0015,
volume: 5000000
},
%{
fee: 0.0014,
volume: 30000000
},
%{
fee: 0.0013,
volume: 300000000
},
%{
fee: 0.0012,
volume: 550000000
},
%{
fee: 0.0011,
volume: 1300000000
}
]
}
}
},
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 if (code >= 200 && code < 300) {\n return undefined;\n }\n const feedback = this.id + ' ' + body;\n const error = this.safeString(response, 'error');\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 }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: false,
cancel_all_orders: true,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: true,
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: false,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: false,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: 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: true,
fetch_currencies_ws: true,
fetch_deposit: false,
fetch_deposit_address: false,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: true,
fetch_deposit_withdraw_fees: true,
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: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: 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: false,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: true,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: true,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: true,
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: true,
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: true,
watch_ohlcv: false,
watch_ohlcv_for_symbols: false,
watch_order_book: true,
watch_order_book_for_symbols: false,
watch_orders: false,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: true,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: false,
withdraw: true,
ws: false
},
http_config: nil,
id: "bitopro",
markets: nil,
name: "BitoPro",
ohlcv_timestamp_resolution: :seconds,
options: %{
"fiat_currencies" => [
"TWD"
],
:networks => %{
"BEP20" => "BSC",
"BSC" => "BSC",
"ERC20" => "ERC20",
"ETH" => "ERC20",
"TRC20" => "TRX",
"TRX" => "TRX"
}
},
order_mappings: %{
side_format: nil,
side_key: nil,
type_format: :lowercase,
type_key: "type"
},
param_mappings: %{
"code" => "currency",
"id" => "orderId",
"side" => "action",
"since" => "from",
"symbol" => "pair",
"timeframe" => "resolution",
"triggerPrice" => "stopPrice"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [
"[{\n \"currency\":\"twd\",\n \"amount\":\"0\",\n \"available\":\"0\",\n \"stake\":\"0\",\n \"tradable\":true\n }]"
],
"line_end" => 999,
"line_start" => 973,
"mappings" => [
%{
"comment" => nil,
"key" => "free",
"value" => "available"
},
%{
"comment" => nil,
"key" => "total",
"value" => "amount"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n //\n // [{\n // \"currency\":\"twd\",\n // \"amount\":\"0\",\n // \"available\":\"0\",\n // \"stake\":\"0\",\n // \"tradable\":true\n // }]\n //\n const result: Dict = {\n 'info': response,\n };\n for (let i = 0; i < response.length; i++) {\n const balance = response[i];\n const currencyId = this.safeString (balance, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const amount = this.safeString (balance, 'amount');\n const available = this.safeString (balance, 'available');\n const account: Dict = {\n 'free': available,\n 'total': amount,\n };\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1241,
"line_start" => 1226,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "orderIds[j]"
},
%{
"comment" => nil,
"key" => "id",
"value" => "orderIds[j]"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "this.safeSymbol (marketId)"
}
],
"name" => "parseCancelOrders",
"signature" => "parseCancelOrders (data)",
"source" => "parseCancelOrders (data) {\n const dataKeys = Object.keys (data);\n const orders = [];\n for (let i = 0; i < dataKeys.length; i++) {\n const marketId = dataKeys[i];\n const orderIds = data[marketId];\n for (let j = 0; j < orderIds.length; j++) {\n orders.push (this.safeOrder ({\n 'info': orderIds[j],\n 'id': orderIds[j],\n 'symbol': this.safeSymbol (marketId),\n }));\n }\n }\n return orders;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"currency\":\"eth\",\n \"withdrawFee\":\"0.007\",\n \"minWithdraw\":\"0.001\",\n \"maxWithdraw\":\"1000\",\n \"maxDailyWithdraw\":\"2000\",\n \"withdraw\":true,\n \"deposit\":true,\n \"depositConfirmation\":\"12\"\n }"
],
"line_end" => 1830,
"line_start" => 1807,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "withdraw",
"value" => "{\n 'fee': this.safeNumber (fee, 'withdrawFee'),\n 'percentage': false,\n }"
},
%{
"comment" => nil,
"key" => "deposit",
"value" => "{\n 'fee': undefined,\n 'percentage': undefined,\n }"
},
%{
"comment" => nil,
"key" => "networks",
"value" => "{}"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
}
],
"name" => "parseDepositWithdrawFee",
"signature" => "parseDepositWithdrawFee (fee, currency: Currency = undefined)",
"source" => "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n // {\n // \"currency\":\"eth\",\n // \"withdrawFee\":\"0.007\",\n // \"minWithdraw\":\"0.001\",\n // \"maxWithdraw\":\"1000\",\n // \"maxDailyWithdraw\":\"2000\",\n // \"withdraw\":true,\n // \"deposit\":true,\n // \"depositConfirmation\":\"12\"\n // }\n return {\n 'info': fee,\n 'withdraw': {\n 'fee': this.safeNumber (fee, 'withdrawFee'),\n 'percentage': false,\n },\n 'deposit': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'networks': {},\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 505,
"line_start" => 445,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "uppercaseId",
"value" => "uppercaseId"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "base",
"value" => "base"
},
%{
"comment" => nil,
"key" => "quote",
"value" => "quote"
},
%{
"comment" => nil,
"key" => "baseId",
"value" => "base"
},
%{
"comment" => nil,
"key" => "quoteId",
"value" => "quote"
},
%{
"comment" => nil,
"key" => "settle",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "settleId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'spot'"
},
%{
"comment" => nil,
"key" => "spot",
"value" => "true"
},
%{
"comment" => nil,
"key" => "margin",
"value" => "false"
},
%{
"comment" => nil,
"key" => "swap",
"value" => "false"
},
%{
"comment" => nil,
"key" => "future",
"value" => "false"
},
%{
"comment" => nil,
"key" => "option",
"value" => "false"
},
%{
"comment" => nil,
"key" => "contract",
"value" => "false"
},
%{
"comment" => nil,
"key" => "linear",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "inverse",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiry",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiryDatetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "strike",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "optionType",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "limits"
},
%{
"comment" => nil,
"key" => "precision",
"value" => "{\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n 'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n }"
},
%{
"comment" => nil,
"key" => "active",
"value" => "active"
},
%{
"comment" => nil,
"key" => "created",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "market"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "{\n 'min': this.safeNumber (market, 'minLimitBaseAmount'),\n 'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n }"
},
%{
"comment" => nil,
"key" => "price",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "leverage",
"value" => "{\n 'min': undefined,\n 'max': undefined,\n }"
},
%{
"comment" => nil,
"key" => "min",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "max",
"value" => "undefined"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (market: Dict): Market",
"source" => "parseMarket (market: Dict): Market {\n const active = !this.safeBool (market, 'maintain');\n const id = this.safeString (market, 'pair');\n const uppercaseId = id.toUpperCase ();\n const baseId = this.safeString (market, 'base');\n const quoteId = this.safeString (market, 'quote');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const symbol = base + '/' + quote;\n const limits: Dict = {\n 'amount': {\n 'min': this.safeNumber (market, 'minLimitBaseAmount'),\n 'max': this.safeNumber (market, 'maxLimitBaseAmount'),\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n };\n return {\n 'id': id,\n 'uppercaseId': uppercaseId,\n 'symbol': symbol,\n 'base': base,\n 'quote': quote,\n 'baseId': base,\n 'quoteId': quote,\n 'settle': undefined,\n 'settleId': undefined,\n 'type': 'spot',\n 'spot': true,\n 'margin': false,\n 'swap': false,\n 'future': false,\n 'option': false,\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 'limits': limits,\n 'precision': {\n 'price': this.parseNumber (this.parsePrecision (this.safeString (market, 'quotePrecision'))),\n 'amount': this.parseNumber (this.parsePrecision (this.safeString (market, 'basePrecision'))),\n },\n 'active': active,\n 'created': undefined,\n 'info': market,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 874,
"line_start" => 865,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n return [\n this.safeInteger (ohlcv, 'timestamp'),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'volume'),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"orderId\": \"2220595581\",\n \"timestamp\": \"1644896744886\",\n \"action\": \"SELL\",\n \"amount\": \"0.01\",\n \"price\": \"15000\",\n \"timeInForce\": \"GTC\"\n }",
"{\n \"id\":\"8777138788\",\n \"pair\":\"bnb_twd\",\n \"price\":\"16000\",\n \"avgExecutionPrice\":\"0\",\n \"action\":\"SELL\",\n \"type\":\"LIMIT\",\n \"timestamp\":1644899002598,\n \"status\":4,\n \"originalAmount\":\"0.01\",\n \"remainingAmount\":\"0.01\",\n \"executedAmount\":\"0\",\n \"fee\":\"0\",\n \"feeSymbol\":\"twd\",\n \"bitoFee\":\"0\",\n \"total\":\"0\",\n \"seq\":\"BNBTWD548774666\",\n \"timeInForce\":\"GTC\",\n \"createdTimestamp\":1644898944074,\n \"updatedTimestamp\":1644899002598\n }"
],
"line_end" => 1129,
"line_start" => 1042,
"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" => "this.safeInteger (order, 'updatedTimestamp')"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "timeInForce"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "postOnly"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "average"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "filled"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "remaining"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n // {\n // \"orderId\": \"2220595581\",\n // \"timestamp\": \"1644896744886\",\n // \"action\": \"SELL\",\n // \"amount\": \"0.01\",\n // \"price\": \"15000\",\n // \"timeInForce\": \"GTC\"\n // }\n //\n // fetchOrder\n // {\n // \"id\":\"8777138788\",\n // \"pair\":\"bnb_twd\",\n // \"price\":\"16000\",\n // \"avgExecutionPrice\":\"0\",\n // \"action\":\"SELL\",\n // \"type\":\"LIMIT\",\n // \"timestamp\":1644899002598,\n // \"status\":4,\n // \"originalAmount\":\"0.01\",\n // \"remainingAmount\":\"0.01\",\n // \"executedAmount\":\"0\",\n // \"fee\":\"0\",\n // \"feeSymbol\":\"twd\",\n // \"bitoFee\":\"0\",\n // \"total\":\"0\",\n // \"seq\":\"BNBTWD548774666\",\n // \"timeInForce\":\"GTC\",\n // \"createdTimestamp\":1644898944074,\n // \"updatedTimestamp\":1644899002598\n // }\n //\n const id = this.safeString2 (order, 'id', 'orderId');\n const timestamp = this.safeInteger2 (order, 'timestamp', 'createdTimestamp');\n let side = this.safeString (order, 'action');\n side = side.toLowerCase ();\n const amount = this.safeString2 (order, 'amount', 'originalAmount');\n const price = this.safeString (order, 'price');\n const marketId = this.safeString (order, 'pair');\n market = this.safeMarket (marketId, market, '_');\n const symbol = this.safeString (market, 'symbol');\n const orderStatus = this.safeString (order, 'status');\n const status = this.parseOrderStatus (orderStatus);\n const type = this.safeStringLower (order, 'type');\n const average = this.safeString (order, 'avgExecutionPrice');\n const filled = this.safeString (order, 'executedAmount');\n const remaining = this.safeString (order, 'remainingAmount');\n const timeInForce = this.safeString (order, 'timeInForce');\n let postOnly = undefined;\n if (timeInForce === 'POST_ONLY') {\n postOnly = true;\n }\n let fee = undefined;\n const feeAmount = this.safeString (order, 'fee');\n const feeSymbol = this.safeCurrencyCode (this.safeString (order, 'feeSymbol'));\n if (Precise.stringGt (feeAmount, '0')) {\n fee = {\n 'currency': feeSymbol,\n 'cost': feeAmount,\n };\n }\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': this.safeInteger (order, 'updatedTimestamp'),\n 'symbol': symbol,\n 'type': type,\n 'timeInForce': timeInForce,\n 'postOnly': postOnly,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'amount': amount,\n 'cost': undefined,\n 'average': average,\n 'filled': filled,\n 'remaining': remaining,\n 'status': status,\n 'fee': fee,\n 'trades': undefined,\n 'info': order,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1040,
"line_start" => 1029,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n '-1': 'open',\n '0': 'open',\n '1': 'open',\n '2': 'closed',\n '3': 'closed',\n '4': 'canceled',\n '6': 'canceled',\n };\n return this.safeString (statuses, status, undefined);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"pair\":\"btc_twd\",\n \"lastPrice\":\"1182449.00000000\",\n \"isBuyer\":false,\n \"priceChange24hr\":\"-1.99\",\n \"volume24hr\":\"9.13089740\",\n \"high24hr\":\"1226097.00000000\",\n \"low24hr\":\"1181000.00000000\"\n }"
],
"line_end" => 544,
"line_start" => 507,
"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, 'high24hr')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeString (ticker, 'low24hr')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "this.safeString (ticker, 'lastPrice')"
},
%{
"comment" => nil,
"key" => "last",
"value" => "this.safeString (ticker, 'lastPrice')"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "this.safeString (ticker, 'priceChange24hr')"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'volume24hr')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // {\n // \"pair\":\"btc_twd\",\n // \"lastPrice\":\"1182449.00000000\",\n // \"isBuyer\":false,\n // \"priceChange24hr\":\"-1.99\",\n // \"volume24hr\":\"9.13089740\",\n // \"high24hr\":\"1226097.00000000\",\n // \"low24hr\":\"1181000.00000000\"\n // }\n //\n const marketId = this.safeString (ticker, 'pair');\n market = this.safeMarket (marketId, market);\n const symbol = this.safeString (market, 'symbol');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'high': this.safeString (ticker, 'high24hr'),\n 'low': this.safeString (ticker, 'low24hr'),\n 'bid': undefined,\n 'bidVolume': undefined,\n 'ask': undefined,\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': this.safeString (ticker, 'lastPrice'),\n 'last': this.safeString (ticker, 'lastPrice'),\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': this.safeString (ticker, 'priceChange24hr'),\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'volume24hr'),\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"timestamp\":1644651458,\n \"price\":\"1180785.00000000\",\n \"amount\":\"0.00020000\",\n \"isBuyer\":false\n }",
"{\n \"tradeId\":\"5685030251\",\n \"orderId\":\"9669168142\",\n \"price\":\"11821.8\",\n \"action\":\"SELL\",\n \"baseAmount\":\"0.01\",\n \"quoteAmount\":\"118.218\",\n \"fee\":\"0.236436\",\n \"feeSymbol\":\"BNB\",\n \"isTaker\":true,\n \"timestamp\":1644905714862,\n \"createdTimestamp\":1644905714862\n }"
],
"line_end" => 738,
"line_start" => 653,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "takerOrMaker"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"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 // fetchTrades\n // {\n // \"timestamp\":1644651458,\n // \"price\":\"1180785.00000000\",\n // \"amount\":\"0.00020000\",\n // \"isBuyer\":false\n // }\n //\n // fetchMyTrades\n // {\n // \"tradeId\":\"5685030251\",\n // \"orderId\":\"9669168142\",\n // \"price\":\"11821.8\",\n // \"action\":\"SELL\",\n // \"baseAmount\":\"0.01\",\n // \"quoteAmount\":\"118.218\",\n // \"fee\":\"0.236436\",\n // \"feeSymbol\":\"BNB\",\n // \"isTaker\":true,\n // \"timestamp\":1644905714862,\n // \"createdTimestamp\":1644905714862\n // }\n //\n const id = this.safeString (trade, 'tradeId');\n const orderId = this.safeString (trade, 'orderId');\n let timestamp = undefined;\n if (id === undefined) {\n timestamp = this.safeTimestamp (trade, 'timestamp');\n } else {\n timestamp = this.safeInteger (trade, 'timestamp');\n }\n const marketId = this.safeString (trade, 'pair');\n market = this.safeMarket (marketId, market);\n const symbol = this.safeString (market, 'symbol');\n const price = this.safeString (trade, 'price');\n const type = this.safeStringLower (trade, 'type');\n let side = this.safeStringLower (trade, 'action');\n if (side === undefined) {\n const isBuyer = this.safeBool (trade, 'isBuyer');\n if (isBuyer) {\n side = 'buy';\n } else {\n side = 'sell';\n }\n }\n let amount = this.safeString (trade, 'amount');\n if (amount === undefined) {\n amount = this.safeString (trade, 'baseAmount');\n }\n let fee = undefined;\n const feeAmount = this.safeString (trade, 'fee');\n const feeSymbol = this.safeCurrencyCode (this.safeString (trade, 'feeSymbol'));\n if (feeAmount !== undefined) {\n fee = {\n 'cost': feeAmount,\n 'currency': feeSymbol,\n 'rate': undefined,\n };\n }\n const isTaker = this.safeBool (trade, 'isTaker');\n let takerOrMaker = undefined;\n if (isTaker !== undefined) {\n if (isTaker) {\n takerOrMaker = 'taker';\n } else {\n takerOrMaker = 'maker';\n }\n }\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'order': orderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'takerOrMaker': takerOrMaker,\n 'type': type,\n 'side': side,\n 'price': price,\n 'amount': amount,\n 'cost': undefined,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"serial\": \"20220214X766799\",\n \"timestamp\": \"1644833015053\",\n \"address\": \"bnb1xml62k5a9dcewgc542fha75fyxdcp0zv8eqfsh\",\n \"amount\": \"0.20000000\",\n \"fee\": \"0.00000000\",\n \"total\": \"0.20000000\",\n \"status\": \"COMPLETE\",\n \"txid\": \"A3CC4F6828CC752B9F3737F48B5826B9EC2857040CB5141D0CC955F7E53DB6D9\",\n \"message\": \"778553959\",\n \"protocol\": \"MAIN\",\n \"id\": \"2905906537\"\n }",
"{\n \"serial\": \"20220215BW14069838\",\n \"timestamp\": \"1644907716044\",\n \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n \"amount\": \"8.00000000\",\n \"fee\": \"2.00000000\",\n \"total\": \"10.00000000\",\n \"status\": \"COMPLETE\",\n \"txid\": \"50bf250c71a582f40cf699fb58bab978437ea9bdf7259ff8072e669aab30c32b\",\n \"protocol\": \"TRX\",\n \"id\": \"9925310345\"\n }",
"{\n \"serial\": \"20220215BW14069838\",\n \"currency\": \"USDT\",\n \"protocol\": \"TRX\",\n \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n \"amount\": \"8\",\n \"fee\": \"2\",\n \"total\": \"10\"\n }"
],
"line_end" => 1606,
"line_start" => 1525,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'serial')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString (transaction, 'txid')"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "network",
"value" => "this.networkIdToCode (networkId)"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'total')"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (status)"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "address"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "tag"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "tag"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "{\n 'currency': code,\n 'cost': this.safeNumber (transaction, 'fee'),\n 'rate': undefined,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeNumber (transaction, 'fee')"
},
%{
"comment" => nil,
"key" => "rate",
"value" => "undefined"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n //\n // {\n // \"serial\": \"20220214X766799\",\n // \"timestamp\": \"1644833015053\",\n // \"address\": \"bnb1xml62k5a9dcewgc542fha75fyxdcp0zv8eqfsh\",\n // \"amount\": \"0.20000000\",\n // \"fee\": \"0.00000000\",\n // \"total\": \"0.20000000\",\n // \"status\": \"COMPLETE\",\n // \"txid\": \"A3CC4F6828CC752B9F3737F48B5826B9EC2857040CB5141D0CC955F7E53DB6D9\",\n // \"message\": \"778553959\",\n // \"protocol\": \"MAIN\",\n // \"id\": \"2905906537\"\n // }\n //\n // fetchWithdrawals || fetchWithdraw\n //\n // {\n // \"serial\": \"20220215BW14069838\",\n // \"timestamp\": \"1644907716044\",\n // \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n // \"amount\": \"8.00000000\",\n // \"fee\": \"2.00000000\",\n // \"total\": \"10.00000000\",\n // \"status\": \"COMPLETE\",\n // \"txid\": \"50bf250c71a582f40cf699fb58bab978437ea9bdf7259ff8072e669aab30c32b\",\n // \"protocol\": \"TRX\",\n // \"id\": \"9925310345\"\n // }\n //\n // withdraw\n //\n // {\n // \"serial\": \"20220215BW14069838\",\n // \"currency\": \"USDT\",\n // \"protocol\": \"TRX\",\n // \"address\": \"TKrwMaZaGiAvtXCFT41xHuusNcs4LPWS7w\",\n // \"amount\": \"8\",\n // \"fee\": \"2\",\n // \"total\": \"10\"\n // }\n //\n const currencyId = this.safeString (transaction, 'coin');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.safeInteger (transaction, 'timestamp');\n const address = this.safeString (transaction, 'address');\n const tag = this.safeString (transaction, 'message');\n const status = this.safeString (transaction, 'status');\n let networkId = this.safeString (transaction, 'protocol');\n if (networkId === 'MAIN') {\n networkId = code;\n }\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'serial'),\n 'txid': this.safeString (transaction, 'txid'),\n 'type': undefined,\n 'currency': code,\n 'network': this.networkIdToCode (networkId),\n 'amount': this.safeNumber (transaction, 'total'),\n 'status': this.parseTransactionStatus (status),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': address,\n 'addressFrom': undefined,\n 'addressTo': address,\n 'tag': tag,\n 'tagFrom': undefined,\n 'tagTo': tag,\n 'updated': undefined,\n 'comment': undefined,\n 'internal': undefined,\n 'fee': {\n 'currency': code,\n 'cost': this.safeNumber (transaction, 'fee'),\n 'rate': undefined,\n },\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1523,
"line_start" => 1510,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const states: Dict = {\n 'COMPLETE': 'ok',\n 'INVALID': 'failed',\n 'PROCESSING': 'pending',\n 'WAIT_PROCESS': 'pending',\n 'FAILED': 'failed',\n 'EXPIRED': 'failed',\n 'CANCELLED': 'failed',\n 'EMAIL_VERIFICATION': 'pending',\n 'WAIT_CONFIRMATION': 'pending',\n };\n return this.safeString (states, status, status);\n }"
}
],
path_prefix: "",
pro: true,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 100,
period: 1000,
requests: 10,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [
%{
auth: false,
cost: 1,
method: :get,
path: "/accounts/balance"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orders/all/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orders/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orders/open"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orders/trades/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/orders/{pair}/{orderId}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/wallet/depositHistory/{currency}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/wallet/withdraw/{currency}/id/{id}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/wallet/withdraw/{currency}/{serial}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/wallet/withdrawHistory/{currency}"
},
%{
auth: false,
cost: 6.666666666666667,
method: :post,
path: "/orders/batch"
},
%{
auth: false,
cost: 0.5,
method: :post,
path: "/orders/{pair}"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/wallet/withdraw/{currency}"
},
%{
auth: false,
cost: 5,
method: :put,
path: "/orders"
},
%{
auth: false,
cost: 5,
method: :delete,
path: "/orders/all"
},
%{
auth: false,
cost: 5,
method: :delete,
path: "/orders/{pair}"
},
%{
auth: false,
cost: 0.6666666666666666,
method: :delete,
path: "/orders/{pair}/{id}"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/order-book/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/price/otc/{currency}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/provisioning/currencies"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/provisioning/limitations-and-fees"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/provisioning/trading-pairs"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/tickers"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/tickers/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/trades/{pair}"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/trading-history/{pair}"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
api_key_header: "X-BITOPRO-APIKEY",
confidence: :medium,
pattern: :hmac_sha512_nonce,
signature_header: "X-BITOPRO-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" => 100000000,
"min" => 0.001
},
"cost" => %{},
"price" => %{}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 0.1
},
spot: %{
base: "BCH",
base_id: "BCH",
case: :lower,
contract: false,
id: "bch_twd",
limits: %{
"amount" => %{
"max" => 100000000,
"min" => 0.001
},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
maker: 0.001,
precision: %{
"amount" => 1.0e-8,
"price" => 0.1
},
quote: "TWD",
quote_id: "TWD",
separator: "_",
symbol: "BCH/TWD",
taker: 0.002
}
},
symbol_patterns: %{
spot: %{
case: :lower,
component_order: nil,
date_format: nil,
pattern: :underscore_lower,
separator: "_",
suffix: nil
}
},
timeframes: %{
"12h" => "12h",
"15m" => "15m",
"1M" => "1M",
"1d" => "1d",
"1h" => "1h",
"1m" => "1m",
"1w" => "1w",
"30m" => "30m",
"3h" => "3h",
"5m" => "5m",
"6h" => "6h"
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://api.bitopro.com/v3",
api_sections: %{
"rest" => "https://api.bitopro.com/v3"
},
doc: [
"https://github.com/bitoex/bitopro-offical-api-docs/blob/master/v3-1/rest-1/rest.md"
],
other: nil,
sandbox: nil,
www: "https://www.bitopro.com"
},
version: "v3",
ws: %{
channel_templates: %{
watch_balance: %{
auth_required: true,
market_id_format: :native,
params: [],
pattern: :custom
},
watch_my_trades: %{
auth_required: true,
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_order_book: %{
channel_name: "order-books",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
},
watch_public: %{
market_id_format: :native,
params: [],
pattern: :custom
},
watch_ticker: %{
market_id_format: :native,
params: [],
pattern: :custom
},
watch_trades: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :custom
}
},
has: %{
watch_balance: true,
watch_bids_asks: nil,
watch_liquidations: nil,
watch_liquidations_for_symbols: nil,
watch_my_liquidations: nil,
watch_my_liquidations_for_symbols: nil,
watch_my_trades: true,
watch_ohlcv: false,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: nil,
watch_orders: false,
watch_orders_for_symbols: nil,
watch_position: nil,
watch_positions: nil,
watch_status: nil,
watch_ticker: true,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: false
},
options: %{
"ws" => %{
"options" => %{
"headers" => %{}
}
}
},
subscription_config: %{
market_id_format: :native
},
subscription_pattern: :custom,
watch_methods: [
"watchBalance",
"watchMyTrades",
"watchOrderBook",
"watchPublic",
"watchTicker",
"watchTrades"
]
}
}