Skip to content

Commit 685f2fc

Browse files
committed
chore: anvil
1 parent 8849ba4 commit 685f2fc

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

src/lib/wagmi.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getDefaultConfig } from "@rainbow-me/rainbowkit";
22
import { http } from "@wagmi/core";
3+
import type { Transport } from "@wagmi/core";
34
import { anvil, sepolia } from "wagmi/chains";
45

56
/**
@@ -14,13 +15,18 @@ const anvilRpcUrl = process.env.NEXT_PUBLIC_ANVIL_RPC_URL || "http://127.0.0.1:8
1415
const isDev = process.env.NODE_ENV === "development";
1516
export const chains = isDev ? ([sepolia, anvil] as const) : ([sepolia] as const);
1617

18+
const transports: Record<number, Transport> = {
19+
[sepolia.id]: http(sepoliaRpcUrl),
20+
};
21+
22+
if (isDev) {
23+
transports[anvil.id] = http(anvilRpcUrl);
24+
}
25+
1726
export const config = getDefaultConfig({
1827
appName: "Nillion Faucet",
1928
projectId: walletConnectProjectId,
2029
chains,
21-
transports: {
22-
[sepolia.id]: http(sepoliaRpcUrl),
23-
...(isDev ? { [anvil.id]: http(anvilRpcUrl) } : {}),
24-
},
30+
transports,
2531
ssr: true,
2632
});

0 commit comments

Comments
 (0)