wiki/exchanges/coinbase.md
<a name="coinbase" id="coinbase"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="fetchTime" id="fetchtime"></a>
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of <code>coinbase</code>
Returns: <code>int</code> - 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 | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | 'v2PublicGetTime' or 'v3PublicGetBrokerageTime' default is 'v2PublicGetTime' |
coinbase.fetchTime ([params])
<a name="fetchAccounts" id="fetchaccounts"></a>
fetch all the accounts associated with a profile
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a dictionary of account structures indexed by the account type
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
coinbase.fetchAccounts ([params])
<a name="fetchPortfolios" id="fetchportfolios"></a>
fetch all the portfolios
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a dictionary of account structures indexed by the account type
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getportfolios
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchPortfolios ([params])
<a name="createDepositAddress" id="createdepositaddress"></a>
create a currency deposit address
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an address structure
See: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-addresses#create-address
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency for the deposit address |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.createDepositAddress (code[, params])
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
Fetch all withdrawals made from an account. Won't return crypto withdrawals. Use fetchLedger for those.
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<object></code> - a list of transaction structures
See: https://docs.cdp.coinbase.com/coinbase-app/docs/api-withdrawals#list-withdrawals
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.currencyType | <code>string</code> | No | "fiat" or "crypto" |
coinbase.fetchWithdrawals (code[, since, limit, params])
<a name="fetchDeposits" id="fetchdeposits"></a>
Fetch all fiat deposits made to an account. Won't return crypto deposits or staking rewards. Use fetchLedger for those.
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<object></code> - a list of transaction structures
See: https://docs.cdp.coinbase.com/coinbase-app/docs/api-deposits#list-deposits
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.currencyType | <code>string</code> | No | "fiat" or "crypto" |
coinbase.fetchDeposits (code[, since, limit, params])
<a name="fetchDepositsWithdrawals" id="fetchdepositswithdrawals"></a>
fetch history of deposits and withdrawals
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a list of transaction structure
See: https://docs.cdp.coinbase.com/coinbase-app/docs/api-transactions
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code for the currency of the deposit/withdrawals, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest deposit/withdrawal, default is undefined |
| limit | <code>int</code> | No | max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositsWithdrawals ([code, since, limit, params])
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for coinbase
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<object></code> - an array of objects representing market data
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.usePrivate | <code>boolean</code> | No | use private endpoint for fetching markets |
coinbase.fetchMarkets ([params])
<a name="fetchCurrencies" id="fetchcurrencies"></a>
fetches all available currencies on an exchange
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an associative dictionary of currencies
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchCurrencies ([params])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a dictionary of ticker structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.usePrivate | <code>boolean</code> | No | use private endpoint for fetching tickers |
coinbase.fetchTickers (symbols[, params])
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.usePrivate | <code>boolean</code> | No | whether to use the private endpoint for fetching the ticker |
coinbase.fetchTicker (symbol[, params])
<a name="fetchBalance" id="fetchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.v3 | <code>boolean</code> | No | default false, set true to use v3 api endpoint |
| params.type | <code>string</code> | No | "spot" (default) or "swap" or "future" |
| params.limit | <code>int</code> | No | default 250, maximum number of accounts to return |
coinbase.fetchBalance ([params])
<a name="fetchLedger" id="fetchledger"></a>
Fetch the history of changes, i.e. actions done by the user or operations that altered the balance. Will return staking rewards, and crypto deposits or withdrawals.
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a ledger structure
See: https://docs.cdp.coinbase.com/coinbase-app/docs/api-transactions#list-transactions
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | <code>int</code> | No | max number of ledger entries to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
coinbase.fetchLedger ([code, since, limit, params])
<a name="createMarketBuyOrderWithCost" id="createmarketbuyorderwithcost"></a>
create a market buy order by providing the symbol and cost
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an order structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_postorder
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.createMarketBuyOrderWithCost (symbol, cost[, params])
<a name="createOrder" id="createorder"></a>
create a trade order
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an order structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_postorder
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders |
| price | <code>float</code> | No | the price to fulfill the order, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.stopPrice | <code>float</code> | No | price to trigger stop orders |
| params.triggerPrice | <code>float</code> | No | price to trigger stop orders |
| params.stopLossPrice | <code>float</code> | No | price to trigger stop-loss orders |
| params.takeProfitPrice | <code>float</code> | No | price to trigger take-profit orders |
| params.postOnly | <code>bool</code> | No | true or false |
| params.timeInForce | <code>string</code> | No | 'GTC', 'IOC', 'GTD' or 'PO', 'FOK' |
| params.stop_direction | <code>string</code> | No | 'UNKNOWN_STOP_DIRECTION', 'STOP_DIRECTION_STOP_UP', 'STOP_DIRECTION_STOP_DOWN' the direction the stopPrice is triggered from |
| params.end_time | <code>string</code> | No | '2023-05-25T17:01:05.092Z' for 'GTD' orders |
| params.cost | <code>float</code> | No | spot market buy only the quote quantity that can be used as an alternative for the amount |
| params.preview | <code>boolean</code> | No | default to false, wether to use the test/preview endpoint or not |
| params.leverage | <code>float</code> | No | default to 1, the leverage to use for the order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
| params.retail_portfolio_id | <code>string</code> | No | portfolio uid |
| params.is_max | <code>boolean</code> | No | Used in conjunction with tradable_balance to indicate the user wants to use their entire tradable balance |
| params.tradable_balance | <code>string</code> | No | amount of tradable balance |
| params.reduceOnly | <code>float</code> | No | set to true for closing a position or use closePosition |
coinbase.createOrder (symbol, type, side, amount[, price, params])
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - An order structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_cancelorders
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | not used by coinbase cancelOrder() |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.cancelOrder (id, symbol[, params])
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a list of order structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_cancelorders
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | Yes | not used by coinbase cancelOrders() |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.cancelOrders (ids, symbol[, params])
<a name="editOrder" id="editorder"></a>
edit a trade order
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an order structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_editorder
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | cancel order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.preview | <code>boolean</code> | No | default to false, wether to use the test/preview endpoint or not |
coinbase.editOrder (id, symbol, type, side, amount[, price, params])
<a name="fetchOrder" id="fetchorder"></a>
fetches information on an order made by the user
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - An order structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorder
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the order id |
| symbol | <code>string</code> | Yes | unified market symbol that the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchOrder (id, symbol[, params])
<a name="fetchOrders" id="fetchorders"></a>
fetches information on multiple orders made by the user
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol that the orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
coinbase.fetchOrders (symbol[, since, limit, params])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
fetches information on all currently open orders
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the orders |
| since | <code>int</code> | No | timestamp in ms of the earliest order, default is undefined |
| limit | <code>int</code> | No | the maximum number of open order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
coinbase.fetchOpenOrders (symbol[, since, limit, params])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetches information on multiple closed orders made by the user
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the orders |
| since | <code>int</code> | No | timestamp in ms of the earliest order, default is undefined |
| limit | <code>int</code> | No | the maximum number of closed order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
coinbase.fetchClosedOrders (symbol[, since, limit, params])
<a name="fetchCanceledOrders" id="fetchcanceledorders"></a>
fetches information on multiple canceled orders made by the user
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a list of order structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_gethistoricalorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the orders |
| since | <code>int</code> | No | timestamp in ms of the earliest order, default is undefined |
| limit | <code>int</code> | No | the maximum number of canceled order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchCanceledOrders (symbol[, since, limit, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<Array<int>></code> - 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 | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch, not used by coinbase |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.usePrivate | <code>boolean</code> | No | default false, when true will use the private endpoint to fetch the candles |
coinbase.fetchOHLCV (symbol, timeframe[, since, limit, params])
<a name="fetchTrades" id="fetchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicmarkettrades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the trades |
| since | <code>int</code> | No | not used by coinbase fetchTrades |
| limit | <code>int</code> | No | the maximum number of trade structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.usePrivate | <code>boolean</code> | No | default false, when true will use the private endpoint to fetch the trades |
coinbase.fetchTrades (symbol[, since, limit, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfills
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the trades |
| since | <code>int</code> | No | timestamp in ms of the earliest order, default is undefined |
| limit | <code>int</code> | No | the maximum number of trade structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
coinbase.fetchMyTrades (symbol[, since, limit, params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpublicproductbook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.usePrivate | <code>boolean</code> | No | default false, when true will use the private endpoint to fetch the order book |
coinbase.fetchOrderBook (symbol[, limit, params])
<a name="fetchBidsAsks" id="fetchbidsasks"></a>
fetches the bid and ask price and volume for multiple markets
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a dictionary of ticker structures
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getbestbidask
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchBidsAsks ([symbols, params])
<a name="withdraw" id="withdraw"></a>
make a withdrawal
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a transaction structure
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/send-crypto
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | No | an optional tag for the withdrawal |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | the cryptocurrency network to use for the withdrawal using the lowercase name like bitcoin, ethereum, solana, etc. |
| params.travel_rule_data | <code>object</code> | No | some regions require travel rule information for crypto withdrawals, see the exchange docs for details https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule |
coinbase.withdraw (code, amount, address[, tag, params])
<a name="fetchDepositAddress" id="fetchdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an address structure
See: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositAddress (code[, params])
<a name="deposit" id="deposit"></a>
make a deposit
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a transaction structure
See: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#deposit-funds
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to deposit |
| id | <code>string</code> | Yes | the payment method id to be used for the deposit, can be retrieved from v2PrivateGetPaymentMethods |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountId | <code>string</code> | No | the id of the account to deposit into |
coinbase.deposit (code, amount, id[, params])
<a name="fetchDeposit" id="fetchdeposit"></a>
fetch information on a deposit, fiat only, for crypto transactions use fetchLedger
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a transaction structure
See: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#show-deposit
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | deposit id |
| code | <code>string</code> | No | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountId | <code>string</code> | No | the id of the account that the funds were deposited into |
coinbase.fetchDeposit (id[, code, params])
<a name="fetchDepositMethodIds" id="fetchdepositmethodids"></a>
fetch the deposit id for a fiat currency associated with this account
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an array of deposit id structures
See: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpaymentmethods
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositMethodIds ([params])
<a name="fetchDepositMethodId" id="fetchdepositmethodid"></a>
fetch the deposit id for a fiat currency associated with this account
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a deposit id structure
See: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_getpaymentmethod
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the deposit payment method id |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositMethodId (id[, params])
<a name="fetchConvertQuote" id="fetchconvertquote"></a>
fetch a quote for converting from one currency to another
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a conversion structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_createconvertquote
| Param | Type | Required | Description |
|---|---|---|---|
| fromCode | <code>string</code> | Yes | the currency that you want to sell and convert from |
| toCode | <code>string</code> | Yes | the currency that you want to buy and convert into |
| amount | <code>float</code> | No | how much you want to trade in units of the from currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trade_incentive_metadata | <code>object</code> | No | an object to fill in user incentive data |
| params.trade_incentive_metadata.user_incentive_id | <code>string</code> | No | the id of the incentive |
| params.trade_incentive_metadata.code_val | <code>string</code> | No | the code value of the incentive |
coinbase.fetchConvertQuote (fromCode, toCode[, amount, params])
<a name="createConvertTrade" id="createconverttrade"></a>
convert from one currency to another
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a conversion structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_commitconverttrade
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the id of the trade that you want to make |
| fromCode | <code>string</code> | Yes | the currency that you want to sell and convert from |
| toCode | <code>string</code> | Yes | the currency that you want to buy and convert into |
| amount | <code>float</code> | No | how much you want to trade in units of the from currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
coinbase.createConvertTrade (id, fromCode, toCode[, amount, params])
<a name="fetchConvertTrade" id="fetchconverttrade"></a>
fetch the data for a conversion trade
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a conversion structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getconverttrade
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the id of the trade that you want to commit |
| code | <code>string</code> | Yes | the unified currency code that was converted from |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.toCode | <code>strng</code> | Yes | the unified currency code that was converted into |
coinbase.fetchConvertTrade (id, code[, params])
<a name="closePosition" id="closeposition"></a>
futures only closes open positions for a market
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - an order structure
See: https://docs.cdp.coinbase.com/coinbase-app/trade/reference/retailbrokerageapi_closeposition
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| side | <code>string</code> | No | not used by coinbase |
| params | <code>object</code> | No | extra parameters specific to the coinbase api endpoint |
| params.clientOrderId | <code>string</code> | Yes | mandatory the client order id of the position to close |
| params.size | <code>float</code> | No | the size of the position to close, optional |
coinbase.closePosition (symbol[, side, params])
<a name="fetchPositions" id="fetchpositions"></a>
fetch all open positions
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<object></code> - a list of position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolio | <code>string</code> | No | the portfolio UUID to fetch positions for |
coinbase.fetchPositions ([symbols, params])
<a name="fetchPosition" id="fetchposition"></a>
fetch data on a single open contract trade position
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.product_id | <code>string</code> | No | futures only the product id of the position to fetch, required for futures markets only |
| params.portfolio | <code>string</code> | No | perpetual/swaps only the portfolio UUID to fetch the position for, required for perpetual/swaps markets only |
coinbase.fetchPosition (symbol[, params])
<a name="fetchTradingFees" id="fetchtradingfees"></a>
fetch the trading fees for multiple markets
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a dictionary of fee structures indexed by market symbols
See: https://docs.cdp.coinbase.com/advanced-trade/reference/retailbrokerageapi_gettransactionsummary/
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'swap' |
coinbase.fetchTradingFees ([params])
<a name="fetchPortfolioDetails" id="fetchportfoliodetails"></a>
Fetch details for a specific portfolio by UUID
Kind: instance method of <code>coinbase</code>
Returns: <code>Array<any></code> - An account structure https://docs.ccxt.com/?id=account-structure
See: https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getportfolios
| Param | Type | Required | Description |
|---|---|---|---|
| portfolioUuid | <code>string</code> | Yes | The unique identifier of the portfolio to fetch |
| params | <code>Dict</code> | No | Extra parameters specific to the exchange API endpoint |
coinbase.fetchPortfolioDetails (portfolioUuid[, params])
<a name="fetchDepositAddresses" id="fetchdepositaddresses"></a>
fetch deposit addresses for multiple currencies (when available)
Kind: instance method of <code>coinbase</code>
Returns: <code>object</code> - a dictionary of address structures indexed by currency code
See: https://coinbase-migration.mintlify.app/coinbase-app/transfer-apis/onchain-addresses
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code> | No | list of unified currency codes, default is undefined (all currencies) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountId | <code>string</code> | No | account ID to fetch deposit addresses for |
coinbase.fetchDepositAddresses ([codes, params])