Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
chore: Update urls to Coinbase API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bennycode committed May 25, 2022
1 parent 093c1b9 commit d5bfc01
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 39 deletions.
8 changes: 4 additions & 4 deletions src/account/AccountAPI.ts
Expand Up @@ -141,7 +141,7 @@ export class AccountAPI {
*
* @param accountId - Account ID belonging to the API key’s profile
* @param pagination - Pagination field
* @see https://docs.pro.coinbase.com/#get-account-history
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
*/
async getAccountHistory(accountId: string, pagination?: Pagination): Promise<PaginatedData<AccountHistory>> {
const resource = `${AccountAPI.URL.ACCOUNTS}/${accountId}/ledger`;
Expand All @@ -162,7 +162,7 @@ export class AccountAPI {
*
* @param accountId - Account ID belonging to the API key’s profile
* @param pagination - Pagination field
* @see https://docs.pro.coinbase.com/#get-holds
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountholds
*/
async getHolds(accountId: string, pagination?: Pagination): Promise<PaginatedData<Hold>> {
const resource = `${AccountAPI.URL.ACCOUNTS}/${accountId}/holds`;
Expand All @@ -179,7 +179,7 @@ export class AccountAPI {
/**
* Get a list of trading accounts from the profile of the API key.
*
* @see https://docs.pro.coinbase.com/#list-accounts
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounts
*/
async listAccounts(): Promise<Account[]> {
const resource = AccountAPI.URL.ACCOUNTS;
Expand All @@ -190,7 +190,7 @@ export class AccountAPI {
/**
* Get a list of your coinbase accounts.
*
* @see https://docs.pro.coinbase.com/#coinbase-accounts
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcoinbaseaccounts
*/
async listCoinbaseAccounts(): Promise<CoinbaseAccount[]> {
const resource = AccountAPI.URL.COINBASE_ACCOUNT;
Expand Down
2 changes: 1 addition & 1 deletion src/client/RESTClient.ts
Expand Up @@ -82,7 +82,7 @@ export class RESTClient extends EventEmitter {
* Rate limits:
* - 3 requests per second, up to 6 requests per second in bursts for public endpoints
* - 5 requests per second, up to 10 requests per second in bursts for private endpoints
* @see https://docs.pro.coinbase.com/#rate-limits
* @see https://docs.cloud.coinbase.com/exchange/docs/rate-limits
*/
return 1000;
},
Expand Down
4 changes: 2 additions & 2 deletions src/client/WebSocketClient.ts
Expand Up @@ -376,7 +376,7 @@ export class WebSocketClient extends EventEmitter {
*
* @param reconnectOptions - Reconnect options to be used with the "reconnecting-websocket" package. Note: Options
* will be merged with sensible default values.
* @see https://docs.pro.coinbase.com/#websocket-feed
* @see https://docs.cloud.coinbase.com/exchange/docs/websocket-overview
*/
connect(reconnectOptions?: Options): ReconnectingWebSocket {
if (this.socket) {
Expand Down Expand Up @@ -485,7 +485,7 @@ export class WebSocketClient extends EventEmitter {
* Authentication will result in a couple of benefits:
* 1. Messages where you're one of the parties are expanded and have more useful fields
* 2. You will receive private messages, such as lifecycle information about stop orders you placed
* @see https://docs.pro.coinbase.com/#subscribe
* @see https://docs.cloud.coinbase.com/exchange/docs/websocket-overview#subscribe
*/
const signature = await this.signRequest({
httpMethod: 'GET',
Expand Down
2 changes: 1 addition & 1 deletion src/currency/CurrencyAPI.ts
Expand Up @@ -38,7 +38,7 @@ export class CurrencyAPI {
* Currency codes will conform to the ISO 4217 standard where possible.
* Currencies which have or had no representation in ISO 4217 may use a custom code.
*
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-currencies
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcurrencies
*/
async listCurrencies(): Promise<Currency[]> {
const resource = CurrencyAPI.URL.CURRENCIES;
Expand Down
3 changes: 1 addition & 2 deletions src/fee/FeeAPI.ts
Expand Up @@ -25,8 +25,7 @@ export class FeeAPI {
* Get your current maker & taker fee rates, as well as your 30-day trailing volume. Quoted rates are subject to
* change.
*
* @see https://docs.pro.coinbase.com/#fees
* @see https://help.coinbase.com/en/pro/trading-and-funding/trading-rules-and-fees/fees.html
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfees
*/
async getCurrentFees(): Promise<FeeTier> {
const resource = FeeAPI.URL.FEES;
Expand Down
6 changes: 2 additions & 4 deletions src/fill/FillAPI.ts
Expand Up @@ -34,8 +34,7 @@ export class FillAPI {
*
* @param orderId - ID of previously placed order
* @param pagination - Pagination field
* @see https://docs.pro.coinbase.com/#list-fills
* @see https://pro.coinbase.com/orders/filled
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
*/
async getFillsByOrderId(orderId: string, pagination?: Pagination): Promise<PaginatedData<Fill>> {
const resource = FillAPI.URL.FILLS;
Expand All @@ -54,8 +53,7 @@ export class FillAPI {
*
* @param productId - Representation for base and counter
* @param pagination - Pagination field
* @see https://docs.pro.coinbase.com/#list-fills
* @see https://pro.coinbase.com/orders/filled
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
*/
async getFillsByProductId(productId: string, pagination?: Pagination): Promise<PaginatedData<Fill>> {
const resource = FillAPI.URL.FILLS;
Expand Down
12 changes: 6 additions & 6 deletions src/order/OrderAPI.ts
Expand Up @@ -95,7 +95,7 @@ export interface FilledOrder extends BasePlacedOrder {
status: OrderStatus.DONE;
}

/** @see https://docs.pro.coinbase.com/#list-orders */
/** @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders */
export interface OrderListQueryParam extends Pagination {
/** Only list orders for a specific product. */
product_id?: string;
Expand All @@ -117,7 +117,7 @@ export class OrderAPI {
*
* @param productId - Representation for base and counter
* @returns A list of ids of the canceled orders
* @see https://docs.pro.coinbase.com/#cancel-all
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorders
*/
async cancelOpenOrders(productId?: string): Promise<string[]> {
const resource = OrderAPI.URL.ORDERS;
Expand All @@ -133,7 +133,7 @@ export class OrderAPI {
* @param orderId - ID of the order to cancel
* @param productId - While not required, the request will be more performant if you include the product ID
* @returns The ID of the canceled order
* @see https://docs.pro.coinbase.com/#cancel-an-order
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorder
*/
async cancelOrder(orderId: string, productId?: string): Promise<string> {
const resource = `${OrderAPI.URL.ORDERS}/${orderId}`;
Expand All @@ -150,7 +150,7 @@ export class OrderAPI {
* @note Depending on your activity, fetching all data from this endpoint can take very long (measured already 25
* seconds!)
* @param query - Available query parameters (Pagination, Product ID and/or Order Status)
* @see https://docs.pro.coinbase.com/#list-orders
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
*/
async getOrders(query?: OrderListQueryParam): Promise<PaginatedData<Order>> {
const resource = OrderAPI.URL.ORDERS;
Expand All @@ -171,7 +171,7 @@ export class OrderAPI {
* Get a single order by order id from the profile that the API key belongs to.
*
* @param orderId - ID of previously placed order
* @see https://docs.pro.coinbase.com/#get-an-order
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
*/
async getOrder(orderId: string): Promise<Order | null> {
const resource = `${OrderAPI.URL.ORDERS}/${orderId}`;
Expand All @@ -196,7 +196,7 @@ export class OrderAPI {
* funds. Once an order is placed, your account funds will be put on hold for the duration of the order.
*
* @param newOrder - Order type and parameters
* @see https://docs.pro.coinbase.com/#place-a-new-order
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
*/
async placeOrder(newOrder: NewOrder): Promise<Order> {
const resource = OrderAPI.URL.ORDERS;
Expand Down
16 changes: 8 additions & 8 deletions src/product/ProductAPI.ts
Expand Up @@ -200,7 +200,7 @@ export class ProductAPI {
*
* @param productId - Representation for base and counter
* @param [params] - Desired timespan
* @see https://docs.pro.coinbase.com/#get-historic-rates
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
*/
async getCandles(productId: string, params: HistoricRateRequest): Promise<Candle[]> {
const resource = `${ProductAPI.URL.PRODUCTS}/${productId}/candles`;
Expand Down Expand Up @@ -281,7 +281,7 @@ export class ProductAPI {
/**
* Get trading details for a specified product.
*
* @see https://docs.pro.coinbase.com/#get-products
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproduct
*/
async getProduct(productId: string): Promise<Product | undefined> {
const resource = `${ProductAPI.URL.PRODUCTS}/${productId}`;
Expand All @@ -292,7 +292,7 @@ export class ProductAPI {
/**
* Get trading details of all available products.
*
* @see https://docs.pro.coinbase.com/#get-products
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducts
*/
async getProducts(): Promise<Product[]> {
const resource = ProductAPI.URL.PRODUCTS;
Expand All @@ -301,11 +301,11 @@ export class ProductAPI {
}

/**
* Get latest trades for a product.
* Get the latest trades for a product.
*
* @param productId - Representation for base and counter
* @param pagination - Pagination field
* @see https://docs.pro.coinbase.com/#get-trades
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducttrades
*/
async getTrades(productId: string, pagination?: Pagination): Promise<PaginatedData<Trade>> {
const resource = `${ProductAPI.URL.PRODUCTS}/${productId}/trades`;
Expand All @@ -325,7 +325,7 @@ export class ProductAPI {
*
* @param productId - Representation for base and counter
* @param params - Amount of detail
* @see https://docs.pro.coinbase.com/#get-product-order-book
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductbook
*/
async getProductOrderBook(
productId: string,
Expand Down Expand Up @@ -364,7 +364,7 @@ export class ProductAPI {
* Get latest 24 hours of movement data for a product.
*
* @param productId - Representation for base and counter
* @see https://docs.pro.coinbase.com/#get-24hr-stats
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductstats
*/
async getProductStats(productId: string): Promise<ProductStats> {
const resource = `${ProductAPI.URL.PRODUCTS}/${productId}/stats`;
Expand All @@ -376,7 +376,7 @@ export class ProductAPI {
* Get snapshot information about the last trade (tick), best bid/ask and 24h volume.
*
* @param productId - Representation for base and counter
* @see https://docs.pro.coinbase.com/#get-product-ticker
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker
*/
async getProductTicker(productId: string): Promise<ProductTicker> {
const resource = `${ProductAPI.URL.PRODUCTS}/${productId}/ticker`;
Expand Down
5 changes: 3 additions & 2 deletions src/profile/ProfileAPI.ts
Expand Up @@ -31,7 +31,7 @@ export class ProfileAPI {
* This endpoint requires the “view” permission and is accessible by any profile’s API key.
*
* @param active - Only return active profiles if set true
* @see https://docs.pro.coinbase.com/#list-profiles
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getprofiles
*/
async listProfiles(active?: true): Promise<Profile[]> {
const resource = ProfileAPI.URL.PROFILES;
Expand All @@ -52,6 +52,7 @@ export class ProfileAPI {
* This endpoint requires the “view” permission and is accessible by any profile’s API key.
*
* @param profileId - Profile ID
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getprofile
* @returns A single profile
*/
async getProfile(profileId: string): Promise<Profile | null> {
Expand All @@ -72,7 +73,7 @@ export class ProfileAPI {
* Transfer funds from API key’s profile to another user owned profile.
* This endpoint requires the “transfer” permission.
*
* @see https://docs.pro.coinbase.com/#create-profile-transfer
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postprofiletransfer
*/
async transferFunds(transfer: FundTransfer): Promise<void> {
const resource = `${ProfileAPI.URL.PROFILES}/transfer`;
Expand Down
6 changes: 2 additions & 4 deletions src/transfer/TransferAPI.ts
Expand Up @@ -45,8 +45,7 @@ export class TransferAPI {
* Get a list of deposits/withdrawals from the profile of the API key, in descending order by created time.
*
* @param pagination - Pagination field
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#list-deposits
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-withdrawals#list-withdrawals
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfers
*/
async getTransfers(
transferType: TransferType,
Expand Down Expand Up @@ -81,8 +80,7 @@ export class TransferAPI {
* Get information on a single deposit/withdrawal.
*
* @param transferId - id of the requested resource
* @see https://docs.pro.coinbase.com/#single-deposit
* @see https://docs.pro.coinbase.com/#single-withdrawal
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_gettransfer
*/
async getTransfer(transferId: string): Promise<TransferInformation> {
const resource = `${TransferAPI.URL.TRANSFERS}/${transferId}`;
Expand Down
10 changes: 5 additions & 5 deletions src/withdraw/WithdrawAPI.ts
Expand Up @@ -88,7 +88,7 @@ export class WithdrawAPI {
* @param destinationTag - A destination tag for currencies that support one
* @param addNetworkFeeToTotal - A boolean flag to add the network fee on top of the amount.
* If this is blank, it will default to deducting the network fee from the amount.
* @see https://docs.pro.coinbase.com/#crypto
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawcrypto
*/
async withdrawToCryptoAddress(
amount: string,
Expand Down Expand Up @@ -120,7 +120,7 @@ export class WithdrawAPI {
* @param amount - The amount to withdraw
* @param currency - The type of currency
* @param coinbaseAccountId - ID of the Coinbase or Coinbase Pro account
* @see https://docs.pro.coinbase.com/#coinbase56
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawcoinbaseaccount
*/
async withdrawToCoinbaseAccount(
amount: string,
Expand All @@ -143,7 +143,7 @@ export class WithdrawAPI {
* @param amount - The amount to withdraw
* @param currency - The type of currency
* @param paymentMethodId - ID of the payment method
* @see https://docs.pro.coinbase.com/#payment-method55
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawpaymentmethod
*/
async withdrawToPaymentMethod(
amount: string,
Expand All @@ -165,7 +165,7 @@ export class WithdrawAPI {
*
* @param currency - The type of currency
* @param cryptoAddress - A crypto address of the recipient
* @see https://docs.pro.coinbase.com/#fee-estimate
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getwithdrawfeeestimate
*/
async getFeeEstimate(currency: string, cryptoAddress: string): Promise<WithdrawalFeeEstimate> {
const resource = WithdrawAPI.URL.WITHDRAWALS.FEE_ESTIMATE;
Expand All @@ -178,7 +178,7 @@ export class WithdrawAPI {
/**
* Get a list of your payment methods.
*
* @see https://docs.pro.coinbase.com/#list-payment-methods
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getpaymentmethods
*/
async getPaymentMethods(): Promise<PaymentMethod[]> {
const resource = WithdrawAPI.URL.LIST_PAYMENT_METHODS;
Expand Down

0 comments on commit d5bfc01

Please sign in to comment.