From fda953b3c99941245c598e784fdf8ce9cee2f3b7 Mon Sep 17 00:00:00 2001 From: siddhant-k08 Date: Mon, 28 Apr 2025 23:02:22 +0530 Subject: [PATCH] fix: removed `customChains` and switched to LTS of `viem` --- packages/nextjs/package.json | 2 +- packages/nextjs/scaffold.config.ts | 3 +-- packages/nextjs/utils/customChains.ts | 21 ------------------- .../nextjs/utils/scaffold-eth/networks.ts | 5 ++--- 4 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 packages/nextjs/utils/customChains.ts diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 182c325..c050345 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -31,7 +31,7 @@ "react-dom": "^18.3.1", "react-hot-toast": "^2.4.0", "usehooks-ts": "^3.1.0", - "viem": "2.21.32", + "viem": "2.28.0", "wagmi": "2.12.23", "zustand": "^5.0.0" }, diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index d415ad7..2aacc66 100644 --- a/packages/nextjs/scaffold.config.ts +++ b/packages/nextjs/scaffold.config.ts @@ -1,4 +1,3 @@ -import { monadTestnet } from "./utils/customChains"; import * as chains from "viem/chains"; export type ScaffoldConfig = { @@ -11,7 +10,7 @@ export type ScaffoldConfig = { const scaffoldConfig = { // The networks on which your DApp is live - targetNetworks: [monadTestnet], + targetNetworks: [chains.monadTestnet], // The interval at which your front-end polls the RPC servers for new data // it has no effect if you only target the local network (default is 4000) diff --git a/packages/nextjs/utils/customChains.ts b/packages/nextjs/utils/customChains.ts deleted file mode 100644 index 012cf58..0000000 --- a/packages/nextjs/utils/customChains.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineChain } from "viem"; - -// TODO: Add Chain details here. -export const monadTestnet = defineChain({ - id: 10143, - name: "Monad Testnet", - nativeCurrency: { name: "Monad", symbol: "MON", decimals: 18 }, - rpcUrls: { - default: { - // TODO: Add Monad RPC URL - http: [""], - }, - }, - blockExplorers: { - default: { - name: "Monad Testnet Blockscout", - // TODO: Add Explorer URL - url: "https://testnet.monadexplorer.com", - }, - }, -}); diff --git a/packages/nextjs/utils/scaffold-eth/networks.ts b/packages/nextjs/utils/scaffold-eth/networks.ts index fe26931..25347c4 100644 --- a/packages/nextjs/utils/scaffold-eth/networks.ts +++ b/packages/nextjs/utils/scaffold-eth/networks.ts @@ -1,4 +1,3 @@ -import { monadTestnet } from "../customChains"; import * as chains from "viem/chains"; import scaffoldConfig from "~~/scaffold.config"; @@ -14,7 +13,7 @@ export type ChainWithAttributes = chains.Chain & Partial; // Mapping of chainId to RPC chain name an format followed by alchemy and infura export const RPC_CHAIN_NAMES: Record = { - [monadTestnet.id]: "monad-testnet", + [chains.monadTestnet.id]: "monad-testnet", }; export const getAlchemyHttpUrl = (chainId: number) => { @@ -24,7 +23,7 @@ export const getAlchemyHttpUrl = (chainId: number) => { }; export const NETWORKS_EXTRA_DATA: Record = { - [monadTestnet.id]: { + [chains.monadTestnet.id]: { color: "#200052", }, };