Skip to content

Commit 7bbf3e2

Browse files
authored
refactor(utils): update RPC URLs and remove unnecessary code (#2337)
1 parent abc0a53 commit 7bbf3e2

File tree

2 files changed

+11
-44
lines changed

2 files changed

+11
-44
lines changed

packages/chains/test/utils.test.ts

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,22 @@ import {
1212
const MAINNET_FALLBACK_HTTP_RPCS = [
1313
"https://api.mycryptoapi.com/eth",
1414
"https://cloudflare-eth.com",
15-
"https://ethereum.publicnode.com",
15+
"https://ethereum-rpc.publicnode.com",
1616
"https://mainnet.gateway.tenderly.co",
1717
"https://rpc.blocknative.com/boost",
1818
"https://rpc.flashbots.net/fast",
1919
"https://rpc.mevblocker.io/fullprivacy",
2020
];
2121

2222
const MAINNET_FALLBACK_WS_RPCS = [
23-
"wss://ethereum.publicnode.com",
23+
"wss://ethereum-rpc.publicnode.com",
2424
"wss://mainnet.gateway.tenderly.co",
2525
];
2626

2727
const CHAIN_RPC_TEST_CASES: [ChainRPCOptions, string[]][] = [
2828
[
2929
{ thirdwebApiKey: "SAMPLE_KEY" },
30-
[
31-
"https://ethereum.rpc.thirdweb.com/SAMPLE_KEY",
32-
"https://1.rpc.thirdweb.com/SAMPLE_KEY",
33-
...MAINNET_FALLBACK_HTTP_RPCS,
34-
],
30+
["https://1.rpc.thirdweb.com/SAMPLE_KEY", ...MAINNET_FALLBACK_HTTP_RPCS],
3531
],
3632
[
3733
{ alchemyApiKey: "SAMPLE_KEY" },
@@ -63,26 +59,17 @@ describe("chains/utils", () => {
6359
[
6460
undefined,
6561
undefined,
66-
[
67-
"https://ethereum.rpc.thirdweb.com/",
68-
"https://1.rpc.thirdweb.com/",
69-
...MAINNET_FALLBACK_HTTP_RPCS,
70-
],
62+
["https://1.rpc.thirdweb.com/", ...MAINNET_FALLBACK_HTTP_RPCS],
7163
],
7264
[
7365
undefined,
7466
"http",
75-
[
76-
"https://ethereum.rpc.thirdweb.com/",
77-
"https://1.rpc.thirdweb.com/",
78-
...MAINNET_FALLBACK_HTTP_RPCS,
79-
],
67+
["https://1.rpc.thirdweb.com/", ...MAINNET_FALLBACK_HTTP_RPCS],
8068
],
8169
[
8270
"SAMPLE_CLIENT_KEY",
8371
undefined,
8472
[
85-
"https://ethereum.rpc.thirdweb.com/SAMPLE_CLIENT_KEY",
8673
"https://1.rpc.thirdweb.com/SAMPLE_CLIENT_KEY",
8774
...MAINNET_FALLBACK_HTTP_RPCS,
8875
],
@@ -91,7 +78,6 @@ describe("chains/utils", () => {
9178
"SAMPLE_CLIENT_KEY",
9279
"http",
9380
[
94-
"https://ethereum.rpc.thirdweb.com/SAMPLE_CLIENT_KEY",
9581
"https://1.rpc.thirdweb.com/SAMPLE_CLIENT_KEY",
9682
...MAINNET_FALLBACK_HTTP_RPCS,
9783
],
@@ -117,7 +103,7 @@ describe("chains/utils", () => {
117103
width: 512,
118104
format: "png",
119105
},
120-
rpc: ["https://ethereum.rpc.thirdweb.com/${THIRDWEB_API_KEY}"],
106+
rpc: ["https://1.rpc.thirdweb.com/${THIRDWEB_API_KEY}"],
121107
nativeCurrency: {
122108
name: "Ether",
123109
symbol: "ETH",
@@ -153,11 +139,7 @@ describe("chains/utils", () => {
153139
undefined,
154140
{
155141
...Ethereum,
156-
rpc: [
157-
"https://ethereum.rpc.thirdweb.com/",
158-
"https://1.rpc.thirdweb.com/",
159-
...MAINNET_FALLBACK_HTTP_RPCS,
160-
],
142+
rpc: ["https://1.rpc.thirdweb.com/", ...MAINNET_FALLBACK_HTTP_RPCS],
161143
},
162144
],
163145
[
@@ -166,7 +148,6 @@ describe("chains/utils", () => {
166148
{
167149
...Ethereum,
168150
rpc: [
169-
"https://ethereum.rpc.thirdweb.com/SAMPLE_CLIENT_KEY",
170151
"https://1.rpc.thirdweb.com/SAMPLE_CLIENT_KEY",
171152
...MAINNET_FALLBACK_HTTP_RPCS,
172153
],
@@ -187,26 +168,17 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
187168
[
188169
undefined,
189170
undefined,
190-
[
191-
"https://ethereum.rpc.thirdweb.com/",
192-
"https://1.rpc.thirdweb.com/",
193-
...MAINNET_FALLBACK_HTTP_RPCS,
194-
],
171+
["https://1.rpc.thirdweb.com/", ...MAINNET_FALLBACK_HTTP_RPCS],
195172
],
196173
[
197174
undefined,
198175
"http",
199-
[
200-
"https://ethereum.rpc.thirdweb.com/",
201-
"https://1.rpc.thirdweb.com/",
202-
...MAINNET_FALLBACK_HTTP_RPCS,
203-
],
176+
["https://1.rpc.thirdweb.com/", ...MAINNET_FALLBACK_HTTP_RPCS],
204177
],
205178
[
206179
"SAMPLE_CLIENT_KEY",
207180
undefined,
208181
[
209-
"https://ethereum.rpc.thirdweb.com/SAMPLE_CLIENT_KEY/?bundleId=com.thirdweb.rpc",
210182
"https://1.rpc.thirdweb.com/SAMPLE_CLIENT_KEY/?bundleId=com.thirdweb.rpc",
211183
...MAINNET_FALLBACK_HTTP_RPCS,
212184
],
@@ -215,7 +187,6 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
215187
"SAMPLE_CLIENT_KEY",
216188
"http",
217189
[
218-
"https://ethereum.rpc.thirdweb.com/SAMPLE_CLIENT_KEY/?bundleId=com.thirdweb.rpc",
219190
"https://1.rpc.thirdweb.com/SAMPLE_CLIENT_KEY/?bundleId=com.thirdweb.rpc",
220191
...MAINNET_FALLBACK_HTTP_RPCS,
221192
],
@@ -230,11 +201,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
230201
undefined,
231202
{
232203
...Ethereum,
233-
rpc: [
234-
"https://ethereum.rpc.thirdweb.com/",
235-
"https://1.rpc.thirdweb.com/",
236-
...MAINNET_FALLBACK_HTTP_RPCS,
237-
],
204+
rpc: ["https://1.rpc.thirdweb.com/", ...MAINNET_FALLBACK_HTTP_RPCS],
238205
},
239206
],
240207
[
@@ -243,7 +210,6 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
243210
{
244211
...Ethereum,
245212
rpc: [
246-
"https://ethereum.rpc.thirdweb.com/SAMPLE_CLIENT_KEY/?bundleId=com.thirdweb.rpc",
247213
"https://1.rpc.thirdweb.com/SAMPLE_CLIENT_KEY/?bundleId=com.thirdweb.rpc",
248214
...MAINNET_FALLBACK_HTTP_RPCS,
249215
],

pnpm-lock.yaml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)