Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump axios from 0.27.2 to 1.6.0 #912

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@types/node": "20.10.1",
"@types/ws": "8.5.10",
"axios": "0.27.2",
"axios": "1.6.0",
"axios-retry": "4.0.0",
"reconnecting-websocket": "4.4.0",
"ws": "8.14.2",
Expand Down
13 changes: 5 additions & 8 deletions src/client/RESTClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class RESTClient extends EventEmitter {
super();
this.logger = util.debuglog('coinbase-pro-node');

this.httpClient = axios.default.create({
this.httpClient = axios.create({
baseURL: baseURL,
timeout: 50_000,
});
Expand Down Expand Up @@ -105,13 +105,10 @@ export class RESTClient extends EventEmitter {
requestPath,
});

config.headers = {
...config.headers,
'CB-ACCESS-KEY': signedRequest.key,
'CB-ACCESS-PASSPHRASE': signedRequest.passphrase,
'CB-ACCESS-SIGN': signedRequest.signature,
'CB-ACCESS-TIMESTAMP': `${signedRequest.timestamp}`,
};
config.headers.set('CB-ACCESS-KEY', signedRequest.key);
config.headers.set('CB-ACCESS-PASSPHRASE', signedRequest.passphrase);
config.headers.set('CB-ACCESS-SIGN', signedRequest.signature);
config.headers.set('CB-ACCESS-TIMESTAMP', `${signedRequest.timestamp}`);

return config;
});
Expand Down
2 changes: 1 addition & 1 deletion src/exchange-rate/ExchangeRateAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ExchangeRateAPI {
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
*/
async getExchangeRates(currency: string = 'USD'): Promise<ExchangeRate> {
const response = await axios.default.get<{
const response = await axios.get<{
data: ExchangeRate;
}>(`${this.baseURL}${ExchangeRateAPI.URL.V2_EXCHANGE_RATES}`, {params: {currency}});
return response.data.data;
Expand Down
4 changes: 3 additions & 1 deletion src/order/OrderAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export class OrderAPI {
const resource = OrderAPI.URL.ORDERS;
const response = await this.apiClient.get<Order[]>(`${resource}`, {
params: query,
paramsSerializer: querystring.stringify,
paramsSerializer: params => {
return querystring.stringify(params);
},
});
return {
data: response.data,
Expand Down
2 changes: 1 addition & 1 deletion src/time/TimeAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class TimeAPI {
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-time
*/
async getTime(): Promise<TimeSkew> {
const response = await axios.default.get<TimeSkew>(`${this.baseURL}${TimeAPI.URL.TIME}`, {
const response = await axios.get<TimeSkew>(`${this.baseURL}${TimeAPI.URL.TIME}`, {
// This trick forces axios to set JSON headers
data: {},
});
Expand Down
4 changes: 3 additions & 1 deletion src/transfer/TransferAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export class TransferAPI {
}
const response = await this.apiClient.get<TransferInformation[]>(resource, {
params,
paramsSerializer: querystring.stringify,
paramsSerializer: params => {
return querystring.stringify(params);
},
});

z.array(TransferInformationSchema).parse(response.data);
Expand Down
20 changes: 13 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,14 @@ axios-retry@4.0.0:
dependencies:
is-retry-allowed "^2.2.0"

axios@0.27.2:
version "0.27.2"
resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
axios@1.6.0:
version "1.6.0"
resolved "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102"
integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==
dependencies:
follow-redirects "^1.14.9"
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

balanced-match@^1.0.0:
version "1.0.2"
Expand Down Expand Up @@ -1017,9 +1018,9 @@ flatted@^3.1.0:
resolved "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz"
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==

follow-redirects@^1.14.9:
follow-redirects@^1.15.0:
version "1.15.3"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==

foreground-child@^2.0.0:
Expand Down Expand Up @@ -1718,6 +1719,11 @@ propagate@^2.0.0:
resolved "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz"
integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==

proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

punycode@^2.1.0:
version "2.1.1"
resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
Expand Down