Skip to content

Commit 454226e

Browse files
committed
chore: sync staging → main
Signed-off-by: Griko Nibras <[email protected]>
2 parents de9d252 + 60efaee commit 454226e

File tree

4 files changed

+41
-38
lines changed

4 files changed

+41
-38
lines changed

Diff for: package-lock.json

+23-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@radix-ui/react-toast": "^1.1.5",
6060
"@radix-ui/react-toggle-group": "^1.0.4",
6161
"@radix-ui/react-tooltip": "^1.0.7",
62+
"@react-stately/table": "^3.11.4",
6263
"@sentry/nextjs": "^7.90.0",
6364
"@skip-router/core": "^1.1.2",
6465
"@tanstack/react-query": "^5.14.2",

Diff for: src/constants/rpc.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const CHAIN_IDS_L5_NODES = [
2+
"secret-4",
3+
//
4+
];

Diff for: src/pages/api/nodes/[$chainID]/[[...$args]].ts

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PageConfig } from "next";
22
import { NextRequest } from "next/server";
33

4+
import { CHAIN_IDS_L5_NODES } from "@/constants/rpc";
45
import { getCorsDomains } from "@/lib/edge-config";
56
import { getPolkachuAuthHeader } from "@/utils/api";
67
import { raise } from "@/utils/assert";
@@ -49,16 +50,23 @@ export default async function handler(req: NextRequest) {
4950
const args = searchParams.getAll("$args");
5051
searchParams.delete("$args");
5152

52-
const rpcURL = `https://${chainID}-skip-rpc.polkachu.com`;
53-
const search = searchParams.toString();
53+
const shouldUseL5 = CHAIN_IDS_L5_NODES.includes(chainID);
54+
55+
const headers = new Headers();
56+
const rpcURL = shouldUseL5
57+
? `https://skip-secretnetwork-rpc.lavenderfive.com`
58+
: `https://${chainID}-skip-rpc.polkachu.com`;
5459

60+
if (!shouldUseL5) {
61+
headers.set("authorization", getPolkachuAuthHeader());
62+
}
63+
64+
const search = searchParams.toString();
5565
const proxyDest = [rpcURL, ...args].join("/") + (search ? `?${search}` : "");
5666

5767
return fetch(proxyDest, {
5868
body: req.body,
59-
headers: {
60-
authorization: getPolkachuAuthHeader(),
61-
},
69+
headers,
6270
method: req.method,
6371
});
6472
}

0 commit comments

Comments
 (0)