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

priv/specs/extracted/bittrade.exs

# BitTrade Exchange Specification
#
# Auto-generated by: mix ccxt.extract bittrade
# 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: [
"JP"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"BIFI" => "Bitcoin File",
"GET" => "Themis",
"GTC" => "Game.com",
"HIT" => "HitChain",
"PNT" => "Penta",
"SBTC" => "Super Bitcoin",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 28,
"coveragePercent" => 100,
"enabledMethods" => 29,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 28,
"failures" => []
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :post,
name: :cancel_all_orders,
param_mappings: %{},
params: [
:symbol
],
path: "/order/orders/batchCancelOpenOrders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :post,
name: :cancel_order,
param_mappings: %{},
params: [
:id,
:symbol
],
path: "/order/orders/{id}/submitcancel",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
default_params: %{
"order-ids" => [
"test-order-id"
]
},
market_type: :spot,
method: :post,
name: :cancel_orders,
param_mappings: %{},
params: [
:ids,
:symbol
],
path: "/order/orders/batchcancel",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :create_limit_order,
param_mappings: %{},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/account/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :create_market_buy_order_with_cost,
param_mappings: %{},
params: [
:symbol,
:cost
],
path: "/account/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :create_market_order,
param_mappings: %{},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/account/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :create_order,
param_mappings: %{},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/account/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_accounts,
param_mappings: %{},
params: [],
path: "/account/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/account/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
default_params: %{
"states" => "filled,partial-canceled,canceled"
},
market_type: :spot,
method: :get,
name: :fetch_closed_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/order/orders",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1.0,
default_params: %{
"language" => "en-US"
},
market_type: :spot,
method: :get,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/settings/currencys",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
default_params: %{
"from" => "<generated>",
"size" => 100,
"type" => "deposit"
},
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{
"code" => "currency",
"since" => "from"
},
params: [
:code,
:since,
:limit
],
path: "/query/deposit-withdraw",
source: :intercepted
},
%{
api_section: "market",
auth: false,
cost: 1.0,
default_params: %{
"type" => "step0"
},
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/depth",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/common/symbols",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/order/matchresults",
source: :intercepted
},
%{
api_section: "market",
auth: false,
cost: 1.0,
default_params: %{
"period" => "60min"
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"limit" => "size",
"timeframe" => "period"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/history/kline",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
default_params: %{
"states" => "pre-submitted,submitted,partial-filled"
},
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/order/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{},
params: [
:id,
:symbol
],
path: "/order/orders/{id}",
source: :intercepted
},
%{
api_section: "market",
auth: false,
cost: 1.0,
default_params: %{
"type" => "step0"
},
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/depth",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_order_trades,
param_mappings: %{},
params: [
:id,
:symbol,
:since,
:limit
],
path: "/order/orders/{id}/matchresults",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
default_params: %{
"states" => "pre-submitted,submitted,partial-filled,filled,partial-canceled,canceled"
},
market_type: :spot,
method: :get,
name: :fetch_orders,
param_mappings: %{},
params: [
:symbol,
:since,
:limit
],
path: "/order/orders",
source: :intercepted
},
%{
api_section: "market",
auth: false,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{},
params: [
:symbol
],
path: "/detail/merged",
source: :intercepted
},
%{
api_section: "market",
auth: false,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/tickers",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_time,
param_mappings: %{},
params: [],
path: "/common/timestamp",
source: :intercepted
},
%{
api_section: "market",
auth: false,
cost: 1.0,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"limit" => "size"
},
params: [
:symbol,
:since,
:limit
],
path: "/history/trade",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1.0,
default_params: %{
"symbol" => "BTCUSDT"
},
market_type: :spot,
method: :get,
name: :fetch_trading_limits,
param_mappings: %{},
params: [
:symbols
],
path: "/common/exchange",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
default_params: %{
"from" => "<generated>",
"size" => 100,
"type" => "withdraw"
},
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{
"code" => "currency",
"since" => "from"
},
params: [
:code,
:since,
:limit
],
path: "/query/deposit-withdraw",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1.0,
market_type: :spot,
method: :post,
name: :withdraw,
param_mappings: %{
"code" => "currency"
},
params: [
:code,
:amount,
:address,
:tag
],
path: "/dw/withdraw/api/create",
source: :intercepted
}
],
error_code_details: %{
"account-frozen-balance-insufficient-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"account-frozen-balance-insufficient-error\",\"err-msg\":\"trade account balance is not enough, left: `0.0027`\",\"data\":null}",
type: :insufficient_balance
},
"api-not-support-temp-addr" => %{
description: "{\"status\":\"error\",\"err-code\":\"api-not-support-temp-addr\",\"err-msg\":\"API withdrawal does not support temporary addresses\",\"data\":null}",
type: :access_restricted
},
"api-signature-check-failed" => %{
description: nil,
type: :invalid_credentials
},
"api-signature-not-valid" => %{
description: "{\"status\":\"error\",\"err-code\":\"api-signature-not-valid\",\"err-msg\":\"Signature not valid: Incorrect Access key [Access key错误]\",\"data\":null}",
type: :invalid_credentials
},
"bad-request" => %{
description: nil,
type: :invalid_parameters
},
"base-currency-chain-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"base-currency-chain-error\",\"err-msg\":\"The current currency chain does not exist\",\"data\":null},",
type: :invalid_parameters
},
"base-date-limit-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"base-date-limit-error\",\"err-msg\":\"date less than system limit\",\"data\":null}",
type: :invalid_parameters
},
"base-record-invalid" => %{
description: "https://github.com/ccxt/ccxt/issues/5750",
type: :order_not_found
},
"base-symbol-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"base-symbol-error\",\"err-msg\":\"The symbol is invalid\",\"data\":null}",
type: :invalid_order
},
"base-symbol-trade-disabled" => %{
description: "{\"status\":\"error\",\"err-code\":\"base-symbol-trade-disabled\",\"err-msg\":\"Trading is disabled for this symbol\",\"data\":null}",
type: :invalid_order
},
"contract is restricted of closing positions on API. Please contact customer service" => %{
description: nil,
type: :network_error
},
"dw-insufficient-balance" => %{
description: "{\"status\":\"error\",\"err-code\":\"dw-insufficient-balance\",\"err-msg\":\"Insufficient balance. You can only transfer `12.3456` at most.\",\"data\":null}",
type: :insufficient_balance
},
"gateway-internal-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"gateway-internal-error\",\"err-msg\":\"Failed to load data. Try again later.\",\"data\":null}",
type: :network_error
},
"invalid symbol" => %{
description: "{\"ts\":1568813334794,\"status\":\"error\",\"err-code\":\"invalid-parameter\",\"err-msg\":\"invalid symbol\"}",
type: :invalid_order
},
"invalid-address" => %{
description: "{\"status\":\"error\",\"err-code\":\"invalid-address\",\"err-msg\":\"Invalid address.\",\"data\":null},",
type: :invalid_parameters
},
"invalid-amount" => %{
description: "eg \"Paramemter `amount` is invalid.\"",
type: :invalid_order
},
"maintain" => %{
description: nil,
type: :network_error
},
"order-etp-nav-price-max-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"order-etp-nav-price-max-error\",\"err-msg\":\"Order price cannot be higher than 5% of NAV\",\"data\":null}",
type: :invalid_order
},
"order-holding-limit-failed" => %{
description: "{\"status\":\"error\",\"err-code\":\"order-holding-limit-failed\",\"err-msg\":\"Order failed, exceeded the holding limit of this currency\",\"data\":null}",
type: :invalid_order
},
"order-limitorder-amount-max-error" => %{
description: "market order amount error, max: `1000000`",
type: :invalid_order
},
"order-limitorder-amount-min-error" => %{
description: "limit order amount error, min: `0.001`",
type: :invalid_order
},
"order-limitorder-price-max-error" => %{
description: "limit order price error",
type: :invalid_order
},
"order-limitorder-price-min-error" => %{
description: "limit order price error",
type: :invalid_order
},
"order-marketorder-amount-min-error" => %{
description: "market order amount error, min: `0.01`",
type: :invalid_order
},
"order-orderprice-precision-error" => %{
description: "{\"status\":\"error\",\"err-code\":\"order-orderprice-precision-error\",\"err-msg\":\"order price precision error, scale: `4`\",\"data\":null}",
type: :invalid_order
},
"order-orderstate-error" => %{
description: "canceling an already canceled order",
type: :order_not_found
},
"order-queryorder-invalid" => %{
description: "querying a non-existent order",
type: :order_not_found
},
"order-update-error" => %{
description: "undocumented error",
type: :network_error
},
"symbol trade not open now" => %{
description: "{\"ts\":1576210479343,\"status\":\"error\",\"err-code\":\"invalid-parameter\",\"err-msg\":\"symbol trade not open now\"},",
type: :invalid_order
},
"system-maintenance" => %{
description: "{\"status\": \"error\", \"err-code\": \"system-maintenance\", \"err-msg\": \"System is in maintenance!\", \"data\": null}",
type: :network_error
},
"timeout" => %{
description: "{\"ts\":1571653730865,\"status\":\"error\",\"err-code\":\"timeout\",\"err-msg\":\"Request Timeout\"}",
type: :network_error
}
},
error_codes: %{
"account-frozen-balance-insufficient-error" => :insufficient_balance,
"api-not-support-temp-addr" => :access_restricted,
"api-signature-check-failed" => :invalid_credentials,
"api-signature-not-valid" => :invalid_credentials,
"bad-request" => :invalid_parameters,
"base-currency-chain-error" => :invalid_parameters,
"base-date-limit-error" => :invalid_parameters,
"base-record-invalid" => :order_not_found,
"base-symbol-error" => :invalid_order,
"base-symbol-trade-disabled" => :invalid_order,
"contract is restricted of closing positions on API. Please contact customer service" => :network_error,
"dw-insufficient-balance" => :insufficient_balance,
"gateway-internal-error" => :network_error,
"invalid symbol" => :invalid_order,
"invalid-address" => :invalid_parameters,
"invalid-amount" => :invalid_order,
"maintain" => :network_error,
"order-etp-nav-price-max-error" => :invalid_order,
"order-holding-limit-failed" => :invalid_order,
"order-limitorder-amount-max-error" => :invalid_order,
"order-limitorder-amount-min-error" => :invalid_order,
"order-limitorder-price-max-error" => :invalid_order,
"order-limitorder-price-min-error" => :invalid_order,
"order-marketorder-amount-min-error" => :invalid_order,
"order-orderprice-precision-error" => :invalid_order,
"order-orderstate-error" => :order_not_found,
"order-queryorder-invalid" => :order_not_found,
"order-update-error" => :network_error,
"symbol trade not open now" => :invalid_order,
"system-maintenance" => :network_error,
"timeout" => :network_error
},
exceptions: %{
broad: %{
"contract is restricted of closing positions on API. Please contact customer service" => :on_maintenance,
"maintain" => :on_maintenance
},
exact: %{
"account-frozen-balance-insufficient-error" => :insufficient_funds,
"api-not-support-temp-addr" => :permission_denied,
"api-signature-check-failed" => :authentication_error,
"api-signature-not-valid" => :authentication_error,
"bad-request" => :bad_request,
"base-currency-chain-error" => :bad_request,
"base-date-limit-error" => :bad_request,
"base-record-invalid" => :order_not_found,
"base-symbol-error" => :bad_symbol,
"base-symbol-trade-disabled" => :bad_symbol,
"dw-insufficient-balance" => :insufficient_funds,
"gateway-internal-error" => :exchange_not_available,
"invalid symbol" => :bad_symbol,
"invalid-address" => :bad_request,
"invalid-amount" => :invalid_order,
"order-etp-nav-price-max-error" => :invalid_order,
"order-holding-limit-failed" => :invalid_order,
"order-limitorder-amount-max-error" => :invalid_order,
"order-limitorder-amount-min-error" => :invalid_order,
"order-limitorder-price-max-error" => :invalid_order,
"order-limitorder-price-min-error" => :invalid_order,
"order-marketorder-amount-min-error" => :invalid_order,
"order-orderprice-precision-error" => :invalid_order,
"order-orderstate-error" => :order_not_found,
"order-queryorder-invalid" => :order_not_found,
"order-update-error" => :exchange_not_available,
"symbol trade not open now" => :bad_symbol,
"system-maintenance" => :on_maintenance,
"timeout" => :request_timeout
}
},
exchange_options: %{
"broker" => %{
"id" => "AA03022abc"
},
"createMarketBuyOrderRequiresPrice" => true,
"createOrderMethod" => "privatePostOrderOrdersPlace",
"currencyToPrecisionRoundingMode" => 0,
"defaultNetwork" => "ERC20",
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"fetchBalanceMethod" => "privateGetAccountAccountsIdBalance",
"fetchMarketsMethod" => "publicGetCommonSymbols",
"fetchOpenOrdersMethod" => "fetch_open_orders_v1",
"fetchOrdersByStatesMethod" => "private_get_order_orders",
"language" => "en-US",
"networks" => %{
"ALGO" => "algo",
"ETH" => "erc20",
"HECO" => "hrc20",
"HRC20" => "hrc20",
"HT" => "hrc20",
"OMNI" => "",
"TRX" => "trc20"
},
"networksById" => %{
"" => "OMNI",
"algo" => "ALGO",
"erc20" => "ETH",
"hrc20" => "HT",
"trc20" => "TRX"
}
},
extended_metadata: %{
fees_url: "https://www.bittrade.co.jp/ja-jp/support/fee",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/85734211-85755480-b705-11ea-8b35-0b7f1db33a2f.jpg",
referral_url: "https://www.bittrade.co.jp/register/?invite_code=znnq3"
},
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: true,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: false,
gtd: false,
ioc: false,
po: false
},
trailing: false,
trigger_direction: false,
trigger_price: true
},
fetch_closed_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_my_trades: %{
days_back: 120,
limit: 100,
margin_mode: false,
symbol_required: false,
until_days: 2
},
fetch_ohlcv: %{
limit: 2000
},
fetch_open_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_orders: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
fee_side: "get",
maker: 0.002,
percentage: true,
taker: 0.002,
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 if ('status' in response) {\n //\n // {\"status\":\"error\",\"err-code\":\"order-limitorder-amount-min-error\",\"err-msg\":\"limit order amount error, min: `0.001`\",\"data\":null}\n //\n const status = this.safeString(response, 'status');\n if (status === 'error') {\n const code = this.safeString(response, 'err-code');\n const feedback = this.id + ' ' + body;\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);\n const message = this.safeString(response, 'err-msg');\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n throw new errors.ExchangeError(feedback);\n }\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: 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: true,
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: true,
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: 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: 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: true,
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: 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: true,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: true,
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: true,
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: %{
user_agent: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36"
},
id: "bittrade",
markets: nil,
name: "BitTrade",
ohlcv_timestamp_resolution: :unknown,
options: %{
broker: %{
"id" => "AA03022abc"
},
create_market_buy_order_requires_price: true,
create_order_method: "privatePostOrderOrdersPlace",
currency_to_precision_rounding_mode: 0,
default_network: "ERC20",
fetch_balance_method: "privateGetAccountAccountsIdBalance",
fetch_markets_method: "publicGetCommonSymbols",
fetch_open_orders_method: "fetch_open_orders_v1",
fetch_orders_by_states_method: "private_get_order_orders",
language: "en-US",
networks: %{
"ALGO" => "algo",
"ETH" => "erc20",
"HECO" => "hrc20",
"HRC20" => "hrc20",
"HT" => "hrc20",
"OMNI" => "",
"TRX" => "trc20"
}
},
order_mappings: nil,
param_mappings: %{
"code" => "currency",
"limit" => "size",
"since" => "from",
"timeframe" => "period"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 1204,
"line_start" => 1182,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "response"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const balances = this.safeValue (response['data'], 'list', []);\n const result: Dict = { 'info': response };\n for (let i = 0; i < balances.length; i++) {\n const balance = balances[i];\n const currencyId = this.safeString (balance, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n let account = undefined;\n if (code in result) {\n account = result[code];\n } else {\n account = this.account ();\n }\n if (balance['type'] === 'trade') {\n account['free'] = this.safeString (balance, 'balance');\n }\n if (balance['type'] === 'frozen') {\n account['used'] = this.safeString (balance, 'balance');\n }\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"success\": [\n \"5983466\"\n ],\n \"failed\": [\n {\n \"err-msg\": \"Incorrect order state\",\n \"order-state\": 7,\n \"order-id\": \"\",\n \"err-code\": \"order-orderstate-error\",\n \"client-order-id\": \"first\"\n },\n ...\n ]\n }",
"{\n \"errors\": [\n {\n \"order_id\": \"769206471845261312\",\n \"err_code\": 1061,\n \"err_msg\": \"This order doesnt exist.\"\n }\n ],\n \"successes\": \"1258075374411399168,1258075393254871040\"\n }"
],
"line_end" => 1713,
"line_start" => 1657,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "order"
},
%{
"comment" => nil,
"key" => "status",
"value" => "'canceled'"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString2 (order, 'order-id', 'order_id')"
},
%{
"comment" => nil,
"key" => "status",
"value" => "'failed'"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "this.safeString (order, 'client-order-id')"
}
],
"name" => "parseCancelOrders",
"signature" => "parseCancelOrders (orders)",
"source" => "parseCancelOrders (orders) {\n //\n // {\n // \"success\": [\n // \"5983466\"\n // ],\n // \"failed\": [\n // {\n // \"err-msg\": \"Incorrect order state\",\n // \"order-state\": 7,\n // \"order-id\": \"\",\n // \"err-code\": \"order-orderstate-error\",\n // \"client-order-id\": \"first\"\n // },\n // ...\n // ]\n // }\n //\n // {\n // \"errors\": [\n // {\n // \"order_id\": \"769206471845261312\",\n // \"err_code\": 1061,\n // \"err_msg\": \"This order doesnt exist.\"\n // }\n // ],\n // \"successes\": \"1258075374411399168,1258075393254871040\"\n // }\n //\n const successes = this.safeString (orders, 'successes');\n let success = undefined;\n if (successes !== undefined) {\n success = successes.split (',');\n } else {\n success = this.safeList (orders, 'success', []);\n }\n const failed = this.safeList2 (orders, 'errors', 'failed', []);\n const result = [];\n for (let i = 0; i < success.length; i++) {\n const order = success[i];\n result.push (this.safeOrder ({\n 'info': order,\n 'id': order,\n 'status': 'canceled',\n }));\n }\n for (let i = 0; i < failed.length; i++) {\n const order = failed[i];\n result.push (this.safeOrder ({\n 'info': order,\n 'id': this.safeString2 (order, 'order-id', 'order_id'),\n 'status': 'failed',\n 'clientOrderId': this.safeString (order, 'client-order-id'),\n }));\n }\n return result;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"currency\": \"usdt\",\n \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n \"addressTag\": \"\",\n \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n }"
],
"line_end" => 1783,
"line_start" => 1756,
"mappings" => [
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "tag"
},
%{
"comment" => nil,
"key" => "network",
"value" => "network"
},
%{
"comment" => nil,
"key" => "info",
"value" => "depositAddress"
}
],
"name" => "parseDepositAddress",
"signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined)",
"source" => "parseDepositAddress (depositAddress, currency: Currency = undefined) {\n //\n // {\n // \"currency\": \"usdt\",\n // \"address\": \"0xf7292eb9ba7bc50358e27f0e025a4d225a64127b\",\n // \"addressTag\": \"\",\n // \"chain\": \"usdterc20\", // trc20usdt, hrc20usdt, usdt, algousdt\n // }\n //\n const address = this.safeString (depositAddress, 'address');\n const tag = this.safeString (depositAddress, 'addressTag');\n const currencyId = this.safeString (depositAddress, 'currency');\n currency = this.safeCurrency (currencyId, currency);\n const code = this.safeCurrencyCode (currencyId, currency);\n const networkId = this.safeString (depositAddress, 'chain');\n const networks = this.safeValue (currency, 'networks', {});\n const networksById = this.indexBy (networks, 'id');\n const networkValue = this.safeValue (networksById, networkId, networkId);\n const network = this.safeString (networkValue, 'network');\n this.checkAddress (address);\n return {\n 'currency': code,\n 'address': address,\n 'tag': tag,\n 'network': network,\n 'info': depositAddress,\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"amount\":1.2082,\n \"open\":0.025096,\n \"close\":0.025095,\n \"high\":0.025096,\n \"id\":1591515300,\n \"count\":6,\n \"low\":0.025095,\n \"vol\":0.0303205097\n }"
],
"line_end" => 1029,
"line_start" => 1008,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"amount\":1.2082,\n // \"open\":0.025096,\n // \"close\":0.025095,\n // \"high\":0.025096,\n // \"id\":1591515300,\n // \"count\":6,\n // \"low\":0.025095,\n // \"vol\":0.0303205097\n // }\n //\n return [\n this.safeTimestamp (ohlcv, 'id'),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'amount'),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{ id: 13997833014,\n \"symbol\": \"ethbtc\",\n \"account-id\": 3398321,\n \"amount\": \"0.045000000000000000\",\n \"price\": \"0.034014000000000000\",\n \"created-at\": 1545836976871,\n \"type\": \"sell-limit\",\n \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n \"finished-at\": 1545837948214,\n \"source\": \"spot-api\",\n \"state\": \"filled\",\n \"canceled-at\": 0 }",
"{ id: 20395337822,\n \"symbol\": \"ethbtc\",\n \"account-id\": 5685075,\n \"amount\": \"0.001000000000000000\",\n \"price\": \"0.0\",\n \"created-at\": 1545831584023,\n \"type\": \"buy-market\",\n \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n \"finished-at\": 1545831584181,\n \"source\": \"spot-api\",\n \"state\": \"filled\",\n \"canceled-at\": 0 }"
],
"line_end" => 1471,
"line_start" => 1389,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "clientOrderId"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['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" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "cost"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "filled"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // { id: 13997833014,\n // \"symbol\": \"ethbtc\",\n // \"account-id\": 3398321,\n // \"amount\": \"0.045000000000000000\",\n // \"price\": \"0.034014000000000000\",\n // \"created-at\": 1545836976871,\n // \"type\": \"sell-limit\",\n // \"field-amount\": \"0.045000000000000000\", // they have fixed it for filled-amount\n // \"field-cash-amount\": \"0.001530630000000000\", // they have fixed it for filled-cash-amount\n // \"field-fees\": \"0.000003061260000000\", // they have fixed it for filled-fees\n // \"finished-at\": 1545837948214,\n // \"source\": \"spot-api\",\n // \"state\": \"filled\",\n // \"canceled-at\": 0 }\n //\n // { id: 20395337822,\n // \"symbol\": \"ethbtc\",\n // \"account-id\": 5685075,\n // \"amount\": \"0.001000000000000000\",\n // \"price\": \"0.0\",\n // \"created-at\": 1545831584023,\n // \"type\": \"buy-market\",\n // \"field-amount\": \"0.029100000000000000\", // they have fixed it for filled-amount\n // \"field-cash-amount\": \"0.000999788700000000\", // they have fixed it for filled-cash-amount\n // \"field-fees\": \"0.000058200000000000\", // they have fixed it for filled-fees\n // \"finished-at\": 1545831584181,\n // \"source\": \"spot-api\",\n // \"state\": \"filled\",\n // \"canceled-at\": 0 }\n //\n const id = this.safeString (order, 'id');\n let side = undefined;\n let type = undefined;\n let status = undefined;\n if ('type' in order) {\n const orderType = order['type'].split ('-');\n side = orderType[0];\n type = orderType[1];\n status = this.parseOrderStatus (this.safeString (order, 'state'));\n }\n const marketId = this.safeString (order, 'symbol');\n market = this.safeMarket (marketId, market);\n const timestamp = this.safeInteger (order, 'created-at');\n const clientOrderId = this.safeString (order, 'client-order-id');\n const amount = this.safeString (order, 'amount');\n const filled = this.safeString2 (order, 'filled-amount', 'field-amount'); // typo in their API, filled amount\n const price = this.safeString (order, 'price');\n const cost = this.safeString2 (order, 'filled-cash-amount', 'field-cash-amount'); // same typo\n const feeCost = this.safeString2 (order, 'filled-fees', 'field-fees'); // typo in their API, filled fees\n let fee = undefined;\n if (feeCost !== undefined) {\n const feeCurrency = (side === 'sell') ? market['quote'] : market['base'];\n fee = {\n 'cost': feeCost,\n 'currency': feeCurrency,\n };\n }\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': clientOrderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'symbol': market['symbol'],\n 'type': type,\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'average': undefined,\n 'cost': cost,\n 'amount': amount,\n 'filled': filled,\n 'remaining': undefined,\n 'status': status,\n 'fee': fee,\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1387,
"line_start" => 1378,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'partial-filled': 'open',\n 'partial-canceled': 'canceled',\n 'filled': 'closed',\n 'canceled': 'canceled',\n 'submitted': 'open',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"amount\": 26228.672978342216,\n \"open\": 9078.95,\n \"close\": 9146.86,\n \"high\": 9155.41,\n \"id\": 209988544334,\n \"count\": 265846,\n \"low\": 8988.0,\n \"version\": 209988544334,\n \"ask\": [ 9146.87, 0.156134 ],\n \"vol\": 2.3822168242201668E8,\n \"bid\": [ 9146.86, 0.080758 ],\n }",
"{\n \"symbol\": \"bhdht\",\n \"open\": 2.3938,\n \"high\": 2.4151,\n \"low\": 2.3323,\n \"close\": 2.3909,\n \"amount\": 628.992,\n \"vol\": 1493.71841095,\n \"count\": 2088,\n \"bid\": 2.3643,\n \"bidSize\": 0.7136,\n \"ask\": 2.4061,\n \"askSize\": 0.4156\n }"
],
"line_end" => 697,
"line_start" => 613,
"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" => "bid"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "bidVolume"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "ask"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "askVolume"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "open"
},
%{
"comment" => nil,
"key" => "close",
"value" => "close"
},
%{
"comment" => nil,
"key" => "last",
"value" => "close"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "baseVolume"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "quoteVolume"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // fetchTicker\n //\n // {\n // \"amount\": 26228.672978342216,\n // \"open\": 9078.95,\n // \"close\": 9146.86,\n // \"high\": 9155.41,\n // \"id\": 209988544334,\n // \"count\": 265846,\n // \"low\": 8988.0,\n // \"version\": 209988544334,\n // \"ask\": [ 9146.87, 0.156134 ],\n // \"vol\": 2.3822168242201668E8,\n // \"bid\": [ 9146.86, 0.080758 ],\n // }\n //\n // fetchTickers\n // {\n // \"symbol\": \"bhdht\",\n // \"open\": 2.3938,\n // \"high\": 2.4151,\n // \"low\": 2.3323,\n // \"close\": 2.3909,\n // \"amount\": 628.992,\n // \"vol\": 1493.71841095,\n // \"count\": 2088,\n // \"bid\": 2.3643,\n // \"bidSize\": 0.7136,\n // \"ask\": 2.4061,\n // \"askSize\": 0.4156\n // }\n //\n const symbol = this.safeSymbol (undefined, market);\n const timestamp = this.safeInteger (ticker, 'ts');\n let bid = undefined;\n let bidVolume = undefined;\n let ask = undefined;\n let askVolume = undefined;\n if ('bid' in ticker) {\n if (Array.isArray (ticker['bid'])) {\n bid = this.safeString (ticker['bid'], 0);\n bidVolume = this.safeString (ticker['bid'], 1);\n } else {\n bid = this.safeString (ticker, 'bid');\n bidVolume = this.safeString (ticker, 'bidSize');\n }\n }\n if ('ask' in ticker) {\n if (Array.isArray (ticker['ask'])) {\n ask = this.safeString (ticker['ask'], 0);\n askVolume = this.safeString (ticker['ask'], 1);\n } else {\n ask = this.safeString (ticker, 'ask');\n askVolume = this.safeString (ticker, 'askSize');\n }\n }\n const open = this.safeString (ticker, 'open');\n const close = this.safeString (ticker, 'close');\n const baseVolume = this.safeString (ticker, 'amount');\n const quoteVolume = this.safeString (ticker, 'vol');\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': bid,\n 'bidVolume': bidVolume,\n 'ask': ask,\n 'askVolume': askVolume,\n 'vwap': undefined,\n 'open': open,\n 'close': close,\n 'last': close,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"amount\": 0.010411000000000000,\n \"trade-id\": 102090736910,\n \"ts\": 1583497692182,\n \"id\": 10500517034273194594947,\n \"price\": 9096.050000000000000000,\n \"direction\": \"sell\"\n }",
"{\n \"symbol\": \"swftcbtc\",\n \"fee-currency\": \"swftc\",\n \"filled-fees\": \"0\",\n \"source\": \"spot-api\",\n \"id\": 83789509854000,\n \"type\": \"buy-limit\",\n \"order-id\": 83711103204909,\n 'filled-points': \"0.005826843283532154\",\n \"fee-deduct-currency\": \"ht\",\n 'filled-amount': \"45941.53\",\n \"price\": \"0.0000001401\",\n \"created-at\": 1597933260729,\n \"match-id\": 100087455560,\n \"role\": \"maker\",\n \"trade-id\": 100050305348\n },"
],
"line_end" => 900,
"line_start" => 819,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "order",
"value" => "order"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "takerOrMaker"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "cost"
},
%{
"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 (public)\n //\n // {\n // \"amount\": 0.010411000000000000,\n // \"trade-id\": 102090736910,\n // \"ts\": 1583497692182,\n // \"id\": 10500517034273194594947,\n // \"price\": 9096.050000000000000000,\n // \"direction\": \"sell\"\n // }\n //\n // fetchMyTrades (private)\n //\n // {\n // \"symbol\": \"swftcbtc\",\n // \"fee-currency\": \"swftc\",\n // \"filled-fees\": \"0\",\n // \"source\": \"spot-api\",\n // \"id\": 83789509854000,\n // \"type\": \"buy-limit\",\n // \"order-id\": 83711103204909,\n // 'filled-points': \"0.005826843283532154\",\n // \"fee-deduct-currency\": \"ht\",\n // 'filled-amount': \"45941.53\",\n // \"price\": \"0.0000001401\",\n // \"created-at\": 1597933260729,\n // \"match-id\": 100087455560,\n // \"role\": \"maker\",\n // \"trade-id\": 100050305348\n // },\n //\n const marketId = this.safeString (trade, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\n const timestamp = this.safeInteger2 (trade, 'ts', 'created-at');\n const order = this.safeString (trade, 'order-id');\n let side = this.safeString (trade, 'direction');\n let type = this.safeString (trade, 'type');\n if (type !== undefined) {\n const typeParts = type.split ('-');\n side = typeParts[0];\n type = typeParts[1];\n }\n const takerOrMaker = this.safeString (trade, 'role');\n const price = this.safeString (trade, 'price');\n const amount = this.safeString2 (trade, 'filled-amount', 'amount');\n const cost = Precise.stringMul (price, amount);\n let fee = undefined;\n let feeCost = this.safeString (trade, 'filled-fees');\n let feeCurrency = this.safeCurrencyCode (this.safeString (trade, 'fee-currency'));\n const filledPoints = this.safeString (trade, 'filled-points');\n if (filledPoints !== undefined) {\n if ((feeCost === undefined) || (Precise.stringEq (feeCost, '0.0'))) {\n feeCost = filledPoints;\n feeCurrency = this.safeCurrencyCode (this.safeString (trade, 'fee-deduct-currency'));\n }\n }\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': feeCurrency,\n };\n }\n const tradeId = this.safeString2 (trade, 'trade-id', 'tradeId');\n const id = this.safeString (trade, 'id', tradeId);\n return this.safeTrade ({\n 'info': trade,\n 'id': id,\n 'symbol': symbol,\n 'order': order,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'type': type,\n 'side': side,\n 'takerOrMaker': takerOrMaker,\n 'price': price,\n 'amount': amount,\n 'cost': cost,\n 'fee': fee,\n });\n }"
},
%{
"comment" => nil,
"examples" => [
"{ symbol: \"aidocbtc\",\n \"buy-limit-must-less-than\": 1.1,\n \"sell-limit-must-greater-than\": 0.9,\n \"limit-order-must-greater-than\": 1,\n \"limit-order-must-less-than\": 5000000,\n \"market-buy-order-must-greater-than\": 0.0001,\n \"market-buy-order-must-less-than\": 100,\n \"market-sell-order-must-greater-than\": 1,\n \"market-sell-order-must-less-than\": 500000,\n \"circuit-break-when-greater-than\": 10000,\n \"circuit-break-when-less-than\": 10,\n \"market-sell-order-rate-must-less-than\": 0.1,\n \"market-buy-order-rate-must-less-than\": 0.1 }"
],
"line_end" => 491,
"line_start" => 466,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "limits"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'amount': {\n 'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n 'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n },\n }"
}
],
"name" => "parseTradingLimits",
"signature" => "parseTradingLimits (limits, symbol: Str = undefined, params = {})",
"source" => "parseTradingLimits (limits, symbol: Str = undefined, params = {}) {\n //\n // { symbol: \"aidocbtc\",\n // \"buy-limit-must-less-than\": 1.1,\n // \"sell-limit-must-greater-than\": 0.9,\n // \"limit-order-must-greater-than\": 1,\n // \"limit-order-must-less-than\": 5000000,\n // \"market-buy-order-must-greater-than\": 0.0001,\n // \"market-buy-order-must-less-than\": 100,\n // \"market-sell-order-must-greater-than\": 1,\n // \"market-sell-order-must-less-than\": 500000,\n // \"circuit-break-when-greater-than\": 10000,\n // \"circuit-break-when-less-than\": 10,\n // \"market-sell-order-rate-must-less-than\": 0.1,\n // \"market-buy-order-rate-must-less-than\": 0.1 }\n //\n return {\n 'info': limits,\n 'limits': {\n 'amount': {\n 'min': this.safeNumber (limits, 'limit-order-must-greater-than'),\n 'max': this.safeNumber (limits, 'limit-order-must-less-than'),\n },\n },\n };\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": 8211029,\n \"type\": \"deposit\",\n \"currency\": \"eth\",\n \"chain\": \"eth\",\n 'tx-hash': \"bd315....\",\n \"amount\": 0.81162421,\n \"address\": \"4b8b....\",\n 'address-tag\": '\",\n \"fee\": 0,\n \"state\": \"safe\",\n \"created-at\": 1542180380965,\n \"updated-at\": 1542180788077\n }",
"{\n \"id\": 6908275,\n \"type\": \"withdraw\",\n \"currency\": \"btc\",\n \"chain\": \"btc\",\n 'tx-hash': \"c1a1a....\",\n \"amount\": 0.80257005,\n \"address\": \"1QR....\",\n 'address-tag\": '\",\n \"fee\": 0.0005,\n \"state\": \"confirmed\",\n \"created-at\": 1552107295685,\n \"updated-at\": 1552108032859\n }",
"{\n \"status\": \"ok\",\n \"data\": \"99562054\"\n }"
],
"line_end" => 1932,
"line_start" => 1853,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString2 (transaction, 'id', 'data')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString (transaction, 'tx-hash')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "network",
"value" => "this.safeStringUpper (transaction, 'chain')"
},
%{
"comment" => nil,
"key" => "address",
"value" => "this.safeString (transaction, 'address')"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "this.safeString (transaction, 'address-tag')"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'amount')"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (this.safeString (transaction, 'state'))"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "this.safeInteger (transaction, 'updated-at')"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "{\n 'currency': code,\n 'cost': this.parseNumber (feeCost),\n 'rate': undefined,\n }"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "this.parseNumber (feeCost)"
},
%{
"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 // \"id\": 8211029,\n // \"type\": \"deposit\",\n // \"currency\": \"eth\",\n // \"chain\": \"eth\",\n // 'tx-hash': \"bd315....\",\n // \"amount\": 0.81162421,\n // \"address\": \"4b8b....\",\n // 'address-tag\": '\",\n // \"fee\": 0,\n // \"state\": \"safe\",\n // \"created-at\": 1542180380965,\n // \"updated-at\": 1542180788077\n // }\n //\n // fetchWithdrawals\n //\n // {\n // \"id\": 6908275,\n // \"type\": \"withdraw\",\n // \"currency\": \"btc\",\n // \"chain\": \"btc\",\n // 'tx-hash': \"c1a1a....\",\n // \"amount\": 0.80257005,\n // \"address\": \"1QR....\",\n // 'address-tag\": '\",\n // \"fee\": 0.0005,\n // \"state\": \"confirmed\",\n // \"created-at\": 1552107295685,\n // \"updated-at\": 1552108032859\n // }\n //\n // withdraw\n //\n // {\n // \"status\": \"ok\",\n // \"data\": \"99562054\"\n // }\n //\n const timestamp = this.safeInteger (transaction, 'created-at');\n const code = this.safeCurrencyCode (this.safeString (transaction, 'currency'));\n let type = this.safeString (transaction, 'type');\n if (type === 'withdraw') {\n type = 'withdrawal';\n }\n let feeCost = this.safeString (transaction, 'fee');\n if (feeCost !== undefined) {\n feeCost = Precise.stringAbs (feeCost);\n }\n return {\n 'info': transaction,\n 'id': this.safeString2 (transaction, 'id', 'data'),\n 'txid': this.safeString (transaction, 'tx-hash'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': this.safeStringUpper (transaction, 'chain'),\n 'address': this.safeString (transaction, 'address'),\n 'addressTo': undefined,\n 'addressFrom': undefined,\n 'tag': this.safeString (transaction, 'address-tag'),\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'currency': code,\n 'status': this.parseTransactionStatus (this.safeString (transaction, 'state')),\n 'updated': this.safeInteger (transaction, 'updated-at'),\n 'comment': undefined,\n 'internal': undefined,\n 'fee': {\n 'currency': code,\n 'cost': this.parseNumber (feeCost),\n 'rate': undefined,\n },\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1956,
"line_start" => 1934,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n // deposit statuses\n 'unknown': 'failed',\n 'confirming': 'pending',\n 'confirmed': 'ok',\n 'safe': 'ok',\n 'orphan': 'failed',\n // withdrawal statuses\n 'submitted': 'pending',\n 'canceled': 'canceled',\n 'reexamine': 'pending',\n 'reject': 'failed',\n 'pass': 'pending',\n 'wallet-reject': 'failed',\n // 'confirmed': 'ok', // present in deposit statuses\n 'confirm-error': 'failed',\n 'repealed': 'failed',\n 'wallet-transfer': 'pending',\n 'pre-transfer': 'pending',\n };\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "/v1/",
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: 0.2,
method: :get,
path: "/account/accounts"
},
%{
auth: false,
cost: 0.2,
method: :get,
path: "/account/accounts/{id}/balance"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/account/accounts/{sub-uid}"
},
%{
auth: false,
cost: 4,
method: :get,
path: "/account/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/cross-margin/accounts/balance"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/cross-margin/loan-info"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/cross-margin/loan-orders"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/fee/fee-rate/get"
},
%{
auth: false,
cost: 0.2,
method: :get,
path: "/margin/accounts/balance"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/margin/loan-info"
},
%{
auth: false,
cost: 0.2,
method: :get,
path: "/margin/loan-orders"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/order/history"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/order/matchresults"
},
%{
auth: false,
cost: 0.4,
method: :get,
path: "/order/openOrders"
},
%{
auth: false,
cost: 0.4,
method: :get,
path: "/order/orders"
},
%{
auth: false,
cost: 0.4,
method: :get,
path: "/order/orders/getClientOrder"
},
%{
auth: false,
cost: 0.4,
method: :get,
path: "/order/orders/{id}"
},
%{
auth: false,
cost: 0.4,
method: :get,
path: "/order/orders/{id}/matchresults"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/points/actions"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/points/orders"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/query/deposit-withdraw"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/stable-coin/exchange_rate"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/stable-coin/quote"
},
%{
auth: false,
cost: 10,
method: :get,
path: "/subuser/aggregate-balance"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/account/transfer"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/cross-margin/orders"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/cross-margin/orders/{id}/repay"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/cross-margin/transfer-in"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/cross-margin/transfer-out"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/dw/transfer-in/margin"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/dw/transfer-out/margin"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/dw/withdraw-virtual/{id}/cancel"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/dw/withdraw/api/create"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/futures/transfer"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/margin/orders"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/margin/orders/{id}/repay"
},
%{
auth: false,
cost: 0.4,
method: :post,
path: "/order/batch-orders"
},
%{
auth: false,
cost: 0.4,
method: :post,
path: "/order/orders/batchCancelOpenOrders"
},
%{
auth: false,
cost: 0.4,
method: :post,
path: "/order/orders/batchcancel"
},
%{
auth: false,
cost: 0.2,
method: :post,
path: "/order/orders/place"
},
%{
auth: false,
cost: 0.2,
method: :post,
path: "/order/orders/submitCancelClientOrder"
},
%{
auth: false,
cost: 0.2,
method: :post,
path: "/order/orders/{id}/submitcancel"
},
%{
auth: false,
cost: 1,
method: :post,
path: "/stable-coin/exchange"
},
%{
auth: false,
cost: 10,
method: :post,
path: "/subuser/transfer"
}
],
public: [
%{
auth: false,
cost: 1,
method: :get,
path: "/common/currencys"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/common/exchange"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/common/symbols"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/common/timestamp"
},
%{
auth: false,
cost: 1,
method: :get,
path: "/settings/currencys"
}
]
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: %{
code_field: "err-code",
field: "status",
message_field: "err-msg",
success_values: [
"ok"
],
type: :success_code
},
signing: %{
confidence: :high,
pattern: :hmac_sha256_query,
signature_encoding: :base64
},
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" => 500000,
"min" => 1
},
"cost" => %{
"min" => 2
},
"price" => %{}
},
sample_precision: %{
"amount" => 0.01,
"price" => 0.0001
},
spot: %{
base: "IOST",
base_id: "iost",
case: :lower,
contract: false,
id: "iostjpy",
limits: %{
"amount" => %{
"max" => 500000,
"min" => 1
},
"cost" => %{
"min" => 2
},
"leverage" => %{
"max" => 1,
"min" => 1,
"superMax" => 1
},
"price" => %{}
},
maker: 0.002,
precision: %{
"amount" => 0.01,
"cost" => 0.01,
"price" => 0.0001
},
quote: "JPY",
quote_id: "jpy",
separator: "",
symbol: "IOST/JPY",
taker: 0.002
}
},
symbol_patterns: %{
spot: %{
case: :lower,
component_order: nil,
date_format: nil,
pattern: :no_separator_lower,
separator: "",
suffix: nil
}
},
timeframes: %{
"15m" => "15min",
"1M" => "1mon",
"1d" => "1day",
"1h" => "60min",
"1m" => "1min",
"1w" => "1week",
"1y" => "1year",
"30m" => "30min",
"4h" => "4hour",
"5m" => "5min"
},
url_strategy: %{
detected_from: "sign_method",
pattern: :version_slash,
prefix: "/v1/"
},
urls: %{
api: "https://api-cloud.bittrade.co.jp",
doc: "https://api-doc.bittrade.co.jp",
other: nil,
sandbox: nil,
www: "https://www.bittrade.co.jp"
},
version: "v1",
ws: %{
channel_templates: %{
watch_ohlcv: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "interval"
},
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :sub_based,
separator: "."
},
watch_order_book: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :sub_based,
separator: "."
},
watch_order_book_snapshot: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :sub_based,
separator: "."
},
watch_ticker: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :sub_based,
separator: "."
},
watch_trades: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :sub_based,
separator: "."
}
},
has: %{
watch_balance: false,
watch_bids_asks: nil,
watch_liquidations: nil,
watch_liquidations_for_symbols: nil,
watch_my_liquidations: nil,
watch_my_liquidations_for_symbols: nil,
watch_my_trades: nil,
watch_ohlcv: true,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: nil,
watch_orders: nil,
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
},
hostname: "api-cloud.bittrade.co.jp",
message_patterns: [
%{
format: :custom,
id_field: "id",
keys: [
"id",
"sub"
],
sources: [
:send,
:watch
]
}
],
options: %{
"ws" => %{
"gunzip" => true
}
},
subscription_config: %{
args_field: "sub",
args_format: :string,
market_id_format: :native,
op_field: "sub",
separator: "."
},
subscription_pattern: :sub_subscribe,
urls: %{
"api" => %{
"private" => "wss://{hostname}/ws/v2",
"public" => "wss://{hostname}/ws"
}
},
watch_methods: [
"watchOHLCV",
"watchOrderBook",
"watchOrderBookSnapshot",
"watchTicker",
"watchTrades"
]
}
}