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

Commit

Permalink
chore(deps): bump axios from 0.21.4 to 0.22.0 (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] committed Oct 16, 2021
1 parent 5952d12 commit 44e60f8
Show file tree
Hide file tree
Showing 9 changed files with 2,569 additions and 2,561 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -4,7 +4,7 @@
},
"dependencies": {
"@types/ws": "7.4.7",
"axios": "0.21.4",
"axios": "0.23.0",
"axios-retry": "3.2.0",
"buffer": "6.0.3",
"bufferutil": "4.0.4",
Expand Down
2 changes: 1 addition & 1 deletion src/account/AccountAPI.ts
Expand Up @@ -164,7 +164,7 @@ export class AccountAPI {
*/
async listCoinbaseAccounts(): Promise<CoinbaseAccount[]> {
const resource = AccountAPI.URL.COINBASE_ACCOUNT;
const response = await this.apiClient.get(resource);
const response = await this.apiClient.get<CoinbaseAccount[]>(resource);
return response.data;
}
}
13 changes: 10 additions & 3 deletions src/client/RESTClient.ts
@@ -1,4 +1,11 @@
import axios, {AxiosError, AxiosInstance, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse} from 'axios';
import axios, {
AxiosDefaults,
AxiosError,
AxiosInstance,
AxiosInterceptorManager,
AxiosRequestConfig,
AxiosResponse,
} from 'axios';
import {AccountAPI} from '../account';
import {RequestSetup, SignedRequest} from '../auth/RequestSigner';
import {OrderAPI} from '../order';
Expand Down Expand Up @@ -26,7 +33,7 @@ export interface RESTClient {

// eslint-disable-next-line no-redeclare
export class RESTClient extends EventEmitter {
get defaults(): AxiosRequestConfig {
get defaults(): AxiosDefaults {
return this.httpClient.defaults;
}

Expand Down Expand Up @@ -98,7 +105,7 @@ export class RESTClient extends EventEmitter {
'CB-ACCESS-KEY': signedRequest.key,
'CB-ACCESS-PASSPHRASE': signedRequest.passphrase,
'CB-ACCESS-SIGN': signedRequest.signature,
'CB-ACCESS-TIMESTAMP': signedRequest.timestamp,
'CB-ACCESS-TIMESTAMP': `${signedRequest.timestamp}`,
};

return config;
Expand Down
3 changes: 2 additions & 1 deletion src/error/ErrorUtil.ts
Expand Up @@ -9,5 +9,6 @@ export function gotRateLimited(error: AxiosError): boolean {
}

export function getErrorMessage(error: AxiosError): string {
return error.response?.data.message || error.message;
const responseWithErrorMessage = error as AxiosError<{message: string}>;
return responseWithErrorMessage.response?.data.message || error.message;
}
2 changes: 1 addition & 1 deletion src/fee/FeeAPI.ts
Expand Up @@ -30,7 +30,7 @@ export class FeeAPI {
*/
async getCurrentFees(): Promise<FeeTier> {
const resource = FeeAPI.URL.FEES;
const response = await this.apiClient.get(resource);
const response = await this.apiClient.get<FeeTier>(resource);
return response.data;
}
}
2 changes: 1 addition & 1 deletion src/fill/FillAPI.ts
Expand Up @@ -59,7 +59,7 @@ export class FillAPI {
*/
async getFillsByProductId(productId: string, pagination?: Pagination): Promise<PaginatedData<Fill>> {
const resource = FillAPI.URL.FILLS;
const response = await this.apiClient.get(resource, {params: {product_id: productId, ...pagination}});
const response = await this.apiClient.get<Fill[]>(resource, {params: {product_id: productId, ...pagination}});
return {
data: response.data,
pagination: {
Expand Down
4 changes: 2 additions & 2 deletions src/order/OrderAPI.ts
Expand Up @@ -121,7 +121,7 @@ export class OrderAPI {
*/
async cancelOpenOrders(productId?: string): Promise<string[]> {
const resource = OrderAPI.URL.ORDERS;
const response = await this.apiClient.delete(resource, {
const response = await this.apiClient.delete<string[]>(resource, {
params: productId ? {product_id: productId} : {},
});
return response.data;
Expand All @@ -137,7 +137,7 @@ export class OrderAPI {
*/
async cancelOrder(orderId: string, productId?: string): Promise<string> {
const resource = `${OrderAPI.URL.ORDERS}/${orderId}`;
const response = await this.apiClient.delete(resource, {
const response = await this.apiClient.delete<string>(resource, {
params: productId ? {product_id: productId} : {},
});
return response.data;
Expand Down
2 changes: 1 addition & 1 deletion src/product/ProductAPI.ts
Expand Up @@ -344,7 +344,7 @@ export class ProductAPI {
params: OrderBookRequestParameters = {level: OrderBookLevel.ONLY_BEST_BID_AND_ASK}
): Promise<OrderBook> {
const resource = `${ProductAPI.URL.PRODUCTS}/${productId}/book`;
let response: AxiosResponse;
let response: AxiosResponse<OrderBookLevel1 | OrderBookLevel2 | OrderBookLevel3>;

switch (params.level) {
case OrderBookLevel.TOP_50_BIDS_AND_ASKS:
Expand Down

0 comments on commit 44e60f8

Please sign in to comment.