diff --git a/src/CBAdvancedTradeClient.ts b/src/CBAdvancedTradeClient.ts index 918f2b9..e377da4 100644 --- a/src/CBAdvancedTradeClient.ts +++ b/src/CBAdvancedTradeClient.ts @@ -1,11 +1,5 @@ -import { AxiosRequestConfig } from 'axios'; - import { BaseRestClient } from './lib/BaseRestClient.js'; -import { - REST_CLIENT_TYPE_ENUM, - RestClientOptions, - RestClientType, -} from './lib/requestUtils.js'; +import { REST_CLIENT_TYPE_ENUM, RestClientType } from './lib/requestUtils.js'; import { AllocateAdvTradePortfolioRequest, CloseAdvTradePositionRequest, @@ -59,14 +53,6 @@ import { * https://docs.cdp.coinbase.com/advanced-trade/docs/api-overview/ */ export class CBAdvancedTradeClient extends BaseRestClient { - constructor( - restClientOptions: RestClientOptions = {}, - requestOptions: AxiosRequestConfig = {}, - ) { - super(restClientOptions, requestOptions); - return this; - } - getClientType(): RestClientType { return REST_CLIENT_TYPE_ENUM.advancedTrade; } diff --git a/src/CBCommerceClient.ts b/src/CBCommerceClient.ts index b9cbaa5..9cea498 100644 --- a/src/CBCommerceClient.ts +++ b/src/CBCommerceClient.ts @@ -1,25 +1,11 @@ -import { AxiosRequestConfig } from 'axios'; - import { BaseRestClient } from './lib/BaseRestClient.js'; -import { - REST_CLIENT_TYPE_ENUM, - RestClientOptions, - RestClientType, -} from './lib/requestUtils.js'; +import { REST_CLIENT_TYPE_ENUM, RestClientType } from './lib/requestUtils.js'; /** * REST client for Coinbase Prime API: * https://docs.cdp.coinbase.com/commerce-onchain/docs/welcome */ export class CBCommerceClient extends BaseRestClient { - constructor( - restClientOptions: RestClientOptions = {}, - requestOptions: AxiosRequestConfig = {}, - ) { - super(restClientOptions, requestOptions); - return this; - } - getClientType(): RestClientType { return REST_CLIENT_TYPE_ENUM.commerce; } diff --git a/src/CBExchangeClient.ts b/src/CBExchangeClient.ts index 29c5037..0972298 100644 --- a/src/CBExchangeClient.ts +++ b/src/CBExchangeClient.ts @@ -1,11 +1,5 @@ -import { AxiosRequestConfig } from 'axios'; - import { BaseRestClient } from './lib/BaseRestClient.js'; -import { - REST_CLIENT_TYPE_ENUM, - RestClientOptions, - RestClientType, -} from './lib/requestUtils.js'; +import { REST_CLIENT_TYPE_ENUM, RestClientType } from './lib/requestUtils.js'; import { CancelCBExchOrderRequest, CBExchDepositFromCoinbaseAccount, @@ -43,14 +37,6 @@ import { * https://docs.cdp.coinbase.com/exchange/docs/welcome */ export class CBExchangeClient extends BaseRestClient { - constructor( - restClientOptions: RestClientOptions = {}, - requestOptions: AxiosRequestConfig = {}, - ) { - super(restClientOptions, requestOptions); - return this; - } - getClientType(): RestClientType { return REST_CLIENT_TYPE_ENUM.exchange; } diff --git a/src/CBInternationalClient.ts b/src/CBInternationalClient.ts index 36e37d6..da4e7a1 100644 --- a/src/CBInternationalClient.ts +++ b/src/CBInternationalClient.ts @@ -1,11 +1,5 @@ -import { AxiosRequestConfig } from 'axios'; - import { BaseRestClient } from './lib/BaseRestClient.js'; -import { - REST_CLIENT_TYPE_ENUM, - RestClientOptions, - RestClientType, -} from './lib/requestUtils.js'; +import { REST_CLIENT_TYPE_ENUM, RestClientType } from './lib/requestUtils.js'; import { CancelINTXOrdersRequest, GetINTXAggregatedCandlesData, @@ -28,14 +22,6 @@ import { * https://docs.cdp.coinbase.com/intx/docs/welcome */ export class CBInternationalClient extends BaseRestClient { - constructor( - restClientOptions: RestClientOptions = {}, - requestOptions: AxiosRequestConfig = {}, - ) { - super(restClientOptions, requestOptions); - return this; - } - getClientType(): RestClientType { return REST_CLIENT_TYPE_ENUM.international; } diff --git a/src/CBPrimeClient.ts b/src/CBPrimeClient.ts index 47c33a6..065aece 100644 --- a/src/CBPrimeClient.ts +++ b/src/CBPrimeClient.ts @@ -1,11 +1,5 @@ -import { AxiosRequestConfig } from 'axios'; - import { BaseRestClient } from './lib/BaseRestClient.js'; -import { - REST_CLIENT_TYPE_ENUM, - RestClientOptions, - RestClientType, -} from './lib/requestUtils.js'; +import { REST_CLIENT_TYPE_ENUM, RestClientType } from './lib/requestUtils.js'; import { CreatePrimeAddressBookEntryRequest, CreatePrimeConversionRequest, @@ -38,14 +32,6 @@ import { * https://docs.cdp.coinbase.com/prime/docs/welcome */ export class CBPrimeClient extends BaseRestClient { - constructor( - restClientOptions: RestClientOptions = {}, - requestOptions: AxiosRequestConfig = {}, - ) { - super(restClientOptions, requestOptions); - return this; - } - getClientType(): RestClientType { return REST_CLIENT_TYPE_ENUM.prime; } diff --git a/src/WebsocketClient.ts b/src/WebsocketClient.ts index d356778..3341fd0 100644 --- a/src/WebsocketClient.ts +++ b/src/WebsocketClient.ts @@ -1,9 +1,6 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { CBAdvancedTradeClient } from './CBAdvancedTradeClient.js'; import { BaseWebsocketClient, EmittableEvent } from './lib/BaseWSClient.js'; import { signWSJWT } from './lib/jwtNode.js'; import { neverGuard } from './lib/misc-util.js'; -import { signMessage } from './lib/webCryptoAPI.js'; import { isCBAdvancedTradeErrorEvent, isCBAdvancedTradeWSEvent, @@ -17,7 +14,6 @@ import { getCBInternationalWSSign, getCBPrimeWSSign, getMergedCBExchangeWSRequestOperations, - getMergedCBINTXRequestOperations, MessageEventLike, WS_KEY_MAP, WS_URL_MAP, @@ -411,6 +407,7 @@ export class WebsocketClient extends BaseWebsocketClient { case WS_KEY_MAP.advTradeUserData: // Technically, INTX supports request batching but not with nested parameters, so we'll send one at a time case WS_KEY_MAP.internationalMarketData: + case WS_KEY_MAP.primeMarketData: return 1; // Exchange supports request batching, no known limit to max topics per request case WS_KEY_MAP.exchangeDirectMarketData: @@ -655,7 +652,7 @@ export class WebsocketClient extends BaseWebsocketClient { ); } - // We're over the max topics per request limit. Break into batches. + // INTX supports batching, but only if all channels use the same product_ids. Easier to just avoid batching for now.... const finalOperations: string[] = []; for (const operationEvent of operationEvents) { if (!apiKey || !apiSecret || !apiPassphrase) { diff --git a/src/types/websockets/requests.ts b/src/types/websockets/requests.ts index c00bba5..a135cd7 100644 --- a/src/types/websockets/requests.ts +++ b/src/types/websockets/requests.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ export type WsOperation = 'subscribe' | 'unsubscribe'; /**