Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit a18f727

Browse files
chore(deps): bump axios from 0.27.2 to 1.6.0 (#912)
* chore(deps): bump axios from 0.27.2 to 1.6.0 Bumps [axios](https://github.com/axios/axios) from 0.27.2 to 1.6.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v0.27.2...v1.6.0) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * fix types * prettier --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Benny Neugebauer <mail@bennycode.com>
1 parent 0dd80c0 commit a18f727

7 files changed

Lines changed: 27 additions & 20 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dependencies": {
66
"@types/node": "20.10.1",
77
"@types/ws": "8.5.10",
8-
"axios": "0.27.2",
8+
"axios": "1.6.0",
99
"axios-retry": "4.0.0",
1010
"reconnecting-websocket": "4.4.0",
1111
"ws": "8.14.2",

src/client/RESTClient.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class RESTClient extends EventEmitter {
6868
super();
6969
this.logger = util.debuglog('coinbase-pro-node');
7070

71-
this.httpClient = axios.default.create({
71+
this.httpClient = axios.create({
7272
baseURL: baseURL,
7373
timeout: 50_000,
7474
});
@@ -105,13 +105,10 @@ export class RESTClient extends EventEmitter {
105105
requestPath,
106106
});
107107

108-
config.headers = {
109-
...config.headers,
110-
'CB-ACCESS-KEY': signedRequest.key,
111-
'CB-ACCESS-PASSPHRASE': signedRequest.passphrase,
112-
'CB-ACCESS-SIGN': signedRequest.signature,
113-
'CB-ACCESS-TIMESTAMP': `${signedRequest.timestamp}`,
114-
};
108+
config.headers.set('CB-ACCESS-KEY', signedRequest.key);
109+
config.headers.set('CB-ACCESS-PASSPHRASE', signedRequest.passphrase);
110+
config.headers.set('CB-ACCESS-SIGN', signedRequest.signature);
111+
config.headers.set('CB-ACCESS-TIMESTAMP', `${signedRequest.timestamp}`);
115112

116113
return config;
117114
});

src/exchange-rate/ExchangeRateAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class ExchangeRateAPI {
2222
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
2323
*/
2424
async getExchangeRates(currency: string = 'USD'): Promise<ExchangeRate> {
25-
const response = await axios.default.get<{
25+
const response = await axios.get<{
2626
data: ExchangeRate;
2727
}>(`${this.baseURL}${ExchangeRateAPI.URL.V2_EXCHANGE_RATES}`, {params: {currency}});
2828
return response.data.data;

src/order/OrderAPI.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export class OrderAPI {
156156
const resource = OrderAPI.URL.ORDERS;
157157
const response = await this.apiClient.get<Order[]>(`${resource}`, {
158158
params: query,
159-
paramsSerializer: querystring.stringify,
159+
paramsSerializer: params => {
160+
return querystring.stringify(params);
161+
},
160162
});
161163
return {
162164
data: response.data,

src/time/TimeAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class TimeAPI {
2121
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-time
2222
*/
2323
async getTime(): Promise<TimeSkew> {
24-
const response = await axios.default.get<TimeSkew>(`${this.baseURL}${TimeAPI.URL.TIME}`, {
24+
const response = await axios.get<TimeSkew>(`${this.baseURL}${TimeAPI.URL.TIME}`, {
2525
// This trick forces axios to set JSON headers
2626
data: {},
2727
});

src/transfer/TransferAPI.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export class TransferAPI {
7272
}
7373
const response = await this.apiClient.get<TransferInformation[]>(resource, {
7474
params,
75-
paramsSerializer: querystring.stringify,
75+
paramsSerializer: params => {
76+
return querystring.stringify(params);
77+
},
7678
});
7779

7880
z.array(TransferInformationSchema).parse(response.data);

yarn.lock

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,14 @@ axios-retry@4.0.0:
442442
dependencies:
443443
is-retry-allowed "^2.2.0"
444444

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

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

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

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

1722+
proxy-from-env@^1.1.0:
1723+
version "1.1.0"
1724+
resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
1725+
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
1726+
17211727
punycode@^2.1.0:
17221728
version "2.1.1"
17231729
resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"

0 commit comments

Comments
 (0)