Current section
Files
Jump to
Current section
Files
priv/specs/extracted/coinbaseexchange.exs
# Coinbase Exchange Exchange Specification
#
# Auto-generated by: mix ccxt.extract coinbaseexchange
# 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: [
"US"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"CGLD" => "CELO",
"XBT" => "BTC"
},
dex: false,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 32,
"coveragePercent" => 100,
"enabledMethods" => 34,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
},
%{
"method" => "fetchTransactions",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 2,
"extractableMethods" => 32,
"failures" => []
},
endpoints: [
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :delete,
name: :cancel_all_orders,
param_mappings: %{
"symbol" => "product_id"
},
params: [
:symbol
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :delete,
name: :cancel_order,
param_mappings: %{
"symbol" => "product_id"
},
params: [
:id,
:symbol
],
path: "/orders/{id}",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :create_deposit_address,
param_mappings: %{},
params: [
:code
],
path: "/coinbase-accounts",
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" => "size",
"symbol" => "product_id"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders",
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" => "size",
"symbol" => "product_id"
},
params: [
:symbol,
:side,
:amount,
:price
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :create_order,
param_mappings: %{
"amount" => "size",
"symbol" => "product_id"
},
params: [
:symbol,
:type,
:side,
:amount,
:price
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"product_id" => "BTCUSDT",
"triggerDirection" => "below",
"type" => "limit"
},
market_type: :swap,
method: :post,
name: :create_stop_limit_order,
param_mappings: %{
"amount" => "size",
"triggerPrice" => "stop_price"
},
params: [
:symbol,
:side,
:amount,
:price,
:triggerPrice
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"product_id" => "BTCUSDT",
"triggerDirection" => "below",
"type" => "market"
},
market_type: :swap,
method: :post,
name: :create_stop_market_order,
param_mappings: %{
"amount" => "size",
"triggerPrice" => "stop_price"
},
params: [
:symbol,
:side,
:amount,
:triggerPrice
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"product_id" => "BTCUSDT",
"triggerDirection" => "below"
},
market_type: :swap,
method: :post,
name: :create_stop_order,
param_mappings: %{
"amount" => "size",
"triggerPrice" => "stop_price"
},
params: [
:symbol,
:type,
:side,
:amount,
:price,
:triggerPrice
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_accounts,
param_mappings: %{},
params: [],
path: "/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_balance,
param_mappings: %{},
params: [],
path: "/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"status" => "done"
},
market_type: :spot,
method: :get,
name: :fetch_closed_orders,
param_mappings: %{
"symbol" => "product_id"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_currencies,
param_mappings: %{},
params: [],
path: "/currencies",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposits,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_deposits_withdrawals,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/accounts",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"level" => 2
},
market_type: :spot,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "id"
},
params: [
:symbol,
:limit
],
path: "/products/{id}/book",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ledger,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/accounts",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/products",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_my_trades,
param_mappings: %{
"symbol" => "product_id"
},
params: [
:symbol,
:since,
:limit
],
path: "/fills",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"end" => "<generated>",
"granularity" => 3600,
"start" => "2024-01-01T00:00:00.000Z"
},
market_type: :spot,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"since" => "start",
"symbol" => "id",
"timeframe" => "granularity"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/products/{id}/candles",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_open_orders,
param_mappings: %{
"symbol" => "product_id"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order,
param_mappings: %{},
params: [
:id,
:symbol
],
path: "/orders/{id}",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
default_params: %{
"level" => 2
},
market_type: :spot,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "id"
},
params: [
:symbol,
:limit
],
path: "/products/{id}/book",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_order_trades,
param_mappings: %{
"id" => "order_id"
},
params: [
:id,
:symbol,
:since,
:limit
],
path: "/fills",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
default_params: %{
"status" => "all"
},
market_type: :spot,
method: :get,
name: :fetch_orders,
param_mappings: %{
"symbol" => "product_id"
},
params: [
:symbol,
:since,
:limit
],
path: "/orders",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_ticker,
param_mappings: %{
"symbol" => "id"
},
params: [
:symbol
],
path: "/products/{id}/ticker",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_tickers,
param_mappings: %{},
params: [
:symbols
],
path: "/products/spark-lines",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_time,
param_mappings: %{},
params: [],
path: "/time",
source: :intercepted
},
%{
api_section: "public",
auth: false,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trades,
param_mappings: %{
"symbol" => "id"
},
params: [
:symbol,
:since,
:limit
],
path: "/products/{id}/trades",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_trading_fees,
param_mappings: %{},
params: [],
path: "/fees",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :get,
name: :fetch_withdrawals,
param_mappings: %{},
params: [
:code,
:since,
:limit
],
path: "/accounts",
source: :intercepted
},
%{
api_section: "private",
auth: true,
cost: 1,
market_type: :spot,
method: :post,
name: :withdraw,
param_mappings: %{
"address" => "crypto_address",
"code" => "currency"
},
params: [
:code,
:amount,
:address,
:tag
],
path: "/withdrawals/crypto",
source: :intercepted
}
],
error_code_details: %{
"Cancel only mode" => %{
description: "https://github.com/ccxt/ccxt/issues/7690",
type: :network_error
},
"Insufficient funds" => %{
description: nil,
type: :insufficient_balance
},
"Invalid API Key" => %{
description: nil,
type: :invalid_credentials
},
"Invalid Passphrase" => %{
description: nil,
type: :invalid_credentials
},
"Invalid order id" => %{
description: nil,
type: :invalid_order
},
"NotFound" => %{
description: nil,
type: :order_not_found
},
"Order already done" => %{
description: nil,
type: :order_not_found
},
"Private rate limit exceeded" => %{
description: nil,
type: :rate_limited
},
"Product not found" => %{
description: nil,
type: :invalid_order
},
"Trading pair not available" => %{
description: nil,
type: :access_restricted
},
"invalid signature" => %{
description: nil,
type: :invalid_credentials
},
"order not found" => %{
description: nil,
type: :order_not_found
},
"price too precise" => %{
description: nil,
type: :invalid_order
},
"price too small" => %{
description: nil,
type: :invalid_order
},
"size is too small" => %{
description: nil,
type: :invalid_order
},
"under maintenance" => %{
description: nil,
type: :network_error
}
},
error_codes: %{
"Cancel only mode" => :network_error,
"Insufficient funds" => :insufficient_balance,
"Invalid API Key" => :invalid_credentials,
"Invalid Passphrase" => :invalid_credentials,
"Invalid order id" => :invalid_order,
"NotFound" => :order_not_found,
"Order already done" => :order_not_found,
"Private rate limit exceeded" => :rate_limited,
"Product not found" => :invalid_order,
"Trading pair not available" => :access_restricted,
"invalid signature" => :invalid_credentials,
"order not found" => :order_not_found,
"price too precise" => :invalid_order,
"price too small" => :invalid_order,
"size is too small" => :invalid_order,
"under maintenance" => :network_error
},
exceptions: %{
broad: %{
"Cancel only mode" => :on_maintenance,
"Order already done" => :order_not_found,
"order not found" => :order_not_found,
"price too precise" => :invalid_order,
"price too small" => :invalid_order,
"size is too small" => :invalid_order,
"under maintenance" => :on_maintenance
},
exact: %{
"Insufficient funds" => :insufficient_funds,
"Invalid API Key" => :authentication_error,
"Invalid Passphrase" => :authentication_error,
"Invalid order id" => :invalid_order,
"NotFound" => :order_not_found,
"Private rate limit exceeded" => :rate_limit_exceeded,
"Product not found" => :invalid_order,
"Trading pair not available" => :permission_denied,
"invalid signature" => :authentication_error
}
},
exchange_options: %{
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"networks" => %{
"ADA" => "cardano",
"ALGO" => "algorand",
"APT" => "aptos",
"ARBONE" => "arbitrum",
"ATOM" => "cosmos",
"AVAXC" => "avacchain",
"BASE" => "base",
"BLAST" => "blast",
"BTC" => "bitcoin",
"CELO" => "celo",
"CORE" => "coredao",
"DASH" => "dash",
"DOGE" => "dogecoin",
"DOT" => "polkadot",
"EGLD" => "elrond",
"ETH" => "ethereum",
"FIL" => "filecoin",
"HBAR" => "hedera",
"KAVA" => "kava",
"LTC" => "litecoin",
"MATIC" => "polygon",
"NEAR" => "near",
"OP" => "optimism",
"OSMO" => "osmosis",
"SEI" => "sei",
"SOL" => "solana",
"STX" => "stacks",
"SUI" => "sui",
"XLM" => "stellar",
"XRP" => "ripple",
"XTZ" => "tezos",
"ZKSYNC" => "zksync"
},
"networksById" => %{
"algorand" => "ALGO",
"aptos" => "APT",
"arbitrum" => "ARBONE",
"avacchain" => "AVAXC",
"base" => "BASE",
"bitcoin" => "BTC",
"blast" => "BLAST",
"cardano" => "ADA",
"celo" => "CELO",
"coredao" => "CORE",
"cosmos" => "ATOM",
"dash" => "DASH",
"dogecoin" => "DOGE",
"elrond" => "EGLD",
"ethereum" => "ETH",
"filecoin" => "FIL",
"hedera" => "HBAR",
"kava" => "KAVA",
"litecoin" => "LTC",
"near" => "NEAR",
"optimism" => "OP",
"osmosis" => "OSMO",
"polkadot" => "DOT",
"polygon" => "MATIC",
"ripple" => "XRP",
"sei" => "SEI",
"solana" => "SOL",
"stacks" => "STX",
"stellar" => "XLM",
"sui" => "SUI",
"tezos" => "XTZ",
"zksync" => "ZKSYNC"
}
},
extended_metadata: %{
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/ccxt/ccxt/assets/43336371/34a65553-88aa-4a38-a714-064bd228b97e"
},
extracted_metadata: %{
ccxt_version: "4.5.34"
},
features: %{
default: %{
create_order: %{
hedged: false,
iceberg: true,
leverage: false,
margin_mode: true,
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: true,
ioc: true,
po: true
},
trailing: false,
trigger_direction: false,
trigger_price: true
},
fetch_closed_orders: %{
days_back: 100000,
days_back_canceled: 1,
limit: 100,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false,
until_days: 100000
},
fetch_my_trades: %{
days_back: 100000,
limit: 100,
margin_mode: false,
symbol_required: true,
until_days: 100000
},
fetch_ohlcv: %{
limit: 300
},
fetch_open_orders: %{
limit: 100,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false
},
fetch_orders: %{
days_back: 100000,
limit: 100,
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: false,
until_days: 100000
},
sandbox: true
},
future: %{},
spot: %{
extends: "default"
},
swap: %{}
},
fees: %{
funding: %{
deposit: %{
"BCH" => 0,
"BTC" => 0,
"ETH" => 0,
"EUR" => 0.15,
"LTC" => 0,
"USD" => 10
},
percentage: false,
tier_based: false,
withdraw: %{
"BCH" => 0,
"BTC" => 0,
"ETH" => 0,
"EUR" => 0.15,
"LTC" => 0,
"USD" => 25
}
},
trading: %{
maker: 0.004,
percentage: true,
taker: 0.006,
tier_based: true
}
},
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if ((code === 400) || (code === 404)) {\n if (body[0] === '{') {\n const message = this.safeString(response, 'message');\n const feedback = this.id + ' ' + message;\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\n }\n throw new errors.ExchangeError(this.id + ' ' + body);\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: true,
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: true,
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: true,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: true,
create_stop_market_order_ws: false,
create_stop_order: true,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: 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: true,
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: 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: true,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: true,
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,
repay_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: true,
watch_my_trades_for_symbols: true,
watch_ohlcv: false,
watch_ohlcv_for_symbols: false,
watch_order_book: true,
watch_order_book_for_symbols: true,
watch_orders: true,
watch_orders_for_symbols: true,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: true,
watch_tickers: true,
watch_trades: true,
watch_trades_for_symbols: true,
withdraw: true,
ws: false
},
http_config: %{
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"
},
id: "coinbaseexchange",
markets: nil,
name: "Coinbase Exchange",
ohlcv_timestamp_resolution: :unknown,
options: %{
networks: %{
"ADA" => "cardano",
"ALGO" => "algorand",
"APT" => "aptos",
"ARBONE" => "arbitrum",
"ATOM" => "cosmos",
"AVAXC" => "avacchain",
"BASE" => "base",
"BLAST" => "blast",
"BTC" => "bitcoin",
"CELO" => "celo",
"CORE" => "coredao",
"DASH" => "dash",
"DOGE" => "dogecoin",
"DOT" => "polkadot",
"EGLD" => "elrond",
"ETH" => "ethereum",
"FIL" => "filecoin",
"HBAR" => "hedera",
"KAVA" => "kava",
"LTC" => "litecoin",
"MATIC" => "polygon",
"NEAR" => "near",
"OP" => "optimism",
"OSMO" => "osmosis",
"SEI" => "sei",
"SOL" => "solana",
"STX" => "stacks",
"SUI" => "sui",
"XLM" => "stellar",
"XRP" => "ripple",
"XTZ" => "tezos",
"ZKSYNC" => "zksync"
}
},
order_mappings: %{
side_format: :lowercase,
side_key: "side",
type_format: :lowercase,
type_key: "type"
},
param_mappings: %{
"address" => "crypto_address",
"amount" => "size",
"code" => "currency",
"id" => "order_id",
"since" => "start",
"symbol" => "id",
"timeframe" => "granularity",
"triggerPrice" => "stop_price"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"4aac9c60-cbda-4396-9da4-4aa71e95fba0\",\n \"currency\": \"BTC\",\n \"balance\": \"0.0000000000000000\",\n \"available\": \"0\",\n \"hold\": \"0.0000000000000000\",\n \"profile_id\": \"b709263e-f42a-4c7d-949a-a95c83d065da\"\n }"
],
"line_end" => 750,
"line_start" => 732,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (account, 'id')"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "code",
"value" => "this.safeCurrencyCode (currencyId)"
},
%{
"comment" => nil,
"key" => "info",
"value" => "account"
}
],
"name" => "parseAccount",
"signature" => "parseAccount (account)",
"source" => "parseAccount (account) {\n //\n // {\n // \"id\": \"4aac9c60-cbda-4396-9da4-4aa71e95fba0\",\n // \"currency\": \"BTC\",\n // \"balance\": \"0.0000000000000000\",\n // \"available\": \"0\",\n // \"hold\": \"0.0000000000000000\",\n // \"profile_id\": \"b709263e-f42a-4c7d-949a-a95c83d065da\"\n // }\n //\n const currencyId = this.safeString (account, 'currency');\n return {\n 'id': this.safeString (account, 'id'),\n 'type': undefined,\n 'code': this.safeCurrencyCode (currencyId),\n 'info': account,\n };\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 765,
"line_start" => 752,
"mappings" => [],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const result: Dict = { 'info': response };\n for (let i = 0; i < response.length; i++) {\n const balance = response[i];\n const currencyId = this.safeString (balance, 'currency');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['free'] = this.safeString (balance, 'available');\n account['used'] = this.safeString (balance, 'hold');\n account['total'] = this.safeString (balance, 'balance');\n result[code] = account;\n }\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"12087495079\",\n \"amount\": \"-0.0100000000000000\",\n \"balance\": \"0.0645419900000000\",\n \"created_at\": \"2021-10-28T17:14:32.593168Z\",\n \"type\": \"transfer\",\n \"details\": {\n \"from\": \"2f74edf7-1440-4586-86dc-ae58c5693691\",\n \"profile_transfer_id\": \"3ef093ad-2482-40d1-8ede-2f89cff5099e\",\n \"to\": \"dda99503-4980-4b60-9549-0b770ee51336\"\n }\n },",
"{\n \"id\": \"11740725774\",\n \"amount\": \"-1.7565669701255000\",\n \"balance\": \"0.0016490047745000\",\n \"created_at\": \"2021-10-22T03:47:34.764122Z\",\n \"type\": \"fee\",\n \"details\": {\n \"order_id\": \"ad06abf4-95ab-432a-a1d8-059ef572e296\",\n \"product_id\": \"ETH-DAI\",\n \"trade_id\": \"1740617\"\n }\n }"
],
"line_end" => 1773,
"line_start" => 1702,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "item"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "direction",
"value" => "direction"
},
%{
"comment" => nil,
"key" => "account",
"value" => "account"
},
%{
"comment" => nil,
"key" => "referenceAccount",
"value" => "referenceAccount"
},
%{
"comment" => nil,
"key" => "referenceId",
"value" => "referenceId"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "before",
"value" => "before"
},
%{
"comment" => nil,
"key" => "after",
"value" => "after"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseLedgerEntry",
"signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
"source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n // {\n // \"id\": \"12087495079\",\n // \"amount\": \"-0.0100000000000000\",\n // \"balance\": \"0.0645419900000000\",\n // \"created_at\": \"2021-10-28T17:14:32.593168Z\",\n // \"type\": \"transfer\",\n // \"details\": {\n // \"from\": \"2f74edf7-1440-4586-86dc-ae58c5693691\",\n // \"profile_transfer_id\": \"3ef093ad-2482-40d1-8ede-2f89cff5099e\",\n // \"to\": \"dda99503-4980-4b60-9549-0b770ee51336\"\n // }\n // },\n // {\n // \"id\": \"11740725774\",\n // \"amount\": \"-1.7565669701255000\",\n // \"balance\": \"0.0016490047745000\",\n // \"created_at\": \"2021-10-22T03:47:34.764122Z\",\n // \"type\": \"fee\",\n // \"details\": {\n // \"order_id\": \"ad06abf4-95ab-432a-a1d8-059ef572e296\",\n // \"product_id\": \"ETH-DAI\",\n // \"trade_id\": \"1740617\"\n // }\n // }\n const id = this.safeString (item, 'id');\n let amountString = this.safeString (item, 'amount');\n let direction = undefined;\n const afterString = this.safeString (item, 'balance');\n const beforeString = Precise.stringSub (afterString, amountString);\n if (Precise.stringLt (amountString, '0')) {\n direction = 'out';\n amountString = Precise.stringAbs (amountString);\n } else {\n direction = 'in';\n }\n const amount = this.parseNumber (amountString);\n const after = this.parseNumber (afterString);\n const before = this.parseNumber (beforeString);\n const timestamp = this.parse8601 (this.safeValue (item, 'created_at'));\n const type = this.parseLedgerEntryType (this.safeString (item, 'type'));\n const code = this.safeCurrencyCode (undefined, currency);\n const details = this.safeValue (item, 'details', {});\n let account = undefined;\n let referenceAccount = undefined;\n let referenceId = undefined;\n if (type === 'transfer') {\n account = this.safeString (details, 'from');\n referenceAccount = this.safeString (details, 'to');\n referenceId = this.safeString (details, 'profile_transfer_id');\n } else {\n referenceId = this.safeString (details, 'order_id');\n }\n const status = 'ok';\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': id,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'direction': direction,\n 'account': account,\n 'referenceAccount': referenceAccount,\n 'referenceId': referenceId,\n 'type': type,\n 'currency': code,\n 'amount': amount,\n 'before': before,\n 'after': after,\n 'status': status,\n 'fee': undefined,\n }, currency) as LedgerEntry;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1700,
"line_start" => 1691,
"mappings" => [],
"name" => "parseLedgerEntryType",
"signature" => "parseLedgerEntryType (type)",
"source" => "parseLedgerEntryType (type) {\n const types: Dict = {\n 'transfer': 'transfer', // Funds moved between portfolios\n 'match': 'trade', // Funds moved as a result of a trade\n 'fee': 'fee', // Fee as a result of a trade\n 'rebate': 'rebate', // Fee rebate\n 'conversion': 'trade', // Funds converted between fiat currency and a stablecoin\n };\n return this.safeString (types, type, type);\n }"
},
%{
"comment" => nil,
"examples" => [
"[\n 1591514160,\n 0.02507,\n 0.02507,\n 0.02507,\n 0.02507,\n 0.02816506\n ]"
],
"line_end" => 1197,
"line_start" => 1178,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // [\n // 1591514160,\n // 0.02507,\n // 0.02507,\n // 0.02507,\n // 0.02507,\n // 0.02816506\n // ]\n //\n return [\n this.safeTimestamp (ohlcv, 0),\n this.safeNumber (ohlcv, 3),\n this.safeNumber (ohlcv, 2),\n this.safeNumber (ohlcv, 1),\n this.safeNumber (ohlcv, 4),\n this.safeNumber (ohlcv, 5),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"d0c5340b-6d6c-49d9-b567-48c4bfca13d2\",\n \"price\": \"0.10000000\",\n \"size\": \"0.01000000\",\n \"product_id\": \"BTC-USD\",\n \"side\": \"buy\",\n \"stp\": \"dc\",\n \"type\": \"limit\",\n \"time_in_force\": \"GTC\",\n \"post_only\": false,\n \"created_at\": \"2016-12-08T20:02:28.53864Z\",\n \"fill_fees\": \"0.0000000000000000\",\n \"filled_size\": \"0.00000000\",\n \"executed_value\": \"0.0000000000000000\",\n \"status\": \"pending\",\n \"settled\": false\n }"
],
"line_end" => 1365,
"line_start" => 1292,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "clientOrderId"
},
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "market['symbol']"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "timeInForce"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "postOnly"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "triggerPrice"
},
%{
"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" => "fee",
"value" => "fee"
},
%{
"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 // createOrder\n //\n // {\n // \"id\": \"d0c5340b-6d6c-49d9-b567-48c4bfca13d2\",\n // \"price\": \"0.10000000\",\n // \"size\": \"0.01000000\",\n // \"product_id\": \"BTC-USD\",\n // \"side\": \"buy\",\n // \"stp\": \"dc\",\n // \"type\": \"limit\",\n // \"time_in_force\": \"GTC\",\n // \"post_only\": false,\n // \"created_at\": \"2016-12-08T20:02:28.53864Z\",\n // \"fill_fees\": \"0.0000000000000000\",\n // \"filled_size\": \"0.00000000\",\n // \"executed_value\": \"0.0000000000000000\",\n // \"status\": \"pending\",\n // \"settled\": false\n // }\n //\n const timestamp = this.parse8601 (this.safeString (order, 'created_at'));\n const marketId = this.safeString (order, 'product_id');\n market = this.safeMarket (marketId, market, '-');\n let status = this.parseOrderStatus (this.safeString (order, 'status'));\n const doneReason = this.safeString (order, 'done_reason');\n if ((status === 'closed') && (doneReason === 'canceled')) {\n status = 'canceled';\n }\n const price = this.safeString (order, 'price');\n const filled = this.safeString (order, 'filled_size');\n const amount = this.safeString (order, 'size', filled);\n const cost = this.safeString (order, 'executed_value');\n const feeCost = this.safeNumber (order, 'fill_fees');\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': market['quote'],\n 'rate': undefined,\n };\n }\n const id = this.safeString (order, 'id');\n const type = this.safeString (order, 'type');\n const side = this.safeString (order, 'side');\n const timeInForce = this.safeString (order, 'time_in_force');\n const postOnly = this.safeValue (order, 'post_only');\n const triggerPrice = this.safeNumber (order, 'stop_price');\n const clientOrderId = this.safeString (order, 'client_oid');\n return this.safeOrder ({\n 'id': id,\n 'clientOrderId': clientOrderId,\n 'info': order,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'status': status,\n 'symbol': market['symbol'],\n 'type': type,\n 'timeInForce': timeInForce,\n 'postOnly': postOnly,\n 'side': side,\n 'price': price,\n 'triggerPrice': triggerPrice,\n 'cost': cost,\n 'amount': amount,\n 'filled': filled,\n 'remaining': undefined,\n 'fee': fee,\n 'average': undefined,\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1290,
"line_start" => 1280,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'pending': 'open',\n 'active': 'open',\n 'open': 'open',\n 'done': 'closed',\n 'canceled': 'canceled',\n 'canceling': 'open',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [
"[\n 1639472400, // timestamp\n 4.26, // low\n 4.38, // high\n 4.35, // open\n 4.27 // close\n ]",
"{\n \"trade_id\":843439,\n \"price\":\"0.997999\",\n \"size\":\"80.29769\",\n \"time\":\"2020-01-28T02:13:33.012523Z\",\n \"bid\":\"0.997094\",\n \"ask\":\"0.998\",\n \"volume\":\"1903188.03750000\"\n }",
"{\n \"open\": \"34.19000000\",\n \"high\": \"95.70000000\",\n \"low\": \"7.06000000\",\n \"volume\": \"2.41000000\"\n }"
],
"line_end" => 900,
"line_start" => 821,
"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" => "high"
},
%{
"comment" => nil,
"key" => "low",
"value" => "low"
},
%{
"comment" => nil,
"key" => "bid",
"value" => "bid"
},
%{
"comment" => nil,
"key" => "bidVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "ask",
"value" => "ask"
},
%{
"comment" => nil,
"key" => "askVolume",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "vwap",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "open",
"value" => "open"
},
%{
"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" => "volume"
},
%{
"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 // fetchTickers\n //\n // [\n // 1639472400, // timestamp\n // 4.26, // low\n // 4.38, // high\n // 4.35, // open\n // 4.27 // close\n // ]\n //\n // fetchTicker\n //\n // publicGetProductsIdTicker\n //\n // {\n // \"trade_id\":843439,\n // \"price\":\"0.997999\",\n // \"size\":\"80.29769\",\n // \"time\":\"2020-01-28T02:13:33.012523Z\",\n // \"bid\":\"0.997094\",\n // \"ask\":\"0.998\",\n // \"volume\":\"1903188.03750000\"\n // }\n //\n // publicGetProductsIdStats\n //\n // {\n // \"open\": \"34.19000000\",\n // \"high\": \"95.70000000\",\n // \"low\": \"7.06000000\",\n // \"volume\": \"2.41000000\"\n // }\n //\n let timestamp = undefined;\n let bid = undefined;\n let ask = undefined;\n let last = undefined;\n let high = undefined;\n let low = undefined;\n let open = undefined;\n let volume = undefined;\n const symbol = (market === undefined) ? undefined : market['symbol'];\n if (Array.isArray (ticker)) {\n last = this.safeString (ticker, 4);\n timestamp = this.milliseconds ();\n } else {\n timestamp = this.parse8601 (this.safeValue (ticker, 'time'));\n bid = this.safeString (ticker, 'bid');\n ask = this.safeString (ticker, 'ask');\n high = this.safeString (ticker, 'high');\n low = this.safeString (ticker, 'low');\n open = this.safeString (ticker, 'open');\n last = this.safeString2 (ticker, 'price', 'last');\n volume = this.safeString (ticker, 'volume');\n }\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': high,\n 'low': low,\n 'bid': bid,\n 'bidVolume': undefined,\n 'ask': ask,\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': open,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': volume,\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"type\": \"match\",\n \"trade_id\": 82047307,\n \"maker_order_id\": \"0f358725-2134-435e-be11-753912a326e0\",\n \"taker_order_id\": \"252b7002-87a3-425c-ac73-f5b9e23f3caf\",\n \"order_id\": \"d50ec984-77a8-460a-b958-66f114b0de9b\",\n \"side\": \"sell\",\n \"size\": \"0.00513192\",\n \"price\": \"9314.78\",\n \"product_id\": \"BTC-USD\",\n \"profile_id\": \"6244401d-c078-40d9-b305-7ad3551bc3b0\",\n \"sequence\": 12038915443,\n \"time\": \"2020-01-31T20:03:41.158814Z\"\n \"created_at\": \"2014-11-07T22:19:28.578544Z\",\n \"liquidity\": \"T\",\n \"fee\": \"0.00025\",\n \"settled\": true,\n \"usd_volume\": \"0.0924556000000000\",\n \"user_id\": \"595eb864313c2b02ddf2937d\"\n }"
],
"line_end" => 1064,
"line_start" => 993,
"mappings" => [
%{
"comment" => nil,
"key" => "cost",
"value" => "feeCost"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "market['quote']"
},
%{
"comment" => nil,
"key" => "rate",
"value" => "feeRate"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "order",
"value" => "orderId"
},
%{
"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" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "takerOrMaker"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "cost"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // {\n // \"type\": \"match\",\n // \"trade_id\": 82047307,\n // \"maker_order_id\": \"0f358725-2134-435e-be11-753912a326e0\",\n // \"taker_order_id\": \"252b7002-87a3-425c-ac73-f5b9e23f3caf\",\n // \"order_id\": \"d50ec984-77a8-460a-b958-66f114b0de9b\",\n // \"side\": \"sell\",\n // \"size\": \"0.00513192\",\n // \"price\": \"9314.78\",\n // \"product_id\": \"BTC-USD\",\n // \"profile_id\": \"6244401d-c078-40d9-b305-7ad3551bc3b0\",\n // \"sequence\": 12038915443,\n // \"time\": \"2020-01-31T20:03:41.158814Z\"\n // \"created_at\": \"2014-11-07T22:19:28.578544Z\",\n // \"liquidity\": \"T\",\n // \"fee\": \"0.00025\",\n // \"settled\": true,\n // \"usd_volume\": \"0.0924556000000000\",\n // \"user_id\": \"595eb864313c2b02ddf2937d\"\n // }\n //\n const timestamp = this.parse8601 (this.safeString2 (trade, 'time', 'created_at'));\n const marketId = this.safeString (trade, 'product_id');\n market = this.safeMarket (marketId, market, '-');\n let feeRate = undefined;\n let takerOrMaker = undefined;\n let cost = undefined;\n const feeCurrencyId = this.safeStringLower (market, 'quoteId');\n if (feeCurrencyId !== undefined) {\n const costField = feeCurrencyId + '_value';\n cost = this.safeString (trade, costField);\n const liquidity = this.safeString (trade, 'liquidity');\n if (liquidity !== undefined) {\n takerOrMaker = (liquidity === 'T') ? 'taker' : 'maker';\n feeRate = this.safeString (market, takerOrMaker);\n }\n }\n const feeCost = this.safeString2 (trade, 'fill_fees', 'fee');\n const fee = {\n 'cost': feeCost,\n 'currency': market['quote'],\n 'rate': feeRate,\n };\n const id = this.safeString (trade, 'trade_id');\n let side = (trade['side'] === 'buy') ? 'sell' : 'buy';\n const orderId = this.safeString (trade, 'order_id');\n // Coinbase Pro returns inverted side to fetchMyTrades vs fetchTrades\n const makerOrderId = this.safeString (trade, 'maker_order_id');\n const takerOrderId = this.safeString (trade, 'taker_order_id');\n if ((orderId !== undefined) || ((makerOrderId !== undefined) && (takerOrderId !== undefined))) {\n side = (trade['side'] === 'buy') ? 'buy' : 'sell';\n }\n const price = this.safeString (trade, 'price');\n const amount = this.safeString (trade, 'size');\n return this.safeTrade ({\n 'id': id,\n 'order': orderId,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'type': undefined,\n 'takerOrMaker': takerOrMaker,\n 'side': side,\n 'price': price,\n 'amount': amount,\n 'fee': fee,\n 'cost': cost,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"[\n {\n \"id\": \"bee6fd7c-afb2-4e47-8298-671d09997d16\",\n \"type\": \"deposit\",\n \"created_at\": \"2022-12-21 00:48:45.477503+00\",\n \"completed_at\": null,\n \"account_id\": \"sal3802-36bd-46be-a7b8-alsjf383sldak\", // only from privateGetTransfers\n \"user_id\": \"6382048209f92as392039dlks2\", // only from privateGetTransfers\n \"amount\": \"0.01000000\",\n \"details\": {\n \"network\": \"litecoin\",\n \"crypto_address\": \"MKemtnCFUYKsNWaf5EMYMpwSszcXWFDtTY\",\n \"coinbase_account_id\": \"fl2b6925-f6ba-403n-jj03-40fl435n430f\",\n \"coinbase_transaction_id\": \"63a25bb13cb5cf0001d2cf17\", // withdrawals only\n \"crypto_transaction_hash\": \"752f35570736341e2a253f7041a34cf1e196fc56128c900fd03d99da899d94c1\",\n \"tx_service_transaction_id\": \"1873249104\",\n \"coinbase_payment_method_id\": \"\"\n },\n \"canceled_at\": null,\n \"processed_at\": null,\n \"user_nonce\": null,\n \"idem\": \"5e3201b0-e390-5k3k-a913-c32932049242\",\n \"profile_id\": \"k3k302a8-c4dk-4f49-9d39-3203923wpk39\",\n \"currency\": \"LTC\"\n }\n ]"
],
"line_end" => 2062,
"line_start" => 1983,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (transaction, 'id')"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "this.safeString (details, 'crypto_transaction_hash')"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "network",
"value" => "this.networkIdToCode (networkId)"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "status",
"value" => "this.parseTransactionStatus (transaction)"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "address",
"value" => "address"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "this.safeString (details, 'crypto_address')"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "this.safeString (details, 'destination_tag')"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "this.parse8601 (this.safeString (transaction, 'processed_at'))"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "false"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "fee"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "rate",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "feeCost"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // privateGetTransfers\n //\n // [\n // {\n // \"id\": \"bee6fd7c-afb2-4e47-8298-671d09997d16\",\n // \"type\": \"deposit\",\n // \"created_at\": \"2022-12-21 00:48:45.477503+00\",\n // \"completed_at\": null,\n // \"account_id\": \"sal3802-36bd-46be-a7b8-alsjf383sldak\", // only from privateGetTransfers\n // \"user_id\": \"6382048209f92as392039dlks2\", // only from privateGetTransfers\n // \"amount\": \"0.01000000\",\n // \"details\": {\n // \"network\": \"litecoin\",\n // \"crypto_address\": \"MKemtnCFUYKsNWaf5EMYMpwSszcXWFDtTY\",\n // \"coinbase_account_id\": \"fl2b6925-f6ba-403n-jj03-40fl435n430f\",\n // \"coinbase_transaction_id\": \"63a25bb13cb5cf0001d2cf17\", // withdrawals only\n // \"crypto_transaction_hash\": \"752f35570736341e2a253f7041a34cf1e196fc56128c900fd03d99da899d94c1\",\n // \"tx_service_transaction_id\": \"1873249104\",\n // \"coinbase_payment_method_id\": \"\"\n // },\n // \"canceled_at\": null,\n // \"processed_at\": null,\n // \"user_nonce\": null,\n // \"idem\": \"5e3201b0-e390-5k3k-a913-c32932049242\",\n // \"profile_id\": \"k3k302a8-c4dk-4f49-9d39-3203923wpk39\",\n // \"currency\": \"LTC\"\n // }\n // ]\n //\n const details = this.safeValue (transaction, 'details', {});\n const timestamp = this.parse8601 (this.safeString (transaction, 'created_at'));\n const currencyId = this.safeString (transaction, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n let amount = this.safeNumber (transaction, 'amount');\n let type = this.safeString (transaction, 'type');\n let address = this.safeString (details, 'crypto_address');\n address = this.safeString (transaction, 'crypto_address', address);\n const fee = {\n 'currency': undefined,\n 'cost': undefined,\n 'rate': undefined,\n };\n if (type === 'withdraw') {\n type = 'withdrawal';\n address = this.safeString (details, 'sent_to_address', address);\n const feeCost = this.safeNumber (details, 'fee');\n if (feeCost !== undefined) {\n if (amount !== undefined) {\n amount -= feeCost;\n }\n fee['cost'] = feeCost;\n fee['currency'] = code;\n }\n }\n const networkId = this.safeString (details, 'network');\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'id'),\n 'txid': this.safeString (details, 'crypto_transaction_hash'),\n 'type': type,\n 'currency': code,\n 'network': this.networkIdToCode (networkId),\n 'amount': amount,\n 'status': this.parseTransactionStatus (transaction),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': address,\n 'addressFrom': undefined,\n 'addressTo': this.safeString (details, 'crypto_address'),\n 'tag': this.safeString (details, 'destination_tag'),\n 'tagFrom': undefined,\n 'tagTo': undefined,\n 'updated': this.parse8601 (this.safeString (transaction, 'processed_at')),\n 'comment': undefined,\n 'internal': false,\n 'fee': fee,\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1981,
"line_start" => 1967,
"mappings" => [],
"name" => "parseTransactionStatus",
"signature" => "parseTransactionStatus (transaction)",
"source" => "parseTransactionStatus (transaction) {\n const canceled = this.safeValue (transaction, 'canceled_at');\n if (canceled) {\n return 'canceled';\n }\n const processed = this.safeValue (transaction, 'processed_at');\n const completed = this.safeValue (transaction, 'completed_at');\n if (completed) {\n return 'ok';\n } else if (processed && !completed) {\n return 'failed';\n } else {\n return 'pending';\n }\n }"
}
],
path_prefix: "",
pro: true,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 100,
period: 1000,
requests: 10,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [],
public: []
},
required_credentials: %{
api_key: true,
password: true,
secret: true,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
api_key_header: "ACCESS-KEY",
confidence: :high,
has_passphrase: true,
passphrase_header: "ACCESS-PASSPHRASE",
pattern: :hmac_sha256_passphrase_signed,
signature_encoding: :base64,
signature_header: "ACCESS-SIGN",
timestamp_header: "ACCESS-TIMESTAMP"
},
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" => %{
"min" => 1
},
"price" => %{}
},
sample_precision: %{
"amount" => 0.01,
"price" => 1.0e-5
},
spot: %{
base: "W",
base_id: "W",
case: :upper,
contract: false,
id: "W-USD",
limits: %{
"amount" => %{},
"cost" => %{
"min" => 1
},
"leverage" => %{},
"price" => %{}
},
maker: 0.004,
precision: %{
"amount" => 0.01,
"price" => 1.0e-5
},
quote: "USD",
quote_id: "USD",
separator: "-",
symbol: "W/USD",
taker: 0.006
}
},
symbol_patterns: %{
spot: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :dash_upper,
separator: "-",
suffix: nil
}
},
timeframes: %{
"15m" => 900,
"1d" => 86400,
"1h" => 3600,
"1m" => 60,
"5m" => 300,
"6h" => 21600
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://api.exchange.coinbase.com",
api_sections: %{
"private" => "https://api.exchange.coinbase.com",
"public" => "https://api.exchange.coinbase.com"
},
doc: "https://docs.cloud.coinbase.com/exchange/docs/",
other: nil,
sandbox: %{
"private" => "https://api-public.sandbox.exchange.coinbase.com",
"public" => "https://api-public.sandbox.exchange.coinbase.com"
},
www: "https://coinbase.com/"
},
version: nil,
ws: %{
auth: %{
algorithm: :sha256,
encoding: :base64,
market_specific: false,
message_format: :inline,
pattern: :inline_subscribe,
payload_format: "custom",
requires_passphrase: true,
timestamp_unit: :milliseconds
},
channel_templates: %{
watch_my_trades: %{
auth_required: true,
channel_name: "user",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_my_trades_for_symbols: %{
auth_required: true,
channel_name: "user",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_order_book: %{
auth_required: true,
channel_name: "level2",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_order_book_for_symbols: %{
auth_required: true,
channel_name: "level2",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_orders: %{
auth_required: true,
channel_name: "user",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_orders_for_symbols: %{
auth_required: true,
channel_name: "user",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_ticker: %{
channel_name: "ticker",
market_id_format: :native,
params: [],
pattern: :type_subscribe
},
watch_tickers: %{
channel_name: "ticker",
market_id_format: :native,
params: [],
pattern: :type_subscribe
},
watch_trades: %{
channel_name: "matches",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
},
watch_trades_for_symbols: %{
channel_name: "matches",
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_subscribe
}
},
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: true,
watch_my_trades_for_symbols: true,
watch_ohlcv: false,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: true,
watch_orders: true,
watch_orders_for_symbols: true,
watch_position: nil,
watch_positions: nil,
watch_status: false,
watch_ticker: true,
watch_tickers: true,
watch_trades: true,
watch_trades_for_symbols: true
},
hostname: "exchange.coinbase.com",
message_patterns: [
%{
args_field: "channels",
format: :type,
keys: [
"channels",
"product_ids",
"type"
],
kind_field: "type",
kind_value: "subscribe",
sources: [
:send,
:watch,
:watch_multiple
]
}
],
subscription_config: %{
args_field: "product_ids",
args_format: :string_list,
channels_field: "channels",
market_id_format: :native,
op_field: "type"
},
subscription_pattern: :type_subscribe,
test_urls: "wss://ws-feed-public.sandbox.exchange.coinbase.com",
urls: "wss://ws-feed.exchange.coinbase.com",
watch_methods: [
"watchMyTrades",
"watchMyTradesForSymbols",
"watchOrderBook",
"watchOrderBookForSymbols",
"watchOrders",
"watchOrdersForSymbols",
"watchTicker",
"watchTickers",
"watchTrades",
"watchTradesForSymbols"
]
}
}