## coinbase{docsify-ignore} **Kind**: global class **Extends**: Exchange * [fetchTime](#fetchtime) * [fetchAccounts](#fetchaccounts) * [fetchPortfolios](#fetchportfolios) * [createDepositAddress](#createdepositaddress) * [fetchWithdrawals](#fetchwithdrawals) * [fetchDeposits](#fetchdeposits) * [fetchMarkets](#fetchmarkets) * [fetchCurrencies](#fetchcurrencies) * [fetchTickers](#fetchtickers) * [fetchTicker](#fetchticker) * [fetchBalance](#fetchbalance) * [fetchLedger](#fetchledger) * [createMarketBuyOrderWithCost](#createmarketbuyorderwithcost) * [createOrder](#createorder) * [cancelOrder](#cancelorder) * [cancelOrders](#cancelorders) * [editOrder](#editorder) * [fetchOrder](#fetchorder) * [fetchOrders](#fetchorders) * [fetchOpenOrders](#fetchopenorders) * [fetchClosedOrders](#fetchclosedorders) * [fetchCanceledOrders](#fetchcanceledorders) * [fetchOHLCV](#fetchohlcv) * [fetchTrades](#fetchtrades) * [fetchMyTrades](#fetchmytrades) * [fetchOrderBook](#fetchorderbook) * [fetchBidsAsks](#fetchbidsasks) * [withdraw](#withdraw) * [fetchDepositAddress](#fetchdepositaddress) * [deposit](#deposit) * [fetchDeposit](#fetchdeposit) * [fetchConvertQuote](#fetchconvertquote) * [createConvertTrade](#createconverttrade) * [fetchConvertTrade](#fetchconverttrade) * [closePosition](#closeposition) * [fetchPositions](#fetchpositions) * [fetchPosition](#fetchposition) * [fetchTradingFees](#fetchtradingfees) * [watchTicker](#watchticker) * [watchTickers](#watchtickers) * [watchTrades](#watchtrades) * [watchTradesForSymbols](#watchtradesforsymbols) * [watchOrders](#watchorders) * [watchOrderBook](#watchorderbook) * [watchOrderBookForSymbols](#watchorderbookforsymbols) ### fetchTime{docsify-ignore} fetches the current integer timestamp in milliseconds from the exchange server **Kind**: instance method of [coinbase](#coinbase) **Returns**: int - the current integer timestamp in milliseconds from the exchange server **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-time#http-request | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.method | string | No | 'v2PublicGetTime' or 'v3PublicGetBrokerageTime' default is 'v2PublicGetTime' | ```javascript coinbase.fetchTime ([params]) ``` ### fetchAccounts{docsify-ignore} fetch all the accounts associated with a profile **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a dictionary of [account structures](https://docs.ccxt.com/#/?id=account-structure) indexed by the account type **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getaccounts - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-accounts#list-accounts | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript coinbase.fetchAccounts ([params]) ``` ### fetchPortfolios{docsify-ignore} fetch all the portfolios **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a dictionary of [account structures](https://docs.ccxt.com/#/?id=account-structure) indexed by the account type **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getportfolios | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchPortfolios ([params]) ``` ### createDepositAddress{docsify-ignore} create a currency deposit address **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-addresses#create-address | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code of the currency for the deposit address | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.createDepositAddress (code[, params]) ``` ### fetchWithdrawals{docsify-ignore} fetch all withdrawals made from an account **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-withdrawals#list-withdrawals | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | since | int | No | the earliest time in ms to fetch withdrawals for | | limit | int | No | the maximum number of withdrawals structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchWithdrawals (code[, since, limit, params]) ``` ### fetchDeposits{docsify-ignore} fetch all deposits made to an account **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#list-deposits | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | since | int | No | the earliest time in ms to fetch deposits for | | limit | int | No | the maximum number of deposits structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchDeposits (code[, since, limit, params]) ``` ### fetchMarkets{docsify-ignore} retrieves data on all markets for coinbase **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - an array of objects representing market data **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicproducts - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-fiat-currencies - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.usePrivate | boolean | No | use private endpoint for fetching markets | ```javascript coinbase.fetchMarkets ([params]) ``` ### fetchCurrencies{docsify-ignore} fetches all available currencies on an exchange **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an associative dictionary of currencies **See** - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-fiat-currencies - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchCurrencies ([params]) ``` ### fetchTickers{docsify-ignore} fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getproducts - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned | | params | object | No | extra parameters specific to the exchange API endpoint | | params.usePrivate | boolean | No | use private endpoint for fetching tickers | ```javascript coinbase.fetchTickers (symbols[, params]) ``` ### fetchTicker{docsify-ignore} fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getmarkettrades - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-spot-price - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-buy-price - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-sell-price | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | | params.usePrivate | boolean | No | whether to use the private endpoint for fetching the ticker | ```javascript coinbase.fetchTicker (symbol[, params]) ``` ### fetchBalance{docsify-ignore} query for balance and get the amount of funds available for trading or funds locked in orders **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getaccounts - https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-accounts#list-accounts - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmbalancesummary | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.v3 | boolean | No | default false, set true to use v3 api endpoint | | params.type | object | No | "spot" (default) or "swap" or "future" | ```javascript coinbase.fetchBalance ([params]) ``` ### fetchLedger{docsify-ignore} fetch the history of changes, actions done by the user or operations that altered balance of the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [ledger structure](https://docs.ccxt.com/#/?id=ledger-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#list-transactions | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code, default is undefined | | since | int | No | timestamp in ms of the earliest ledger entry, default is undefined | | limit | int | No | max number of ledger entrys to return, default is undefined | | params | object | No | extra parameters specific to the exchange API endpoint | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript coinbase.fetchLedger (code[, since, limit, params]) ``` ### createMarketBuyOrderWithCost{docsify-ignore} create a market buy order by providing the symbol and cost **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_postorder | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | cost | float | Yes | how much you want to trade in units of the quote currency | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.createMarketBuyOrderWithCost (symbol, cost[, params]) ``` ### createOrder{docsify-ignore} create a trade order **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_postorder | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | type | string | Yes | 'market' or 'limit' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders | | price | float | No | the price to fulfill the order, in units of the quote currency, ignored in market orders | | params | object | No | extra parameters specific to the exchange API endpoint | | params.stopPrice | float | No | price to trigger stop orders | | params.triggerPrice | float | No | price to trigger stop orders | | params.stopLossPrice | float | No | price to trigger stop-loss orders | | params.takeProfitPrice | float | No | price to trigger take-profit orders | | params.postOnly | bool | No | true or false | | params.timeInForce | string | No | 'GTC', 'IOC', 'GTD' or 'PO', 'FOK' | | params.stop_direction | string | No | 'UNKNOWN_STOP_DIRECTION', 'STOP_DIRECTION_STOP_UP', 'STOP_DIRECTION_STOP_DOWN' the direction the stopPrice is triggered from | | params.end_time | string | No | '2023-05-25T17:01:05.092Z' for 'GTD' orders | | params.cost | float | No | *spot market buy only* the quote quantity that can be used as an alternative for the amount | | params.preview | boolean | No | default to false, wether to use the test/preview endpoint or not | | params.leverage | float | No | default to 1, the leverage to use for the order | | params.marginMode | string | No | 'cross' or 'isolated' | | params.retail_portfolio_id | string | No | portfolio uid | | params.is_max | boolean | No | Used in conjunction with tradable_balance to indicate the user wants to use their entire tradable balance | | params.tradable_balance | string | No | amount of tradable balance | ```javascript coinbase.createOrder (symbol, type, side, amount[, price, params]) ``` ### cancelOrder{docsify-ignore} cancels an open order **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_cancelorders | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | symbol | string | Yes | not used by coinbase cancelOrder() | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.cancelOrder (id, symbol[, params]) ``` ### cancelOrders{docsify-ignore} cancel multiple orders **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_cancelorders | Param | Type | Required | Description | | --- | --- | --- | --- | | ids | Array<string> | Yes | order ids | | symbol | string | Yes | not used by coinbase cancelOrders() | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.cancelOrders (ids, symbol[, params]) ``` ### editOrder{docsify-ignore} edit a trade order **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_editorder | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | cancel order id | | symbol | string | Yes | unified symbol of the market to create an order in | | type | string | Yes | 'market' or 'limit' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much of currency you want to trade in units of base currency | | price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders | | params | object | No | extra parameters specific to the exchange API endpoint | | params.preview | boolean | No | default to false, wether to use the test/preview endpoint or not | ```javascript coinbase.editOrder (id, symbol, type, side, amount[, price, params]) ``` ### fetchOrder{docsify-ignore} fetches information on an order made by the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorder | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | the order id | | symbol | string | Yes | unified market symbol that the order was made in | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchOrder (id, symbol[, params]) ``` ### fetchOrders{docsify-ignore} fetches information on multiple orders made by the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol that the orders were made in | | since | int | No | the earliest time in ms to fetch orders | | limit | int | No | the maximum number of order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch trades for | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript coinbase.fetchOrders (symbol[, since, limit, params]) ``` ### fetchOpenOrders{docsify-ignore} fetches information on all currently open orders **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the orders | | since | int | No | timestamp in ms of the earliest order, default is undefined | | limit | int | No | the maximum number of open order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | | params.until | int | No | the latest time in ms to fetch trades for | ```javascript coinbase.fetchOpenOrders (symbol[, since, limit, params]) ``` ### fetchClosedOrders{docsify-ignore} fetches information on multiple closed orders made by the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the orders | | since | int | No | timestamp in ms of the earliest order, default is undefined | | limit | int | No | the maximum number of closed order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | | params.until | int | No | the latest time in ms to fetch trades for | ```javascript coinbase.fetchClosedOrders (symbol[, since, limit, params]) ``` ### fetchCanceledOrders{docsify-ignore} fetches information on multiple canceled orders made by the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the orders | | since | int | No | timestamp in ms of the earliest order, default is undefined | | limit | int | No | the maximum number of canceled order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchCanceledOrders (symbol[, since, limit, params]) ``` ### fetchOHLCV{docsify-ignore} fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpubliccandles | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch OHLCV data for | | timeframe | string | Yes | the length of time each candle represents | | since | int | No | timestamp in ms of the earliest candle to fetch | | limit | int | No | the maximum amount of candles to fetch, not used by coinbase | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch trades for | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | | params.usePrivate | boolean | No | default false, when true will use the private endpoint to fetch the candles | ```javascript coinbase.fetchOHLCV (symbol, timeframe[, since, limit, params]) ``` ### fetchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicmarkettrades | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the trades | | since | int | No | not used by coinbase fetchTrades | | limit | int | No | the maximum number of trade structures to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | | params.usePrivate | boolean | No | default false, when true will use the private endpoint to fetch the trades | ```javascript coinbase.fetchTrades (symbol[, since, limit, params]) ``` ### fetchMyTrades{docsify-ignore} fetch all trades made by the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfills | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the trades | | since | int | No | timestamp in ms of the earliest order, default is undefined | | limit | int | No | the maximum number of trade structures to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch trades for | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript coinbase.fetchMyTrades (symbol[, since, limit, params]) ``` ### fetchOrderBook{docsify-ignore} fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicproductbook | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the order book for | | limit | int | No | the maximum amount of order book entries to return | | params | object | No | extra parameters specific to the exchange API endpoint | | params.usePrivate | boolean | No | default false, when true will use the private endpoint to fetch the order book | ```javascript coinbase.fetchOrderBook (symbol[, limit, params]) ``` ### fetchBidsAsks{docsify-ignore} fetches the bid and ask price and volume for multiple markets **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getbestbidask | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchBidsAsks ([symbols, params]) ``` ### withdraw{docsify-ignore} make a withdrawal **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#send-money | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | the amount to withdraw | | address | string | Yes | the address to withdraw to | | tag | string | No | an optional tag for the withdrawal | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.withdraw (code, amount, address[, tag, params]) ``` ### fetchDepositAddress{docsify-ignore} fetch the deposit address for a currency associated with this account **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.fetchDepositAddress (code[, params]) ``` ### deposit{docsify-ignore} make a deposit **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#deposit-funds | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | the amount to deposit | | id | string | Yes | the payment method id to be used for the deposit, can be retrieved from v2PrivateGetPaymentMethods | | params | object | No | extra parameters specific to the exchange API endpoint | | params.accountId | string | No | the id of the account to deposit into | ```javascript coinbase.deposit (code, amount, id[, params]) ``` ### fetchDeposit{docsify-ignore} fetch information on a deposit, fiat only, for crypto transactions use fetchLedger **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#show-deposit | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | deposit id | | code | string | No | unified currency code | | params | object | No | extra parameters specific to the exchange API endpoint | | params.accountId | string | No | the id of the account that the funds were deposited into | ```javascript coinbase.fetchDeposit (id[, code, params]) ``` ### fetchConvertQuote{docsify-ignore} fetch a quote for converting from one currency to another **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [conversion structure](https://docs.ccxt.com/#/?id=conversion-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_createconvertquote | Param | Type | Required | Description | | --- | --- | --- | --- | | fromCode | string | Yes | the currency that you want to sell and convert from | | toCode | string | Yes | the currency that you want to buy and convert into | | amount | float | No | how much you want to trade in units of the from currency | | params | object | No | extra parameters specific to the exchange API endpoint | | params.trade_incentive_metadata | object | No | an object to fill in user incentive data | | params.trade_incentive_metadata.user_incentive_id | string | No | the id of the incentive | | params.trade_incentive_metadata.code_val | string | No | the code value of the incentive | ```javascript coinbase.fetchConvertQuote (fromCode, toCode[, amount, params]) ``` ### createConvertTrade{docsify-ignore} convert from one currency to another **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [conversion structure](https://docs.ccxt.com/#/?id=conversion-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_commitconverttrade | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | the id of the trade that you want to make | | fromCode | string | Yes | the currency that you want to sell and convert from | | toCode | string | Yes | the currency that you want to buy and convert into | | amount | float | No | how much you want to trade in units of the from currency | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.createConvertTrade (id, fromCode, toCode[, amount, params]) ``` ### fetchConvertTrade{docsify-ignore} fetch the data for a conversion trade **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [conversion structure](https://docs.ccxt.com/#/?id=conversion-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getconverttrade | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | the id of the trade that you want to commit | | code | string | Yes | the unified currency code that was converted from | | params | object | No | extra parameters specific to the exchange API endpoint | | params.toCode | strng | Yes | the unified currency code that was converted into | ```javascript coinbase.fetchConvertTrade (id, code[, params]) ``` ### closePosition{docsify-ignore} *futures only* closes open positions for a market **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://coinbase-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | Unified CCXT market symbol | | side | string | No | not used by coinbase | | params | object | No | extra parameters specific to the coinbase api endpoint | | params.clientOrderId | string | Yes | *mandatory* the client order id of the position to close | | params.size | float | No | the size of the position to close, optional | ```javascript coinbase.closePosition (symbol[, side, params]) ``` ### fetchPositions{docsify-ignore} fetch all open positions **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - a list of [position structure](https://docs.ccxt.com/#/?id=position-structure) **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmpositions - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintxpositions | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | | params.portfolio | string | No | the portfolio UUID to fetch positions for | ```javascript coinbase.fetchPositions ([symbols, params]) ``` ### fetchPosition{docsify-ignore} fetch data on a single open contract trade position **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [position structure](https://docs.ccxt.com/#/?id=position-structure) **See** - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getintxposition - https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmposition | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market the position is held in, default is undefined | | params | object | No | extra parameters specific to the exchange API endpoint | | params.product_id | string | No | *futures only* the product id of the position to fetch, required for futures markets only | | params.portfolio | string | No | *perpetual/swaps only* the portfolio UUID to fetch the position for, required for perpetual/swaps markets only | ```javascript coinbase.fetchPosition (symbol[, params]) ``` ### fetchTradingFees{docsify-ignore} fetch the trading fees for multiple markets **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a dictionary of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) indexed by market symbols **See**: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_gettransactionsummary/ | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'spot' or 'swap' | ```javascript coinbase.fetchTradingFees ([params]) ``` ### watchTicker{docsify-ignore} watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#ticker-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | No | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchTicker ([symbol, params]) ``` ### watchTickers{docsify-ignore} watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#ticker-batch-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchTickers ([symbols, params]) ``` ### watchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#market-trades-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch trades for | | since | int | No | timestamp in ms of the earliest trade to fetch | | limit | int | No | the maximum amount of trades to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchTrades (symbol[, since, limit, params]) ``` ### watchTradesForSymbols{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#market-trades-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified symbol of the market to fetch trades for | | since | int | No | timestamp in ms of the earliest trade to fetch | | limit | int | No | the maximum amount of trades to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchTradesForSymbols (symbols[, since, limit, params]) ``` ### watchOrders{docsify-ignore} watches information on multiple orders made by the user **Kind**: instance method of [coinbase](#coinbase) **Returns**: Array<object> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#user-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | No | unified market symbol of the market orders were made in | | since | int | No | the earliest time in ms to fetch orders for | | limit | int | No | the maximum number of order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchOrders ([symbol, since, limit, params]) ``` ### watchOrderBook{docsify-ignore} watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#level2-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the order book for | | limit | int | No | the maximum amount of order book entries to return | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchOrderBook (symbol[, limit, params]) ``` ### watchOrderBookForSymbols{docsify-ignore} watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [coinbase](#coinbase) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See**: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#level2-channel | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified array of symbols | | limit | int | No | the maximum amount of order book entries to return | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinbase.watchOrderBookForSymbols (symbols[, limit, params]) ```