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.27.2 to 1.6.0 (#912)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
dependabot[bot] and bennycode committed Dec 5, 2023
1 parent 0dd80c0 commit a18f727
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
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
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
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
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
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
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
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

0 comments on commit a18f727

Please sign in to comment.