Files
explore/lib/web3/client.ts
T
581008b625 hotfix: fix error in degraded views when no RPC URL provided (#1583)
* typo fix

* fix block views

* fix tx views

---------

Co-authored-by: isstuev <[email protected]>
2024-02-08 16:19:43 +04:00

20 lines
395 B
TypeScript

import { createPublicClient, http } from 'viem';
import currentChain from './currentChain';
export const publicClient = (() => {
if (currentChain.rpcUrls.public.http.filter(Boolean).length === 0) {
return;
}
try {
return createPublicClient({
chain: currentChain,
transport: http(),
batch: {
multicall: true,
},
});
} catch (error) {}
})();