Skip to content

Commit d05ca9b

Browse files
committed
chore(api-reference) Add viem RPC as a backup
1 parent baa42a3 commit d05ca9b

File tree

1 file changed

+5
-3
lines changed
  • apps/api-reference/src/components/EvmProvider

1 file changed

+5
-3
lines changed

apps/api-reference/src/components/EvmProvider/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ const CHAINS = NETWORK_IDS.map((id) =>
1919

2020
const TRANSPORTS = Object.fromEntries(
2121
CHAINS.map((chain) => {
22-
const url = getRpcUrl(chain.id);
23-
if (url) {
24-
return [chain.id, http(url)];
22+
const rpcUrl = getRpcUrl(chain.id);
23+
if (rpcUrl) {
24+
return [chain.id, http(rpcUrl)];
25+
} else if (chain.rpcUrls.default.http[0]) {
26+
return [chain.id, http(chain.rpcUrls.default.http[0])];
2527
} else {
2628
throw new Error(`No rpc url found for ${chain.name}`);
2729
}

0 commit comments

Comments
 (0)