import Exchange from './abstract/coinbase.js'; import type { Int, OrderSide, OrderType, Order, Trade, OHLCV, Ticker, OrderBook, Str, Transaction, Balances, Tickers, Strings, Market, Currency, Num, Account, Currencies, Conversion, Dict, NullableDict, int, TradingFees, LedgerEntry, DepositAddress, Position, TransferEntry, DepositAddresses } from './base/types.js'; /** * @class coinbase * @augments Exchange * @description 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. */ export default class coinbase extends Exchange { describe(): any; /** * @method * @name coinbase#fetchTime * @description fetches the current integer timestamp in milliseconds from the exchange server * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/time * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-server-time * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.method] 'v2PublicGetTime' or 'v3PublicGetBrokerageTime' default is 'v2PublicGetTime' * @returns {int} the current integer timestamp in milliseconds from the exchange server */ fetchTime(params?: Dict): Promise; /** * @method * @name coinbase#fetchAccounts * @description fetch all the accounts associated with a profile * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/accounts/list-accounts * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/accounts * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] 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) * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/?id=account-structure} indexed by the account type */ fetchAccounts(params?: Dict): Promise; fetchAccountsV2(params?: Dict): Promise; fetchAccountsV3(params?: Dict): Promise; /** * @method * @name coinbase#fetchPortfolios * @description fetch all the portfolios * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/portfolios/list-portfolios * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/?id=account-structure} indexed by the account type */ fetchPortfolios(params?: Dict): Promise; parseAccount(account: Dict): Account; /** * @method * @name coinbase#createDepositAddress * @description create a currency deposit address * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/onchain-addresses * @param {string} code unified currency code of the currency for the deposit address * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [address structure]{@link https://docs.ccxt.com/?id=address-structure} */ createDepositAddress(code: string, params?: Dict): Promise; /** * @method * @name coinbase#fetchMySells * @ignore * @description fetch sells * @see https://docs.cdp.coinbase.com/coinbase-app/oauth2-integration/available-apis * @param {string} symbol not used by fetchMySells () * @param {int} [since] timestamp in ms of the earliest sell, default is undefined * @param {int} [limit] max number of sells to return, default is undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [list of order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchMySells(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchMyBuys * @ignore * @description fetch buys * @see https://docs.cdp.coinbase.com/coinbase-app/oauth2-integration/available-apis * @param {string} symbol not used by fetchMyBuys () * @param {int} [since] timestamp in ms of the earliest buy, default is undefined * @param {int} [limit] max number of buys to return, default is undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchMyBuys(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; fetchTransactionsWithMethod(method: string, code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchWithdrawals * @description Fetch all withdrawals made from an account. Won't return crypto withdrawals. Use fetchLedger for those. * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/withdraw-fiat * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions * @param {string} code unified currency code * @param {int} [since] the earliest time in ms to fetch withdrawals for * @param {int} [limit] the maximum number of withdrawals structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.currencyType] "fiat" or "crypto" * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchDeposits * @description Fetch all fiat deposits made to an account. Won't return crypto deposits or staking rewards. Use fetchLedger for those. * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/deposit-fiat * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions * @param {string} code unified currency code * @param {int} [since] the earliest time in ms to fetch deposits for * @param {int} [limit] the maximum number of deposits structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.currencyType] "fiat" or "crypto" * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchDepositsWithdrawals * @description fetch history of deposits and withdrawals * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined * @param {int} [limit] max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100 * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; parseTransactionStatus(status: Str): Str; parseTransaction(transaction: Dict, currency?: Currency): Transaction; parseTrade(trade: Dict, market?: Market): Trade; /** * @method * @name coinbase#fetchMarkets * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/list-products * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/list-public-products * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/currencies * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/exchange-rates * @description retrieves data on all markets for coinbase * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.usePrivate] use private endpoint for fetching markets * @returns {object[]} an array of objects representing market data */ fetchMarkets(params?: Dict): Promise; fetchMarketsV2(params?: Dict): Promise; fetchMarketsV3(params?: Dict): Promise; parseSpotMarket(market: Dict, feeTier: Dict): Market; parseContractMarket(market: Dict, feeTier: Dict): Market; fetchCurrenciesFromCache(params?: Dict): Promise; /** * @method * @name coinbase#fetchCurrencies * @description fetches all available currencies on an exchange * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/currencies * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/exchange-rates * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an associative dictionary of currencies */ fetchCurrencies(params?: Dict): Promise; /** * @method * @name coinbase#fetchTickers * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/list-products * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/list-public-products * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/exchange-rates * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.usePrivate] use private endpoint for fetching tickers * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure} */ fetchTickers(symbols?: Strings, params?: Dict): Promise; fetchTickersV2(symbols?: Strings, params?: Dict): Promise; fetchTickersV3(symbols?: Strings, params?: Dict): Promise; /** * @method * @name coinbase#fetchTicker * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-market-trades * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-market-trades * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/prices * @param {string} symbol unified symbol of the market to fetch the ticker for * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.usePrivate] whether to use the private endpoint for fetching the ticker * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure} */ fetchTicker(symbol: string, params?: Dict): Promise; fetchTickerV2(symbol: string, params?: Dict): Promise; fetchTickerV3(symbol: string, params?: Dict): Promise; parseTicker(ticker: Dict, market?: Market): Ticker; parseCustomBalance(response: Dict, params?: Dict): Balances; /** * @method * @name coinbase#fetchBalance * @description query for balance and get the amount of funds available for trading or funds locked in orders * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/accounts/list-accounts * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/accounts * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/us-derivatives/get-futures-balance-summary * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.v3] default false, set true to use v3 api endpoint * @param {string} [params.type] "spot" (default) or "swap" or "future" * @param {int} [params.limit] default 250, maximum number of accounts to return * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure} */ fetchBalance(params?: Dict): Promise; /** * @method * @name coinbase#fetchLedger * @description 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. * @see https://docs.cdp.coinbase.com/coinbase-app/track-apis/transactions * @param {string} [code] unified currency code, default is undefined * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined * @param {int} [limit] max number of ledger entries to return, default is undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/?id=ledger-entry-structure} */ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; parseLedgerEntryStatus(status: Str): Str; parseLedgerEntryType(type: Str): Str; parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry; findAccountId(code: Str, params?: Dict): Promise; prepareAccountRequest(limit?: Int, params?: Dict): Dict; prepareAccountRequestWithCurrencyCode(code?: Str, limit?: Int, params?: Dict): Promise<[Dict, Dict]>; /** * @method * @name coinbase#createMarketBuyOrderWithCost * @description create a market buy order by providing the symbol and cost * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/create-order * @param {string} symbol unified symbol of the market to create an order in * @param {float} cost how much you want to trade in units of the quote currency * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ createMarketBuyOrderWithCost(symbol: string, cost: number, params?: Dict): Promise; /** * @method * @name coinbase#createOrder * @description create a trade order * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/create-order * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' * @param {string} side 'buy' or 'sell' * @param {float} amount how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders * @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {float} [params.stopPrice] price to trigger stop orders * @param {float} [params.triggerPrice] price to trigger stop orders * @param {float} [params.stopLossPrice] price to trigger stop-loss orders * @param {float} [params.takeProfitPrice] price to trigger take-profit orders * @param {bool} [params.postOnly] true or false * @param {string} [params.timeInForce] 'GTC', 'IOC', 'GTD' or 'PO', 'FOK' * @param {string} [params.stop_direction] 'UNKNOWN_STOP_DIRECTION', 'STOP_DIRECTION_STOP_UP', 'STOP_DIRECTION_STOP_DOWN' the direction the stopPrice is triggered from * @param {string} [params.end_time] '2023-05-25T17:01:05.092Z' for 'GTD' orders * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount * @param {boolean} [params.preview] default to false, wether to use the test/preview endpoint or not * @param {float} [params.leverage] default to 1, the leverage to use for the order * @param {string} [params.marginMode] 'cross' or 'isolated' * @param {string} [params.retail_portfolio_id] portfolio uid * @param {boolean} [params.is_max] Used in conjunction with tradable_balance to indicate the user wants to use their entire tradable balance * @param {string} [params.tradable_balance] amount of tradable balance * @param {float} [params.reduceOnly] set to true for closing a position or use closePosition * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: Dict): Promise; parseOrder(order: Dict, market?: Market): Order; parseOrderStatus(status: Str): Str; parseOrderType(type: Str): Str; parseTimeInForce(timeInForce: Str): Str; /** * @method * @name coinbase#cancelOrder * @description cancels an open order * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/cancel-orders * @param {string} id order id * @param {string} symbol not used by cancelOrder() * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ cancelOrder(id: string, symbol?: Str, params?: Dict): Promise; /** * @method * @name coinbase#cancelOrders * @description cancel multiple orders * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/cancel-orders * @param {string[]} ids order ids * @param {string} symbol not used by cancelOrders() * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ cancelOrders(ids: string[], symbol?: Str, params?: Dict): Promise; /** * @method * @name coinbase#editOrder * @description edit a trade order * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/edit-order * @param {string} id cancel order id * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' * @param {string} side 'buy' or 'sell' * @param {float} amount how much of currency you want to trade in units of base currency * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.preview] default to false, wether to use the test/preview endpoint or not * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: Dict): Promise; /** * @method * @name coinbase#fetchOrder * @description fetches information on an order made by the user * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/get-order * @param {string} id the order id * @param {string} symbol unified market symbol that the order was made in * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ fetchOrder(id: string, symbol?: Str, params?: Dict): Promise; /** * @method * @name coinbase#fetchOrders * @description fetches information on multiple orders made by the user * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders * @param {string} symbol unified market symbol that the orders were made in * @param {int} [since] the earliest time in ms to fetch orders * @param {int} [limit] the maximum number of order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] the latest time in ms to fetch trades for * @param {boolean} [params.paginate] 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) * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; fetchOrdersByStatus(status: Str, symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchOpenOrders * @description fetches information on all currently open orders * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders * @param {string} symbol unified market symbol of the orders * @param {int} [since] timestamp in ms of the earliest order, default is undefined * @param {int} [limit] the maximum number of open order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] 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) * @param {int} [params.until] the latest time in ms to fetch trades for * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchClosedOrders * @description fetches information on multiple closed orders made by the user * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders * @param {string} symbol unified market symbol of the orders * @param {int} [since] timestamp in ms of the earliest order, default is undefined * @param {int} [limit] the maximum number of closed order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] 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) * @param {int} [params.until] the latest time in ms to fetch trades for * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchCanceledOrders * @description fetches information on multiple canceled orders made by the user * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-orders * @param {string} symbol unified market symbol of the orders * @param {int} [since] timestamp in ms of the earliest order, default is undefined * @param {int} [limit] the maximum number of canceled order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchOHLCV * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-product-candles * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-product-candles * @param {string} symbol unified symbol of the market to fetch OHLCV data for * @param {string} timeframe the length of time each candle represents * @param {int} [since] timestamp in ms of the earliest candle to fetch * @param {int} [limit] the maximum amount of candles to fetch, not used by coinbase * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] the latest time in ms to fetch trades for * @param {boolean} [params.paginate] 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) * @param {boolean} [params.usePrivate] default false, when true will use the private endpoint to fetch the candles * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume */ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: Dict): Promise; parseOHLCV(ohlcv: any, market?: Market): OHLCV; /** * @method * @name coinbase#fetchTrades * @description get the list of most recent trades for a particular symbol * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-market-trades * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-market-trades * @param {string} symbol unified market symbol of the trades * @param {int} [since] not used by coinbase fetchTrades * @param {int} [limit] the maximum number of trade structures to fetch * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.usePrivate] default false, when true will use the private endpoint to fetch the trades * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades} */ fetchTrades(symbol: string, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchMyTrades * @description fetch all trades made by the user * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/list-fills * @param {string} symbol unified market symbol of the trades * @param {int} [since] timestamp in ms of the earliest order, default is undefined * @param {int} [limit] the maximum number of trade structures to fetch * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] the latest time in ms to fetch trades for * @param {boolean} [params.paginate] 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) * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure} */ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchOrderBook * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-product-book * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/public/get-public-product-book * @param {string} symbol unified symbol of the market to fetch the order book for * @param {int} [limit] the maximum amount of order book entries to return * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.usePrivate] default false, when true will use the private endpoint to fetch the order book * @returns {object} an [order book structure]{@link https://docs.ccxt.com/?id=order-book-structure} */ fetchOrderBook(symbol: string, limit?: Int, params?: Dict): Promise; /** * @method * @name coinbase#fetchBidsAsks * @description fetches the bid and ask price and volume for multiple markets * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/products/get-best-bid-ask * @param {string[]} [symbols] unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure} */ fetchBidsAsks(symbols?: Strings, params?: Dict): Promise; /** * @method * @name coinbase#withdraw * @description make a withdrawal * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/send-crypto * @param {string} code unified currency code * @param {float} amount the amount to withdraw * @param {string} address the address to withdraw to * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.tag] memo / destination tag, required for currencies in options['withdrawTagRequiredCurrencies'] * @param {string} [params.network] the cryptocurrency network to use for the withdrawal using the lowercase name like bitcoin, ethereum, solana, etc. * @param {object} [params.travel_rule_data] 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 * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure} */ withdraw(code: string, amount: number, address: string, params?: Dict): Promise; /** * @method * @name coinbase#fetchDepositAddress * @description fetch the deposit address for a currency associated with this account * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/onchain-addresses * @param {string} code unified currency code * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [address structure]{@link https://docs.ccxt.com/?id=address-structure} */ fetchDepositAddressesByNetwork(code: string, params?: Dict): Promise; parseDepositAddress(depositAddress: Dict, currency?: Currency): DepositAddress; /** * @method * @name coinbase#deposit * @description make a deposit * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/deposit-fiat * @param {string} code unified currency code * @param {float} amount the amount to deposit * @param {string} id the payment method id to be used for the deposit, can be retrieved from v2PrivateGetPaymentMethods * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.accountId] the id of the account to deposit into * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure} */ deposit(code: string, amount: number, id: string, params?: Dict): Promise; /** * @method * @name coinbase#fetchDeposit * @description fetch information on a deposit, fiat only, for crypto transactions use fetchLedger * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/deposit-fiat * @param {string} id deposit id * @param {string} [code] unified currency code * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.accountId] the id of the account that the funds were deposited into * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchDeposit(id: string, code?: Str, params?: Dict): Promise; /** * @method * @name coinbase#fetchDepositMethodIds * @description fetch the deposit id for a fiat currency associated with this account * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/payment-methods/list-payment-methods * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an array of [deposit id structures]{@link https://docs.ccxt.com/?id=deposit-id-structure} */ fetchDepositMethodIds(params?: Dict): Promise; /** * @method * @name coinbase#fetchDepositMethodId * @description fetch the deposit id for a fiat currency associated with this account * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/payment-methods/get-payment-method * @param {string} id the deposit payment method id * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [deposit id structure]{@link https://docs.ccxt.com/?id=deposit-id-structure} */ fetchDepositMethodId(id: string, params?: Dict): Promise; parseDepositMethodIds(ids: Dict[], params?: Dict): Dict[]; parseDepositMethodId(depositId: Dict): Dict; /** * @method * @name coinbase#fetchConvertQuote * @description fetch a quote for converting from one currency to another * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/convert/create-convert-quote * @param {string} fromCode the currency that you want to sell and convert from * @param {string} toCode the currency that you want to buy and convert into * @param {float} [amount] how much you want to trade in units of the from currency * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {object} [params.trade_incentive_metadata] an object to fill in user incentive data * @param {string} [params.trade_incentive_metadata.user_incentive_id] the id of the incentive * @param {string} [params.trade_incentive_metadata.code_val] the code value of the incentive * @returns {object} a [conversion structure]{@link https://docs.ccxt.com/?id=conversion-structure} */ fetchConvertQuote(fromCode: string, toCode: string, amount?: Num, params?: Dict): Promise; /** * @method * @name coinbase#createConvertTrade * @description convert from one currency to another * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/convert/commit-convert-trade * @param {string} id the id of the trade that you want to make * @param {string} fromCode the currency that you want to sell and convert from * @param {string} toCode the currency that you want to buy and convert into * @param {float} [amount] how much you want to trade in units of the from currency * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [conversion structure]{@link https://docs.ccxt.com/?id=conversion-structure} */ createConvertTrade(id: string, fromCode: string, toCode: string, amount?: Num, params?: Dict): Promise; /** * @method * @name coinbase#fetchConvertTrade * @description fetch the data for a conversion trade * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/convert/get-convert-trade * @param {string} id the id of the trade that you want to commit * @param {string} code the unified currency code that was converted from * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {strng} params.toCode the unified currency code that was converted into * @returns {object} a [conversion structure]{@link https://docs.ccxt.com/?id=conversion-structure} */ fetchConvertTrade(id: string, code?: Str, params?: Dict): Promise; parseConversion(conversion: Dict, fromCurrency?: Currency, toCurrency?: Currency): Conversion; /** * @method * @name coinbase#transfer * @description transfer currency internally between portfolios of the same account * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/portfolios/move-portfolios-funds * @param {string} code unified currency code * @param {float} amount amount to transfer * @param {string} fromAccount the portfolio uuid to transfer funds from * @param {string} toAccount the portfolio uuid to transfer funds to * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/?id=transfer-structure} */ transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: Dict): Promise; parseTransfer(transfer: Dict, currency?: Currency): TransferEntry; /** * @method * @name coinbase#closePosition * @description *futures only* closes open positions for a market * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/orders/close-position * @param {string} symbol Unified CCXT market symbol * @param {string} [side] not used by coinbase * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} params.clientOrderId *mandatory* the client order id of the position to close * @param {float} [params.size] the size of the position to close, optional * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ closePosition(symbol: string, side?: Str, params?: Dict): Promise; /** * @method * @name coinbase#fetchPositions * @description fetch all open positions * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/us-derivatives/list-futures-positions * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/international-derivatives/list-perpetuals-positions * @param {string[]} [symbols] list of unified market symbols * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.portfolio] the portfolio UUID to fetch positions for * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure} */ fetchPositions(symbols?: Strings, params?: Dict): Promise; /** * @method * @name coinbase#fetchPosition * @description fetch data on a single open contract trade position * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/international-derivatives/get-perpetuals-position * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/us-derivatives/get-futures-position * @param {string} symbol unified market symbol of the market the position is held in, default is undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.product_id] *futures only* the product id of the position to fetch, required for futures markets only * @param {string} [params.portfolio] *perpetual/swaps only* the portfolio UUID to fetch the position for, required for perpetual/swaps markets only * @returns {object} a [position structure]{@link https://docs.ccxt.com/?id=position-structure} */ fetchPosition(symbol: string, params?: Dict): Promise; parsePosition(position: Dict, market?: Market): Position; /** * @method * @name coinbase#fetchTradingFees * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/fees/get-transaction-summary * @description fetch the trading fees for multiple markets * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.type] 'spot' or 'swap' * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure} indexed by market symbols */ fetchTradingFees(params?: Dict): Promise; /** * @method * @name coinbase#fetchPortfolioDetails * @description Fetch details for a specific portfolio by UUID * @see https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/portfolios/get-portfolio-breakdown * @param {string} portfolioUuid The unique identifier of the portfolio to fetch * @param {Dict} [params] Extra parameters specific to the exchange API endpoint * @returns {any[]} An account structure */ fetchPortfolioDetails(portfolioUuid: string, params?: Dict): Promise; parsePortfolioDetails(portfolioData: Dict): Dict[]; createAuthToken(seconds: Int, method?: Str, url?: Str, useEddsa?: boolean): string; nonce(): number; sign(path: string, api?: any, method?: string, params?: Dict, headers?: NullableDict, body?: Str): Dict; handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): undefined; /** * @method * @name coinbase#fetchDepositAddresses * @description fetch deposit addresses for multiple currencies (when available) * @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/onchain-addresses * @param {string[]} [codes] list of unified currency codes, default is undefined (all currencies) * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.accountId] account ID to fetch deposit addresses for * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/?id=address-structure} indexed by currency code */ fetchDepositAddresses(codes?: Strings, params?: Dict): Promise; }