Skip to content

Commit 515a2ff

Browse files
committed
get BSC rpc from env
1 parent 5f5fa77 commit 515a2ff

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/const/wagmi.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { bsc, bscTestnet, mainnet, sepolia } from 'viem/chains';
22
import { createConfig, createStorage, http } from 'wagmi';
3-
const { VITE_MAINNET_RPC } = import.meta.env;
3+
const { VITE_MAINNET_RPC, VITE_BSC_RPC } = import.meta.env;
44

55
export const config = createConfig({
66
chains: [mainnet, sepolia, bsc, bscTestnet],
77
storage: createStorage({ storage: window.localStorage }),
88
transports: {
99
[mainnet.id]: http(VITE_MAINNET_RPC ?? mainnet.rpcUrls.default.http[0]),
1010
[sepolia.id]: http('https://sepolia.drpc.org'),
11-
[bsc.id]: http(),
11+
[bsc.id]: http(VITE_BSC_RPC ?? bsc.rpcUrls.default.http[0]),
1212
[bscTestnet.id]: http(),
1313
},
1414
});

src/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface ImportMetaEnv {
1414
readonly VITE_INFURA_API_KEY: string;
1515
readonly VITE_ALCHEMY_API_KEY: string;
1616
readonly VITE_MAINNET_RPC: string;
17+
readonly VITE_BSC_RPC: string;
1718
}
1819

1920
interface ImportMeta {

0 commit comments

Comments
 (0)