Skip to content

Commit 526f7ba

Browse files
committed
Revert "fix: add keep-alive tp connections"
This reverts commit 9e5dd5c.
1 parent f4dccc2 commit 526f7ba

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

.github/workflows/publish-npm.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@snapshot-labs/pineapple",
3-
"version": "0.3.0",
3+
"version": "0.2.0",
44
"license": "MIT",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
1818
},
1919
"prettier": "@snapshot-labs/prettier-config",
2020
"dependencies": {
21-
"node-fetch": "^2.7.0"
21+
"cross-fetch": "^3.1.5"
2222
},
2323
"devDependencies": {
2424
"@snapshot-labs/eslint-config": "^0.1.0-beta.9",

src/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import fetch from 'node-fetch';
2-
import http from 'node:http';
3-
import https from 'node:https';
1+
import fetch from 'cross-fetch';
42

53
const PINEAPPLE_URL = 'https://pineapple.fyi';
6-
const agentOptions = { keepAlive: true };
74

85
export async function pin(json: any, url: string = PINEAPPLE_URL) {
96
const init = {
@@ -17,11 +14,7 @@ export async function pin(json: any, url: string = PINEAPPLE_URL) {
1714
method: 'pin',
1815
params: json,
1916
id: null
20-
}),
21-
agent:
22-
new URL(url).protocol === 'http:'
23-
? new http.Agent(agentOptions)
24-
: new https.Agent(agentOptions)
17+
})
2518
};
2619
const res = await fetch(url, init);
2720
const content = await res.json();

yarn.lock

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,13 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
12401240
dependencies:
12411241
safe-buffer "~5.1.1"
12421242

1243+
cross-fetch@^3.1.5:
1244+
version "3.1.5"
1245+
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
1246+
integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
1247+
dependencies:
1248+
node-fetch "2.6.7"
1249+
12431250
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
12441251
version "7.0.3"
12451252
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -2725,10 +2732,10 @@ natural-compare@^1.4.0:
27252732
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
27262733
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
27272734

2728-
node-fetch@2:
2729-
version "2.7.0"
2730-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
2731-
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
2735+
node-fetch@2.6.7:
2736+
version "2.6.7"
2737+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
2738+
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
27322739
dependencies:
27332740
whatwg-url "^5.0.0"
27342741

@@ -3320,7 +3327,7 @@ tr46@^2.1.0:
33203327
tr46@~0.0.3:
33213328
version "0.0.3"
33223329
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
3323-
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
3330+
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=
33243331

33253332
ts-jest@^27.1.4:
33263333
version "27.1.5"
@@ -3452,7 +3459,7 @@ walker@^1.0.7:
34523459
webidl-conversions@^3.0.0:
34533460
version "3.0.1"
34543461
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
3455-
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==
3462+
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=
34563463

34573464
webidl-conversions@^5.0.0:
34583465
version "5.0.0"
@@ -3479,7 +3486,7 @@ whatwg-mimetype@^2.3.0:
34793486
whatwg-url@^5.0.0:
34803487
version "5.0.0"
34813488
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
3482-
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
3489+
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
34833490
dependencies:
34843491
tr46 "~0.0.3"
34853492
webidl-conversions "^3.0.0"

0 commit comments

Comments
 (0)