Skip to content

Commit

Permalink
add MAINNET RPC from env
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Jan 2, 2025
1 parent 6683ea8 commit 93400e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/const/wagmi.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { bsc, bscTestnet, mainnet, sepolia } from 'viem/chains';
import { createConfig, createStorage, http } from 'wagmi';
const { VITE_MAINNET_RPC } = import.meta.env;

export const config = createConfig({
chains: [mainnet, sepolia, bsc, bscTestnet],
storage: createStorage({ storage: window.localStorage }),
transports: {
[mainnet.id]: http(),
[mainnet.id]: http(VITE_MAINNET_RPC ?? mainnet.rpcUrls.default.http[0]),
[sepolia.id]: http('https://rpc2.sepolia.org'),
[bsc.id]: http(),
[bscTestnet.id]: http(),
Expand Down
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface ImportMetaEnv {
readonly VITE_NO_BRIDGE: string;
readonly VITE_INFURA_API_KEY: string;
readonly VITE_ALCHEMY_API_KEY: string;
readonly VITE_MAINNET_RPC: string;
}

interface ImportMeta {
Expand Down

0 comments on commit 93400e6

Please sign in to comment.