Skip to content

Commit 0053dba

Browse files
committed
Refactor getPublicClient calls to remove unnecessary type casting and enable Ethereum Classic support in the configuration.
1 parent 1785fe8 commit 0053dba

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

web/src/app/[cat]/InteractionClient.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export default function InteractionClient() {
225225
setIsSyncing(true);
226226
console.log('Fetching token details from blockchain...', { tokenAddress, chainId });
227227

228-
const publicClient = getPublicClient(config, { chainId: chainId as any });
228+
const publicClient = getPublicClient(config, { chainId });
229229
if (!publicClient) {
230230
throw new Error(`No public client available for chain ${chainId}`);
231231
}

web/src/app/my-cats/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export default function MyCATsPage() {
187187
for (const [chainId, factoryAddress] of Object.entries(ClowderVaultFactories)) {
188188
if (!isValidChainId(chainId)) continue;
189189

190-
const publicClient = getPublicClient(config, { chainId: Number(chainId) as any });
190+
const publicClient = getPublicClient(config, { chainId });
191191
if (!publicClient) continue;
192192

193193
try {
@@ -596,7 +596,7 @@ export default function MyCATsPage() {
596596
chainId: SupportedChainId,
597597
defaultRole: 'admin' | 'minter' | 'both'
598598
): Promise<CatDetails[]> => {
599-
const publicClient = getPublicClient(config, { chainId: chainId as any });
599+
const publicClient = getPublicClient(config, { chainId });
600600
if (!publicClient || !addresses.length) return [];
601601

602602
try {
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
// import { defineChain } from "viem";
1+
import { defineChain } from "viem";
22

3-
// export const ethereumClassic = defineChain({
4-
// id: 61,
5-
// name: "Ethereum Classic",
6-
// network: "ethereumClassic",
7-
// nativeCurrency: {
8-
// name: "Ethereum Classic",
9-
// symbol: "ETC",
10-
// decimals: 18,
11-
// },
12-
// rpcUrls: {
13-
// default: {
14-
// http: ["https://etc.rivet.link"],
15-
// },
16-
// public: {
17-
// http: ["https://etc.rivet.link"],
18-
// },
19-
// },
20-
// blockExplorers: {
21-
// default: {
22-
// name: "BlockScout",
23-
// url: "https://blockscout.com/etc/mainnet",
24-
// },
25-
// },
26-
// });
3+
export const ethereumClassic = defineChain({
4+
id: 61,
5+
name: "Ethereum Classic",
6+
network: "ethereumClassic",
7+
nativeCurrency: {
8+
name: "Ethereum Classic",
9+
symbol: "ETC",
10+
decimals: 18,
11+
},
12+
rpcUrls: {
13+
default: {
14+
http: ["https://etc.rivet.link"],
15+
},
16+
public: {
17+
http: ["https://etc.rivet.link"],
18+
},
19+
},
20+
blockExplorers: {
21+
default: {
22+
name: "BlockScout",
23+
url: "https://blockscout.com/etc/mainnet",
24+
},
25+
},
26+
});

web/src/utils/config.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import {
2-
// polygon,
3-
// scrollSepolia,
4-
// base,
2+
polygon,
3+
scrollSepolia,
4+
base,
55
} from "wagmi/chains";
66
import {
77
getDefaultConfig,
88
} from "@rainbow-me/rainbowkit";
99
import { citreaTestnet } from "@/components/CitreaTestnet";
10-
// import { ethereumClassic } from "@/components/EthereumClassic";
10+
import { ethereumClassic } from "@/components/EthereumClassic";
1111

1212
export const config = getDefaultConfig({
1313
appName: "clowder",
1414
projectId: process.env.NEXT_PUBLIC_PROJECT_ID ?? "",
1515
chains: [
16-
// scrollSepolia,
17-
// base,
18-
// polygon,
19-
// ethereumClassic,
16+
scrollSepolia,
17+
base,
18+
polygon,
19+
ethereumClassic,
2020
citreaTestnet,
2121
] as const,
2222
ssr: true, // Disable SSR for static export

0 commit comments

Comments
 (0)