Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ab421b9

Browse files
use sepolia chainId (#39)
1 parent 0a40dc8 commit ab421b9

3 files changed

Lines changed: 9 additions & 20 deletions

File tree

‎game/src/app/config.ts‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,12 @@ import { sepolia } from "viem/chains";
22
import { createConfig, http } from "wagmi";
33
import { injected } from "wagmi/connectors";
44

5-
export const stackrDevnet = {
6-
...sepolia,
7-
name: "Stackr Devnet",
8-
rpcUrls: {
9-
default: {
10-
http: ["https://devnet.stf.xyz"],
11-
},
12-
},
13-
id: 69420,
14-
};
15-
165
export function getConfig() {
176
return createConfig({
18-
chains: [stackrDevnet],
7+
chains: [sepolia],
198
connectors: [injected({ shimDisconnect: true })],
209
transports: {
21-
[stackrDevnet.id]: http(),
10+
[sepolia.id]: http(),
2211
},
2312
});
2413
}

‎game/src/app/page.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use client";
2-
import { PastGames } from "@/components/past-games/past-games";
32
import { Button } from "@/components/button";
43
import { Game } from "@/components/game";
4+
import { PastGames } from "@/components/past-games/past-games";
55
import { fetchLeaderboard, fetchMruInfo } from "@/rpc/api";
66
import { useEffect, useState } from "react";
77
import { createWalletClient, custom } from "viem";
88
import { addChain } from "viem/actions";
9+
import { sepolia } from "viem/chains";
910
import { useAccount, useConnect } from "wagmi";
10-
import { stackrDevnet } from "./config";
1111

1212
export default function Main() {
1313
const { isConnected, isConnecting } = useAccount();
@@ -32,12 +32,12 @@ export default function Main() {
3232
const walletClient = createWalletClient({
3333
transport: custom(window.ethereum),
3434
});
35-
if (chainId !== stackrDevnet.id) {
35+
if (chainId !== sepolia.id) {
3636
try {
37-
await walletClient.switchChain({ id: stackrDevnet.id });
37+
await walletClient.switchChain({ id: sepolia.id });
3838
} catch (e) {
3939
console.log(e);
40-
await addChain(walletClient, { chain: stackrDevnet });
40+
await addChain(walletClient, { chain: sepolia });
4141
}
4242
}
4343
connect({ connector });

‎game/src/components/navbar.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
2-
import { stackrDevnet } from "@/app/config";
32
import { formatAddress } from "@/core/highScoreMode";
43
import { useEffect } from "react";
4+
import { sepolia } from "viem/chains";
55
import { useAccount, useDisconnect } from "wagmi";
66
import { Button } from "./button";
77

@@ -10,7 +10,7 @@ export const Navbar = () => {
1010
const { disconnect } = useDisconnect();
1111

1212
useEffect(() => {
13-
if (chainId !== stackrDevnet.id) {
13+
if (chainId !== sepolia.id) {
1414
disconnect();
1515
}
1616
}, [chainId]);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /