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

priv/specs/extracted/mercado.exs

# Mercado Bitcoin Exchange Specification
#
# Auto-generated by: mix ccxt.extract mercado
# 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: [
"BR"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 13,
"coveragePercent" => 100,
"enabledMethods" => 17,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
},
%{
"method" => "fetchMyTrades",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 2,
"extractableMethods" => 15,
"failures" => [
%{
"error" => "mercado createOrder() requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount",
"method" => "createMarketOrder"
},
%{
"error" => "mercado withdraw() requires tx_fee parameter to withdraw BTC",
"method" => "withdraw"
}
]
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :cancel_order,
param_mappings: %{
"id" => "order_id",
"symbol" => "coin_pair"
},
params: [
:id,
:symbol
],
path: "/cancel_order",
response_transformer: {:extract_path, ["response_data", "order"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :create_limit_order,
param_mappings: %{
"amount" => "quantity",
"price" => "limit_price",
"symbol" => "coin_pair"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/place_buy_order",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "quantity",
"price" => "limit_price",
"symbol" => "coin_pair"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/place_buy_order",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/get_account_info",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"coin" => "BTC"
},
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/{coin}/orderbook/",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/coins",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
},
%{
api_section: "v4PublicNet",
auth: false,
cost: 1,
default_params: %{
"symbol" => "BTC-USDT",
"to" => "<generated>"
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"since" => "from",
"timeframe" => "resolution"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/candles",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"status_list" => "[2]"
},
market_type: :spot,
method: :post,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "coin_pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/list_orders",
response_transformer: {:extract_path, ["response_data", "orders"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_order,
param_mappings: %{
"id" => "order_id",
"symbol" => "coin_pair"
},
params: [
:id,
:symbol
],
path: "/get_order",
response_transformer: {:extract_path_unwrap, ["response_data", "order"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"coin" => "BTC"
},
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{},
params: [
:symbol,
:limit
],
path: "/{coin}/orderbook/",
response_transformer: {:extract_path_unwrap, ["response_data"]},
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :fetch_orders,
param_mappings: %{
"symbol" => "coin_pair"
},
params: [
:symbol,
:since,
:limit
],
path: "/list_orders",
response_transformer: {:extract_path, ["response_data", "orders"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"coin" => "BTC"
},
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{},
params: [
:symbol
],
path: "/{coin}/ticker/",
response_transformer: {:extract_path_unwrap, ["ticker"]},
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"coin" => "BTC"
},
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"since" => "from"
},
params: [
:symbol,
:since,
:limit
],
path: "/{coin}/trades/{from}/",
response_transformer: {:extract_path, ["response_data"]},
source: :intercepted
}
],
error_code_details: %{},
error_codes: %{},
exceptions: nil,
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"limits" => %{
"BCH" => 0.001,
"BTC" => 0.001,
"ETH" => 0.01,
"LTC" => 0.01,
"XRP" => 0.1
},
"networksById" => %{}
},
extended_metadata: %{
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://user-images.githubusercontent.com/1294454/27837060-e7c58714-60ea-11e7-9192-f05e86adb83f.jpg"
},
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: true,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: false,
gtd: false,
ioc: false,
po: true
},
trailing: false,
trigger_direction: false,
trigger_price: false
},
fetch_my_trades: %{
days_back: 100000,
margin_mode: false,
symbol_required: true,
until_days: 100000
},
fetch_ohlcv: %{
limit: 1000
},
fetch_open_orders: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false
},
fetch_orders: %{
days_back: 100000,
limit: 500,
margin_mode: false,
symbol_required: true,
trailing: false,
trigger: false,
until_days: 100000
},
sandbox: false
},
swap: %{}
},
fees: %{
trading: %{
maker: 0.003,
taker: 0.007
}
},
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;\n }\n //\n // todo add a unified standard handleErrors with this.exceptions in describe()\n //\n // {\"status\":503,\"message\":\"Maintenancing, try again later\",\"result\":null}\n //\n const errorMessage = this.safeValue(response, 'error_message');\n if (errorMessage !== undefined) {\n throw new errors.ExchangeError(this.id + ' ' + this.json(response));\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: true,
cancel_all_orders: false,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: false,
cancel_orders_with_client_order_id: false,
cancel_orders_ws: false,
close_all_positions: false,
close_position: false,
create_deposit_address: false,
create_limit_buy_order: false,
create_limit_buy_order_ws: false,
create_limit_order: true,
create_limit_order_ws: false,
create_limit_sell_order: false,
create_limit_sell_order_ws: false,
create_market_buy_order: false,
create_market_buy_order_with_cost: false,
create_market_buy_order_with_cost_ws: false,
create_market_buy_order_ws: false,
create_market_order: true,
create_market_order_with_cost: false,
create_market_order_with_cost_ws: false,
create_market_order_ws: true,
create_market_sell_order: false,
create_market_sell_order_with_cost: false,
create_market_sell_order_with_cost_ws: false,
create_market_sell_order_ws: false,
create_order: true,
create_order_with_take_profit_and_stop_loss: false,
create_order_with_take_profit_and_stop_loss_ws: false,
create_order_ws: false,
create_orders: false,
create_post_only_order: false,
create_post_only_order_ws: false,
create_reduce_only_order: false,
create_reduce_only_order_ws: false,
create_stop_limit_order: false,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: false,
create_stop_market_order_ws: false,
create_stop_order: false,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_accounts: false,
fetch_all_greeks: false,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: 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: 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: false,
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_price: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: true,
fetch_my_trades_ws: false,
fetch_ohlcv: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: true,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: false,
fetch_order_with_client_order_id: false,
fetch_order_ws: false,
fetch_orders: 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: false,
fetch_tickers_ws: false,
fetch_time: false,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: false,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: 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: "mercado",
markets: nil,
name: "Mercado Bitcoin",
ohlcv_timestamp_resolution: :seconds,
options: %{
limits: %{
"BCH" => 0.001,
"BTC" => 0.001,
"ETH" => 0.01,
"LTC" => 0.01,
"XRP" => 0.1
}
},
order_mappings: nil,
param_mappings: %{
"amount" => "quantity",
"id" => "order_id",
"price" => "limit_price",
"since" => "from",
"symbol" => "coin_pair",
"timeframe" => "resolution"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 534,
"line_start" => 517,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const data = this.safeValue (response, 'response_data', {});\n const balances = this.safeValue (data, 'balance', {});\n const result: Dict = { 'info': response };\n const currencyIds = Object.keys (balances);\n for (let i = 0; i < currencyIds.length; i++) {\n const currencyId = currencyIds[i];\n const code = this.safeCurrencyCode (currencyId);\n if (currencyId in balances) {\n const balance = this.safeValue (balances, currencyId, {});\n const account = this.account ();\n account['free'] = this.safeString (balance, 'available');\n account['total'] = this.safeString (balance, 'total');\n result[code] = account;\n }\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 862,
"line_start" => 853,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n return [\n this.safeInteger (ohlcv, 0),\n this.safeNumber (ohlcv, 1),\n this.safeNumber (ohlcv, 2),\n this.safeNumber (ohlcv, 3),\n this.safeNumber (ohlcv, 4),\n this.safeNumber (ohlcv, 5),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"order_id\": 4,\n \"coin_pair\": \"BRLBTC\",\n \"order_type\": 1,\n \"status\": 2,\n \"has_fills\": true,\n \"quantity\": \"2.00000000\",\n \"limit_price\": \"900.00000\",\n \"executed_quantity\": \"1.00000000\",\n \"executed_price_avg\": \"900.00000\",\n \"fee\": \"0.00300000\",\n \"created_timestamp\": \"1453838494\",\n \"updated_timestamp\": \"1453838494\",\n \"operations\": [\n {\n \"operation_id\": 1,\n \"quantity\": \"1.00000000\",\n \"price\": \"900.00000\",\n \"fee_rate\": \"0.30\",\n \"executed_timestamp\": \"1453838494\",\n },\n ],\n }"
],
"line_end" => 721,
"line_start" => 651,
"mappings" => [
%{
"comment" => nil,
"key" => "cost",
"value" => "this.safeString (order, 'fee')"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "market['quote']"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "lastTradeTimestamp"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'limit'"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "average"
},
%{
"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" => "rawTrades"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // {\n // \"order_id\": 4,\n // \"coin_pair\": \"BRLBTC\",\n // \"order_type\": 1,\n // \"status\": 2,\n // \"has_fills\": true,\n // \"quantity\": \"2.00000000\",\n // \"limit_price\": \"900.00000\",\n // \"executed_quantity\": \"1.00000000\",\n // \"executed_price_avg\": \"900.00000\",\n // \"fee\": \"0.00300000\",\n // \"created_timestamp\": \"1453838494\",\n // \"updated_timestamp\": \"1453838494\",\n // \"operations\": [\n // {\n // \"operation_id\": 1,\n // \"quantity\": \"1.00000000\",\n // \"price\": \"900.00000\",\n // \"fee_rate\": \"0.30\",\n // \"executed_timestamp\": \"1453838494\",\n // },\n // ],\n // }\n //\n const id = this.safeString (order, 'order_id');\n const order_type = this.safeString (order, 'order_type');\n let side = undefined;\n if ('order_type' in order) {\n side = (order_type === '1') ? 'buy' : 'sell';\n }\n const status = this.parseOrderStatus (this.safeString (order, 'status'));\n const marketId = this.safeString (order, 'coin_pair');\n market = this.safeMarket (marketId, market);\n const timestamp = this.safeTimestamp (order, 'created_timestamp');\n const fee = {\n 'cost': this.safeString (order, 'fee'),\n 'currency': market['quote'],\n };\n const price = this.safeString (order, 'limit_price');\n // price = this.safeNumber (order, 'executed_price_avg', price);\n const average = this.safeString (order, 'executed_price_avg');\n const amount = this.safeString (order, 'quantity');\n const filled = this.safeString (order, 'executed_quantity');\n const lastTradeTimestamp = this.safeTimestamp (order, 'updated_timestamp');\n const rawTrades = this.safeValue (order, 'operations', []);\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': lastTradeTimestamp,\n 'symbol': market['symbol'],\n 'type': 'limit',\n 'timeInForce': undefined,\n 'postOnly': undefined,\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'cost': undefined,\n 'average': average,\n 'amount': amount,\n 'filled': filled,\n 'remaining': undefined,\n 'status': status,\n 'fee': fee,\n 'trades': rawTrades,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 649,
"line_start" => 642,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n '2': 'open',\n '3': 'canceled',\n '4': 'closed',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"high\":\"103.96000000\",\n \"low\":\"95.00000000\",\n \"vol\":\"2227.67806598\",\n \"last\":\"97.91591000\",\n \"buy\":\"95.52760000\",\n \"sell\":\"97.91475000\",\n \"open\":\"99.79955000\",\n \"date\":1643382606\n }"
],
"line_end" => 420,
"line_start" => 382,
"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, 'buy')"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "this.safeString (ticker, 'sell')"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "close",
"value" => "last"
},
%{
"comment" => nil,
"key" => "last",
"value" => "last"
},
%{
"comment" => nil,
"key" => "previousClose",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "change",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "baseVolume",
"value" => "this.safeString (ticker, 'vol')"
},
%{
"comment" => nil,
"key" => "quoteVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "ticker"
}
],
"name" => "parseTicker",
"signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker",
"source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // {\n // \"high\":\"103.96000000\",\n // \"low\":\"95.00000000\",\n // \"vol\":\"2227.67806598\",\n // \"last\":\"97.91591000\",\n // \"buy\":\"95.52760000\",\n // \"sell\":\"97.91475000\",\n // \"open\":\"99.79955000\",\n // \"date\":1643382606\n // }\n //\n const symbol = this.safeSymbol (undefined, market);\n const timestamp = this.safeTimestamp (ticker, 'date');\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, 'buy'),\n 'bidVolume': undefined,\n 'ask': this.safeString (ticker, 'sell'),\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'vol'),\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 486,
"line_start" => 455,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "order",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n const timestamp = this.safeTimestamp2 (trade, 'date', 'executed_timestamp');\n market = this.safeMarket (undefined, market);\n const id = this.safeString2 (trade, 'tid', 'operation_id');\n const type = undefined;\n const side = this.safeString (trade, 'type');\n const price = this.safeString (trade, 'price');\n const amount = this.safeString2 (trade, 'amount', 'quantity');\n const feeCost = this.safeString (trade, 'fee_rate');\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': undefined,\n };\n }\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'order': undefined,\n 'type': type,\n 'side': side,\n 'takerOrMaker': undefined,\n 'price': price,\n 'amount': amount,\n 'cost': undefined,\n 'fee': fee,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": 1,\n \"coin\": \"BRL\",\n \"quantity\": \"300.56\",\n \"net_quantity\": \"291.68\",\n \"fee\": \"8.88\",\n \"account\": \"bco: 341, ag: 1111, cta: 23456-X\",\n \"status\": 1,\n \"created_timestamp\": \"1453912088\",\n \"updated_timestamp\": \"1453912088\"\n }"
],
"line_end" => 851,
"line_start" => 814,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'id')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "address",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "currency['code']"
},
%{
"comment" => nil,
"key" => "status",
"value" => "undefined"
},
%{
"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 // {\n // \"id\": 1,\n // \"coin\": \"BRL\",\n // \"quantity\": \"300.56\",\n // \"net_quantity\": \"291.68\",\n // \"fee\": \"8.88\",\n // \"account\": \"bco: 341, ag: 1111, cta: 23456-X\",\n // \"status\": 1,\n // \"created_timestamp\": \"1453912088\",\n // \"updated_timestamp\": \"1453912088\"\n // }\n //\n currency = this.safeCurrency (undefined, currency);\n return {\n 'id': this.safeString (transaction, 'id'),\n 'txid': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'network': undefined,\n 'addressFrom': undefined,\n 'address': undefined,\n 'addressTo': undefined,\n 'amount': undefined,\n 'type': undefined,\n 'currency': currency['code'],\n 'status': undefined,\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 }"
}
],
path_prefix: "/v3/",
pro: false,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 1000,
period: 1000,
requests: 1,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [],
public: []
},
required_credentials: %{
api_key: true,
password: false,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
confidence: :medium,
pattern: :hmac_sha512_nonce
},
spec_format_version: 1,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: %{
precision_mode: 4,
sample_limits: %{
"amount" => %{},
"cost" => %{},
"price" => %{
"min" => 1.0e-5
}
},
sample_precision: %{
"amount" => 1.0e-8,
"price" => 1.0e-5
},
spot: %{
base: "CAIFT",
base_id: "CAIFT",
case: :upper,
contract: false,
id: "BRLCAIFT",
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{
"min" => 1.0e-5
}
},
maker: 0.003,
precision: %{
"amount" => 1.0e-8,
"price" => 1.0e-5
},
quote: "BRL",
quote_id: "BRL",
separator: "",
symbol: "CAIFT/BRL",
taker: 0.007
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :no_separator_upper,
separator: "",
suffix: nil
}
},
timeframes: %{
"15m" => "15m",
"1M" => "1M",
"1d" => "1d",
"1h" => "1h",
"1w" => "1w",
"3h" => "3h"
},
url_strategy: %{
detected_from: "sign_method",
pattern: :version_slash,
prefix: "/v3/"
},
urls: %{
api: "https://www.mercadobitcoin.net/api",
api_sections: %{
"private" => "https://www.mercadobitcoin.net/tapi",
"public" => "https://www.mercadobitcoin.net/api",
"v4Public" => "https://www.mercadobitcoin.com.br/v4",
"v4PublicNet" => "https://api.mercadobitcoin.net/api/v4"
},
doc: [
"https://www.mercadobitcoin.com.br/api-doc",
"https://www.mercadobitcoin.com.br/trade-api"
],
other: nil,
sandbox: nil,
www: "https://www.mercadobitcoin.com.br"
},
version: "v3",
ws: nil
}