Skip to content

Commit

Permalink
remove alchemyProvider and use jsonRpcProvider with alchemy key
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 committed Jun 20, 2023
1 parent b38a75b commit 7454c8f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react-hot-toast": "^2.4.0",
"use-debounce": "^8.0.4",
"usehooks-ts": "^2.7.2",
"wagmi": "^0.12.13",
"wagmi": "^0.12.15",
"zustand": "^4.1.2"
},
"devDependencies": {
Expand Down
16 changes: 11 additions & 5 deletions packages/nextjs/services/web3/wagmiConnectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@rainbow-me/rainbowkit/wallets";
import { configureChains } from "wagmi";
import * as chains from "wagmi/chains";
import { alchemyProvider } from "wagmi/providers/alchemy";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
import { publicProvider } from "wagmi/providers/public";
import scaffoldConfig from "~~/scaffold.config";
import { burnerWalletConfig } from "~~/services/web3/wagmi-burner/burnerWalletConfig";
Expand All @@ -28,11 +28,17 @@ const enabledChains =
export const appChains = configureChains(
enabledChains,
[
alchemyProvider({
apiKey: scaffoldConfig.alchemyApiKey,
priority: 0,
jsonRpcProvider({
rpc: chain => {
if (chain.rpcUrls.alchemy?.http[0]) {
return {
http: `${chain.rpcUrls.alchemy.http[0]}/${scaffoldConfig.alchemyApiKey}`,
};
}
return null;
},
}),
publicProvider({ priority: 1 }),
publicProvider(),
],
{
stallTimeout: 3_000,
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ __metadata:
use-debounce: ^8.0.4
usehooks-ts: ^2.7.2
vercel: ^28.15.1
wagmi: ^0.12.13
wagmi: ^0.12.15
zustand: ^4.1.2
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -12987,7 +12987,7 @@ __metadata:
languageName: node
linkType: hard

"wagmi@npm:^0.12.13":
"wagmi@npm:^0.12.15":
version: 0.12.16
resolution: "wagmi@npm:0.12.16"
dependencies:
Expand Down

0 comments on commit 7454c8f

Please sign in to comment.