Skip to content

Commit

Permalink
feat: replace infura with alchemy
Browse files Browse the repository at this point in the history
  • Loading branch information
toniocodo committed Sep 1, 2023
1 parent 7ae33b2 commit 8c6d4a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_WALLET_CONNECT_PROJECT_ID=
VITE_INFURA_ID=
VITE_ALCHEMY_ID=
6 changes: 3 additions & 3 deletions apps/oeth/src/clients/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import {
} from '@rainbow-me/rainbowkit/wallets';
import { configureChains, createConfig } from 'wagmi';
import { goerli, localhost, mainnet } from 'wagmi/chains';
import { infuraProvider } from 'wagmi/providers/infura';
import { alchemyProvider } from 'wagmi/providers/alchemy';
import { publicProvider } from 'wagmi/providers/public';

const VITE_WALLET_CONNECT_PROJECT_ID = import.meta.env
.VITE_WALLET_CONNECT_PROJECT_ID;
const VITE_INFURA_ID = import.meta.env.VITE_INFURA_ID;
const VITE_ALCHEMY_ID = import.meta.env.VITE_ALCHEMY_ID;

export const { chains, publicClient, webSocketPublicClient } = configureChains(
[mainnet, goerli, localhost],
[infuraProvider({ apiKey: VITE_INFURA_ID }), publicProvider()],
[alchemyProvider({ apiKey: VITE_ALCHEMY_ID }), publicProvider()],
);

const connectors = connectorsForWallets([
Expand Down
2 changes: 1 addition & 1 deletion apps/oeth/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

interface ImportMetaEnv {
readonly VITE_WALLET_CONNECT_PROJECT_ID: string;
readonly VITE_INFURA_ID: string;
readonly VITE_ALCHEMY_ID: string;
}

interface ImportMeta {
Expand Down

0 comments on commit 8c6d4a4

Please sign in to comment.