Skip to content

Commit

Permalink
fix chains not configured buggst
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 committed Feb 17, 2024
1 parent c454a41 commit b6f406a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/hooks/scaffold-eth/useAccountBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function useAccountBalance(address?: Address) {
const price = useGlobalState(state => state.nativeCurrencyPrice);
const { targetNetwork } = useTargetNetwork();

const { data: blockNumber } = useBlockNumber({ watch: true });
const { data: blockNumber } = useBlockNumber({ watch: true, chainId: targetNetwork.id });
const {
data: fetchedBalanceData,
isError,
Expand Down
3 changes: 2 additions & 1 deletion packages/nextjs/services/web3/wagmiConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { enabledChains } from "./wagmiConnectors";
import { enabledChains, wagmiConnectors } from "./wagmiConnectors";
import { createClient, http } from "viem";
import { hardhat } from "viem/chains";
import { createConfig } from "wagmi";
Expand All @@ -7,6 +7,7 @@ import scaffoldConfig from "~~/scaffold.config";
export const wagmiConfig = createConfig({
// TODO: Maybe we should get literal value here currently TS has widened the types because of ensabledChains logic
chains: enabledChains,
connectors: wagmiConnectors,
ssr: true,
client({ chain }) {
return createClient({
Expand Down

0 comments on commit b6f406a

Please sign in to comment.