From ad8f5d2a6aef394947ea61e79a99681b615fb800 Mon Sep 17 00:00:00 2001 From: Cafe137 <77121044+Cafe137@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:19:57 +0100 Subject: [PATCH] fix: use compatible axios (#874) * fix: use compatible axios * style: add blank line --- package-lock.json | 18 ++++++------------ package.json | 2 +- src/modules/debug/transactions.ts | 7 ++++++- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4a4da754..c9499d5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@ethersphere/swarm-cid": "^0.1.0", "@types/readable-stream": "^2.3.13", - "axios": "^1.3.4", + "axios": "^0.27.2", "cafe-utility": "^10.8.1", "elliptic": "^6.5.4", "fetch-blob": "2.1.2", @@ -3531,13 +3531,12 @@ } }, "node_modules/axios": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", - "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" } }, "node_modules/babel-loader": { @@ -8410,11 +8409,6 @@ "node": ">= 8" } }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, "node_modules/pseudomap": { "version": "1.0.2", "dev": true, diff --git a/package.json b/package.json index 9977c636..6f8a0aeb 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "dependencies": { "@ethersphere/swarm-cid": "^0.1.0", "@types/readable-stream": "^2.3.13", - "axios": "^1.3.4", + "axios": "^0.27.2", "cafe-utility": "^10.8.1", "elliptic": "^6.5.4", "fetch-blob": "2.1.2", diff --git a/src/modules/debug/transactions.ts b/src/modules/debug/transactions.ts index 76f098fc..78843c02 100644 --- a/src/modules/debug/transactions.ts +++ b/src/modules/debug/transactions.ts @@ -74,9 +74,14 @@ export async function cancelTransaction( transactionHash: TransactionHash, gasPrice?: NumberString, ): Promise { + const headers: Record = {} + + if (gasPrice) { + headers['gas-price'] = gasPrice + } const response = await http(requestOptions, { method: 'delete', - headers: { 'gas-price': gasPrice }, + headers, url: `${transactionsEndpoint}/${transactionHash}`, responseType: 'json', })