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

priv/specs/extracted/bitso.exs

# Bitso Exchange Specification
#
# Auto-generated by: mix ccxt.extract bitso
# CCXT version: 4.5.34
# Spec format version: 1
#
# Review before use:
# - signing: Detected from sign() method, verify with testnet
# - endpoints: Raw paths extracted, map to unified API as needed
# - exceptions: Extracted (exact, broad, HTTP status codes)
# - features/options: Extracted from describe()
# - classification: Set to :supported initially, promote after validation
#
%{
api_param_requirements: nil,
certified: false,
classification: :supported,
comment: nil,
countries: [
"MX"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 24,
"coveragePercent" => 100,
"enabledMethods" => 27,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
},
%{
"method" => "fetchDepositWithdrawFee",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 2,
"extractableMethods" => 25,
"failures" => [
%{
"error" => "bitso cancelAllOrders() deletes all orders for user, it does not support filtering by symbol.",
"method" => "cancelAllOrders"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{
"id" => "oid"
},
params: [
:id,
:symbol
],
path: "/orders/{oid}",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"oids" => "test-order-id"
},
market_type: :spot,
method: :delete,
name: :cancel_orders,
param_mappings: %{},
params: [
:ids,
:symbol
],
path: "/orders",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"type" => "limit"
},
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"amount" => "major",
"symbol" => "book"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"type" => "market"
},
market_type: :spot,
method: :post,
name: :create_market_order,
param_mappings: %{
"amount" => "major",
"symbol" => "book"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "major",
"symbol" => "book"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/orders",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/balance",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposit,
param_mappings: %{
"arg0" => "fid"
},
params: [],
path: "/fundings/{fid}",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposit_address,
param_mappings: %{
"code" => "fund_currency"
},
params: [
:code
],
path: "/funding_destination",
response_transformer: {:extract_path_unwrap, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposit_withdraw_fees,
param_mappings: %{},
params: [
:codes
],
path: "/fees",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/fundings",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "book"
},
params: [
:symbol,
:limit
],
path: "/order_book",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ledger,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/ledger",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/available_books",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"limit" => 25
},
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{
"symbol" => "book"
},
params: [
:symbol,
:since,
:limit
],
path: "/user_trades",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"end" => "<generated>",
"time_bucket" => "3600"
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"since" => "start",
"symbol" => "book"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/ohlc",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"limit" => 25
},
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "book"
},
params: [
:symbol,
:since,
:limit
],
path: "/open_orders",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{
"id" => "oid"
},
params: [
:id,
:symbol
],
path: "/orders/{oid}",
response_transformer: {:extract_path_unwrap, ["payload"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "book"
},
params: [
:symbol,
:limit
],
path: "/order_book",
response_transformer: {:extract_path_unwrap, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_trades,
param_mappings: %{
"id" => "oid"
},
params: [
:id,
:symbol,
:since,
:limit
],
path: "/order_trades/{oid}",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "book"
},
params: [
:symbol
],
path: "/ticker",
response_transformer: {:extract_path_unwrap, ["payload"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"symbol" => "book"
},
params: [
:symbol,
:since,
:limit
],
path: "/trades",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/fees",
response_transformer: {:extract_path, ["payload", "fees"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_transaction_fees,
param_mappings: %{},
params: [
:codes
],
path: "/fees",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :withdraw,
param_mappings: %{},
params: [
:code,
:amount,
:address,
:tag
],
path: "/bitcoin_withdrawal",
response_transformer: {:extract_path, ["payload"]},
source: :intercepted
}
],
error_code_details: %{
104 => %{
description: "Cannot perform request - nonce must be higher than 1520307203724237",
type: :invalid_credentials
},
201 => %{
description: "Invalid Nonce or Invalid Credentials",
type: :invalid_credentials
},
304 => %{
description: "{\"success\":false,\"error\":{\"code\":\"0304\",\"message\":\"The field time_bucket () is either invalid or missing\"}}",
type: :invalid_parameters
}
},
error_codes: %{
104 => :invalid_credentials,
201 => :invalid_credentials,
304 => :invalid_parameters
},
exceptions: nil,
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"defaultPrecision" => 1.0e-8,
"networks" => %{
"BEP2" => "bep2",
"BEP20" => "bsc",
"ERC20" => "erc20",
"TRC20" => "trx"
},
"networksById" => %{
"bep2" => "BEP2",
"bsc" => "BEP20",
"erc20" => "ERC20",
"trx" => "TRC20"
},
"precision" => %{
"MXN" => 0.01,
"TUSD" => 0.01,
"XRP" => 1.0e-6
}
},
extended_metadata: %{
fees_url: "https://bitso.com/fees",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/178c8e56-9054-4107-b192-5e5053d4f975",
referral_url: "https://bitso.com/?ref=itej"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
future: %{},
spot: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: true,
gtd: false,
ioc: true,
po: true
},
trailing: false,
trigger_price: true
},
fetch_my_trades: %{
limit: 100,
margin_mode: false,
symbol_required: true
},
fetch_ohlcv: %{
limit: 300
},
fetch_open_orders: %{
limit: 500,
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
sandbox: false
},
swap: %{}
},
fees: nil,
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 ('success' in response) {\n //\n // {\"success\":false,\"error\":{\"code\":104,\"message\":\"Cannot perform request - nonce must be higher than 1520307203724237\"}}\n //\n let success = this.safeBool(response, 'success', false);\n if (typeof success === 'string') {\n if ((success === 'true') || (success === '1')) {\n success = true;\n }\n else {\n success = false;\n }\n }\n if (!success) {\n const feedback = this.id + ' ' + this.json(response);\n const error = this.safeValue(response, 'error');\n if (error === undefined) {\n throw new errors.ExchangeError(feedback);\n }\n const code = this.safeString(error, 'code');\n this.throwExactlyMatchedException(this.exceptions, code, 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: false,
create_market_buy_order_with_cost_ws: false,
create_market_buy_order_ws: false,
create_market_order: true,
create_market_order_with_cost: false,
create_market_order_with_cost_ws: false,
create_market_order_ws: true,
create_market_sell_order: false,
create_market_sell_order_with_cost: false,
create_market_sell_order_with_cost_ws: false,
create_market_sell_order_ws: false,
create_order: true,
create_order_with_take_profit_and_stop_loss: false,
create_order_with_take_profit_and_stop_loss_ws: false,
create_order_ws: false,
create_orders: false,
create_post_only_order: false,
create_post_only_order_ws: false,
create_reduce_only_order: false,
create_reduce_only_order_ws: false,
create_stop_limit_order: false,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: false,
create_stop_market_order_ws: false,
create_stop_order: false,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: false,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: false,
fetch_closed_orders_ws: false,
fetch_convert_currencies: false,
fetch_convert_quote: false,
fetch_convert_trade: false,
fetch_convert_trade_history: false,
fetch_cross_borrow_rate: false,
fetch_cross_borrow_rates: false,
fetch_currencies: false,
fetch_currencies_ws: true,
fetch_deposit: true,
fetch_deposit_address: true,
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: true,
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: false,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: false,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: false,
fetch_ticker: true,
fetch_ticker_ws: false,
fetch_tickers: false,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: true,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: true,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: false,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
sandbox: false,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: true,
swap: false,
transfer: false,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: false,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: false,
watch_ohlcv: false,
watch_ohlcv_for_symbols: false,
watch_order_book: false,
watch_order_book_for_symbols: false,
watch_orders: false,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: false,
watch_tickers: false,
watch_trades: false,
watch_trades_for_symbols: false,
withdraw: true,
ws: false
},
http_config: nil,
id: "bitso",
markets: nil,
name: "Bitso",
ohlcv_timestamp_resolution: :milliseconds,
options: %{
"default_precision" => 1.0e-8,
:networks => %{
"BEP2" => "bep2",
"BEP20" => "bsc",
"ERC20" => "erc20",
"TRC20" => "trx"
},
"precision" => %{
"MXN" => 0.01,
"TUSD" => 0.01,
"XRP" => 1.0e-6
}
},
order_mappings: %{
side_format: :lowercase,
side_key: "side",
type_format: :lowercase,
type_key: "type"
},
param_mappings: %{
"amount" => "major",
"arg0" => "fid",
"code" => "fund_currency",
"id" => "oid",
"since" => "start",
"symbol" => "book"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 614,
"line_start" => 595,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "response"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const payload = this.safeValue (response, 'payload', {});\n const balances = this.safeValue (payload, 'balances', []);\n const result: Dict = {\n 'info': response,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\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 const account = this.account ();\n account['free'] = this.safeString (balance, 'available');\n account['used'] = this.safeString (balance, 'locked');\n account['total'] = this.safeString (balance, 'total');\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"fees\": [\n {\n \"book\": \"btc_mxn\",\n \"fee_percent\": \"0.6500\",\n \"fee_decimal\": \"0.00650000\",\n \"taker_fee_percent\": \"0.6500\",\n \"taker_fee_decimal\": \"0.00650000\",\n \"maker_fee_percent\": \"0.5000\",\n \"maker_fee_decimal\": \"0.00500000\",\n \"volume_currency\": \"mxn\",\n \"current_volume\": \"0.00\",\n \"next_volume\": \"1500000.00\",\n \"next_maker_fee_percent\": \"0.490\",\n \"next_taker_fee_percent\": \"0.637\",\n \"nextVolume\": \"1500000.00\",\n \"nextFee\": \"0.490\",\n \"nextTakerFee\": \"0.637\"\n },\n ...\n ],\n \"deposit_fees\": [\n {\n \"currency\": \"btc\",\n \"method\": \"rewards\",\n \"fee\": \"0.00\",\n \"is_fixed\": false\n },\n ...\n ],\n \"withdrawal_fees\": {\n \"ada\": \"0.20958100\",\n \"bch\": \"0.00009437\",\n \"ars\": \"0\",\n \"btc\": \"0.00001209\",\n ...\n }\n }"
],
"line_end" => 1703,
"line_start" => 1625,
"mappings" => [
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
}
],
"name" => "parseDepositWithdrawFees",
"signature" => "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined)",
"source" => "parseDepositWithdrawFees (response, codes = undefined, currencyIdKey = undefined) {\n //\n // {\n // \"fees\": [\n // {\n // \"book\": \"btc_mxn\",\n // \"fee_percent\": \"0.6500\",\n // \"fee_decimal\": \"0.00650000\",\n // \"taker_fee_percent\": \"0.6500\",\n // \"taker_fee_decimal\": \"0.00650000\",\n // \"maker_fee_percent\": \"0.5000\",\n // \"maker_fee_decimal\": \"0.00500000\",\n // \"volume_currency\": \"mxn\",\n // \"current_volume\": \"0.00\",\n // \"next_volume\": \"1500000.00\",\n // \"next_maker_fee_percent\": \"0.490\",\n // \"next_taker_fee_percent\": \"0.637\",\n // \"nextVolume\": \"1500000.00\",\n // \"nextFee\": \"0.490\",\n // \"nextTakerFee\": \"0.637\"\n // },\n // ...\n // ],\n // \"deposit_fees\": [\n // {\n // \"currency\": \"btc\",\n // \"method\": \"rewards\",\n // \"fee\": \"0.00\",\n // \"is_fixed\": false\n // },\n // ...\n // ],\n // \"withdrawal_fees\": {\n // \"ada\": \"0.20958100\",\n // \"bch\": \"0.00009437\",\n // \"ars\": \"0\",\n // \"btc\": \"0.00001209\",\n // ...\n // }\n // }\n //\n const result: Dict = {};\n const depositResponse = this.safeValue (response, 'deposit_fees', []);\n const withdrawalResponse = this.safeValue (response, 'withdrawal_fees', []);\n for (let i = 0; i < depositResponse.length; i++) {\n const entry = depositResponse[i];\n const currencyId = this.safeString (entry, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n if ((codes === undefined) || (code in codes)) {\n result[code] = {\n 'deposit': {\n 'fee': this.safeNumber (entry, 'fee'),\n 'percentage': !this.safeValue (entry, 'is_fixed'),\n },\n 'withdraw': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'networks': {},\n 'info': entry,\n };\n }\n }\n const withdrawalKeys = Object.keys (withdrawalResponse);\n for (let i = 0; i < withdrawalKeys.length; i++) {\n const currencyId = withdrawalKeys[i];\n const code = this.safeCurrencyCode (currencyId);\n if ((codes === undefined) || (code in codes)) {\n const withdrawFee = this.parseNumber (withdrawalResponse[currencyId]);\n const resultValue = this.safeValue (result, code);\n if (resultValue === undefined) {\n result[code] = this.depositWithdrawFee ({});\n }\n result[code]['withdraw']['fee'] = withdrawFee;\n result[code]['info'][code] = withdrawFee;\n }\n }\n return result;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"eid\": \"2510b3e2bc1c87f584500a18084f35ed\",\n \"created_at\": \"2022-06-08T12:21:42+0000\",\n \"balance_updates\": [{\n \"amount\": \"0.00080000\",\n \"currency\": \"btc\"\n }],\n \"operation\": \"funding\",\n \"details\": {\n \"network\": \"btc\",\n \"method\": \"btc\",\n \"method_name\": \"Bitcoin\",\n \"asset\": \"btc\",\n \"protocol\": \"btc\",\n \"integration\": \"bitgo-v2\",\n \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\"\n }\n }",
"{\n \"eid\": \"8976c6053f078f704f037d82a813678a\",\n \"created_at\": \"2022-06-08T17:01:48+0000\",\n \"balance_updates\": [{\n \"amount\": \"59.21320500\",\n \"currency\": \"mxn\"\n },\n {\n \"amount\": \"-0.00010000\",\n \"currency\": \"btc\"\n }\n ],\n \"operation\": \"trade\",\n \"details\": {\n \"tid\": \"72145428\",\n \"oid\": \"JO5TZmMZjzjlZDyT\"\n }\n }",
"{\n \"eid\": \"cbbb3c8d4e41723d25d2850dcb7c3c74\",\n \"created_at\": \"2022-06-08T17:01:48+0000\",\n \"balance_updates\": [{\n \"amount\": \"-0.38488583\",\n \"currency\": \"mxn\"\n }],\n \"operation\": \"fee\",\n \"details\": {\n \"tid\": \"72145428\",\n \"oid\": \"JO5TZmMZjzjlZDyT\"\n }\n }"
],
"line_end" => 452,
"line_start" => 350,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "item"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (item, 'eid')"
},
%{
"comment" => nil,
"key" => "direction",
"value" => "direction"
},
%{
"comment" => nil,
"key" => "account",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "referenceId",
"value" => "referenceId"
},
%{
"comment" => nil,
"key" => "referenceAccount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "before",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "after",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "'ok'"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
}
],
"name" => "parseLedgerEntry",
"signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
"source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n //\n // {\n // \"eid\": \"2510b3e2bc1c87f584500a18084f35ed\",\n // \"created_at\": \"2022-06-08T12:21:42+0000\",\n // \"balance_updates\": [{\n // \"amount\": \"0.00080000\",\n // \"currency\": \"btc\"\n // }],\n // \"operation\": \"funding\",\n // \"details\": {\n // \"network\": \"btc\",\n // \"method\": \"btc\",\n // \"method_name\": \"Bitcoin\",\n // \"asset\": \"btc\",\n // \"protocol\": \"btc\",\n // \"integration\": \"bitgo-v2\",\n // \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\"\n // }\n // }\n //\n // trade\n // {\n // \"eid\": \"8976c6053f078f704f037d82a813678a\",\n // \"created_at\": \"2022-06-08T17:01:48+0000\",\n // \"balance_updates\": [{\n // \"amount\": \"59.21320500\",\n // \"currency\": \"mxn\"\n // },\n // {\n // \"amount\": \"-0.00010000\",\n // \"currency\": \"btc\"\n // }\n // ],\n // \"operation\": \"trade\",\n // \"details\": {\n // \"tid\": \"72145428\",\n // \"oid\": \"JO5TZmMZjzjlZDyT\"\n // }\n // }\n //\n // fee\n // {\n // \"eid\": \"cbbb3c8d4e41723d25d2850dcb7c3c74\",\n // \"created_at\": \"2022-06-08T17:01:48+0000\",\n // \"balance_updates\": [{\n // \"amount\": \"-0.38488583\",\n // \"currency\": \"mxn\"\n // }],\n // \"operation\": \"fee\",\n // \"details\": {\n // \"tid\": \"72145428\",\n // \"oid\": \"JO5TZmMZjzjlZDyT\"\n // }\n // }\n const operation = this.safeString (item, 'operation');\n const type = this.parseLedgerEntryType (operation);\n const balanceUpdates = this.safeValue (item, 'balance_updates', []);\n const firstBalance = this.safeValue (balanceUpdates, 0, {});\n let direction = undefined;\n let fee = undefined;\n const amount = this.safeString (firstBalance, 'amount');\n const currencyId = this.safeString (firstBalance, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n currency = this.safeCurrency (currencyId, currency);\n const details = this.safeValue (item, 'details', {});\n let referenceId = this.safeString2 (details, 'fid', 'wid');\n if (referenceId === undefined) {\n referenceId = this.safeString (details, 'tid');\n }\n if (operation === 'funding') {\n direction = 'in';\n } else if (operation === 'withdrawal') {\n direction = 'out';\n } else if (operation === 'trade') {\n direction = undefined;\n } else if (operation === 'fee') {\n direction = 'out';\n const cost = Precise.stringAbs (amount);\n fee = {\n 'cost': cost,\n 'currency': currency,\n };\n }\n const timestamp = this.parse8601 (this.safeString (item, 'created_at'));\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': this.safeString (item, 'eid'),\n 'direction': direction,\n 'account': undefined,\n 'referenceId': referenceId,\n 'referenceAccount': undefined,\n 'type': type,\n 'currency': code,\n 'amount': amount,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'before': undefined,\n 'after': undefined,\n 'status': 'ok',\n 'fee': fee,\n }, currency) as LedgerEntry;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 348,
"line_start" => 340,
"mappings" => [],
"name" => "parseLedgerEntryType",
"signature" => "parseLedgerEntryType (type)",
"source" => "parseLedgerEntryType (type) {\n const types: Dict = {\n 'funding': 'transaction',\n 'withdrawal': 'transaction',\n 'trade': 'trade',\n 'fee': 'fee',\n };\n return this.safeString (types, type, type);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"bucket_start_time\":1648219140000,\n \"first_trade_time\":1648219154990,\n \"last_trade_time\":1648219189441,\n \"first_rate\":\"44958.60\",\n \"last_rate\":\"44979.88\",\n \"min_rate\":\"44957.33\",\n \"max_rate\":\"44979.88\",\n \"trade_count\":8,\n \"volume\":\"0.00082814\",\n \"vwap\":\"44965.02\"\n },"
],
"line_end" => 835,
"line_start" => 812,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"bucket_start_time\":1648219140000,\n // \"first_trade_time\":1648219154990,\n // \"last_trade_time\":1648219189441,\n // \"first_rate\":\"44958.60\",\n // \"last_rate\":\"44979.88\",\n // \"min_rate\":\"44957.33\",\n // \"max_rate\":\"44979.88\",\n // \"trade_count\":8,\n // \"volume\":\"0.00082814\",\n // \"vwap\":\"44965.02\"\n // },\n //\n return [\n this.safeInteger (ohlcv, 'bucket_start_time'),\n this.safeNumber (ohlcv, 'first_rate'),\n this.safeNumber (ohlcv, 'max_rate'),\n this.safeNumber (ohlcv, 'min_rate'),\n this.safeNumber (ohlcv, 'last_rate'),\n this.safeNumber (ohlcv, 'volume'),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1261,
"line_start" => 1216,
"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" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "orderType"
},
%{
"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" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "remaining"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n //\n // canceledOrder\n // yWTQGxDMZ0VimZgZ\n //\n let id = undefined;\n if (typeof order === 'string') {\n id = order;\n } else {\n id = this.safeString (order, 'oid');\n }\n const side = this.safeString (order, 'side');\n const status = this.parseOrderStatus (this.safeString (order, 'status'));\n const marketId = this.safeString (order, 'book');\n const symbol = this.safeSymbol (marketId, market, '_');\n const orderType = this.safeString (order, 'type');\n const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n const price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'original_amount');\n const remaining = this.safeString (order, 'unfilled_amount');\n const clientOrderId = this.safeString (order, 'client_id');\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': symbol,\n 'type': orderType,\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'amount': amount,\n 'cost': undefined,\n 'remaining': remaining,\n 'filled': undefined,\n 'status': status,\n 'fee': undefined,\n 'average': undefined,\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1214,
"line_start" => 1206,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'partial-fill': 'open', // this is a common substitution in ccxt\n 'partially filled': 'open',\n 'queued': 'open',\n 'completed': 'closed',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"high\":\"37446.85\",\n \"last\":\"36599.54\",\n \"created_at\":\"2022-01-28T12:06:11+00:00\",\n \"book\":\"btc_usdt\",\n \"volume\":\"7.29075419\",\n \"vwap\":\"36579.1564400307\",\n \"low\":\"35578.52\",\n \"ask\":\"36574.76\",\n \"bid\":\"36538.22\",\n \"change_24\":\"-105.64\"\n }"
],
"line_end" => 720,
"line_start" => 677,
"mappings" => [
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "high",
"value" => "this.safeString (ticker, 'high')"
},
%{
"comment" => nil,
"key" => "low",
"value" => "this.safeString (ticker, 'low')"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "this.safeString (ticker, 'bid')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeString (ticker, 'ask')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "vwap"
},
%{
"comment" => nil,
"key" => "open",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "baseVolume"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "quoteVolume"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // {\n // \"high\":\"37446.85\",\n // \"last\":\"36599.54\",\n // \"created_at\":\"2022-01-28T12:06:11+00:00\",\n // \"book\":\"btc_usdt\",\n // \"volume\":\"7.29075419\",\n // \"vwap\":\"36579.1564400307\",\n // \"low\":\"35578.52\",\n // \"ask\":\"36574.76\",\n // \"bid\":\"36538.22\",\n // \"change_24\":\"-105.64\"\n // }\n //\n const symbol = this.safeSymbol (undefined, market);\n const timestamp = this.parse8601 (this.safeString (ticker, 'created_at'));\n const vwap = this.safeString (ticker, 'vwap');\n const baseVolume = this.safeString (ticker, 'volume');\n const quoteVolume = Precise.stringMul (baseVolume, vwap);\n const last = this.safeString (ticker, 'last');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high'),\n 'low': this.safeString (ticker, 'low'),\n 'bid': this.safeString (ticker, 'bid'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'ask'),\n 'askVolume': undefined,\n 'vwap': vwap,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"book\": \"btc_usdt\",\n \"created_at\": \"2021-11-24T12:14:53+0000\",\n \"amount\": \"0.00026562\",\n \"maker_side\": \"sell\",\n \"price\": \"56471.55\",\n \"tid\": \"52557338\"\n }",
"{\n \"book\": \"btc_usdt\",\n \"created_at\": \"2021-11-24T12:31:03+0000\",\n \"minor\": \"11.30356000\",\n \"major\": \"-0.00020000\",\n \"fees_amount\": \"0.01119052\",\n \"fees_currency\": \"usdt\",\n \"minor_currency\": \"usdt\",\n \"major_currency\": \"btc\",\n \"oid\": \"djTzMIWx2Vi3iMjl\",\n \"tid\": \"52559051\",\n \"price\": \"56517.80\",\n \"side\": \"sell\",\n \"maker_side\": \"buy\"\n }",
"{\n \"book\": \"btc_usdt\",\n \"created_at\": \"2021-11-24T12:30:52+0000\",\n \"minor\": \"-11.33047916\",\n \"major\": \"0.00020020\",\n \"fees_amount\": \"0.00000020\",\n \"fees_currency\": \"btc\",\n \"minor_currency\": \"usdt\",\n \"major_currency\": \"btc\",\n \"oid\": \"O0D2zcljjjQF5xlG\",\n \"tid\": \"52559030\",\n \"price\": \"56595.80\",\n \"side\": \"buy\",\n \"maker_side\": \"sell\"\n }"
],
"line_end" => 941,
"line_start" => 837,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"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"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "feeCost"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "feeCurrency"
}
],
"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 // \"book\": \"btc_usdt\",\n // \"created_at\": \"2021-11-24T12:14:53+0000\",\n // \"amount\": \"0.00026562\",\n // \"maker_side\": \"sell\",\n // \"price\": \"56471.55\",\n // \"tid\": \"52557338\"\n // }\n //\n // fetchMyTrades (private)\n //\n // {\n // \"book\": \"btc_usdt\",\n // \"created_at\": \"2021-11-24T12:31:03+0000\",\n // \"minor\": \"11.30356000\",\n // \"major\": \"-0.00020000\",\n // \"fees_amount\": \"0.01119052\",\n // \"fees_currency\": \"usdt\",\n // \"minor_currency\": \"usdt\",\n // \"major_currency\": \"btc\",\n // \"oid\": \"djTzMIWx2Vi3iMjl\",\n // \"tid\": \"52559051\",\n // \"price\": \"56517.80\",\n // \"side\": \"sell\",\n // \"maker_side\": \"buy\"\n // }\n //\n // fetchOrderTrades (private)\n //\n // {\n // \"book\": \"btc_usdt\",\n // \"created_at\": \"2021-11-24T12:30:52+0000\",\n // \"minor\": \"-11.33047916\",\n // \"major\": \"0.00020020\",\n // \"fees_amount\": \"0.00000020\",\n // \"fees_currency\": \"btc\",\n // \"minor_currency\": \"usdt\",\n // \"major_currency\": \"btc\",\n // \"oid\": \"O0D2zcljjjQF5xlG\",\n // \"tid\": \"52559030\",\n // \"price\": \"56595.80\",\n // \"side\": \"buy\",\n // \"maker_side\": \"sell\"\n // }\n //\n const timestamp = this.parse8601 (this.safeString (trade, 'created_at'));\n const marketId = this.safeString (trade, 'book');\n const symbol = this.safeSymbol (marketId, market, '_');\n let side = this.safeString (trade, 'side');\n const makerSide = this.safeString (trade, 'maker_side');\n let takerOrMaker = undefined;\n if (side !== undefined) {\n if (side === makerSide) {\n takerOrMaker = 'maker';\n } else {\n takerOrMaker = 'taker';\n }\n } else {\n if (makerSide === 'buy') {\n side = 'sell';\n } else {\n side = 'buy';\n }\n }\n let amount = this.safeString2 (trade, 'amount', 'major');\n if (amount !== undefined) {\n amount = Precise.stringAbs (amount);\n }\n let fee = undefined;\n const feeCost = this.safeString (trade, 'fees_amount');\n if (feeCost !== undefined) {\n const feeCurrencyId = this.safeString (trade, 'fees_currency');\n const feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n fee = {\n 'cost': feeCost,\n 'currency': feeCurrency,\n };\n }\n let cost = this.safeString (trade, 'minor');\n if (cost !== undefined) {\n cost = Precise.stringAbs (cost);\n }\n const price = this.safeString (trade, 'price');\n const orderId = this.safeString (trade, 'oid');\n const id = this.safeString (trade, 'tid');\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'order': orderId,\n 'type': undefined,\n 'side': side,\n 'takerOrMaker': takerOrMaker,\n 'price': price,\n 'amount': amount,\n 'cost': cost,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\",\n \"status\": \"complete\",\n \"created_at\": \"2022-06-08T12:02:49+0000\",\n \"currency\": \"btc\",\n \"method\": \"btc\",\n \"method_name\": \"Bitcoin\",\n \"amount\": \"0.00080000\",\n \"asset\": \"btc\",\n \"network\": \"btc\",\n \"protocol\": \"btc\",\n \"integration\": \"bitgo-v2\",\n \"details\": {\n \"receiving_address\": \"3NmvbcYKhogs6RoTb4eYCUJ3beRSqLgSif\",\n \"tx_hash\": \"327f3838531f611485ec59f9d0a119fea1595591e274d942b2c10b9b8262eb1d\",\n \"confirmations\": \"4\"\n }\n }",
"{\n \"wid\": \"c5b8d7f0768ee91d3b33bee648318688\",\n \"status\": \"pending\",\n \"created_at\": \"2016-04-08T17:52:31.000+00:00\",\n \"currency\": \"btc\",\n \"method\": \"Bitcoin\",\n \"amount\": \"0.48650929\",\n \"details\": {\n \"withdrawal_address\": \"18MsnATiNiKLqUHDTRKjurwMg7inCrdNEp\",\n \"tx_hash\": \"d4f28394693e9fb5fffcaf730c11f32d1922e5837f76ca82189d3bfe30ded433\"\n }\n }"
],
"line_end" => 1833,
"line_start" => 1763,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString2 (transaction, 'wid', 'fid')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString (details, 'tx_hash')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "this.parse8601 (datetime)"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "datetime"
},
%{
"comment" => nil,
"key" => "network",
"value" => "networkCodeUpper"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "receivingAddress"
},
%{
"comment" => nil,
"key" => "address",
"value" => "(withdrawalAddress !== undefined) ? withdrawalAddress : receivingAddress"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "withdrawalAddress"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.safeNumber (transaction, 'amount')"
},
%{
"comment" => nil,
"key" => "type",
"value" => "(withdrawId === undefined) ? 'deposit' : 'withdrawal'"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "this.safeCurrencyCode (currencyId, currency)"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (status)"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // deposit\n // {\n // \"fid\": \"6112c6369100d6ecceb7f54f17cf0511\",\n // \"status\": \"complete\",\n // \"created_at\": \"2022-06-08T12:02:49+0000\",\n // \"currency\": \"btc\",\n // \"method\": \"btc\",\n // \"method_name\": \"Bitcoin\",\n // \"amount\": \"0.00080000\",\n // \"asset\": \"btc\",\n // \"network\": \"btc\",\n // \"protocol\": \"btc\",\n // \"integration\": \"bitgo-v2\",\n // \"details\": {\n // \"receiving_address\": \"3NmvbcYKhogs6RoTb4eYCUJ3beRSqLgSif\",\n // \"tx_hash\": \"327f3838531f611485ec59f9d0a119fea1595591e274d942b2c10b9b8262eb1d\",\n // \"confirmations\": \"4\"\n // }\n // }\n //\n // withdraw\n //\n // {\n // \"wid\": \"c5b8d7f0768ee91d3b33bee648318688\",\n // \"status\": \"pending\",\n // \"created_at\": \"2016-04-08T17:52:31.000+00:00\",\n // \"currency\": \"btc\",\n // \"method\": \"Bitcoin\",\n // \"amount\": \"0.48650929\",\n // \"details\": {\n // \"withdrawal_address\": \"18MsnATiNiKLqUHDTRKjurwMg7inCrdNEp\",\n // \"tx_hash\": \"d4f28394693e9fb5fffcaf730c11f32d1922e5837f76ca82189d3bfe30ded433\"\n // }\n // }\n //\n const currencyId = this.safeString2 (transaction, 'currency', 'asset');\n currency = this.safeCurrency (currencyId, currency);\n const details = this.safeValue (transaction, 'details', {});\n const datetime = this.safeString (transaction, 'created_at');\n const withdrawalAddress = this.safeString (details, 'withdrawal_address');\n const receivingAddress = this.safeString (details, 'receiving_address');\n const networkId = this.safeString2 (transaction, 'network', 'method');\n const status = this.safeString (transaction, 'status');\n const withdrawId = this.safeString (transaction, 'wid');\n const networkCode = this.networkIdToCode (networkId);\n const networkCodeUpper = (networkCode !== undefined) ? networkCode.toUpperCase () : undefined;\n return {\n 'id': this.safeString2 (transaction, 'wid', 'fid'),\n 'txid': this.safeString (details, 'tx_hash'),\n 'timestamp': this.parse8601 (datetime),\n 'datetime': datetime,\n 'network': networkCodeUpper,\n 'addressFrom': receivingAddress,\n 'address': (withdrawalAddress !== undefined) ? withdrawalAddress : receivingAddress,\n 'addressTo': withdrawalAddress,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'type': (withdrawId === undefined) ? 'deposit' : 'withdrawal',\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'status': this.parseTransactionStatus (status),\n 'updated': undefined,\n 'tagFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'comment': undefined,\n 'internal': undefined,\n 'fee': undefined,\n 'info': transaction,\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1843,
"line_start" => 1835,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (status: Str)",
"source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'pending': 'pending',\n 'in_progress': 'pending',\n 'complete': 'ok',\n 'failed': 'failed',\n };\n return this.safeString (statuses, status, status);\n }"
}
],
path_prefix: "/v3/",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 2000,
period: 1000,
requests: 1,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [],
public: []
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: %{
code_field: "error",
field: "success",
message_field: "message",
success_values: nil,
type: :success_bool
},
signing: %{
confidence: :medium,
pattern: :hmac_sha256_headers
},
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" => 40000000,
"min" => 0.04
},
"cost" => %{
"max" => 10000000,
"min" => 0.5
},
"price" => %{
"max" => 20,
"min" => 0.05
}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 1.0e-5
},
spot: %{
base: "ADA",
base_id: "ada",
case: :lower,
contract: false,
id: "ada_usd",
limits: %{
"amount" => %{
"max" => 40000000,
"min" => 0.04
},
"cost" => %{
"max" => 10000000,
"min" => 0.5
},
"leverage" => %{},
"price" => %{
"max" => 20,
"min" => 0.05
}
},
maker: 0.003,
precision: %{
"amount" => 1.0e-8,
"price" => 1.0e-5
},
quote: "USD",
quote_id: "usd",
separator: "_",
symbol: "ADA/USD",
taker: 0.0036
}
},
symbol_patterns: %{
spot: %{
case: :lower,
component_order: nil,
date_format: nil,
pattern: :underscore_lower,
separator: "_",
suffix: nil
}
},
timeframes: %{
"12h" => "43200",
"15m" => "900",
"1d" => "86400",
"1h" => "3600",
"1m" => "60",
"1w" => "604800",
"30m" => "1800",
"4h" => "14400",
"5m" => "300"
},
url_strategy: %{
detected_from: "sign_method",
pattern: :version_slash,
prefix: "/v3/"
},
urls: %{
api: "https://bitso.com/api",
api_sections: %{
"rest" => "https://bitso.com/api"
},
doc: "https://bitso.com/api_info",
other: nil,
sandbox: %{
"rest" => "https://stage.bitso.com/api"
},
www: "https://bitso.com"
},
version: "v3",
ws: nil
}