coinbase
coinbase cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
🔌 Looking for raw exchange endpoints? See the coinbase implicit API — every endpoint in this exchange's API exposed as an implicit method.
coinbase
Kind: global class
Extends: Exchange
- fetchTime
- fetchAccounts
- fetchPortfolios
- createDepositAddress
- fetchWithdrawals
- fetchDeposits
- fetchDepositsWithdrawals
- fetchMarkets
- fetchCurrencies
- fetchTickers
- fetchTicker
- fetchBalance
- fetchLedger
- createMarketBuyOrderWithCost
- createOrder
- cancelOrder
- cancelOrders
- editOrder
- fetchOrder
- fetchOrders
- fetchOpenOrders
- fetchClosedOrders
- fetchCanceledOrders
- fetchOHLCV
- fetchTrades
- fetchMyTrades
- fetchOrderBook
- fetchBidsAsks
- withdraw
- fetchDepositAddress
- deposit
- fetchDeposit
- fetchDepositMethodIds
- fetchDepositMethodId
- fetchConvertQuote
- createConvertTrade
- fetchConvertTrade
- transfer
- closePosition
- fetchPositions
- fetchPosition
- fetchTradingFees
- fetchPortfolioDetails
- fetchDepositAddresses
coinbase
This is the retail Coinbase.com exchange class, covering the Advanced Trade API - the successor of the former Coinbase Pro after the Pro/retail unification. Use this class for regular Coinbase.com accounts and API keys created at coinbase.com. For the institutional Coinbase Exchange API (exchange.coinbase.com, application-gated credentials) see the separate coinbaseexchange class, and for Coinbase International derivatives see coinbaseinternational. Historical Coinbase Pro trading data lives in the retail account and is accessible through this class.
Instantiation with CDP (Cloud Developer Platform) keys, the current key format, see https://github.com/ccxt/ccxt/issues/23771:
const exchange = new ccxt.coinbase ({
'apiKey': 'organizations/{org_id}/apiKeys/{key_id}', // the full "name" field from the CDP key file
'secret': '-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----\n', // the "privateKey" field, keep the newlines
});No password/passphrase is used - that field belonged to the old Coinbase Pro keys. If the secret travels through an env var or json config, literal backslash-n sequences instead of real newlines will break the signature - pass the PEM exactly as issued.
coinbase.coinbase ()fetchTime
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of coinbase
Returns: int - the current integer timestamp in milliseconds from the exchange server
See
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/time
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-server-time
| 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' |
coinbase.fetchTime (params?)fetchAccounts
fetch all the accounts associated with a profile
Kind: instance method of coinbase
Returns: object - a dictionary of account structures indexed by the account type
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/accounts/list-accounts
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/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 |
coinbase.fetchAccounts (params?)fetchPortfolios
fetch all the portfolios
Kind: instance method of coinbase
Returns: object - a dictionary of account structures indexed by the account type
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/portfolios/list-portfolios
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchPortfolios (params?)createDepositAddress
create a currency deposit address
Kind: instance method of coinbase
Returns: object - an address structure
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/onchain-addresses
| 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 |
coinbase.createDepositAddress (code, params?)fetchWithdrawals
Fetch all withdrawals made from an account. Won't return crypto withdrawals. Use fetchLedger for those.
Kind: instance method of coinbase
Returns: Array<object> - a list of transaction structures
See
- https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/withdraw-fiat
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions
| 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 |
| params.currencyType | string | No | "fiat" or "crypto" |
coinbase.fetchWithdrawals (code, since?, limit?, params?)fetchDeposits
Fetch all fiat deposits made to an account. Won't return crypto deposits or staking rewards. Use fetchLedger for those.
Kind: instance method of coinbase
Returns: Array<object> - a list of transaction structures
See
- https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/deposit-fiat
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions
| 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 |
| params.currencyType | string | No | "fiat" or "crypto" |
coinbase.fetchDeposits (code, since?, limit?, params?)fetchDepositsWithdrawals
fetch history of deposits and withdrawals
Kind: instance method of coinbase
Returns: object - a list of transaction structure
See: https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code for the currency of the deposit/withdrawals, default is undefined |
| since | int | No | timestamp in ms of the earliest deposit/withdrawal, default is undefined |
| limit | int | No | max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100 |
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositsWithdrawals (code?, since?, limit?, params?)fetchMarkets
retrieves data on all markets for coinbase
Kind: instance method of coinbase
Returns: Array<object> - an array of objects representing market data
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/list-products
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/list-public-products
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/currencies
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/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 |
coinbase.fetchMarkets (params?)fetchCurrencies
fetches all available currencies on an exchange
Kind: instance method of coinbase
Returns: object - an associative dictionary of currencies
See
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/currencies
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/exchange-rates
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchCurrencies (params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of coinbase
Returns: object - a dictionary of ticker structures
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/list-products
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/list-public-products
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/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 |
coinbase.fetchTickers (symbols, params?)fetchTicker
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
Returns: object - a ticker structure
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-market-trades
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-market-trades
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/prices
| 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 |
coinbase.fetchTicker (symbol, params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of coinbase
Returns: object - a balance structure
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/accounts/list-accounts
- https://docs.cdp.coinbase.com/coinbase-app/track-apis/accounts
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/us-derivatives/get-futures-balance-summary
| 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 | string | No | "spot" (default) or "swap" or "future" |
| params.limit | int | No | default 250, maximum number of accounts to return |
coinbase.fetchBalance (params?)fetchLedger
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 coinbase
Returns: object - a ledger structure
See: https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | 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 entries 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 available parameters |
coinbase.fetchLedger (code?, since?, limit?, params?)createMarketBuyOrderWithCost
create a market buy order by providing the symbol and cost
Kind: instance method of coinbase
Returns: object - an order structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/create-order
| 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 |
coinbase.createMarketBuyOrderWithCost (symbol, cost, params?)createOrder
create a trade order
Kind: instance method of coinbase
Returns: object - an order structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/create-order
| 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 |
| params.reduceOnly | float | No | set to true for closing a position or use closePosition |
coinbase.createOrder (symbol, type, side, amount, price?, params?)cancelOrder
cancels an open order
Kind: instance method of coinbase
Returns: object - An order structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/cancel-orders
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | not used by cancelOrder() |
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.cancelOrder (id, symbol, params?)cancelOrders
cancel multiple orders
Kind: instance method of coinbase
Returns: object - a list of order structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/cancel-orders
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | Yes | not used by cancelOrders() |
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.cancelOrders (ids, symbol, params?)editOrder
edit a trade order
Kind: instance method of coinbase
Returns: object - an order structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/edit-order
| 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 |
coinbase.editOrder (id, symbol, type, side, amount, price?, params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of coinbase
Returns: object - An order structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/get-order
| 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 |
coinbase.fetchOrder (id, symbol, params?)fetchOrders
fetches information on multiple orders made by the user
Kind: instance method of coinbase
Returns: Array<Order> - a list of order structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders
| 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 |
coinbase.fetchOrders (symbol, since?, limit?, params?)fetchOpenOrders
fetches information on all currently open orders
Kind: instance method of coinbase
Returns: Array<Order> - a list of order structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders
| 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 |
| params.until | int | No | the latest time in ms to fetch trades for |
coinbase.fetchOpenOrders (symbol, since?, limit?, params?)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of coinbase
Returns: Array<Order> - a list of order structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders
| 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 |
| params.until | int | No | the latest time in ms to fetch trades for |
coinbase.fetchClosedOrders (symbol, since?, limit?, params?)fetchCanceledOrders
fetches information on multiple canceled orders made by the user
Kind: instance method of coinbase
Returns: object - a list of order structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders
| 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 |
coinbase.fetchCanceledOrders (symbol, since?, limit?, params?)fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of coinbase
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-product-candles
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-product-candles
| 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 |
| params.usePrivate | boolean | No | default false, when true will use the private endpoint to fetch the candles |
coinbase.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of coinbase
Returns: Array<Trade> - a list of trade structures
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-market-trades
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-market-trades
| 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 |
coinbase.fetchTrades (symbol, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of coinbase
Returns: Array<Trade> - a list of trade structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-fills
| 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 |
coinbase.fetchMyTrades (symbol, since?, limit?, params?)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of coinbase
Returns: object - an order book structure
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-product-book
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-product-book
| 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 |
coinbase.fetchOrderBook (symbol, limit?, params?)fetchBidsAsks
fetches the bid and ask price and volume for multiple markets
Kind: instance method of coinbase
Returns: object - a dictionary of ticker structures
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-best-bid-ask
| 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 |
coinbase.fetchBidsAsks (symbols?, params?)withdraw
make a withdrawal
Kind: instance method of coinbase
Returns: object - a transaction structure
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/send-crypto
| 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 |
| params.network | string | No | the cryptocurrency network to use for the withdrawal using the lowercase name like bitcoin, ethereum, solana, etc. |
| params.travel_rule_data | object | 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?)fetchDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance method of coinbase
Returns: object - an address structure
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/onchain-addresses
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositAddress (code, params?)deposit
make a deposit
Kind: instance method of coinbase
Returns: object - a transaction structure
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/deposit-fiat
| 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 |
coinbase.deposit (code, amount, id, params?)fetchDeposit
fetch information on a deposit, fiat only, for crypto transactions use fetchLedger
Kind: instance method of coinbase
Returns: object - a transaction structure
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/deposit-fiat
| 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 |
coinbase.fetchDeposit (id, code?, params?)fetchDepositMethodIds
fetch the deposit id for a fiat currency associated with this account
Kind: instance method of coinbase
Returns: object - an array of deposit id structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositMethodIds (params?)fetchDepositMethodId
fetch the deposit id for a fiat currency associated with this account
Kind: instance method of coinbase
Returns: object - a deposit id structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the deposit payment method id |
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.fetchDepositMethodId (id, params?)fetchConvertQuote
fetch a quote for converting from one currency to another
Kind: instance method of coinbase
Returns: object - a conversion structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/convert/create-convert-quote
| 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 |
coinbase.fetchConvertQuote (fromCode, toCode, amount?, params?)createConvertTrade
convert from one currency to another
Kind: instance method of coinbase
Returns: object - a conversion structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/convert/commit-convert-trade
| 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 |
coinbase.createConvertTrade (id, fromCode, toCode, amount?, params?)fetchConvertTrade
fetch the data for a conversion trade
Kind: instance method of coinbase
Returns: object - a conversion structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/convert/get-convert-trade
| 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 |
coinbase.fetchConvertTrade (id, code, params?)transfer
transfer currency internally between portfolios of the same account
Kind: instance method of coinbase
Returns: object - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | the portfolio uuid to transfer funds from |
| toAccount | string | Yes | the portfolio uuid to transfer funds to |
| params | object | No | extra parameters specific to the exchange API endpoint |
coinbase.transfer (code, amount, fromAccount, toAccount, params?)closePosition
futures only closes open positions for a market
Kind: instance method of coinbase
Returns: object - an order structure
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/close-position
| 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 exchange 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 |
coinbase.closePosition (symbol, side?, params?)fetchPositions
fetch all open positions
Kind: instance method of coinbase
Returns: Array<object> - a list of position structure
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/us-derivatives/list-futures-positions
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/international-derivatives/list-perpetuals-positions
| 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 |
coinbase.fetchPositions (symbols?, params?)fetchPosition
fetch data on a single open contract trade position
Kind: instance method of coinbase
Returns: object - a position structure
See
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/international-derivatives/get-perpetuals-position
- https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/us-derivatives/get-futures-position
| 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 |
coinbase.fetchPosition (symbol, params?)fetchTradingFees
fetch the trading fees for multiple markets
Kind: instance method of coinbase
Returns: object - a dictionary of fee structures indexed by market symbols
See: https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/fees/get-transaction-summary
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'spot' or 'swap' |
coinbase.fetchTradingFees (params?)fetchPortfolioDetails
Fetch details for a specific portfolio by UUID
Kind: instance method of coinbase
Returns: Array<any> - An account structure </docs/manual#account-structure>
| Param | Type | Required | Description |
|---|---|---|---|
| portfolioUuid | string | Yes | The unique identifier of the portfolio to fetch |
| params | Dict | No | Extra parameters specific to the exchange API endpoint |
coinbase.fetchPortfolioDetails (portfolioUuid, params?)fetchDepositAddresses
fetch deposit addresses for multiple currencies (when available)
Kind: instance method of coinbase
Returns: object - a dictionary of address structures indexed by currency code
See: https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/onchain-addresses
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string> | No | list of unified currency codes, default is undefined (all currencies) |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.accountId | string | No | account ID to fetch deposit addresses for |
coinbase.fetchDepositAddresses (codes?, params?)